:root {
  --brand-red: #72151b;
  --brand-charcoal: #524b4b;
  --brand-gold: #d7aa68;
  --brand-cream: #f3efe8;
  --brand-white: #ffffff;
  --color-primary: var(--brand-red);
  --color-accent: var(--brand-gold);
  --color-text: var(--brand-charcoal);
  --color-muted: rgba(82, 75, 75, .82);
  --color-canvas: var(--brand-cream);
  --color-surface: var(--brand-white);
  --color-surface-soft: rgba(243, 239, 232, .72);
  --color-primary-soft: rgba(114, 21, 27, .08);
  --color-accent-soft: rgba(215, 170, 104, .24);
  --color-line: rgba(82, 75, 75, .20);
  --shadow-sm: 0 4px 14px rgba(82, 75, 75, .08);
  --shadow-md: 0 14px 36px rgba(82, 75, 75, .14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  color-scheme: light;
  font-family: "Nunito Sans", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; background: var(--color-canvas); }
body { margin: 0; min-height: 100dvh; overscroll-behavior-y: contain; color: var(--color-text); background: linear-gradient(180deg, var(--brand-cream), var(--brand-white) 48%, var(--brand-cream)); font-size: 16px; line-height: 1.5; }
html.scanner-is-open, html.scanner-is-open body { height: 100%; overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
a { color: inherit; }
img { display: block; }
svg { flex: 0 0 auto; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100dvh; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.app-shell--scan .page { width: min(720px, 100%); padding-top: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; color: var(--color-text); background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); border-bottom: 1px solid var(--color-line); }
.topbar__inner { width: min(1160px, 100%); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(12px, env(safe-area-inset-top)) 18px 12px; }
.brand { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo { width: 123px; height: auto; flex: 0 0 auto; }
.brand > span { overflow: hidden; color: var(--color-muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.topnav { display: flex; gap: 8px; }
.topnav a { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: var(--radius-sm); color: var(--color-muted); font-size: 14px; font-weight: 800; text-decoration: none; transition: color 180ms ease, background 180ms ease; }
.topnav a:hover, .topnav a:focus-visible, .topnav a.active { color: var(--brand-red); background: var(--color-primary-soft); }
.topnav-account { min-height: 44px; max-width: 210px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--color-line); border-radius: var(--radius-sm); padding: 0 12px; color: var(--brand-red); background: var(--brand-white); font-size: 12px; font-weight: 900; }
.topnav-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav-account svg:last-child { width: 16px; }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: radial-gradient(circle at top, var(--brand-white), var(--brand-cream) 68%); }
.login-card { width: min(480px, 100%); padding: 28px 20px; border: 1px solid var(--brand-gold); border-radius: var(--radius-lg); background: var(--brand-white); box-shadow: var(--shadow-md); }
.login-logo { width: 142px; height: auto; margin-bottom: 28px; }
.login-card h1 { margin: 5px 0 10px; color: var(--brand-red); font-size: clamp(28px, 8vw, 38px); line-height: 1.14; }
.login-card > p:not(.eyebrow) { margin: 0 0 20px; color: var(--color-muted); line-height: 1.65; }
.login-line-button { min-height: 58px; margin-top: 14px; }
.login-privacy { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; margin-top: 14px; padding: 12px; border-radius: 12px; color: var(--color-muted); background: var(--color-surface-soft); font-size: 11px; }
.login-privacy svg { width: 20px; color: var(--brand-red); }
.login-error { margin: 12px 0; padding: 12px; border-left: 4px solid var(--brand-red); border-radius: 8px; color: var(--brand-red); background: var(--color-primary-soft); font-weight: 800; }
.login-demo { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-line); }
.login-demo > strong { color: var(--brand-red); }
.login-demo p { margin: 4px 0 10px; color: var(--color-muted); font-size: 12px; }
.login-demo > div { display: grid; gap: 8px; }
.login-demo .button { width: 100%; min-height: 48px; }

.page { width: min(1160px, 100%); margin: 0 auto; padding: 20px 16px 40px; }
.eyebrow { margin: 0 0 4px; color: var(--brand-red); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.location-strip { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid rgba(114, 21, 27, .20); border-radius: var(--radius-md); background: rgba(255, 255, 255, .78); box-shadow: var(--shadow-sm); }
.location-strip__label { display: flex; align-items: flex-start; gap: 12px; }
.location-strip__label > svg { color: var(--brand-red); }
.location-strip h1 { margin: 0; color: var(--brand-charcoal); font-size: clamp(20px, 5vw, 25px); line-height: 1.2; }
.location-strip p { margin: 4px 0 0; color: var(--color-muted); font-size: 13px; }
.session-pill { min-height: 32px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border-radius: 999px; color: var(--brand-red); background: var(--color-accent-soft); font-size: 12px; font-weight: 900; }
.session-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-gold); box-shadow: 0 0 0 4px rgba(215, 170, 104, .24); }
.scan-context { min-height: 54px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--color-line); border-radius: 13px; background: rgba(255, 255, 255, .78); }
.scan-context > svg { color: var(--brand-red); }
.scan-context > div { min-width: 0; display: grid; }
.scan-context strong { overflow: hidden; color: var(--brand-charcoal); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.scan-context span:not(.live-indicator) { overflow: hidden; color: var(--color-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.app-shell--scan .flow-stepper { margin-block: 12px; }

.flow-stepper { width: min(620px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 18px auto; padding: 0; list-style: none; }
.flow-stepper li { position: relative; min-width: 0; display: grid; justify-items: center; gap: 6px; color: var(--color-muted); text-align: center; }
.flow-stepper li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 17px; left: calc(50% + 18px); width: calc(100% - 36px); height: 2px; background: var(--color-line); }
.flow-stepper li.complete:not(:last-child)::after { background: var(--brand-gold); }
.flow-stepper li > span { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--color-line); border-radius: 50%; background: var(--brand-white); color: var(--color-muted); font-size: 13px; font-weight: 900; }
.flow-stepper li > span svg { width: 18px; height: 18px; }
.flow-stepper li.current > span { border-color: var(--brand-red); color: var(--brand-white); background: var(--brand-red); box-shadow: 0 0 0 5px var(--color-primary-soft); }
.flow-stepper li.complete > span { border-color: var(--brand-gold); color: var(--brand-red); background: var(--brand-gold); }
.flow-stepper strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.2; }
.flow-stepper li.current strong, .flow-stepper li.complete strong { color: var(--brand-red); }

.welcome-shell { min-height: calc(100dvh - 70px); padding-bottom: 40px; }
.welcome-hero { margin: 30px 2px 20px; }
.welcome-hero h2 { max-width: 760px; margin: 6px 0 12px; color: var(--brand-red); font-family: Rubik, "Noto Sans TC", sans-serif; font-size: clamp(34px, 9vw, 56px); line-height: 1.06; letter-spacing: -.035em; }
.welcome-hero > p:last-child { max-width: 700px; margin: 0; color: var(--color-muted); line-height: 1.7; }
.steps { display: grid; gap: 10px; margin: 20px 0; }
.steps article { display: grid; grid-template-columns: 44px 1fr; gap: 12px; min-height: 108px; padding: 16px; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--brand-white); box-shadow: var(--shadow-sm); }
.steps article > span { color: var(--brand-red); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.steps article svg { width: 24px; height: 24px; color: var(--brand-red); }
.steps article h3 { margin: 6px 0 3px; font-size: 17px; }
.steps article p { margin: 0; color: var(--color-muted); font-size: 14px; }
.welcome-cta { margin-top: 16px; font-size: 17px; }
.tracking-notice { display: grid; gap: 5px; margin: 12px 0 18px; padding: 16px; border-left: 4px solid var(--brand-gold); border-radius: 4px 12px 12px 4px; color: var(--brand-red); background: var(--color-accent-soft); }
.tracking-notice strong { font-size: 15px; }
.tracking-notice span { color: var(--brand-charcoal); font-size: 13px; line-height: 1.6; }
.tracking-notice--compact { margin: 12px 2px 18px; }

.inventory-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 2px 10px; }
.inventory-heading h2 { margin: 0; font-size: clamp(22px, 6vw, 30px); }
.inventory-heading--welcome { margin-top: 36px; }
.live-indicator { min-height: 28px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--brand-red); font-size: 12px; font-weight: 900; }
.live-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-gold); box-shadow: 0 0 0 4px var(--color-accent-soft); }
.stock-group { margin-top: 20px; }
.stock-group > h3 { margin: 0 0 8px; font-size: 18px; }
.stock-list { display: grid; gap: 8px; }
.stock-row { min-height: 76px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--color-line); border-radius: 12px; background: var(--brand-white); }
.stock-row h4 { margin: 0; font-size: 15px; line-height: 1.35; }
.stock-row p { margin: 4px 0 0; color: var(--color-muted); font-size: 12px; }
.rack-slot { min-width: 50px; min-height: 34px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 9px; color: var(--brand-red); background: var(--color-accent-soft); font-size: 12px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
.stock-state { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-charcoal); font-size: 12px; font-weight: 900; }
.stock-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-gold); }
.stock-state.low, .stock-state.out { color: var(--brand-red); }
.stock-state.out::before { background: var(--brand-red); }

