/* Grocery Tracker - tokens and components from Petr's mockups (design/reference/project/*.dc.html).
   CSP is strict (style-src 'self'): templates carry no style attributes, everything lives here. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/static/fonts/space-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/static/fonts/space-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F3F1EA;
  --surface: #FEFDFA;
  --white: #FFFFFF;
  --ink: #191915;
  --ink-2: #3F3D37;
  --accent: #FFD23F;
  --accent-soft: #FFF6D1;
  --line: #E3DFD4;
  --line-2: #CFCABD;
  --dash: #D8D3C6;
  --chip: #EDEAE2;
  --muted: #6B675D;
  --muted-2: #55524A;
  --faint: #8A857A;
  --on-dark: #C9C4B6;
  --on-dark-2: #EDEAE0;
  --dark-line: #3A3A34;
  --blue: #1D4ED8;
  --blue-soft: #E6EDFC;
  --warn: #9A4508;
  --warn-soft: #FBEBD6;
  --danger: #A3261B;
  --radius: 18px;
  --font: Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", Inter, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
a { color: var(--ink); }
a:hover { color: #000; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { min-height: 100vh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.page { flex: 1; display: flex; flex-direction: column; gap: 28px; padding: 20px 16px 110px; }
.page.g24 { gap: 24px; } .page.g22 { gap: 22px; } .page.g20 { gap: 20px; } .page.g18 { gap: 18px; } .page.g16 { gap: 16px; }
.page.top8 { padding-top: 8px; }
.page.top16 { padding-top: 16px; }
.stack { display: flex; flex-direction: column; }
.stack-6 { display: flex; flex-direction: column; gap: 6px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.between.base { align-items: baseline; }
.between.end { align-items: flex-end; }
.between.start { align-items: flex-start; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.minw0 { min-width: 0; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; text-align: right; }
.nowrap { white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }

/* type */
.page-head { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.page-head.split { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.display { margin: 0; font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.display.s32 { font-size: 32px; } .display.s30 { font-size: 30px; } .display.s28 { font-size: 28px; letter-spacing: -0.01em; }
.lead { margin: 0; font-size: 16px; color: var(--muted-2); }
.grot { font-family: var(--display); font-weight: 700; }
.section-title { margin: 0; padding: 0 4px; font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.section-title.dim { color: var(--muted-2); }
.section-title.flush { padding: 0; }
.h-card { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.h-shop { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.2; }
.h-shop.dim { font-size: 20px; color: var(--muted-2); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.ink-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.s14 { font-size: 14px; }
.b600 { font-weight: 600; }
.b700 { font-weight: 700; }
.mono { font-family: var(--mono); }
.note { margin: 0; padding: 0 4px; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.p { margin: 0; }
.err { margin: 0; color: var(--danger); font-weight: 600; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.warn-text { color: var(--warn); }
.blue-text { color: var(--blue); }

/* surfaces */
.card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.r16 { border-radius: 16px; padding: 16px 15px; }
.card.pad16 { padding: 16px; border-radius: 16px; }
.panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.list > li + li, .list > .li + .li { border-top: 1px solid var(--line); }
.dashed-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px dashed var(--line-2); border-radius: 14px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.sm { height: 22px; padding: 0 7px; }
.badge.xs { height: 20px; padding: 0 6px; }
.b-vyjimecna { background: var(--ink); color: var(--accent); }
.b-vyjimecna.on-dark { background: var(--accent); color: var(--ink); }
.b-dobra { background: var(--blue-soft); color: var(--blue); }
.b-malo_historie { height: 22px; padding: 0 7px; border: 1px dashed var(--faint); color: var(--muted-2); font-weight: 600; background: transparent; }
.b-bezna_akce, .b-bez_akce { background: var(--chip); color: var(--muted-2); font-weight: 600; }
.b-nesledovano { border: 1px solid var(--line-2); color: var(--muted); background: transparent; }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-date { background: var(--chip); color: var(--muted-2); font-weight: 600; }
.b-date.ends { background: var(--warn-soft); color: var(--warn); }
.b-tag { height: 22px; padding: 0 7px; border: 1px solid var(--line-2); color: var(--muted-2); font-weight: 500; }
.b-done { background: var(--chip); color: var(--ink-2); font-weight: 600; }
.b-dup { height: 20px; padding: 0 6px; border: 1px dashed var(--faint); color: var(--muted-2); }
.b-sale { height: 20px; padding: 0 6px; border-radius: 5px; background: var(--accent); color: var(--ink); font-size: 11px; }
.b-vysoka { background: var(--blue-soft); color: var(--blue); }
.b-stredni { background: var(--chip); color: var(--ink-2); }
.b-nizka { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.grey { background: var(--chip); color: var(--ink-2); }
.pill.outline { height: 26px; border: 1px solid var(--line-2); color: var(--ink-2); }

/* buttons */
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--ink); color: var(--surface); font-size: 16px; font-weight: 700; text-decoration: none; }
.btn-primary:hover { color: var(--surface); }
.btn-primary[disabled] { opacity: 0.5; cursor: default; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.btn.ink-border { border-color: var(--ink); background: transparent; }
.btn.full { width: 100%; min-height: 48px; }
.btn.tall { min-height: 50px; }
.btn.small { min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn.dark { border: 0; background: var(--ink); color: var(--surface); font-weight: 700; }
.btn.yellow { border: 0; background: var(--accent); color: var(--ink); font-weight: 700; border-radius: 10px; }
.btn.danger { background: transparent; color: var(--warn); }
.btn.muted { color: var(--muted-2); }
.btn.link { border: 0; background: transparent; text-decoration: underline; padding: 0 12px; }
.btn-round { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 22px; background: var(--ink); color: var(--surface); text-decoration: none; font-size: 15px; font-weight: 600; border: 0; }
.btn-round:hover { color: var(--surface); }
.inline-form { display: inline; margin: 0; }
.form-reset { margin: 0; }

/* inputs */
.label { font-size: 14px; font-weight: 600; }
.flabel { font-size: 12px; font-weight: 600; color: var(--muted-2); }
.input { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 17px; }
.field { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 16px; }
.field.num { width: 140px; font-family: var(--display); font-size: 18px; font-weight: 700; }
.field.sm { min-height: 40px; font-size: 15px; }
select.field { appearance: auto; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 15px; color: var(--muted); }
.search input { width: 100%; min-height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 16px; }
.search.strong input { border: 1.5px solid var(--ink); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.chip.on:hover { color: var(--surface); }
.size-pick { position: relative; display: inline-flex; }
.size-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.size-pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.size-pick input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.size-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.size-pick input:disabled + span { border-color: var(--chip); background: var(--chip); color: var(--muted); cursor: default; }
.result { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.result:has(input:checked) { border: 2px solid var(--ink); padding: 13px; }
.thumb { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 10px; background: var(--chip); color: var(--faint); }
.thumb.s40 { width: 40px; height: 40px; border-radius: 8px; }
.thumb.s56 { width: 56px; height: 56px; background: var(--line); }
.thumb.s36 { width: 36px; height: 36px; color: var(--ink); }

/* switch (checkbox role=switch) */
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 15px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch { position: relative; flex-shrink: 0; width: 51px; height: 31px; border-radius: 16px; background: var(--line-2); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: left .15s; }
.switch-row input:checked + .switch { background: var(--ink); }
.switch-row input:checked + .switch::after { left: 23px; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--blue); outline-offset: 2px; }

/* bars */
.backbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding-right: 8px; text-decoration: none; font-size: 16px; font-weight: 600; }
.barlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px 0 8px; text-decoration: none; font-size: 16px; font-weight: 600; }
.modalbar { display: grid; grid-template-columns: 88px minmax(0, 1fr) 88px; align-items: center; gap: 8px; min-height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modalbar h1 { margin: 0; text-align: center; font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.2; }
.modalbar a, .modalbar button { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 16px; font-weight: 500; color: var(--ink); background: transparent; border: 0; padding: 0; }
.modalbar .save { justify-content: flex-end; font-weight: 700; }
.flash { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 600; }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash.err { background: #F8E1DE; color: var(--danger); }
.footer { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.footer.auto { margin-top: auto; }
.footer a { color: var(--muted); }

/* Today */
.trip { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.trip-kicker { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.trip-title { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.trip-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trip-save .lbl { font-size: 17px; font-weight: 500; }
.amount-hl { padding: 2px 10px; border-radius: 8px; background: var(--accent); font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notworth { margin: 0; padding: 12px 0 0; list-style: none; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted-2); }
.notworth li { display: flex; gap: 8px; align-items: flex-start; }
.notworth svg { flex-shrink: 0; margin-top: 1px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.sec-head .section-title { padding: 0; }
.group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 4px; }
.group-head.pt4 { padding-top: 4px; }
.group-save { display: flex; flex-direction: column; align-items: flex-end; }
.group-save .k { font-size: 12px; color: var(--muted); }
.group-save .v { font-family: var(--display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.group-save .v.dim { font-size: 18px; color: var(--muted-2); }
.deal { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.deal-name { font-size: 16px; font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.deal-price { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-qty { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--dash); }
.qty-pill { flex-shrink: 0; padding: 6px 10px; border-radius: 8px; background: var(--accent); color: var(--ink); font-family: var(--display); font-size: 15px; font-weight: 700; white-space: nowrap; }
.qty-pill.outline { padding: 4.5px 8.5px; background: transparent; border: 1.5px solid var(--ink); }
.qty-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.qty-text .why { color: var(--ink-2); }
.qty-text .have { color: var(--muted); }
.exc { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--ink); color: var(--surface); border-radius: 18px; }
.exc .sub { font-size: 13px; color: var(--on-dark); }
.exc .sub strong { color: var(--surface); font-weight: 700; }
.exc-name { color: var(--surface); text-decoration: none; font-size: 20px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.exc-name:hover { color: var(--white); }
.exc-price { font-family: var(--display); font-size: 36px; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exc .deal-qty { padding-top: 14px; border-top: 1px solid var(--dark-line); }
.exc .qty-text .why { color: var(--on-dark-2); }
.exc .qty-text .have { color: var(--on-dark); }
.skip { margin-top: 4px; border: 1px dashed var(--line-2); border-radius: 14px; }
.skip > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.skip > summary::-webkit-details-marker { display: none; }
.skip > summary .btn { flex-shrink: 0; pointer-events: none; }
.skip[open] > summary .btn { background: var(--chip); }
.skip-body { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 10px; }
.empty-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.empty-ico { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--chip); color: var(--muted-2); }
.empty-card h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.2; }
.empty-card p { margin: 0; font-size: 15px; color: var(--muted-2); text-wrap: pretty; }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.next-row + .next-row { border-top: 1px solid var(--line); }

/* list rows (Seznam, Účtenky) */
.lrow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.lrow.tall { min-height: 72px; }
.lrow .name { font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.lrow .size { font-weight: 400; color: var(--muted); }
.lrow .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-2); }
.lrow.dim, .lrow.dim .meta { color: var(--muted); }
.amount { font-family: var(--display); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.l30 { font-size: 30px; line-height: 1.1; }
.empty-list { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; text-align: center; }
.empty-list .t { font-family: var(--display); font-size: 18px; font-weight: 700; }
.empty-list .d { font-size: 14px; color: var(--muted-2); }

/* Product */
.offers-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 15px 6px; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; }
.offer + .offer, .offer-foot { border-top: 1px solid var(--line); }
.offer.best { background: var(--accent-soft); }
.offer .shop { font-size: 16px; font-weight: 600; }
.offer .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-2); }
.offer .up { font-family: var(--display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-foot { padding: 10px 15px 14px; font-size: 13px; color: var(--muted); }
.seg { display: flex; gap: 2px; padding: 2px; background: var(--chip); border-radius: 12px; }
.seg a { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.seg a[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.legend { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend svg { flex-shrink: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-empty { padding: 28px 8px; text-align: center; font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 10px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stat dt { font-size: 12px; color: var(--muted); }
.stat dd { margin: 0; font-size: 12px; color: var(--muted-2); }
.stat dd.v { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.stepper button.step { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; background: transparent; color: var(--ink); }
.stepper input { width: 72px; min-height: 44px; border: 0; background: transparent; text-align: center; font-family: var(--display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .u { padding-right: 4px; font-size: 15px; color: var(--muted-2); }
.info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; color: var(--ink-2); }
.info svg { flex-shrink: 0; color: var(--muted-2); }
.purchases { margin: 0; padding: 0 0 6px; list-style: none; }
.purchases li { display: grid; grid-template-columns: 76px minmax(0, 1fr) 56px 108px; align-items: center; gap: 8px; min-height: 44px; padding: 0 15px; border-top: 1px solid var(--line); font-size: 14px; }
.purchases li > :nth-child(3), .purchases li > :nth-child(4) { text-align: right; }
.purchases li > :nth-child(4) { font-variant-numeric: tabular-nums; }
.navrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-size: 15px; font-weight: 600; }

/* settings forms */
.fgroup { display: flex; flex-direction: column; gap: 4px; padding: 10px 15px 12px; }
.panel > .fgroup + .fgroup, .panel > .fgroup + .switch-row, .panel > * + .src-row, .panel > .src-row + * { border-top: 1px solid var(--line); }
.src-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 15px; cursor: pointer; }
.src-row input { flex-shrink: 0; width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.src-row .off { color: var(--muted); }
.addrow { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 15px; text-decoration: none; font-size: 15px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shop-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 15px; }
.shop-form + .shop-form { border-top: 1px solid var(--line); }
.shop-form .fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.token { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.token code { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.runs { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.runs li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; padding: 8px 15px; border-top: 1px solid var(--line); }
.runs li:first-child { border-top: 0; }

/* receipts */
.banner { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px; background: var(--accent); color: var(--ink); text-decoration: none; }
.banner .n { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--accent); font-family: var(--display); font-size: 17px; font-weight: 700; }
.banner.soft { min-height: 52px; padding: 8px 14px; background: var(--warn-soft); color: var(--warn); }
.banner.soft:hover { color: var(--warn); }
.upload-label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 1px solid var(--ink); border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.upload-input { width: 100%; font-size: 14px; }
.js .upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.js .upload-submit { display: none; }
.no-js-only { }
.js .no-js-only { display: none; }
.rline { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.rline + .rline { border-top: 1px solid var(--line); }
.rline .raw { min-width: 0; font-family: var(--mono); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.rline .tot { flex-shrink: 0; font-family: var(--display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.maplink { display: inline-flex; align-items: center; gap: 4px; min-width: 0; min-height: 28px; color: var(--blue); text-decoration: none; font-weight: 600; }
.maplink:hover { color: var(--blue); }
.edit-line { display: grid; grid-template-columns: minmax(0, 1fr) 72px 64px 88px 88px; gap: 6px; align-items: center; padding: 8px 10px; }
.edit-line + .edit-line { border-top: 1px solid var(--line); }
.edit-line .full { grid-column: 1 / -1; }
.edit-head { font-size: 11px; font-weight: 600; color: var(--muted); }

/* mapping */
.bulk { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; background: var(--ink); color: var(--surface); border-radius: 14px; }
.bulk .sub { font-size: 13px; color: var(--on-dark); }
.map-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.map-card h2 { margin: 0; font-family: var(--mono); font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.proposal { display: flex; gap: 12px; padding: 12px; background: var(--bg); border-radius: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.actions .primary { flex: 1; }
.actions .primary button { width: 100%; }
.done { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--chip); color: var(--muted-2); }
.done.ok { background: var(--blue-soft); color: var(--blue); }
.done .t { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.pick-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick-list form { margin: 0; }
.pick-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 6px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; font-size: 15px; }

/* login */
.login-page { min-height: 100vh; }
.login { max-width: 420px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: 32px 24px 64px; }
.login-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.logo-tile { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 16px; background: var(--accent); color: var(--ink); }
.login-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 20px)); background: var(--surface); border-top: 1px solid var(--line); max-width: 640px; margin: 0 auto; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 48px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab-ico { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 15px; }
.tabbar a[aria-current="page"] .tab-ico { background: var(--accent); }

.htmx-request.dimmable, .htmx-request .dimmable { opacity: 0.6; transition: opacity .2s; }

@media (min-width: 700px) {
  .tabbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}
@media (max-width: 360px) {
  .shop-form .fields { grid-template-columns: 1fr 1fr; }
  .edit-line { grid-template-columns: minmax(0, 1fr) 64px 56px; }
}
.nm { font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.nm .size, .size { font-weight: 400; color: var(--muted); }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.watch-main { gap: 5px; }
.row.start { align-items: flex-start; }
.pt12 { padding-top: 12px; }
details > summary.btn { list-style: none; width: fit-content; }
details > summary.btn::-webkit-details-marker { display: none; }
.px4 { padding: 0 4px; }
.gap4 { gap: 4px; }
.pb8 { padding-bottom: 8px; }
.s15 { font-size: 15px; } .s18 { font-size: 18px; } .b500 { font-weight: 500; }
.subhead { margin: 0; padding: 4px 15px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.offer-foot.first { border-top: 0; }
p.offer-foot { margin: 0; }
.stack-22 { display: flex; flex-direction: column; gap: 22px; }
.gap8 { gap: 8px; }
.center { text-align: center; }
.src-row + .src-row, .panel > .src-row + .addrow, .panel > p + .addrow { border-top: 1px solid var(--line); }
.gap3 { gap: 3px; } .gap6 { gap: 6px; } .gap12 { gap: 12px; }
.row.base { align-items: baseline; }
.dash-top { padding-top: 12px; border-top: 1px dashed var(--dash); }
fieldset.edit-line { margin: 0; border: 0; min-width: 0; }
.check.sm { min-height: 32px; font-size: 13px; gap: 6px; }
.check.sm input { width: 18px; height: 18px; }
.mt4 { margin-top: 4px; }
.panel { overflow: hidden; }
.stepper input { width: 56px; }
#stock .between > label { min-width: 0; }
.bulk .btn { flex-shrink: 0; white-space: nowrap; }
