:root {
  color-scheme: light;
  --ink: #241812;
  --muted: #6d5b51;
  --paper: #fffaf3;
  --surface: #ffffff;
  --surface-strong: #f5e9da;
  --line: #dfcdbd;
  --accent: #8c3b16;
  --accent-strong: #6c280d;
  --accent-soft: #f7e3d6;
  --success: #27633d;
  --danger: #a22923;
  --ring: #1269c7;
  --shadow: 0 18px 50px rgba(74, 45, 27, 0.12);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100dvh; color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a, select, input { touch-action: manipulation; }
button, .button { min-height: 44px; }
a { color: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); background: rgba(255,250,243,.96); position: sticky; top: 0; z-index: 20; }
.topbar__actions, .workspace-controls, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand { margin: 0; font: 700 clamp(18px, 2vw, 24px)/1.2 Georgia, serif; }
.eyebrow { margin: 0 0 4px; color: var(--accent-strong); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.compact-label select { min-height: 44px; }
.seller-shell { width: min(1440px, 100%); margin: auto; padding: clamp(16px, 3vw, 40px); }
.workspace-bar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.tabs { display: flex; gap: 8px; }
.tabs button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.tabs button[aria-current="page"] { background: var(--ink); color: white; border-color: var(--ink); }
.workspace-controls label, form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
select, input { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--ink); background: var(--surface); font-size: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); box-shadow: var(--shadow); }
.seller-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); gap: 24px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); }
h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stock-card { display: flex; min-height: 148px; flex-direction: column; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.stock-card__name { margin: 0; font-weight: 800; }
.stock-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.basket { position: sticky; top: 96px; }
.basket ul { margin: 16px 0 22px; padding-left: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 12px; padding: 10px 16px; background: var(--accent); color: white; font-weight: 800; text-decoration: none; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, opacity .2s ease; }
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button--quiet { background: transparent; color: var(--accent-strong); }
.button--selected { background: var(--ink); border-color: var(--ink); }
.button--small { min-height: 44px; padding: 8px 12px; }
.button--wide { width: 100%; }
.checkout-panel { display: grid; gap: 16px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.state-label { display: inline-block; margin: 8px 0; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
.amount { margin: 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qr { width: min(240px, 100%); aspect-ratio: 1; margin: auto; padding: 10px; border: 1px solid var(--line); background: white; }
.qr svg { display: block; width: 100%; height: 100%; }
.actions--stack { display: grid; }
.notice, .demo-banner { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #cfb571; border-radius: 12px; background: #fff7d7; }
.notice--error { border-color: #e1aaa5; background: #fff0ef; color: var(--danger); }
.demo-banner { color: var(--muted); font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; }
.metric-grid div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.metric-grid dt { color: var(--muted); }
.metric-grid dd { margin: 6px 0 0; font-size: 30px; font-weight: 800; }
.muted, .privacy-copy, .empty { color: var(--muted); }
.buyer-shell { width: min(100%, 460px); margin: auto; padding: 24px 16px 56px; }
.phone-card { overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.buyer-lines { list-style: none; margin: 24px 0; padding: 0; border-top: 1px solid var(--line); }
.buyer-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.buyer-total { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0; font-size: 22px; font-variant-numeric: tabular-nums; }
.phone-card form { display: grid; gap: 16px; margin-top: 24px; }
.privacy-copy { margin: 0; font-size: 13px; }
.receipt { margin: 20px 0; padding: 16px; border: 1px dashed var(--accent); border-radius: 14px; background: var(--accent-soft); }
.boot-shell, .recovery { width: min(680px, calc(100% - 32px)); margin: 12vh auto 0; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.recovery p { max-width: 62ch; }

@media (max-width: 900px) {
  .seller-grid { grid-template-columns: 1fr; }
  .basket { position: static; }
  .workspace-bar { align-items: stretch; flex-direction: column; }
  .workspace-controls { align-items: stretch; }
  .workspace-controls > * { flex: 1 1 180px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; }
  .status-pill { display: none; }
  .seller-shell { padding: 16px; }
  .stock-grid { grid-template-columns: 1fr; }
  .workspace-controls { display: grid; grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