.scan-panel { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 14px; margin-top: 16px; padding: 18px; border-radius: var(--radius-lg); color: var(--brand-white); background: var(--brand-red); box-shadow: var(--shadow-md); }
.scan-panel__icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; color: var(--brand-red); background: var(--brand-gold); }
.scan-panel .eyebrow { color: var(--brand-gold); }
.scan-panel h2 { margin: 3px 0 6px; font-size: clamp(23px, 6vw, 30px); line-height: 1.2; }
.scan-panel p { margin: 0; color: rgba(255, 255, 255, .86); font-size: 14px; line-height: 1.6; }
.scanner-stage { position: relative; grid-column: 1 / -1; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: var(--brand-charcoal); }
.scan-panel:not(.scan-panel--active) .scanner-stage { display: none; }
.live-barcode-reader { width: 100%; min-height: 0; overflow: hidden; border-radius: inherit; background: var(--brand-charcoal); }
.live-barcode-reader.active { min-height: 260px; border: 3px solid var(--brand-gold); }
.live-barcode-reader video { width: 100% !important; min-height: 260px; object-fit: cover; }
.live-barcode-reader img { display: none !important; }
.scanner-guide { position: absolute; inset: 0; z-index: 3; display: none; place-items: center; padding: 18px; pointer-events: none; }
.scanner-stage.active .scanner-guide { display: grid; }
.scanner-guide__frame { position: relative; width: min(94%, 680px); height: min(44%, 176px); border: 2px solid var(--brand-gold); border-radius: 14px; box-shadow: 0 0 0 999px rgba(82, 75, 75, .28); }
.scanner-guide__frame::before, .scanner-guide__frame::after { content: ""; position: absolute; right: 8%; left: 8%; height: 2px; border-radius: 99px; background: var(--brand-gold); }
.scanner-guide__frame::before { top: 50%; opacity: .34; }
.scanner-guide__frame::after { top: 50%; box-shadow: 0 0 12px var(--brand-gold); animation: barcode-sweep 1.3s ease-in-out infinite; }
.scanner-guide > span { position: absolute; right: 20px; bottom: 14px; left: 20px; color: var(--brand-white); font-size: 13px; font-weight: 800; line-height: 1.4; text-align: center; text-shadow: 0 2px 8px var(--brand-charcoal); }
.scanner-feedback { position: absolute; z-index: 5; inset: 0; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 24px; color: var(--brand-white); background: rgba(114, 21, 27, .92); opacity: 0; transform: scale(.985); transition: opacity 160ms ease, transform 160ms ease; pointer-events: none; text-align: center; }
.scanner-stage.is-reading .scanner-feedback, .scanner-stage.is-success .scanner-feedback, .scanner-stage.is-error .scanner-feedback { opacity: 1; transform: scale(1); }
.scanner-stage.is-success .scanner-feedback { color: var(--brand-red); background: rgba(215, 170, 104, .96); }
.scanner-stage.is-error .scanner-feedback { background: rgba(82, 75, 75, .94); }
.scanner-feedback__mark { width: 76px; height: 76px; display: grid; place-items: center; border: 3px solid currentColor; border-radius: 50%; transform: scale(.72); opacity: .45; }
.scanner-stage.is-reading .scanner-feedback__mark { animation: scanner-pulse 1s ease-out infinite; }
.scanner-stage.is-success .scanner-feedback__mark, .scanner-stage.is-error .scanner-feedback__mark { animation: success-pop 220ms ease-out forwards; }
.scanner-feedback strong { font-size: 26px; line-height: 1.15; }
.scanner-feedback span { max-width: 310px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.scan-panel--active { position: fixed; z-index: 50; top: max(12px, env(safe-area-inset-top)); right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: auto minmax(220px, 1fr) auto; align-items: center; gap: 12px; margin: auto; padding: 16px; overflow: hidden; border: 2px solid var(--brand-gold); border-radius: 24px; box-shadow: 0 0 0 9999px rgba(82, 75, 75, .68), var(--shadow-md); }
.scan-panel--active .scan-panel__intro > p:last-child { display: none; }
.scan-panel--active .scanner-stage { width: min(720px, 100%); min-height: 0; height: 100%; justify-self: center; }
.scan-panel--active .live-barcode-reader.active { width: 150%; min-height: 0; border-width: 0; transform: scale(.666667); transform-origin: center; }
.scan-panel--active .live-barcode-reader video { min-height: 0; height: auto !important; object-fit: contain; }
.scan-panel--active .camera-button { width: min(720px, 100%); justify-self: center; }
.scan-panel--active .button.camera-button { min-height: 58px; }
.scan-panel--active .scan-result, .scan-panel--active .text-button { display: none; }
.camera-button { grid-column: 1 / -1; min-height: 58px; }
.scan-result { grid-column: 1 / -1; display: grid; gap: 3px; padding: 13px 14px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 12px; }
.scan-result strong { font-size: 15px; }
.scan-result span { font-size: 13px; }
.scan-result.success { color: var(--brand-red); background: var(--brand-gold); }
.scan-result.error { color: var(--brand-white); background: rgba(82, 75, 75, .72); }
.scan-panel .text-button { grid-column: 1 / -1; justify-self: center; color: var(--brand-white); }
.text-button { min-height: 44px; border: 0; background: transparent; color: var(--brand-red); text-decoration: underline; text-underline-offset: 4px; }
@keyframes scanner-pulse { 0% { box-shadow: 0 0 0 0 rgba(215, 170, 104, .48); } 70%, 100% { box-shadow: 0 0 0 9px rgba(215, 170, 104, 0); } }
@keyframes barcode-sweep { 0%, 100% { transform: translateY(-48px); opacity: .28; } 50% { transform: translateY(48px); opacity: 1; } }

.inventory-disclosure { overflow: hidden; margin-top: 18px; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--brand-white); }
.inventory-disclosure > summary { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; list-style: none; }
.inventory-disclosure > summary::-webkit-details-marker { display: none; }
.inventory-disclosure > summary::after { content: "+"; width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand-white); background: var(--brand-red); font-size: 20px; font-weight: 800; transition: transform 180ms ease; }
.inventory-disclosure[open] > summary::after { transform: rotate(45deg); }
.inventory-disclosure > summary > span:first-child { min-width: 0; display: grid; gap: 2px; }
.inventory-disclosure > summary strong { font-size: 16px; }
.inventory-disclosure > summary small { color: var(--color-muted); font-size: 12px; }
.inventory-disclosure > summary .live-indicator { margin-left: auto; }
.inventory-disclosure__content { padding: 0 14px 18px; border-top: 1px solid var(--color-line); }
.rack-section { margin-top: 20px; }
.rack-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.rack-heading h3 { margin: 0; font-size: 18px; }
.rack-heading span { color: var(--color-muted); font-size: 12px; }
.product-list { display: grid; gap: 9px; }
.product-row { min-height: 90px; display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--brand-white); box-shadow: var(--shadow-sm); }
.product-row__image { width: 66px; height: 66px; overflow: hidden; border-radius: 10px; background: var(--color-surface-soft); }
.product-row__image img { width: 100%; height: 100%; object-fit: cover; }
.product-row__content { min-width: 0; }
.product-row__sku { color: var(--brand-red); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.product-row h4 { margin: 3px 0; font-size: 15px; line-height: 1.3; }
.product-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--color-muted); font-size: 12px; }
.product-row__price { color: var(--brand-charcoal); font-weight: 900; }

