/* Beidou / purchase journey. Load after the existing storefront and public-page skins. */
:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal),
body.auth-body:not(.admin-auth),
body.legal-body {
  --journey-sans: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --journey-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --journey-shadow: 0 1px 2px rgb(33 52 82 / 5%), 0 20px 44px -32px rgb(33 52 82 / 36%);
  --journey-frame: 1px solid #d6e0ee;
  --journey-radius: 14px;
  --bg: #edf2f9;
  --bg-sunken: #e7eef8;
  --paper: #fff;
  --paper-raised: #fff;
  --paper-soft: #f5f8fc;
  --line: #d6e0ee;
  --line-soft: #e6edf6;
  --line-strong: #aebed6;
  --ink: #213452;
  --ink-soft: #354968;
  --muted: #516681;
  --muted-soft: #5d7190;
  --brand: #2455c4;
  --brand-hi: #3265d8;
  --brand-deep: #19449e;
  --brand-wash: #eaf1fe;
  --brand-line: #b4c8ee;
  --on-brand: #fff;
  --blue: var(--brand);
  --blue-hover: var(--brand-deep);
  --blue-line: var(--brand-line);
  --blue-wash: var(--brand-wash);
  --font-num: var(--journey-sans);
  color: var(--ink);
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) :is(h1, h2, h3),
body.auth-body:not(.admin-auth) :is(.user-auth-aside h1, .user-auth-form h2),
body.legal-body .legal-shell :is(h1, h2) {
  color: var(--ink);
  font-family: var(--journey-sans);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) :focus-visible,
body.auth-body:not(.admin-auth) :focus-visible,
body.legal-body :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

:where(html:not([data-theme])) .shop-body :is(#checkout, #cashier, #account, #orders, #modal) .kicker,
body.auth-body:not(.admin-auth) .kicker,
body.legal-body .legal-shell > .kicker {
  color: var(--brand) !important; /* Supersede legacy editorial gold. */
  font: 650 10px/1.4 var(--journey-mono);
  letter-spacing: .17em;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) .dark-button,
body.auth-body:not(.admin-auth) .user-auth-form .dark-button.full {
  min-height: 46px;
  border-color: var(--brand) !important;
  border-radius: 8px;
  background: var(--brand) !important;
  box-shadow: 0 7px 16px -12px rgb(36 85 196 / 80%);
  font-family: var(--journey-sans);
  font-weight: 680;
  letter-spacing: .015em;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) .dark-button:hover:not(:disabled),
body.auth-body:not(.admin-auth) .user-auth-form .dark-button.full:hover:not(:disabled) {
  border-color: var(--brand-deep) !important;
  background: var(--brand-deep) !important;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) .outline-button,
body.legal-body .legal-header .outline-button {
  min-height: 44px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--brand-deep);
  letter-spacing: .01em;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal) .outline-button:hover:not(:disabled),
body.legal-body .legal-header .outline-button:hover {
  border-color: var(--brand);
  background: var(--brand-wash);
  color: var(--brand-deep);
}

/* Product dossier: compact identity, framed artwork, then options and delivery. */
:where(html:not([data-theme])) .shop-body #product {
  --detail-inset: clamp(6px, 2vw, 24px);
  --detail-width: 1200px;
}

:where(html:not([data-theme])) .shop-body #product .crumb {
  max-width: var(--detail-width);
  margin: 0 auto 12px;
  padding: 0 var(--detail-inset);
  color: var(--muted);
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #product .crumb button {
  min-height: 36px;
  flex-shrink: 0;
  color: var(--brand);
}

:where(html:not([data-theme])) .shop-body #product .detail-layout {
  width: 100%;
  max-width: var(--detail-width);
  padding: 0 var(--detail-inset) clamp(18px, 4vw, 40px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, .46fr);
  gap: clamp(16px, 2.5vw, 32px);
}

:where(html:not([data-theme])) .shop-body #product .detail-main {
  display: grid;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

:where(html:not([data-theme])) .shop-body #product #detail-category {
  order: -4;
  width: fit-content;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid var(--brand-line);
  border-radius: 5px;
  background: var(--brand-wash);
  color: var(--brand-deep);
  font: 650 11px/1.4 var(--journey-sans);
  letter-spacing: .06em;
}

