/* Dezzert: neutral surfaces, one raspberry accent, Geist + Geist Mono for numbers.
   Shape rule: cards 14px, controls 10px, chips and badges full pill. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2?v=2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2?v=2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #EFEFEC;
  --ink: #18181B;
  --muted: #63636B;
  --line: #E4E4E1;
  --accent: #BE185D;
  --accent-ink: #BE185D;
  --accent-soft: #FCE7F0;
  --on-accent: #FFFFFF;
  --solid: #18181B;
  --on-solid: #FAFAFA;
  --good: #356B30;
  --good-soft: #E7F2E4;
  --warn: #8A5A00;
  --warn-soft: #FBF1DC;
  --bad: #B91C1C;
  --bad-soft: #FDECEC;
  --scrim: rgba(24, 24, 27, .45);
  --radius: 14px;
  --radius-sm: 10px;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar: 64px;
  --maxw: 600px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1A1A1D;
    --surface-2: #242428;
    --ink: #F4F4F5;
    --muted: #A1A1AA;
    --line: #2C2C31;
    --accent: #F472B6;
    --accent-ink: #F472B6;
    --accent-soft: #3A1A2A;
    --on-accent: #111113;
    --solid: #2E2E33;
    --on-solid: #F4F4F5;
    --good: #8FCB7E;
    --good-soft: #1D2B1B;
    --warn: #E3B04B;
    --warn-soft: #2F2615;
    --bad: #F87171;
    --bad-soft: #3A1A1A;
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-feature-settings: "tnum";
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
img { display: block; max-width: 100%; }
h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { min-height: 100dvh; display: grid; place-items: center; font: 600 28px var(--body); letter-spacing: -.02em; color: var(--accent); }

/* ---------- layout ---------- */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom));
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.xs { gap: 4px; }
.stack.sm { gap: 8px; }
.stack.lg { gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xsmall { font-size: 12px; }
.bad { color: var(--bad) !important; }
.good { color: var(--good) !important; }
.strong { font-weight: 700; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, calc((100% - var(--maxw)) / 2 + 16px)) 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.event-switch {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 1fr auto; column-gap: 6px;
  text-align: left; background: none; border: 0; padding: 4px 0;
}
.event-name { font: 600 17px/1.25 var(--body); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { grid-row: 2; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-switch .chev { grid-row: 1 / 3; grid-column: 2; align-self: center; width: 18px; height: 18px; color: var(--muted); }
.sync { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.sync .i { width: 14px; height: 14px; }
.sync.off { background: var(--warn-soft); color: var(--warn); }
.sync.busy { background: var(--surface-2); color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.tabbar a .i { width: 22px; height: 22px; stroke-width: 1.75; }
.tabbar a.on { color: var(--ink); font-weight: 600; }
.tabbar a.on .i { color: var(--accent); stroke-width: 2.25; }
.tabbar .dot {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--on-accent); font: 600 11px/18px var(--body); text-align: center;
}

/* ---------- icons ---------- */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
section.card[role=link] { cursor: pointer; }
.section-title { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.pist { background: var(--solid); color: var(--on-solid); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.small .i { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn.big { min-height: 68px; padding: 0; font: 600 22px var(--mono); letter-spacing: -.02em; }
.danger-text { color: var(--bad); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.faint { color: var(--muted); }
.icon-btn.tiny { width: 28px; height: 28px; }
.icon-btn.tiny .i { width: 15px; height: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; font-size: 14px; }

/* ---------- segmented ---------- */
.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; padding: 0 6px; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(24, 24, 27, .08); }
.seg.sticky { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 10; box-shadow: 0 0 0 8px var(--bg); }
.seg.kinds button.on { color: var(--accent-ink); }

/* ---------- hero stats & counters ---------- */
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); text-align: left;
}
.stat-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat-num { font: 600 40px/1 var(--mono); letter-spacing: -.04em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-of { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); margin-bottom: 12px; }
.stat .bar { width: 100%; }

.counter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 18px 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.counter-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.counter-num { font: 600 76px/1 var(--mono); letter-spacing: -.05em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.counter-of { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); margin-bottom: 14px; }
.counter .bar { width: 100%; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick .btn.big.ghost { font: 600 16px var(--body); letter-spacing: 0; }

/* ---------- progress ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .4s ease; }
.bar.berry span, .bar.pist span { background: var(--accent); }
.bar.bad span { background: var(--bad); }

/* ---------- key/value ---------- */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv-row:first-child { padding-top: 0; }
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-row strong { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- alerts ---------- */
.alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 3px solid var(--muted);
  background: var(--surface); font-size: 14.5px;
}
.alert.warn { border-left-color: var(--warn); }
.alert.bad { border-left-color: var(--bad); }
.alert.film { background: var(--solid); color: var(--on-solid); border: 0; }
.alert.film .btn { background: var(--accent); color: var(--on-accent); }
.alert.film .btn.ghost { background: transparent; color: var(--on-solid); border-color: color-mix(in srgb, var(--on-solid) 35%, transparent); }
.film-text { color: var(--accent-ink); display: flex; align-items: center; gap: 6px; }
.film-text .i { width: 16px; height: 16px; }

/* ---------- lists ---------- */
.rows, .mini-list, .checks, .event-list { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.row-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 0; background: none; border: 0; text-align: left; }
.row-title { display: block; font-weight: 500; }
.row-btn .muted.small { display: block; }
.row-num { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.mini-list li:first-child { padding-top: 0; }
.mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list .small { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-list .time { width: 44px; flex: none; }
.log { padding: 9px 0; gap: 12px !important; }
.thumb { width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); overflow: hidden; border: 0; padding: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.thumb .i { width: 18px; height: 18px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.ph.sample, .thumb.ph.staff { color: var(--warn); }
.thumb.ph.damaged { color: var(--bad); }
.pending { color: var(--warn); font-weight: 500; font-size: 13px; }
.empty { color: var(--muted); font-size: 14.5px; padding: 4px 0; }
.hint { font-size: 13px; color: var(--muted); }

.chip { border: 1px solid transparent; border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.planned { background: transparent; border-color: var(--line); color: var(--muted); }
.chip.ordered { background: var(--warn-soft); color: var(--warn); }
.chip.paid { background: var(--accent-soft); color: var(--accent-ink); }
.chip.arrived { background: var(--good-soft); color: var(--good); }
.tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.ok { background: var(--good-soft); color: var(--good); }
.tag.none { background: var(--surface-2); color: var(--muted); }
.stock-row { padding: 12px 0; }
.stock-row:first-child { padding-top: 4px; }
.stock-row .bar { height: 4px; }
.stock-row .row.between { align-items: baseline; }

/* checklist */
.checks li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.check { flex: 1; display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; min-width: 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 1.5px solid color-mix(in srgb, var(--muted) 60%, transparent); display: grid; place-items: center; color: transparent; transition: background-color .15s ease, border-color .15s ease; background: var(--surface); }
.check .box .i { width: 15px; height: 15px; stroke-width: 3; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks li.done .check-label { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); color: var(--muted); }

/* tiles */
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; text-align: left; }
.tile-num { font: 600 22px var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* stock table */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.stock { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stock th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.stock td { text-align: right; padding: 9px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.stock th:first-child, table.stock td:first-child { text-align: left; white-space: normal; font: 600 14px var(--body); }
table.stock tr:last-child td { border-bottom: 0; }
table.stock tr.short td:first-child { color: var(--bad); }

/* money */
.money-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.money-big { font: 600 28px/1.15 var(--body); letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money-mid { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* pace chart */
.spark { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.spark-col { flex: 1; max-width: 40px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.spark-bar { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 4px; }
.spark-val, .spark-lbl { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark-val { color: var(--ink); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--muted) 40%, var(--line)); border-radius: var(--radius-sm);
  font-size: 16px; /* stops iOS zoom */
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.error { color: var(--bad); font-size: 14px; min-height: 0; }
.error:empty { display: none; }
.photo-field { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.photo-field label.btn { cursor: pointer; }
.photo-preview { position: relative; }
.photo-preview img { max-height: 220px; border-radius: var(--radius-sm); }
.photo-preview .on-photo { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); color: #fff; }

/* ---------- sheet ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: transparent; transition: background-color .2s ease;
}
.sheet-wrap.open { background: var(--scrim); }
.sheet {
  width: 100%; max-width: 600px; max-height: 92dvh; overflow: auto;
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  overscroll-behavior: contain;
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 12px; background: var(--bg); }
.sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--line); }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; max-height: 86dvh; }
  .sheet-head::before { display: none; }
}
.viewer-img { width: 100%; border-radius: var(--radius-sm); }

/* events list */
.event-row { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; margin-bottom: 8px; }
.event-row.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.event-row.archived { opacity: .65; }
.event-row-name { font: 600 16px var(--body); }

/* ---------- content ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.gallery-img { aspect-ratio: 4 / 5; border: 0; padding: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.gallery-img img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { display: grid; grid-template-columns: 1fr auto; column-gap: 4px; }
.gallery figcaption .xsmall { grid-row: 2; }
.gallery figcaption .icon-btn { grid-row: 1 / 3; grid-column: 2; align-self: center; }

.canvas-frame { display: flex; justify-content: center; }
.card-canvas { width: min(100%, 340px); aspect-ratio: 9 / 16; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.bg-picker { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.bg-opt { width: 56px; height: 72px; flex: none; padding: 0; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.bg-opt img { width: 100%; height: 100%; object-fit: cover; }
.bg-opt.on { border-color: var(--accent); }
.caption-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.caption-box .seg { align-self: stretch; }
.caption-text { white-space: pre-wrap; font-size: 15px; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); width: 100%; user-select: text; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 0 auto; padding: calc(64px + env(safe-area-inset-top)) 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.brand-mark { font: 600 32px var(--body); color: var(--accent); letter-spacing: -.03em; }
.login > .muted.center { text-align: left; margin-top: -8px; margin-bottom: 8px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 500;
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- two panes (Kitchen, Hand out, Story cards) ---------- */
.split { display: flex; flex-direction: column; gap: 16px; }

/* ---------- hover (mouse and trackpad only) ---------- */
@media (hover: hover) {
  .btn:hover:not(:disabled) { filter: brightness(.96); }
  .btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
  .row-btn:hover .row-title { color: var(--accent-ink); }
  section.card[role=link]:hover, button.card:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
  .tabbar a:hover { color: var(--ink); }
  .chip:hover:not(:disabled) { filter: brightness(.95); }
}

/* ---------- tablet: wider page, two-column boards, side-by-side panes ---------- */
@media (min-width: 768px) {
  :root { --maxw: 980px; }
  .view { padding-top: 20px; }
  .board { display: block; columns: 2; column-gap: 16px; }
  .board > * { break-inside: avoid; margin-bottom: 16px; }
  .board > .full { column-span: all; }
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
  .split > .pane-main:has(.quick) { position: sticky; top: calc(76px + env(safe-area-inset-top)); }
  .quick .btn.big { min-height: 88px; font-size: 26px; }
  .counter-num { font-size: 96px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .sheet { max-width: 640px; padding-left: 24px; padding-right: 24px; }
}

/* ---------- desktop and iPad landscape: sidebar instead of bottom tabs ---------- */
@media (min-width: 1024px) {
  :root { --rail: 220px; --maxw: 1120px; }
  #app:has(> .tabbar) { padding-left: var(--rail); }
  .tabbar {
    top: 0; right: auto; width: var(--rail); height: auto;
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tabbar::before { content: "Dezzert"; padding: 8px 12px 20px; font: 600 20px var(--body); letter-spacing: -.03em; color: var(--accent); }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14.5px; }
  .tabbar a.on { background: var(--surface-2); }
  .tabbar .dot { position: static; margin-left: auto; }
  .view { padding-bottom: 48px; }
  #toast { bottom: 24px; left: calc(50% + var(--rail) / 2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