.empty-state { margin-top: 24px; padding: 36px 22px; border: 1px dashed var(--brand-red); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .74); text-align: center; }
.empty-state__icon { width: 66px; height: 66px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 20px; color: var(--brand-red); background: var(--color-accent-soft); }
.empty-state h1 { margin: 0; color: var(--brand-red); font-size: 28px; }
.empty-state p { max-width: 480px; margin: 10px auto 20px; color: var(--color-muted); line-height: 1.65; }

.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 0 18px; color: var(--brand-white); background: var(--brand-red); font-weight: 900; text-decoration: none; transition: opacity 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.button:hover { box-shadow: 0 8px 22px rgba(114, 21, 27, .20); }
.button:active { opacity: .78; }
.button--secondary { border: 1px solid var(--brand-red); color: var(--brand-red); background: var(--brand-white); }
.button--secondary:hover { background: var(--color-primary-soft); box-shadow: none; }
.button--danger { color: var(--brand-white); background: var(--brand-red); }
.button--amber { color: var(--brand-red); background: var(--brand-gold); }
.button--full { width: 100%; }
.button.welcome-cta { min-height: 58px; }
.button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.button.is-loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }

.bottom-cart { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(18px); }
.bottom-cart__inner { width: min(720px, 100%); margin: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.bottom-cart__meta { min-width: 0; font-variant-numeric: tabular-nums; }
.bottom-cart__meta span, .bottom-cart__meta strong { display: block; }
.bottom-cart__meta span { color: var(--color-muted); font-size: 12px; }
.bottom-cart__meta strong { color: var(--brand-red); font-size: 20px; }

.drawer-backdrop { position: fixed; z-index: 45; inset: 0; display: grid; align-items: end; background: rgba(82, 75, 75, .62); animation: fade-in 180ms ease; }
.drawer { width: 100%; height: 100dvh; max-height: 100dvh; overflow: auto; padding: max(8px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); color: var(--brand-charcoal); background: var(--brand-white); animation: slide-up 220ms ease-out; }
.drawer__handle { width: 48px; height: 5px; margin: 3px auto 14px; border-radius: 999px; background: rgba(82, 75, 75, .28); }
.drawer .flow-stepper { margin-top: 8px; }
.drawer__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer__heading h2 { margin: 0; color: var(--brand-red); font-size: 25px; line-height: 1.2; }
.drawer__heading p { margin: 6px 0 0; color: var(--color-muted); font-size: 14px; }
.icon-button { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--color-line); border-radius: 13px; color: var(--brand-red); background: var(--brand-cream); }
.count-check { display: grid; gap: 4px; margin-top: 16px; padding: 14px; border-left: 4px solid var(--brand-gold); border-radius: 4px 12px 12px 4px; color: var(--brand-red); background: var(--color-accent-soft); }
.count-check strong { font-size: 14px; }
.count-check span { color: var(--brand-charcoal); font-size: 13px; line-height: 1.55; }
.cart-review-progress { display: grid; gap: 7px; margin-top: 18px; color: var(--brand-red); font-size: 13px; font-weight: 900; }
.cart-review-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--color-primary-soft); }
.cart-review-progress i { height: 100%; display: block; border-radius: inherit; background: var(--brand-gold); transition: width 200ms ease; }
.cart-lines { display: grid; gap: 10px; margin: 16px 0 20px; }
.cart-line { display: grid; gap: 10px; padding: 11px; border: 1px solid var(--color-line); border-radius: 14px; background: var(--brand-white); transition: border-color 180ms ease, background 180ms ease; }
.cart-line.checked { border-color: var(--brand-gold); background: var(--color-accent-soft); }
.cart-line__thumb { width: 68px; height: 68px; object-fit: cover; border: 1px solid var(--color-line); border-radius: 12px; background: var(--brand-cream); }
.cart-check-button { position: relative; min-width: 0; min-height: 68px; display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 10px; padding: 0 46px 0 0; border: 0; color: var(--brand-charcoal); background: transparent; text-align: left; }
.cart-check-icon { position: absolute; top: 0; right: 0; width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--brand-red); border-radius: 50%; color: var(--brand-red); background: var(--brand-white); }
.cart-check-icon svg { width: 22px; height: 22px; }
.cart-line.checked .cart-check-icon { border-color: var(--brand-gold); background: var(--brand-gold); }
.cart-line__copy { min-width: 0; display: grid; }
.cart-check-button strong { overflow-wrap: anywhere; font-size: 15px; line-height: 1.3; }
.cart-check-button small { margin-top: 3px; color: var(--color-muted); font-size: 12px; }
.cart-line__check { width: fit-content; margin-bottom: 4px; padding: 2px 7px; border-radius: 999px; color: var(--brand-red); background: var(--color-primary-soft); font-size: 10px; font-weight: 900; }
.quantity-editor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 10px; padding-top: 11px; border-top: 1px solid var(--color-line); }
.quantity-editor label { min-width: 0; display: grid; gap: 6px; color: var(--brand-charcoal); font-size: 13px; font-weight: 900; }
.quantity-editor input { width: 100%; height: 46px; min-width: 0; padding: 0 10px; border: 0; outline: 0; color: var(--brand-red); background: transparent; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.quantity-editor > small { grid-column: 1 / -1; color: var(--color-muted); font-size: 11px; line-height: 1.4; }
.cart-quantity-editor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: end; gap: 7px 10px; padding-top: 11px; border-top: 1px solid var(--color-line); }
.cart-quantity-editor__label { grid-column: 1 / -1; color: var(--brand-charcoal); font-size: 13px; font-weight: 900; }
.cart-quantity-stepper { min-width: 0; display: grid; grid-template-columns: 48px minmax(58px, 1fr) 48px; overflow: hidden; border: 1px solid var(--brand-red); border-radius: 12px; background: var(--brand-white); }
.cart-quantity-stepper button { min-width: 48px; min-height: 48px; border: 0; color: var(--brand-red); background: var(--color-primary-soft); font-size: 24px; font-weight: 900; }
.cart-quantity-stepper button:first-child { border-right: 1px solid var(--color-line); }
.cart-quantity-stepper button:last-child { border-left: 1px solid var(--color-line); }
.cart-quantity-stepper button:disabled { color: var(--color-muted); cursor: not-allowed; opacity: .42; }
.cart-quantity-stepper output { min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 4px; color: var(--brand-red); font-variant-numeric: tabular-nums; }
.cart-quantity-stepper output strong { font-size: 20px; }
.cart-quantity-stepper output span { font-size: 12px; font-weight: 900; }
.cart-remove-button { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--brand-red); border-radius: 12px; color: var(--brand-red); background: var(--brand-white); transition: background 160ms ease, opacity 160ms ease; }
.cart-remove-button:active { background: var(--color-primary-soft); opacity: .78; }
.cart-quantity-editor > small { grid-column: 1 / -1; color: var(--color-muted); font-size: 11px; line-height: 1.4; }
.summary { display: grid; gap: 9px; padding: 16px; border-radius: 14px; background: var(--brand-cream); font-variant-numeric: tabular-nums; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; }
.summary__row--total { padding-top: 10px; border-top: 1px solid var(--color-line); color: var(--brand-red); font-size: 21px; font-weight: 900; }
.drawer__actions { display: grid; gap: 10px; margin-top: 16px; }
.text-button--danger { color: var(--brand-red); }
.warning-note { display: grid; gap: 4px; margin: 16px 0; padding: 14px; border-left: 4px solid var(--brand-gold); border-radius: 4px 12px 12px 4px; color: var(--brand-red); background: var(--color-accent-soft); }
.warning-note span { color: var(--brand-charcoal); font-size: 13px; }
.payment-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.payment-overview > div { display: grid; gap: 3px; padding: 13px 14px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--brand-cream); }
.payment-overview span { color: var(--color-muted); font-size: 12px; }
.payment-overview strong { color: var(--brand-red); font-size: 20px; font-variant-numeric: tabular-nums; }
.payment-review { margin-top: 14px; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--brand-white); }
.payment-review__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--color-line); background: var(--color-surface-soft); }
.payment-review__heading h3 { margin: 0; font-size: 18px; }
.payment-review__heading > span { min-width: 50px; min-height: 32px; display: grid; place-items: center; border-radius: 999px; color: var(--brand-red); background: var(--color-accent-soft); font-size: 12px; font-weight: 900; }
.payment-amount { display: grid; justify-items: center; gap: 4px; margin-top: 14px; padding: 20px 16px; border: 2px solid var(--brand-gold); border-radius: var(--radius-md); background: var(--brand-cream); text-align: center; }
.payment-amount span { color: var(--color-muted); font-size: 13px; }
.payment-amount strong { color: var(--brand-red); font-size: clamp(34px, 10vw, 46px); font-variant-numeric: tabular-nums; line-height: 1.15; }
.payment-amount small { color: var(--color-muted); }
.payment-lines { display: grid; }
.payment-line { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--color-line); font-size: 13px; }
.payment-line:last-child { border-bottom: 0; }
.payment-line img { width: 54px; height: 54px; object-fit: cover; border: 1px solid var(--color-line); border-radius: 10px; background: var(--brand-cream); }
.payment-line > div { min-width: 0; display: grid; gap: 3px; }
.payment-line > div strong { overflow-wrap: anywhere; color: var(--brand-charcoal); line-height: 1.35; white-space: normal; }
.payment-line span { color: var(--color-muted); font-size: 12px; }
.payment-line b { width: fit-content; padding: 2px 8px; border-radius: 999px; color: var(--brand-red); background: var(--color-accent-soft); font-size: 11px; }
.payment-line > strong { color: var(--brand-red); font-variant-numeric: tabular-nums; white-space: nowrap; }
.payment-confirm-note { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 12px; padding: 13px 14px; border-left: 4px solid var(--brand-gold); border-radius: 4px 12px 12px 4px; color: var(--brand-red); background: var(--color-accent-soft); }
.payment-confirm-note > svg { width: 30px; height: 30px; }
.payment-confirm-note > div { display: grid; gap: 2px; }
.payment-confirm-note span { color: var(--brand-charcoal); font-size: 12px; line-height: 1.45; }
.payment-actions .button:first-child { min-height: 58px; }
.payment-actions { display: grid; gap: 10px; }