:where(html:not([data-theme])) .shop-body #product #detail-name {
  order: -3;
  margin: 0;
  font-size: clamp(26px, 3.8vw, 46px);
}

:where(html:not([data-theme])) .shop-body #product #detail-desc {
  order: -2;
  max-width: 67ch;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #product #detail-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 140px;
  aspect-ratio: auto;
  margin: 0;
  padding: clamp(12px, 2vw, 24px) !important;
  border: var(--journey-frame) !important;
  border-radius: var(--journey-radius);
  background-color: var(--paper) !important;
  box-shadow: inset 0 0 0 4px var(--paper-soft), var(--journey-shadow);
}

:where(html:not([data-theme])) .shop-body #product #detail-icon img {
  width: 100%;
  height: auto;
  max-height: clamp(160px, 23vw, 290px) !important;
  padding: 0;
  object-fit: contain;
}

:where(html:not([data-theme])) .shop-body #product #detail-icon.has-banner {
  min-height: 0;
  padding: 7px !important;
}

:where(html:not([data-theme])) .shop-body #product #detail-icon.has-banner img {
  max-height: none !important; /* Description art can be tall and contain text. */
}

:where(html:not([data-theme])) .shop-body #product #detail-icon .cover-fallback {
  min-height: clamp(116px, 17vw, 184px);
  padding: clamp(15px, 3vw, 30px);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, transparent 0 27px, rgb(36 85 196 / 5%) 27px 28px),
    linear-gradient(135deg, #f9fbff, var(--bg));
}

:where(html:not([data-theme])) .shop-body #product #detail-icon .cover-fallback .mark-fallback {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--brand);
  font: 700 17px/1 var(--journey-mono);
}

:where(html:not([data-theme])) .shop-body #product #detail-icon .cover-fallback b {
  color: var(--ink);
  font-size: clamp(17px, 2.6vw, 27px);
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body :is(#product, #checkout, #cashier, #account, #orders, #modal)
  :is(.detail-specs, .description-panel, .detail-info, .purchase-panel, .checkout-block, .checkout-summary,
      .account-orders, .order-query, .wallet-card, .order-list-card, .od-section, .cashier-shell,
      .cashier-payment-card, .cashier-info-card) {
  min-width: 0;
  border: var(--journey-frame);
  border-radius: var(--journey-radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--journey-shadow);
}

:where(html:not([data-theme])) .shop-body #product .detail-specs:not([hidden]) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  margin: 0;
  padding: clamp(12px, 2vw, 18px);
  background-color: var(--paper) !important;
}

:where(html:not([data-theme])) .shop-body #product .detail-specs-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font: 680 13px/1.5 var(--journey-sans);
  letter-spacing: .025em;
}

:where(html:not([data-theme])) .shop-body #product .detail-spec {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--paper-soft);
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #product .detail-spec > span {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 9px;
}

:where(html:not([data-theme])) .shop-body #product .detail-spec strong {
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}

:where(html:not([data-theme])) .shop-body #product .detail-spec:hover,
:where(html:not([data-theme])) .shop-body #product .detail-spec[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-wash);
}

:where(html:not([data-theme])) .shop-body #product .detail-spec[aria-pressed="true"] {
  box-shadow: inset 3px 0 var(--brand);
}

:where(html:not([data-theme])) .shop-body #product .detail-spec.is-soldout { opacity: .76; }
:where(html:not([data-theme])) .shop-body #product .detail-info { background-color: var(--paper) !important; }
:where(html:not([data-theme])) .shop-body #product .detail-info > article { overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #product .detail-info > article span { letter-spacing: .04em; }

:where(html:not([data-theme])) .shop-body #product .description-panel {
  padding: clamp(16px, 2.7vw, 26px);
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #product .description-panel h2 { font-size: 18px; }
:where(html:not([data-theme])) .shop-body #product #detail-content { font-size: 14px; }

:where(html:not([data-theme])) .shop-body #product .purchase-panel {
  top: calc(var(--header-h, 68px) + 18px);
  width: 100%;
  max-width: none;
  gap: 14px;
  padding: clamp(16px, 2vw, 24px);
  box-shadow: inset 0 3px var(--brand), var(--journey-shadow);
}

