/* Layout idea: fixed left rail of modules, a work surface on the right; tables and the POS cart are the main objects. */
:root {
  /* Brand: navy and the blue family. --navy* stay the same in light and dark (front page banner, app icon). */
  --navy-900: #0a1b38;
  --navy-800: #102a55;
  --navy-700: #173b78;
  --sky: #8ec1f5;
  --ice: #e3eefb;
  --bg: #f2f6fb;
  --surface: #ffffff;
  --surface-2: #e5edf7;
  --ink: #0e1c33;
  --muted: #54637a;
  --line: #d2dcea;
  --accent: #173b78;
  --accent-ink: #ffffff;
  --accent-soft: #dbe7f8;
  --ok: #26703f;
  --ok-soft: #dcefe1;
  --warn: #9a5b00;
  --warn-soft: #fbecd2;
  --crit: #b0261b;
  --crit-soft: #fadedb;
  --info: #0b6a8f;
  --info-soft: #d7eef6;
  --shadow: 0 1px 2px rgba(10, 27, 56, .06), 0 6px 24px rgba(10, 27, 56, .09);
  --font-display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09111f; --surface: #0f1a2d; --surface-2: #16243b; --ink: #e3ebf7; --muted: #94a4bd; --line: #22334f;
    --accent: #78aef6; --accent-ink: #06142b; --accent-soft: #15305b;
    --ok: #6cc78a; --ok-soft: #173322; --warn: #e9a94a; --warn-soft: #3a2a10; --crit: #f07c70; --crit-soft: #401b17;
    --info: #62c6e6; --info-soft: #0f3345; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09111f; --surface: #0f1a2d; --surface-2: #16243b; --ink: #e3ebf7; --muted: #94a4bd; --line: #22334f;
  --accent: #78aef6; --accent-ink: #06142b; --accent-soft: #15305b;
  --ok: #6cc78a; --ok-soft: #173322; --warn: #e9a94a; --warn-soft: #3a2a10; --crit: #f07c70; --crit-soft: #401b17;
  --info: #62c6e6; --info-soft: #0f3345; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
td.n, th.n { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* Shell */
#app { height: 100%; }
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; }
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { padding: 16px 16px 12px; display: flex; gap: 10px; align-items: center; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; overflow-y: auto; flex: 1 1 auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--crit-soft); color: var(--crit); }
.nav svg { flex: none; }
.rail-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.top h1 { margin-right: auto; }
.view { flex: 1 1 auto; overflow: auto; padding: 18px 20px 40px; min-height: 0; }
.view-inner { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; }
  .brand { padding: 8px 10px; }
  .brand-name, .rail-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 6px; }
  .nav a { padding: 7px 10px; }
  .view { padding: 14px 16px 32px; }
  .top { padding: 10px 16px; }
}

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--crit); }
.btn.danger.solid { background: var(--crit); color: #fff; border-color: var(--crit); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 46px; font-size: 16px; padding: 0 18px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.icon-btn { width: 30px; height: 30px; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input, select.input, textarea.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 0; }
textarea.input { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 28px; font-size: 13px; padding: 0 7px; }
.input.n { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.search { position: relative; flex: 1 1 220px; min-width: 160px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 32px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin-right: auto; }
.card-b { padding: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .v { white-space: nowrap; font-family: var(--font-display); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .s { font-size: 12px; color: var(--muted); }
.tile.warn { box-shadow: inset 4px 0 0 var(--warn); }
.tile.crit { box-shadow: inset 4px 0 0 var(--crit); }
.tile.ok { box-shadow: inset 4px 0 0 var(--ok); }
a.tile:hover { border-color: var(--muted); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line); }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--muted); line-height: 1.6; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.crit { background: var(--crit-soft); color: var(--crit); }
.note.info { background: var(--info-soft); color: var(--info); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty h3 { color: var(--ink); }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.results { display: flex; flex-direction: column; }
.result { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; color: inherit; }
.result:hover, .result.hl { background: var(--surface-2); }
.result[disabled] { opacity: .55; cursor: not-allowed; }
.result .price { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 15px; }
.cart { position: sticky; top: 0; }
.cart-line { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cart-line .ctrl { display: grid; grid-template-columns: 104px 1fr 72px auto; gap: 8px; align-items: end; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 30px; }
.stepper button { width: 28px; height: 100%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; line-height: 1; }
.stepper input { width: 46px; border: 0; text-align: center; height: 100%; background: var(--surface); font-variant-numeric: tabular-nums; }
.totals { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.totals .row { justify-content: space-between; }
.totals .grand { font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(8, 16, 13, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(560px, 100%); display: flex; flex-direction: column; max-height: 90vh; }
.modal.wide { width: min(880px, 100%); }
.modal.xwide { width: min(1080px, 100%); }
.modal-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h2 { margin-right: auto; }
.modal-b { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.backdrop.drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
.backdrop.drawer .modal { border-radius: 0; max-height: none; height: 100%; width: min(760px, 100%); }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-weight: 500; }
.toast.crit { background: var(--crit); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* Picker */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; color: inherit; border-bottom: 1px solid var(--line); }
.picker-list button:last-child { border-bottom: 0; }
.picker-list button:hover, .picker-list button.hl { background: var(--surface-2); }

/* Charts */
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .bar { fill: var(--accent); }
.chart .bar.today { fill: var(--accent); opacity: 1; }
.chart .bar.past { opacity: .55; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .val { fill: var(--ink); font-weight: 650; }
.chart text.gl, .chart text.val { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.seg.nw { flex-wrap: nowrap; }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }

/* Receipt */
.receipt { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 8px; line-height: 1.45; overflow-x: auto; }

/* Gate screens */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.gate .card { max-width: 520px; width: 100%; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { scroll-behavior: auto !important; } }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { border: 0; background: var(--surface); padding: 4px 9px; cursor: pointer; font-weight: 650; font-size: 12px; color: var(--muted); }
.lang button.on { background: var(--accent); color: var(--accent-ink); }
.who { display: flex; align-items: center; gap: 8px; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sync-btn { background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px; }
.sync-btn:hover { background: var(--crit-soft); color: var(--crit); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.warn { background: var(--warn); }
.dot.crit { background: var(--crit); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover { background: var(--surface-2); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
.sample-flag { font-size: 11px; font-weight: 700; color: var(--info); background: var(--info-soft); padding: 2px 8px; border-radius: 99px; }

/* ---------- frame & demo bar ---------- */
.frame { display: flex; flex-direction: column; height: 100%; }
.frame-body { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; }
.frame-body > .app, .frame-body > .store { height: 100%; }
.demobar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 14px; background: var(--ink); color: var(--bg); font-size: 12.5px; }
.demobar select { font: inherit; padding: 2px 6px; border-radius: 6px; border: 0; background: var(--bg); color: var(--ink); max-width: 260px; }
.demobar .linklike, .linklike { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.disabled { pointer-events: none; opacity: .5; }
.narrow { max-width: 460px; }
.rail-foot a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* ---------- client store ---------- */
.store { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.store-top { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.store-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.store-brand .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.15; }
.store-links { display: flex; gap: 4px; }
.store-links a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 550; position: relative; }
.store-links a:hover { background: var(--surface-2); color: var(--ink); }
.store-links a.on { color: var(--accent); background: var(--accent-soft); }
.count.acc { margin-left: 2px; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); line-height: 1.5; }
.store-main { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.store-inner { max-width: 1180px; margin: 0 auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.store-tabs { display: none; }
.store-foot { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.store-foot strong { color: var(--ink); }
@media (max-width: 760px) {
  .store-links { display: none; }
  .store-brand .brand-name { display: block; font-size: 15px; }
  .demobar { gap: 8px; padding: 5px 10px; }
  .demobar select { max-width: 170px; font-size: 12px; }
  .store-top { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .store-inner { padding: 14px 14px 24px; }
  .store-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
  .store-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px 8px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .store-tabs a.on { color: var(--accent); }
  .store-tabs .ic { position: relative; display: inline-flex; }
  .store-tabs .count { position: absolute; top: -5px; right: -12px; }
}
.shop-hero { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 2px; }
.shop-hero h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; }
.shop-hero .search { max-width: 560px; flex: none; width: 100%; }
.shop-hero .search .input { height: 44px; font-size: 15px; border-radius: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 99px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.sm { padding: 5px 11px; font-size: 13px; font-weight: 550; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s; }
.pcard:hover { border-color: var(--muted); }
.pcard-b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pname { font-weight: 650; line-height: 1.3; color: var(--ink); text-decoration: none; }
.pfoot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.pfoot .stepper { height: 28px; }
@media (max-width: 520px) { .pfoot > .btn, .pfoot > .stepper { width: 100%; justify-content: center; } .pfoot .stepper input { flex: 1; } .pfoot .stepper button { width: 36px; } }
.pprice { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pprice.big { font-size: 28px; }
.pthumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border-radius: 10px; }
.pcard .pthumb { border-radius: 0; }
.pthumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pthumb.big { aspect-ratio: 1 / 1; border-radius: 14px; }
.pthumb.ph { color: var(--accent); }
.cat-food, .cat-accessory { background: #dfeafa; color: #173b78; }
.cat-antibiotic, .cat-antiinflam, .cat-anesthetic { background: #e3e6f7; color: #303f8f; }
.cat-vaccine, .cat-hormone, .cat-supplies, .cat-fluid { background: #d9eef6; color: #0b6a8f; }
.cat-antiparasitic { background: #e6ebf3; color: #44546f; }
.cat-vitamin, .cat-dermatology, .cat-hygiene { background: #e9e4f8; color: #54459b; }
:root[data-theme="dark"] .pthumb.ph { filter: brightness(.55) saturate(1.2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pthumb.ph { filter: brightness(.55) saturate(1.2); } }
.ppage { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.ppage h1 { font-size: 26px; }
@media (max-width: 760px) { .ppage { grid-template-columns: minmax(0, 1fr); gap: 16px; } .ppage .pthumb.big { max-height: 320px; aspect-ratio: auto; height: 260px; } }
.back { align-self: flex-start; }
.page-h { font-size: 24px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .checkout { grid-template-columns: minmax(0, 1fr); } }
.ck-sum { position: sticky; top: 0; }
.cline { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cline:last-child { border-bottom: 0; }
.cline .pthumb { width: 64px; flex: none; border-radius: 8px; }
.grand { font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.radio input { margin-top: 3px; accent-color: var(--accent); }
.radio > span { display: flex; flex-direction: column; gap: 2px; }
.rxprev { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--surface-2); cursor: pointer; }
.rxprev img { width: 100%; height: 100%; object-fit: cover; }
.rxprev .btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; }
.rxadd { width: 96px; height: 96px; border-radius: 10px; border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; text-align: center; padding: 6px; }
.rxadd input { display: none; }
.rxadd:hover { border-color: var(--accent); color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.timeline li { display: flex; flex-direction: column; gap: 6px; position: relative; font-size: 13px; color: var(--muted); }
.timeline li .dot { width: 14px; height: 14px; background: var(--line); }
.timeline li::before { content: ''; position: absolute; top: 6px; left: 14px; right: -6px; height: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done, .timeline li.cur { color: var(--ink); }
.timeline li.done .dot, .timeline li.cur .dot { background: var(--accent); }
.timeline li.done::before { background: var(--accent); }
.timeline li.cur .dot { box-shadow: 0 0 0 4px var(--accent-soft); }
@media (max-width: 640px) { .timeline { grid-template-columns: minmax(0, 1fr); } .timeline li { flex-direction: row; align-items: center; gap: 10px; } .timeline li::before { display: none; } }

/* ---------- front page (#home) ----------
   One bold element: the navy banner with the photo entering from the right as the rounded end of a capsule.
   Everything below it stays quiet. The banner keeps its navy in light and dark themes. */
.hm-hero { background: var(--navy-900); color: #fff; overflow: hidden; }
.hm-hero-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 440px; }
.hm-hero-text { padding: 56px 32px 56px 20px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; }
.hm-hero h1 { font-size: clamp(31px, 4.5vw, 54px); line-height: 1.05; font-weight: 700; letter-spacing: -0.025em; max-width: 17ch; }
.hm-lead { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.45; color: #c8d9f1; max-width: 42ch; }
.hm-hours { font-size: 13.5px; color: #9bb5da; }
.hm-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .45); color: #fff; font-weight: 650; font-size: 15.5px; text-decoration: none; white-space: nowrap; }
.hm-btn:hover { border-color: #fff; }
.hm-btn.solid { background: #fff; border-color: #fff; color: var(--navy-900); }
.hm-btn.solid:hover { background: var(--ice); }
.hm-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.hm-hero-media { margin: 28px 0; margin-right: min(0px, calc((1180px - 100vw) / 2)); border-radius: 999px 0 0 999px; overflow: hidden; background: linear-gradient(120deg, var(--navy-700), #2c6fd1 70%, var(--sky)); display: grid; place-items: center; color: rgba(255, 255, 255, .92); min-height: 0; }
.hm-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-hero-media svg { width: 38%; height: auto; }
.hm-sec { padding: 44px 0; }
.hm-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 22px; }
.hm-sec h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.015em; }
.hm-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.hm-sec-h a { font-weight: 600; text-decoration: none; }
.hm-sec-h a:hover { text-decoration: underline; }
.hm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.hm-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hm-tile { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); }
.hm-tile-ph { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); margin-bottom: 7px; transition: box-shadow .15s; }
.hm-tile-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-tile:hover .hm-tile-ph, .hm-tile:focus-visible .hm-tile-ph { box-shadow: 0 0 0 3px var(--accent); }
.hm-tile:focus-visible { outline: none; }
.hm-tile-t { font-family: var(--font-display); font-weight: 650; font-size: 17px; line-height: 1.2; }
.hm-tile-s { font-size: 13px; color: var(--muted); }
:root[data-theme="dark"] .hm-tile-ph.ph { background: var(--surface-2); color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-tile-ph.ph { background: var(--surface-2); color: var(--accent); } }
.hm-how { background: var(--surface-2); }
.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.hm-steps li { display: flex; gap: 14px; align-items: flex-start; }
.hm-n { font-family: var(--font-display); font-weight: 700; font-size: 46px; line-height: .9; color: var(--accent); min-width: 30px; }
.hm-steps h3, .hm-rx h3 { font-size: 17px; margin-bottom: 4px; }
.hm-steps p, .hm-rx p { color: var(--muted); font-size: 14.5px; max-width: 38ch; }
.hm-rx { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.hm-rx p { max-width: 70ch; }
.hm-rx-ic { flex: none; width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hm-about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 32px; align-items: start; }
.hm-about-t { font-size: 16px; line-height: 1.55; max-width: 62ch; white-space: pre-line; }
.hm-contact { margin: 4px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 14.5px; }
.hm-contact dt { color: var(--muted); }
.hm-contact dd { margin: 0; }
.hm-about .card h2 { font-size: 18px; letter-spacing: -0.01em; }
@media (max-width: 760px) {
  .hm-hero-in { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hm-hero-media { order: -1; height: 190px; margin: 16px 0 0 20px; }
  .hm-hero:not(.has-photo) .hm-hero-media { height: 96px; }
  .hm-hero-media svg { width: auto; height: 62%; }
  .hm-hero-text { padding: 24px 20px 32px; gap: 14px; }
  .hm-cta { width: 100%; }
  .hm-btn { flex: 1 1 auto; }
  .hm-sec { padding: 30px 0; }
  .hm-in { padding: 0 16px; gap: 16px; }
  .hm-tiles, .hm-tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .hm-tile-t { font-size: 15.5px; }
  .hm-steps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hm-about { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
/* Setup → Front page */
.hm-up { display: flex; gap: 12px; align-items: center; }
.hm-up-prev { width: 52px; height: 52px; flex: none; border-radius: 10px; border: 1px dashed var(--muted); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.hm-up-prev.wide { width: 128px; height: 72px; cursor: default; }
.hm-up-prev:not(.noimg) { border-style: solid; border-color: var(--line); }
.hm-up-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
@media (max-width: 640px) { .hm-row { grid-template-columns: 52px minmax(0, 1fr) auto; } .hm-row > select:nth-of-type(2), .hm-row > input.input { grid-column: 2 / 3; } }