.scan-confirm-backdrop { position: fixed; z-index: 48; inset: 0; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(82, 75, 75, .68); animation: fade-in 160ms ease; }
.scan-confirm-modal { width: min(400px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px; border: 2px solid var(--brand-gold); border-radius: 18px; color: var(--brand-charcoal); background: var(--brand-white); box-shadow: var(--shadow-md); animation: success-pop 200ms ease-out; }
.scan-confirm-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 10px; }
.scan-confirm-heading h1 { margin: 1px 0 0; color: var(--brand-red); font-size: 20px; line-height: 1.2; }
.scan-success-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--brand-red); background: var(--brand-gold); box-shadow: 0 0 0 4px var(--color-accent-soft); }
.scan-success-mark svg { width: 22px; height: 22px; }
.scanned-product-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--brand-cream); }
.scanned-product-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 9px; background: var(--brand-white); }
.scanned-product-card h2 { margin: 4px 0 1px; font-size: 16px; line-height: 1.3; }
.scanned-product-card p { margin: 0 0 4px; color: var(--color-muted); font-size: 12px; }
.scanned-product-card strong { color: var(--brand-red); font-size: 13px; }
.scan-quantity-confirm { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; padding: 0; border: 0; }
.scan-quantity-confirm label { display: grid; gap: 6px; font-size: 13px; }
.scan-quantity-stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: stretch; overflow: hidden; border: 1px solid var(--brand-red); border-radius: 12px; background: var(--brand-white); }
.scan-quantity-stepper button { min-width: 48px; min-height: 48px; border: 0; color: var(--brand-red); background: var(--color-primary-soft); font-size: 24px; font-weight: 900; }
.scan-quantity-stepper button:first-child { border-right: 1px solid var(--color-line); }
.scan-quantity-stepper button:last-child { border-left: 1px solid var(--color-line); }
.scan-quantity-stepper button:disabled { color: var(--color-muted); cursor: not-allowed; opacity: .42; }
.scan-quantity-stepper input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; color: var(--brand-red); background: var(--brand-white); font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; }
.scan-quantity-confirm > small { color: var(--color-muted); font-size: 11px; line-height: 1.45; }
.scan-confirm-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(88px, .8fr); gap: 8px; margin-top: 10px; }
.scan-confirm-actions .button { min-height: 56px; padding-inline: 12px; }
.scan-confirm-summary { margin: 6px 0 0; color: var(--color-muted); font-size: 11px; font-weight: 800; text-align: center; }