:where(html:not([data-theme])) .shop-body #product .purchase-top {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}

:where(html:not([data-theme])) .shop-body #product #detail-price {
  color: var(--brand-deep);
  font-size: clamp(25px, 3.1vw, 39px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #product #detail-stock {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-size: 11px;
}

:where(html:not([data-theme])) .shop-body #product .wholesale-tiers:empty { display: none; }
:where(html:not([data-theme])) .shop-body #product .wholesale-tiers span { color: var(--brand-deep); }
:where(html:not([data-theme])) .shop-body #product .purchase-panel .quantity :is(button, input) { min-height: 42px; }
:where(html:not([data-theme])) .shop-body #product .purchase-panel .quantity button { min-width: 40px; }
:where(html:not([data-theme])) .shop-body #product .purchase-note { color: var(--muted); line-height: 1.65; }

/* The shared modal stays centered except for the cart and search contents. */
:where(html:not([data-theme])) .shop-body #modal:not(.entry-notice-open) {
  background: rgb(24 40 66 / 38%);
  backdrop-filter: blur(4px);
}

:where(html:not([data-theme])) .shop-body #modal:not(.entry-notice-open) .modal-card {
  border: var(--journey-frame);
  border-radius: var(--journey-radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 26px 70px -30px rgb(20 37 67 / 48%);
}

:where(html:not([data-theme])) .shop-body #modal:not(.entry-notice-open) .modal-x {
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--paper-soft);
}

:where(html:not([data-theme])) .shop-body #modal:not(.entry-notice-open) #modal-body > h2 {
  margin: 0 42px 14px 0;
  font-size: clamp(21px, 3vw, 29px);
}

:where(html:not([data-theme])) .shop-body #modal:not(.entry-notice-open) #modal-body > p {
  color: var(--muted);
  line-height: 1.65;
}

:where(html:not([data-theme])) .shop-body #modal:has(#modal-body > .search-input, #modal-body > div > :is(.cart-empty, .cart-line)) {
  place-items: stretch end;
  padding: 0;
}

:where(html:not([data-theme])) .shop-body #modal:has(#modal-body > .search-input, #modal-body > div > :is(.cart-empty, .cart-line)) .modal-card {
  box-sizing: border-box;
  /* The old mobile modal forces an inset width with !important. */
  width: min(100%, 520px) !important;
  max-width: 100% !important;
  height: 100%;
  max-height: 100%;
  padding: clamp(18px, 4.8vw, 34px);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-radius: 16px 0 0 16px;
  border-block: 0;
  border-right: 0;
  box-shadow: -20px 0 54px -32px rgb(20 37 67 / 55%);
  overscroll-behavior: contain;
  animation: beidou-journey-slide .2s ease-out;
}

@keyframes beidou-journey-slide { from { transform: translateX(24px); opacity: .5; } }

:where(html:not([data-theme])) .shop-body #modal :is(.search-input, .cart-total) {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

:where(html:not([data-theme])) .shop-body #modal .search-input > svg { top: 31px; color: var(--brand); }
:where(html:not([data-theme])) .shop-body #modal .search-input input { min-height: 48px; font-size: 16px; }

:where(html:not([data-theme])) .shop-body #modal .search-results {
  max-height: none;
  padding: 3px;
  margin-inline: -3px;
  gap: 7px;
}

:where(html:not([data-theme])) .shop-body #modal .search-results button {
  min-width: 0;
  min-height: 57px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #modal .search-results button:hover {
  border-color: var(--brand-line);
  background: var(--paper-soft);
}

:where(html:not([data-theme])) .shop-body #modal .cart-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 9px;
  padding: 14px 0;
}

