:root {
  --ink: #18211d;
  --muted: #66716b;
  --surface: #ffffff;
  --canvas: #f3f6f2;
  --line: #d9e0da;
  --line-strong: #b9c4bc;
  --accent: #1f6b4f;
  --accent-strong: #15513b;
  --accent-soft: #e4f1ea;
  --warm: #c45c35;
  --warm-soft: #f9e8df;
  --danger: #a5302e;
  --danger-soft: #fbe9e8;
  --warning: #8a5518;
  --warning-soft: #fbf0dc;
  --info: #2e5f86;
  --info-soft: #e5eef6;
  --shadow: 0 8px 24px rgba(24, 33, 29, 0.08);
  --radius: 8px;
  --radius-small: 6px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

input,
select,
textarea {
  caret-color: var(--accent);
}

:focus-visible {
  outline: 3px solid rgba(31, 107, 79, 0.3);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.4;
}

p {
  margin-bottom: 12px;
}

small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-header,
.admin-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #17251f;
  color: #ffffff;
}

.site-header-inner,
.admin-header-inner {
  display: flex;
  max-width: 1180px;
  min-height: 62px;
  margin: 0 auto;
  padding: 10px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  color: #ffffff;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: #ffffff;
}

.site-nav,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a,
.admin-nav a {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: var(--radius-small);
  color: #dbe5df;
  font-size: 14px;
  text-decoration: none;
}

.site-nav a:hover,
.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.wrap {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 24px 0 52px;
}

.admin-wrap {
  width: min(100% - 32px, 1120px);
}

.site-footer {
  padding: 20px 16px 34px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.campaign-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.campaign-banner-compact {
  margin-bottom: 20px;
  box-shadow: none;
}

.campaign-copy h1 {
  max-width: 18ch;
  margin: 10px 0 8px;
}

.campaign-copy p {
  max-width: 58ch;
  margin-bottom: 10px;
  color: var(--muted);
}

.campaign-meta,
.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 14px;
}