.receipt-page > .flow-stepper { margin-top: 0; }
.receipt { max-width: 620px; margin: 18px auto 0; padding: 28px 20px; border: 2px solid var(--brand-gold); border-radius: var(--radius-lg); background: var(--brand-white); box-shadow: var(--shadow-md); }
.receipt__check { width: 70px; height: 70px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; color: var(--brand-red); background: var(--brand-gold); }
.receipt h1, .receipt > p { text-align: center; }
.receipt h1 { margin: 0; color: var(--brand-red); font-size: 32px; }
.receipt > p { color: var(--color-muted); }
.receipt__number { margin: 20px 0; padding: 15px; border-radius: 13px; background: var(--brand-cream); text-align: center; }
.receipt__number span, .receipt__number strong { display: block; }
.receipt__number span { color: var(--color-muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.receipt__number strong { margin-top: 4px; color: var(--brand-red); font-size: 15px; word-break: break-all; }
.receipt__next { display: grid; gap: 4px; margin-top: 16px; padding: 15px; border-radius: 13px; color: var(--brand-red); background: var(--color-accent-soft); text-align: center; }
.receipt__next span { color: var(--brand-charcoal); font-size: 13px; }

.toast { position: fixed; z-index: 70; top: max(82px, calc(env(safe-area-inset-top) + 70px)); left: 50%; width: min(92vw, 460px); padding: 14px 16px; border: 2px solid var(--brand-gold); border-radius: 13px; color: var(--brand-white); background: var(--brand-charcoal); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translate(-50%, -10px); transition: opacity 200ms ease, transform 200ms ease; font-weight: 800; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--brand-red); background: var(--brand-red); }

.admin-page { width: min(1220px, 100%); margin: auto; padding: 24px 16px 60px; }
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.admin-hero h1 { margin: 3px 0 0; color: var(--brand-red); font-size: clamp(28px, 5vw, 42px); }
.admin-hero p:last-child { margin: 6px 0 0; color: var(--color-muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { min-height: 108px; padding: 16px; border: 1px solid var(--color-line); border-top: 4px solid var(--brand-gold); border-radius: var(--radius-md); background: var(--brand-white); }
.stat-card span { color: var(--color-muted); font-size: 12px; font-weight: 800; }
.stat-card strong { display: block; margin-top: 9px; color: var(--brand-red); font-size: 28px; }
.stat-card strong small { font-size: 12px; }
.stat-card--attention { border-color: rgba(114, 21, 27, .45); border-top-color: var(--brand-red); background: var(--color-primary-soft); }
.admin-sync-status { min-height: 40px; display: flex; align-items: center; gap: 8px; margin: -12px 0 14px; color: var(--color-muted); font-size: 12px; }
.admin-sync-status > span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-gold); box-shadow: 0 0 0 4px var(--color-accent-soft); }
.admin-sync-status strong { color: var(--brand-charcoal); }
.admin-sync-status small { margin-left: auto; font-size: 11px; }
.admin-alert { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid rgba(114, 21, 27, .36); border-left: 5px solid var(--brand-red); border-radius: var(--radius-md); background: var(--color-primary-soft); }
.admin-alert > div:first-child { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--brand-white); background: var(--brand-red); }
.admin-alert strong { color: var(--brand-red); }
.admin-alert p { margin: 2px 0 0; color: var(--color-muted); font-size: 12px; line-height: 1.5; }
.admin-alert button { grid-column: 2; min-height: 44px; justify-self: start; border: 0; padding: 0 4px; color: var(--brand-red); background: transparent; font-weight: 900; text-decoration: underline; text-decoration-color: var(--brand-gold); text-decoration-thickness: 3px; }
.admin-alert--clear { border-color: var(--brand-gold); border-left-color: var(--brand-gold); background: var(--color-accent-soft); }
.admin-alert--clear > div:first-child { color: var(--brand-red); background: var(--brand-gold); }
.admin-order-record--review { border-left: 4px solid var(--brand-red); background: var(--color-primary-soft); }
.admin-order-record--review .type-pill.sale { background: rgba(114, 21, 27, .12); color: var(--brand-red); }
.admin-view-tabs { position: sticky; z-index: 10; top: 82px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 20px; padding: 6px; border: 1px solid var(--color-line); border-radius: 15px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-sm); }
.admin-view-tabs button { min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: var(--color-muted); background: transparent; font-weight: 900; transition: color 180ms ease, background 180ms ease; }
.admin-view-tabs button > span { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.admin-view-tabs button > strong { min-width: 23px; height: 23px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--brand-red); background: var(--color-accent-soft); font-size: 10px; }
.admin-view-tabs button.active { color: var(--brand-white); background: var(--brand-red); }
.admin-view-tabs button.active > strong { background: var(--brand-gold); }
.admin-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .82); box-shadow: var(--shadow-sm); }
.admin-panel .admin-section__heading { margin-bottom: 16px; }
.admin-toolbar { display: grid; gap: 10px; }
.admin-search { min-height: 50px; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--color-line); border-radius: 12px; color: var(--color-muted); background: var(--brand-white); }
.admin-search:focus-within { border-color: var(--brand-red); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.admin-search input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; color: var(--brand-charcoal); background: transparent; }
.admin-rack-filter { min-height: 50px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding-left: 13px; border: 1px solid var(--color-line); border-radius: 12px; color: var(--color-muted); background: var(--brand-white); font-size: 12px; font-weight: 900; }
.admin-rack-filter select { width: 100%; height: 48px; border: 0; outline: 0; color: var(--brand-charcoal); background: transparent; font: inherit; }
.admin-filter-row { display: flex; gap: 8px; margin-top: 10px; padding-bottom: 2px; overflow-x: auto; }
.filter-chip { min-height: 44px; flex: 0 0 auto; border: 1px solid var(--color-line); border-radius: 999px; padding: 0 15px; color: var(--brand-charcoal); background: var(--brand-white); font-weight: 900; }
.filter-chip.active { border-color: var(--brand-red); color: var(--brand-white); background: var(--brand-red); }
.admin-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.admin-results-heading p { margin: 0; font-size: 13px; }
.admin-results-heading p strong { color: var(--brand-red); font-size: 20px; }
.admin-results-heading > span { color: var(--color-muted); font-size: 11px; text-align: right; }
.admin-inventory-grid { display: grid; gap: 12px; }
.admin-inventory-card { overflow: hidden; padding: 15px; border: 1px solid var(--color-line); border-top: 4px solid var(--brand-gold); border-radius: var(--radius-md); background: var(--brand-white); }
.admin-inventory-card--low, .admin-inventory-card--out { border-color: rgba(114, 21, 27, .38); border-top-color: var(--brand-red); }
.admin-product-summary { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.admin-product-summary img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--color-line); border-radius: 12px; background: var(--brand-cream); }
.admin-product-summary__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-product-summary h3 { margin: 7px 0 2px; color: var(--brand-charcoal); font-size: 15px; line-height: 1.35; }
.admin-product-summary p { margin: 0; color: var(--color-muted); font-size: 11px; }
.stock-badge { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; color: var(--brand-charcoal); background: var(--color-accent-soft); font-size: 10px; font-weight: 900; white-space: nowrap; }
.stock-badge svg { width: 15px; height: 15px; }
.stock-badge--low, .stock-badge--out { color: var(--brand-white); background: var(--brand-red); }
.stock-badge--ready { color: var(--brand-red); background: var(--color-accent-soft); }
.admin-product-code { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 12px; padding: 8px 10px; border-radius: 9px; color: var(--color-muted); background: var(--color-surface-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.admin-stock-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0 8px; }
.admin-stock-values > div { min-width: 0; padding: 10px 8px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-surface-soft); text-align: center; }
.admin-stock-values dt { color: var(--color-muted); font-size: 9px; font-weight: 800; white-space: nowrap; }
.admin-stock-values dd { margin: 2px 0 0; color: var(--brand-charcoal); font-size: 23px; font-weight: 900; font-variant-numeric: tabular-nums; }
.admin-stock-values dd small { margin-left: 2px; font-size: 9px; }
.admin-stock-values__available { border-color: var(--brand-gold) !important; background: var(--color-accent-soft) !important; }
.admin-stock-values__available dd { color: var(--brand-red); }
.stock-meter { height: 7px; overflow: hidden; border-radius: 999px; background: var(--color-accent-soft); }
.stock-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-red); }
.admin-card-note { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--color-muted); font-size: 10px; }
.admin-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.admin-card-actions .button { min-height: 48px; padding-inline: 10px; }
.admin-empty { padding: 36px 18px; border: 1px dashed var(--brand-gold); border-radius: var(--radius-md); background: var(--color-surface-soft); text-align: center; }
.admin-empty > div { width: 52px; height: 52px; display: grid; place-items: center; margin: auto; border-radius: 15px; color: var(--brand-red); background: var(--color-accent-soft); }
.admin-empty h3 { margin: 12px 0 4px; color: var(--brand-red); }
.admin-empty p { margin: 0 auto 14px; color: var(--color-muted); font-size: 13px; }
.admin-record-list { display: grid; gap: 9px; }
.admin-record { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--color-line); border-radius: 13px; background: var(--brand-white); }
.admin-record__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--brand-red); background: var(--color-accent-soft); }
.admin-record__body { min-width: 0; }
.admin-record__body > div { display: flex; align-items: center; gap: 8px; }
.admin-record time { color: var(--color-muted); font-size: 10px; }
.admin-record h3 { margin: 5px 0 1px; font-size: 13px; }
.admin-record p { margin: 0; color: var(--color-muted); font-size: 10px; overflow-wrap: anywhere; }
.admin-record__operator { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 7px !important; color: var(--brand-red) !important; }
.admin-record__operator svg { width: 15px; height: 15px; }
.admin-record__operator span { min-height: 24px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; color: var(--brand-charcoal); background: var(--color-accent-soft); font-weight: 800; }
.admin-record__placement { margin-top: 4px !important; padding-left: 24px; color: var(--brand-charcoal) !important; font-size: 11px !important; }
.admin-record__value { min-width: 64px; text-align: right; }
.admin-record__value strong, .admin-record__value span { display: block; }
.admin-record__value strong { color: var(--brand-red); font-size: 18px; font-variant-numeric: tabular-nums; }
.admin-record__value span { color: var(--color-muted); font-size: 10px; }
.admin-test-tools { margin-top: 20px; border-top: 1px solid var(--color-line); color: var(--color-muted); }
.admin-test-tools summary { min-height: 48px; display: flex; align-items: center; font-size: 12px; font-weight: 900; }
.admin-test-tools > div { padding: 0 0 12px; }
.admin-test-tools p { font-size: 12px; }
.admin-test-tools .button { margin: 4px 8px 4px 0; }
.admin-modal-is-open, .admin-modal-is-open body { overflow: hidden; }
.admin-modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; align-items: end; padding-top: env(safe-area-inset-top); background: rgba(82, 75, 75, .62); animation: fade-in 180ms ease; }
.admin-modal { width: 100%; max-height: 92dvh; overflow: auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--brand-white); box-shadow: var(--shadow-md); animation: slide-up 220ms ease-out; }
.admin-modal__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-modal__heading h2 { margin: 0; color: var(--brand-red); font-size: 25px; }
.admin-modal__heading p:last-child { margin: 4px 0 0; color: var(--color-muted); font-size: 13px; }
.icon-button { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--color-line); border-radius: 12px; color: var(--brand-red); background: var(--brand-white); }
.admin-modal__current { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0; }
.admin-modal__current > * { min-width: 0; padding: 10px 5px; border-radius: 9px; color: var(--brand-charcoal); background: var(--color-surface-soft); font-size: 11px; text-align: center; }
.admin-modal__current strong { color: var(--brand-red); background: var(--color-accent-soft); }
.admin-field { display: grid; gap: 7px; margin-top: 13px; color: var(--brand-charcoal); font-size: 13px; font-weight: 900; }
.admin-field input, .admin-field select, .admin-field textarea { width: 100%; min-height: 50px; border: 1px solid var(--color-line); border-radius: 11px; padding: 0 13px; color: var(--brand-charcoal); background: var(--brand-white); }
.admin-field textarea { min-height: 82px; padding-block: 11px; line-height: 1.5; resize: vertical; }
.admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus { border-color: var(--brand-red); outline: 3px solid var(--color-accent-soft); }
.admin-field small { color: var(--color-muted); font-size: 11px; font-weight: 600; }
.admin-quick-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.admin-quick-values button { min-height: 44px; border: 1px solid var(--brand-gold); border-radius: 10px; color: var(--brand-red); background: var(--color-accent-soft); font-weight: 900; }
.admin-modal__actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; margin-top: 18px; }
.admin-section { margin-top: 28px; }
.admin-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.admin-section h2 { margin: 0; color: var(--brand-red); font-size: 21px; }
.admin-section__heading p { margin: 2px 0 0; color: var(--color-muted); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--brand-white); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--brand-red); background: var(--brand-cream); font-size: 11px; letter-spacing: .05em; text-align: left; white-space: nowrap; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--color-line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-product { min-width: 240px; }
.table-product strong, .table-product span { display: block; }
.table-product span { margin-top: 3px; color: var(--color-muted); font-size: 11px; }
.number { font-variant-numeric: tabular-nums; font-weight: 800; }
.low-number { color: var(--brand-red); text-decoration: underline; text-decoration-color: var(--brand-gold); text-decoration-thickness: 3px; }
.inline-actions { display: flex; gap: 8px; }
.small-button { min-height: 44px; border: 1px solid var(--brand-red); border-radius: 10px; padding: 0 12px; color: var(--brand-red); background: var(--brand-white); font-weight: 900; white-space: nowrap; }
.type-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; color: var(--brand-red); background: var(--color-primary-soft); font-size: 10px; font-weight: 900; }
.type-pill.sale { color: var(--brand-white); background: var(--brand-red); }
.type-pill.restock { color: var(--brand-red); background: var(--brand-gold); }
.type-pill.reserve { border: 1px solid var(--brand-gold); color: var(--brand-charcoal); background: var(--brand-cream); }