:where(html:not([data-theme])) .shop-body #modal .cart-line > div { grid-column: 2 / -1; overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #modal .cart-line > .cart-line-qty { grid-column: 2; grid-row: 2; justify-self: start; }
:where(html:not([data-theme])) .shop-body #modal .cart-line > strong { grid-column: 3; grid-row: 2; justify-self: end; overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #modal .cart-line-remove { grid-column: 4; grid-row: 2; width: 40px; height: 40px; }
:where(html:not([data-theme])) .shop-body #modal .cart-line-qty button { width: 34px; height: 35px; }
:where(html:not([data-theme])) .shop-body #modal .cart-line-qty button:focus-visible { outline-offset: -3px; }

:where(html:not([data-theme])) .shop-body #modal :is(.cart-line > strong, .cart-total > strong) {
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}

:where(html:not([data-theme])) .shop-body #modal .cart-total > strong { font-size: 23px; }
:where(html:not([data-theme])) .shop-body #modal .cart-empty {
  margin-top: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper-soft);
}

/* Checkout pages deliberately distinguish the form, summary, and payment state. */
:where(html:not([data-theme])) .shop-body #checkout .checkout-wrap { max-width: 1120px; }
:where(html:not([data-theme])) .shop-body #checkout .checkout-title {
  margin-bottom: 17px;
  padding: clamp(18px, 3vw, 30px);
  border: var(--journey-frame);
  border-radius: var(--journey-radius);
  background: linear-gradient(115deg, var(--paper) 20%, var(--bg));
  font-family: var(--journey-sans);
  letter-spacing: normal;
}

:where(html:not([data-theme])) .shop-body :is(#checkout, #account, #orders) h1 {
  margin-top: 6px;
  font-size: clamp(27px, 3.9vw, 42px);
}

:where(html:not([data-theme])) .shop-body #checkout .checkout-title > p:not(.kicker) { color: var(--muted); line-height: 1.65; }
:where(html:not([data-theme])) .shop-body #checkout .checkout-layout {
  grid-template-columns: minmax(0, 1fr) minmax(270px, .54fr);
  gap: clamp(12px, 2vw, 24px);
}

:where(html:not([data-theme])) .shop-body #checkout :is(.checkout-block, .checkout-summary) { padding: clamp(15px, 2.5vw, 23px); }
:where(html:not([data-theme])) .shop-body #checkout :is(.checkout-block, .checkout-summary) > h2 { font-size: 18px; }
:where(html:not([data-theme])) .shop-body #checkout .checkout-summary { box-shadow: inset 0 3px var(--brand), var(--journey-shadow); }
:where(html:not([data-theme])) .shop-body #checkout .purchase-mode { grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); }
:where(html:not([data-theme])) .shop-body #checkout :is(.mode-choice, .pay-option) { min-width: 0; min-height: 64px; border-radius: 8px; }
:where(html:not([data-theme])) .shop-body #checkout :is(.mode-choice, .pay-option):hover { border-color: var(--brand-line); }
:where(html:not([data-theme])) .shop-body #checkout :is(.mode-choice, .pay-option).active {
  border-color: var(--brand);
  background: var(--brand-wash);
  color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px var(--brand);
}

:where(html:not([data-theme])) .shop-body #checkout :is(.mode-choice, .pay-option) > :is(i, svg) { flex-shrink: 0; }
:where(html:not([data-theme])) .shop-body #checkout :is(.mode-choice, .pay-option).active > :is(i, svg):last-child { color: var(--brand); }
:where(html:not([data-theme])) .shop-body #checkout .summary-item { overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #checkout .summary-total { gap: 10px; }
:where(html:not([data-theme])) .shop-body #checkout .summary-total strong { color: var(--brand-deep); font-variant-numeric: tabular-nums; }