.section-block,
.panel,
.form-section,
.batch-workspace {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading,
.panel-heading,
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-heading {
  margin: 4px 0 22px;
}

.page-heading p,
.section-heading p,
.panel-heading p {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--muted);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3,
.panel-heading h2 {
  margin-bottom: 3px;
}

.status-chip {
  display: inline-flex;
  min-height: 28px;
  padding: 3px 10px;
  align-items: center;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status-on_sale,
.status-open,
.order-paid,
.order-buying,
.order-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-scheduled,
.status-draft,
.order-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-ended,
.status-closed,
.status-returned,
.order-done,
.order-cancelled {
  background: #eef1ef;
  color: #56615b;
}

.status-buying,
.order-returned {
  background: var(--warm-soft);
  color: var(--warm);
}

.order-refunded {
  background: var(--danger-soft);
  color: var(--danger);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 22px rgba(24, 33, 29, 0.09);
  color: var(--ink);
  transform: translateY(-2px);
}

.product-image-wrap,
.product-detail-image,
.checkout-thumb,
.admin-product-thumb {
  overflow: hidden;
  background: #edf1ee;
}

.product-image-wrap {
  aspect-ratio: 4 / 3;
}

.product-image-wrap img,
.product-detail-image img,
.checkout-thumb img,
.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 72px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.product-card-body {
  display: flex;
  padding: 15px;
  flex-direction: column;
  justify-content: space-between;
}

.product-card-body h3 {
  margin-bottom: 4px;
}

.product-subline,
.product-description {
  color: var(--muted);
  font-size: 14px;
}

.product-description {
  margin-top: 8px;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  object-fit: cover;
}

.product-card-footer {
  display: flex;
  margin-top: 14px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.price {
  color: var(--warm);
  font-weight: 800;
  white-space: nowrap;
}

.sold-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: flex;
  min-height: 58px;
  padding: 11px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--ink);
  text-decoration: none;
}

.history-row:hover {
  border-color: var(--line-strong);
  background: #fafcf9;
  color: var(--ink);
}

.history-row strong {
  display: block;
}

.history-arrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.product-stack {
  display: grid;
  gap: 16px;
}

.product-detail {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-detail-head {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.product-detail-image {
  aspect-ratio: 1;
  border-radius: var(--radius-small);
}

.variant-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.variant-row {
  display: flex;
  min-height: 72px;
  padding: 13px 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.variant-row:last-child {
  border-bottom: 0;
}

.variant-row.is-soldout {
  opacity: 0.68;
}

.variant-copy {
  min-width: 0;
}

.variant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}

.status-text.danger {
  color: var(--danger);
  font-weight: 700;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 44px 54px 44px;
  flex: 0 0 auto;
  align-items: center;
}

.qty-button,
.qty-control input {
  height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.qty-button {
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.qty-button:first-child {
  border-radius: var(--radius-small) 0 0 var(--radius-small);
}

.qty-button:last-child {
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.qty-control input {
  width: 54px;
  padding: 0 4px;
  border-right: 0;
  border-left: 0;
  text-align: center;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.qty-button:hover,
.qty-button:focus-visible {
  background: var(--accent-soft);
}

.qty-button:disabled,
.qty-control input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.checkout-bar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  margin-top: 18px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(24, 33, 29, 0.15);
  backdrop-filter: blur(8px);
}

.checkout-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
}

.checkout-bar strong {
  color: var(--warm);
  font-size: 21px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  align-items: start;
}

.order-summary {
  position: sticky;
  top: 84px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.order-summary span {
  color: var(--muted);
  font-size: 14px;
}

.order-summary strong {
  display: block;
  margin: 4px 0 10px;
  color: var(--warm);
  font-size: 34px;
  line-height: 1.15;
}

.order-summary p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.checkout-items {
  display: grid;
  gap: 2px;
}

.checkout-item {
  display: flex;
  min-height: 66px;
  padding: 10px 0;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.checkout-item:last-child {
  border-bottom: 0;
}

.checkout-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: var(--radius-small);
}

.checkout-item-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.checkout-item-copy span {
  color: var(--muted);
  font-size: 13px;
}

.total-row {
  display: flex;
  margin-top: 12px;
  padding-top: 14px;
  align-items: baseline;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid var(--line-strong);
}

.total-row strong {
  color: var(--warm);
  font-size: 25px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary,
.btn:not(.secondary):not(.danger-text):not(.gray):not(.green):not(.red) {
  background: var(--accent);
  color: #ffffff;
}

.btn.primary:hover,
.btn:not(.secondary):not(.danger-text):not(.gray):not(.green):not(.red):hover {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.btn.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn.danger-text,
.btn.red {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.btn.danger-text:hover,
.btn.red:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.gray {
  background: #59645e;
  color: #ffffff;
}

.btn.green {
  background: var(--accent);
  color: #ffffff;
}

.btn.small,
.btn.sm {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 13px;
}

.btn.block {
  width: 100%;
  margin-top: 12px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.page-actions,
.form-actions,
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
label {
  color: #354039;
  font-size: 14px;
  font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #7a857f;
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #93a39a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stacked-form,
.contact-form,
.compact-form {
  display: grid;
  gap: 16px;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.inline-form .grow {
  flex: 1;
}

.optional-field {
  padding: 14px 0;
}

.optional-field summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 14px;
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-success {
  border-color: #bdd9ca;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.alert-error,
.err {
  border-color: #e8b9b7;
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-warning {
  border-color: #e5c898;
  background: var(--warning-soft);
  color: var(--warning);
}

.alert-info {
  border-color: #bfd3e5;
  background: var(--info-soft);
  color: var(--info);
}

.err {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius);
}

.notice-block {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafcf9;
}

.notice-block p:last-child {
  margin-bottom: 0;
}

.empty-state {
  padding: 36px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty-state-large {
  margin-top: 42px;
  padding: 64px 24px;
  background: var(--surface);
}

.empty-state p {
  max-width: 52ch;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
}

.empty-state.compact {
  padding: 22px 16px;
}

.empty-actions {
  justify-content: center;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.text-link {
  font-size: 14px;
  font-weight: 700;
}

.order-success {
  margin: 12px 0 22px;
  text-align: center;
}

.order-success h1 {
  margin-top: 12px;
}

.order-success p {
  margin-bottom: 5px;
  color: var(--muted);
}

.payment-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.payment-note {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fafcf9;
  color: var(--muted);
}

.payment-qr {
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
}

.small-qr {
  width: 180px;
  height: 180px;
}

.center-block {
  display: flex;
  padding: 12px 0;
  justify-content: center;
}

.cancel-form {
  margin: 12px 0 4px;
  text-align: center;
}

.contact-summary p {
  display: flex;
  margin-bottom: 8px;
  justify-content: space-between;
  gap: 18px;
}

.contact-summary span {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 3px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.current-batch-panel {
  display: flex;
  margin-bottom: 20px;
  padding: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.current-batch-panel h2 {
  margin: 10px 0 4px;
}

.current-batch-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.form-section {
  display: grid;
  gap: 18px;
}

.image-editor {
  display: grid;
  gap: 10px;
}

.image-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  padding: 10px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.image-row img {
  width: 86px;
  height: 68px;
  border-radius: var(--radius-small);
  object-fit: cover;
}

.radio-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.radio-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.image-actions,
.order-actions,
.admin-product-actions,
.batch-actions,
.next-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.media-upload-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.media-upload-status[data-type="success"] {
  color: var(--accent-strong);
}

.media-upload-status[data-type="error"] {
  color: var(--danger);
}

.variant-editor,
.publish-list,
.offer-admin-list {
  display: grid;
  gap: 10px;
}

.variant-editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) 130px auto;
  padding: 14px;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fbfcfa;
}

.sticky-form-actions {
  position: static;
  z-index: 20;
  display: flex;
  padding: 12px;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.product-form,
.publish-form,
.settings-form {
  padding-bottom: 6px;
}

.publish-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.publish-toggle {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.publish-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.publish-toggle small {
  font-weight: 400;
}

.publish-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  gap: 12px;
}

.admin-product-list {
  display: grid;
  gap: 10px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  padding: 14px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-product-thumb {
  width: 82px;
  height: 70px;
  border-radius: var(--radius-small);
}

.admin-product-main h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.admin-product-main p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
}

.admin-product-actions form {
  display: inline-flex;
}

.batch-workspaces {
  display: grid;
  gap: 22px;
}

.batch-workspace {
  scroll-margin-top: 90px;
}

.batch-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.batch-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-workspace-head h2 {
  margin: 10px 0 5px;
}

.batch-workspace-head p {
  max-width: 65ch;
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.metric-strip > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-strip strong {
  font-size: 19px;
}

.next-action-row {
  margin-bottom: 22px;
  padding: 14px;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fafcf9;
}

.next-action-row > div {
  display: grid;
  gap: 2px;
}

.next-action-row span {
  color: var(--muted);
  font-size: 13px;
}

.batch-offer-heading {
  margin-top: 6px;
}

.offer-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px 0;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.offer-admin-row:last-child {
  border-bottom: 0;
}

.offer-admin-main {
  display: grid;
  gap: 2px;
}

.offer-admin-main span {
  color: var(--muted);
  font-size: 14px;
}

.offer-edit summary {
  list-style: none;
}

.offer-edit summary::-webkit-details-marker {
  display: none;
}

.offer-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) auto;
  margin-top: 12px;
  padding: 12px;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fafcf9;
}

.offer-edit[open] {
  grid-column: 1 / -1;
  width: 100%;
}

.filter-bar {
  display: flex;
  margin-bottom: 18px;
  padding: 14px;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filter-bar .field {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.order-detail-row td {
  padding-top: 0;
  background: #fafcf9;
}

.order-detail-row summary {
  padding: 9px 0;
  color: var(--accent);
  cursor: pointer;
}

.order-items-list {
  display: grid;
  gap: 5px;
  padding: 8px 0;
}

.order-item-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h2 {
  margin-bottom: 14px;
}

.card > label,
.card form > label {
  display: block;
  margin: 12px 0 6px;
}

.card form > input,
.card form > select,
.card form > textarea {
  margin-bottom: 2px;
}

.foot {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.mt8 {
  margin-top: 8px;
}

.login-wrap {
  max-width: 430px;
  margin-top: 72px;
}

.setting-image-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setting-image-field {
  display: grid;
  gap: 10px;
  align-content: start;
}

.setting-qr {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  object-fit: contain;
}

@media (max-width: 900px) {
  .admin-header-inner {
    align-items: flex-start;
  }

  .admin-nav {
    justify-content: flex-end;
  }

  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-summary {
    position: static;
    order: -1;
  }

  .variant-editor-row,
  .publish-fields,
  .offer-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-product-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .admin-product-thumb {
    width: 72px;
    height: 64px;
  }

  .admin-product-actions {
    grid-column: 1 / -1;
  }

  .batch-workspace-head {
    flex-direction: column;
  }

  .offer-admin-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .setting-image-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .offer-admin-row > form:last-child {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 25px;
  }

  .site-header-inner,
  .admin-header-inner {
    padding: 9px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .site-nav,
  .admin-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar,
  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a,
  .admin-nav a {
    min-height: 36px;
    padding: 7px 9px;
    white-space: nowrap;
  }

  .wrap {
    width: min(100% - 24px, 760px);
    padding-top: 16px;
  }

  .campaign-banner {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }

  .campaign-copy h1 {
    max-width: none;
  }

  .section-block,
  .panel,
  .form-section,
  .batch-workspace,
  .product-detail {
    padding: 16px;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-detail-head {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
  }

  .product-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .variant-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .qty-control {
    align-self: stretch;
    grid-template-columns: 44px minmax(54px, 1fr) 44px;
  }

  .checkout-bar {
    bottom: 6px;
  }

  .checkout-bar .btn {
    min-width: 108px;
  }

  .metric-grid,
  .metric-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip > div:last-child {
    border-bottom: 0;
  }

  .current-batch-panel,
  .page-heading,
  .section-heading,
  .panel-heading,
  .next-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col,
  .variant-editor-row,
  .publish-fields,
  .offer-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .image-row img {
    width: 72px;
    height: 62px;
  }

  .image-actions {
    grid-column: 1 / -1;
  }

  .sticky-form-actions {
    flex-wrap: wrap;
  }

  .sticky-form-actions .btn {
    flex: 1 1 140px;
  }

  .admin-product-row {
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 12px;
  }

  .admin-product-thumb {
    width: 62px;
    height: 58px;
  }

  .offer-admin-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .offer-admin-row > form:last-child,
  .offer-edit[open] {
    grid-column: 1;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar .field {
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .order-table,
  .order-table tbody,
  .order-table tr,
  .order-table td {
    display: block;
    width: 100%;
  }

  .order-table thead {
    display: none;
  }

  .order-table tr {
    margin-bottom: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .order-table td {
    display: flex;
    padding: 6px 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 0;
    text-align: right;
  }

  .order-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }

  .order-table .order-detail-row {
    padding: 0;
    border: 0;
  }

  .order-table .order-detail-row td {
    display: block;
    text-align: left;
  }

  .order-table .order-detail-row td::before {
    display: none;
  }

  .order-actions {
    justify-content: flex-end;
  }

  .payment-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .payment-qr {
    width: min(100%, 240px);
    height: auto;
    margin: 0 auto;
    aspect-ratio: 1;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-summary p {
    flex-direction: column;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