.loading { min-height: 70dvh; display: grid; place-items: center; color: var(--color-muted); }
.spinner { width: 40px; height: 40px; border: 4px solid var(--color-accent-soft); border-top-color: var(--brand-red); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { opacity: .6; transform: translateY(36px); } }
@keyframes success-pop { from { opacity: .2; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 3px; }

@media (min-width: 720px) {
  .page { padding: 30px 24px 60px; }
  .product-list, .stock-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .welcome-cta { width: min(520px, 100%); }
  .scan-panel { grid-template-columns: 58px minmax(0, 1fr) 230px; align-items: center; }
  .scan-panel .text-button { grid-column: 2 / 3; justify-self: start; }
  .bottom-cart__inner { grid-template-columns: 1fr 210px; }
  .drawer-backdrop { place-items: center; padding: 24px; }
  .drawer { width: min(660px, 100%); height: auto; max-height: 90dvh; border-radius: var(--radius-lg); padding: 8px 24px 24px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-toolbar { grid-template-columns: minmax(0, 1fr) 220px; }
  .admin-inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-modal-backdrop { place-items: center; padding: 24px; }
  .admin-modal { width: min(520px, 100%); max-height: 90dvh; border-radius: var(--radius-lg); padding: 24px; }
}

@media (min-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .admin-inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 559px) {
  .brand > span { display: none; }
  .brand__logo { width: 116px; }
  .topbar--shop .operator-link { display: none; }
  .topnav a span { display: none; }
  .topnav a { width: 46px; justify-content: center; padding: 0; }
  .topnav-account { width: 46px; justify-content: center; padding: 0; }
  .topnav-account span, .topnav-account svg:first-child { display: none; }
  .page { padding-inline: 12px; }
  .session-pill { display: none; }
  .location-strip { padding: 14px; }
  .flow-stepper strong { font-size: 11px; }
  .scan-panel { margin-inline: -2px; padding: 16px 14px; }
  .scan-panel__intro h2 { font-size: 22px; }
  .live-barcode-reader.active, .live-barcode-reader video { min-height: 230px; }
  .inventory-disclosure > summary .live-indicator { display: none; }
  .stock-row { grid-template-columns: 54px minmax(0, 1fr); }
  .stock-row .stock-state { grid-column: 2; }
  .cart-line__thumb { width: 60px; height: 60px; }
  .cart-check-button { grid-template-columns: 60px minmax(0, 1fr); }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-actions { width: 100%; }
  .admin-actions .button { flex: 1; }
  .admin-view-tabs { top: 74px; }
  .admin-view-tabs button { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 11px; }
  .admin-view-tabs button > span { gap: 4px; }
  .admin-view-tabs button svg { display: none; }
  .admin-panel { margin-inline: -4px; padding: 14px; }
  .admin-record { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-record__icon { display: none; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .topbar { position: static; }
  .drawer { padding-top: 8px; }
  .drawer .flow-stepper { margin-block: 6px 14px; }
  .app-shell--scan .page { padding-top: 8px; }
  .scan-context { min-height: 46px; padding-block: 5px; }
  .app-shell--scan .flow-stepper { margin-block: 6px; }
  .app-shell--scan .flow-stepper li { gap: 3px; }
  .app-shell--scan .flow-stepper li > span { width: 30px; height: 30px; }
  .app-shell--scan .flow-stepper li:not(:last-child)::after { top: 14px; }
  .scan-panel { grid-template-columns: 44px minmax(0, 1fr) 220px; gap: 10px; margin-top: 8px; padding: 12px; }
  .scan-panel:not(.scan-panel--active) .scan-panel__icon { width: 44px; height: 44px; }
  .scan-panel:not(.scan-panel--active) .scan-panel__intro > p:last-child { display: none; }
  .scan-panel:not(.scan-panel--active) .camera-button { grid-column: 3; grid-row: 1; min-height: 56px; align-self: center; }
  .scan-panel:not(.scan-panel--active) .text-button { grid-column: 2 / 3; justify-self: start; }
  .scan-panel--active { grid-template-columns: 44px minmax(0, 1fr) 180px; grid-template-rows: auto minmax(180px, 1fr); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
  .scan-panel--active .scan-panel__icon { width: 44px; height: 44px; }
  .scan-panel--active .scan-panel__intro h2 { margin: 0; font-size: 20px; }
  .scan-panel--active .scan-panel__intro .eyebrow, .scan-panel--active .scan-panel__intro > p:last-child { display: none; }
  .scan-panel--active .scanner-stage { grid-column: 1 / 3; grid-row: 2; }
  .scan-panel--active .camera-button { grid-column: 3; grid-row: 2; width: 100%; align-self: center; }
  .scanner-guide > span { bottom: 8px; font-size: 11px; }
}

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