:where(html:not([data-theme])) .shop-body :is(#checkout .form-grid, #orders #query-form, #modal .search-input) input,
body.auth-body:not(.admin-auth) .user-auth-form .auth-panel input {
  min-width: 0;
  min-height: 47px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

:where(html:not([data-theme])) .shop-body :is(#checkout .form-grid, #orders #query-form, #modal .search-input) input:focus,
body.auth-body:not(.admin-auth) .user-auth-form .auth-panel input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-shell {
  width: min(100%, 1140px);
  margin-inline: auto;
  padding: clamp(14px, 3vw, 28px);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-head {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 17px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-brand-mark {
  flex-shrink: 0;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  background: var(--brand-wash);
  color: var(--brand);
  font: 700 18px/1 var(--journey-mono);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-brand small { color: var(--muted); }
:where(html:not([data-theme])) .shop-body #cashier .cashier-steps { margin-bottom: 12px; }
:where(html:not([data-theme])) .shop-body #cashier .cashier-step { justify-content: flex-start; padding: 7px 11px; background: var(--paper-soft); }
:where(html:not([data-theme])) .shop-body #cashier .cashier-step b {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--brand-deep);
  font-family: var(--journey-mono);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-step.active {
  border-color: var(--brand-line);
  background: var(--brand-wash);
  color: var(--brand-deep);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-step.active b { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
:where(html:not([data-theme])) .shop-body #cashier .cashier-grid {
  grid-template-columns: minmax(0, 1fr) minmax(244px, .56fr);
  gap: 12px;
  padding: clamp(8px, 1.6vw, 14px);
  border: var(--journey-frame);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: none;
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-payment-card {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  gap: 12px;
  padding: clamp(12px, 2vw, 18px);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-info-card { padding: clamp(15px, 2.4vw, 25px); }
:where(html:not([data-theme])) .shop-body #cashier .cashier-countdown {
  border-color: #e7d3a1;
  background: #fff8e8;
  color: #74531b;
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-countdown strong { color: #74531b; }
:where(html:not([data-theme])) .shop-body #cashier .cashier-countdown strong.expired { color: #a33434; }
:where(html:not([data-theme])) .shop-body #cashier :is(.cashier-transfer li, .cashier-address code, .cashier-address .icon-button, .online-pay-qr-frame) {
  border-color: var(--line);
  background: var(--paper-soft);
  color: var(--ink);
}

:where(html:not([data-theme])) .shop-body #cashier .cashier-transfer li::before { color: var(--brand); }
:where(html:not([data-theme])) .shop-body #cashier .online-pay-qr-frame { width: min(100%, 242px); padding: 7px; }
:where(html:not([data-theme])) .shop-body #cashier .online-pay-qr-frame img { width: 100%; height: auto; border-color: var(--line-soft); }
:where(html:not([data-theme])) .shop-body #cashier :is(.cashier-qr-wrap strong, .online-pay-amount strong) { color: var(--brand-deep) !important; }
:where(html:not([data-theme])) .shop-body #cashier :is(.online-pay-scan-tip, .online-pay-order, .online-pay-switch) { color: var(--muted) !important; }
:where(html:not([data-theme])) .shop-body #cashier :is(.online-pay-order, .cashier-qr-wrap strong) { overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #cashier :is(.online-pay-sub, .cashier-info-card > p:not(.kicker), .cashier-result p, .cashier-footnote) { color: var(--muted); }
:where(html:not([data-theme])) .shop-body #cashier .cashier-footnote { align-items: flex-start; }
:where(html:not([data-theme])) .shop-body #cashier .cashier-footnote svg { flex: 0 0 15px; color: var(--brand); }

/* Account and order lookup. Status colors remain distinct from financial totals. */
:where(html:not([data-theme])) .shop-body #account .account-page-wrap { max-width: 1020px; }
:where(html:not([data-theme])) .shop-body #account .account-orders {
  padding: clamp(15px, 3.2vw, 32px);
}

:where(html:not([data-theme])) .shop-body #account .account-orders-head {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

:where(html:not([data-theme])) .shop-body #account .account-orders-head > div { flex: 1 1 270px; min-width: 0; }
:where(html:not([data-theme])) .shop-body #account .wallet-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: clamp(12px, 2.4vw, 18px);
  border-color: var(--brand-line);
  background: linear-gradient(118deg, var(--paper-soft), var(--brand-wash));
  box-shadow: none;
}

:where(html:not([data-theme])) .shop-body #account .wallet-card-main {
  padding: 5px;
  background: transparent;
  color: var(--ink);
}

:where(html:not([data-theme])) .shop-body #account .wallet-card-main h2 { color: var(--ink); }
:where(html:not([data-theme])) .shop-body #account #wallet-balance {
  color: var(--brand-deep);
  font: 700 clamp(30px, 5vw, 49px)/1.15 var(--journey-sans);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body #account .wallet-ledger {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--brand-line);
}

:where(html:not([data-theme])) .shop-body #account .wallet-ledger-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

:where(html:not([data-theme])) .shop-body #account .wallet-ledger-item > div { min-width: 0; overflow-wrap: anywhere; }
:where(html:not([data-theme])) .shop-body #account .wallet-ledger-item > div > b { color: var(--ink); white-space: normal; }
:where(html:not([data-theme])) .shop-body #account .wallet-ledger-item.credit > b { color: #196749; }
:where(html:not([data-theme])) .shop-body #account .wallet-ledger-item.debit > b { color: #a12d43; }
:where(html:not([data-theme])) .shop-body #account .account-guest-hint { padding: 14px; border: var(--journey-frame); border-radius: 8px; background: var(--paper); }

:where(html:not([data-theme])) .shop-body #orders .order-query {
  width: min(100%, 690px);
  max-width: none;
  padding: clamp(17px, 4vw, 35px);
  box-shadow: inset 0 3px var(--brand), var(--journey-shadow);
}

:where(html:not([data-theme])) .shop-body #orders .order-query > p { line-height: 1.7; }
:where(html:not([data-theme])) .shop-body #orders .order-query > .kicker { margin-bottom: 5px; }
:where(html:not([data-theme])) .shop-body #orders #query-form { min-width: 0; }
:where(html:not([data-theme])) .shop-body #orders #query-form label { min-width: 0; }

:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-list-row, .od-kv) > span {
  color: var(--muted);
  flex-shrink: 0;
}

:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-list-row, .od-kv) > b {
  min-width: 0;
  text-align: end;
  overflow-wrap: anywhere;
}

:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-list-amount, .od-product strong) { color: var(--brand-deep); }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-list-status, .od-status):not(.done) { color: #79571b; }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-list-status, .od-status).done { color: #196749; }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.order-detail-panel, .order-detail-sheet) {
  border-color: var(--line-soft);
  border-radius: 10px;
  background: var(--paper-soft);
}

:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) .order-detail-sheet { padding: clamp(8px, 2vw, 15px); }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) :is(.od-copy-btn, .od-reveal-btn) { color: var(--brand-deep); }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) .od-tip { color: #79571b; }
:where(html:not([data-theme])) .shop-body :is(#orders, #account, #cashier, #modal) .od-product { overflow-wrap: anywhere; }

/* Customer login and legal pages are linked separately; do not target admin authentication. */
body.auth-body:not(.admin-auth), body.legal-body {
  color-scheme: light;
  background: linear-gradient(150deg, var(--paper) 0%, var(--bg) 58%) fixed;
  font-family: var(--journey-sans);
}

body.auth-body:not(.admin-auth) { padding: clamp(10px, 3.8vw, 46px); }
body.auth-body:not(.admin-auth) .auth-shell {
  width: min(100%, 970px);
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  padding: 0;
  border: var(--journey-frame);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--journey-shadow);
}

body.auth-body:not(.admin-auth) .user-auth-aside {
  gap: clamp(30px, 7vw, 75px);
  justify-content: space-between;
  min-width: 0;
  padding: clamp(24px, 4.2vw, 52px);
  border-right: var(--journey-frame);
  background:
    repeating-linear-gradient(90deg, transparent 0 35px, rgb(36 85 196 / 5%) 35px 36px),
    linear-gradient(145deg, #f9fbff 12%, #e3edfd 100%);
}

body.auth-body:not(.admin-auth) .user-auth-aside h1 {
  margin: 7px 0 14px;
  font-size: clamp(29px, 4.25vw, 49px);
}

body.auth-body:not(.admin-auth) .user-auth-aside > div > p:last-child {
  max-width: 33ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

body.auth-body:not(.admin-auth) .auth-form-wrap {
  min-width: 0;
  padding: clamp(19px, 4.15vw, 50px);
  background: var(--paper);
}

body.auth-body:not(.admin-auth) .auth-form-wrap .back-link { color: var(--brand); }
body.auth-body:not(.admin-auth) .user-auth-form h2 { margin-top: 5px; font-size: clamp(25px, 3.4vw, 37px); }
body.auth-body:not(.admin-auth) .user-auth-form .auth-copy { color: var(--muted); font-size: 14px; }
body.auth-body:not(.admin-auth) .user-auth-form .auth-tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-soft);
}

body.auth-body:not(.admin-auth) .user-auth-form .auth-tab { min-height: 44px; border-radius: 6px; }
body.auth-body:not(.admin-auth) .user-auth-form .auth-tab.active {
  background: var(--paper);
  color: var(--brand-deep);
  box-shadow: inset 0 -2px var(--brand), 0 1px 3px rgb(33 52 82 / 10%);
}

body.auth-body:not(.admin-auth) .user-auth-form .password-wrap .reveal { border-radius: 6px; }
body.auth-body:not(.admin-auth) .user-auth-form .auth-panel small { color: var(--muted); }
body.auth-body:not(.admin-auth) .user-auth-form .code-field button { border-color: var(--line-strong); border-radius: 8px; color: var(--brand-deep); }
body.auth-body:not(.admin-auth) .user-auth-form .auth-footer a { color: var(--brand); }

body.legal-body .legal-header { border-bottom: var(--journey-frame); background-color: var(--paper) !important; }
body.legal-body .legal-shell {
  width: min(900px, calc(100% - clamp(24px, 7vw, 90px)));
  margin: clamp(16px, 4vw, 48px) auto;
  padding: clamp(20px, 5.5vw, 62px);
  border: var(--journey-frame);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset 0 3px var(--brand), var(--journey-shadow);
}

body.legal-body .legal-shell h1 { margin-top: 7px; font-size: clamp(32px, 6vw, 54px); }
body.legal-body .legal-shell h2 { font-size: clamp(17px, 3vw, 22px); }
body.legal-body .legal-shell .legal-updated { color: var(--muted); font-variant-numeric: tabular-nums; }
body.legal-body .legal-shell > section:first-of-type { border-color: var(--brand-line); }
body.legal-body .legal-shell section p { color: var(--ink-soft); font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
body.legal-body .legal-footer { background: var(--paper-soft); }
body.legal-body .legal-footer a { color: var(--brand); }

@media (max-width: 960px) {
  :where(html:not([data-theme])) .shop-body #product .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  :where(html:not([data-theme])) .shop-body #product .detail-main { display: contents; }
  :where(html:not([data-theme])) .shop-body #product #detail-icon { order: -1; }
  :where(html:not([data-theme])) .shop-body #product .purchase-panel { position: static; display: grid; }
  :where(html:not([data-theme])) .shop-body #cashier .cashier-payment-card { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  :where(html:not([data-theme])) .shop-body #checkout .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  :where(html:not([data-theme])) .shop-body #checkout .checkout-summary { position: static; }
}

@media (max-width: 720px) {
  :where(html:not([data-theme])) .shop-body #cashier .cashier-grid { grid-template-columns: minmax(0, 1fr); }
  :where(html:not([data-theme])) .shop-body #cashier .cashier-step { gap: 7px; font-size: 12px; }
  :where(html:not([data-theme])) .shop-body #account .wallet-card { grid-template-columns: minmax(0, 1fr); }
  body.auth-body:not(.admin-auth) .auth-shell { width: min(100%, 510px); grid-template-columns: minmax(0, 1fr); }
  body.auth-body:not(.admin-auth) .user-auth-aside { gap: 17px; padding: 20px; border-right: 0; border-bottom: var(--journey-frame); }
  body.auth-body:not(.admin-auth) .user-auth-aside h1 { margin-bottom: 8px; }
  body.auth-body:not(.admin-auth) .user-auth-aside h1 br { display: none; }
}

@media (max-width: 560px) {
  :where(html:not([data-theme])) .shop-body #modal:has(#modal-body > .search-input, #modal-body > div > :is(.cart-empty, .cart-line)) .modal-card {
    border-radius: 0;
  }
  :where(html:not([data-theme])) .shop-body #product .detail-info { grid-template-columns: minmax(0, 1fr); }
  :where(html:not([data-theme])) .shop-body #checkout .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  :where(html:not([data-theme])) .shop-body #modal .modal-card { animation: none; }
}
