/* Cadence — built for the wink Design Authority (packs/wink). All values trace to
   pack artifacts (see NOTES.md); improvised/fallback elements are marked in the DOM
   and are noncanonical by policy. Every path is relative (served under a subpath). */

/* ---- wink type stand-ins, self-hosted (tile: Fraunces ≈ display, Inter ≈ text) ---- */
@font-face { font-family: 'Fraunces'; src: url('fonts/Fraunces-VF.ttf'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/Fraunces-Italic-VF.ttf'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-VF.ttf'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* wink palette roles (W-R2; hexes per pack-live + source tile) */
  --yellow: #FFE01B;   /* brand field + primary action */
  --ink: #231E15;      /* all text/ink, shadow tint */
  --parsnip: #F6F6F4;  /* warm subtle background */
  --paper: #FFFFFF;    /* primary surface */
  --border: #DEDDDC;   /* dividers/inputs */
  --ochre: #E7B75F;    /* band terminator / amber accent */
  --kale: #007C89;     /* links */
  --err: #BF4055;      /* error copy */
  --muted: #5d5245;    /* quiet caption ink (source tile) */
  --shadow: 0 8px 32px rgba(35,30,21,.2);        /* warm-tinted elevation */
  --shadow-dialog: 0 8px 32px rgba(35,30,21,.35);/* dialog vessel (heavier) */
  --scrim: rgba(35,30,21,.35);
  --spring: cubic-bezier(.5,2.5,.7,.7);
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--paper); }
body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  font-size: 16px; line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* type registers — serif speaks (display), sans works (everything else).
   font-variation-settings per source tile: 'SOFT' 80 'WONK' 1 'opsz' 40 */
.serif, .display em, .h2, .statnum, .ringpct, .bignum, .clead {
  font-variation-settings: 'SOFT' 80, 'WONK' 1, 'opsz' 40;
}
.display { font-family: 'Fraunces', serif; font-weight: 400; font-size: 40px; letter-spacing: -1px; line-height: 1.15; }
.display em { font-style: italic; }
.h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 26px; line-height: 1.1; }
.clead { font-family: 'Fraunces', serif; font-size: 22px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.small { font-size: 14px; }
.caption { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

/* ---- layout ---- */
.shell { max-width: 1040px; margin: 0 auto; padding: 0 40px 96px; }
.view { padding-top: 32px; }

/* top bar (component/navbar: white bar, single row, dark links) */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.topbar .inner {
  max-width: 1040px; margin: 0 auto; padding: 14px 40px;
  display: flex; align-items: center; gap: 18px;
}
.wordmark { font-family: 'Fraunces', serif; font-size: 24px; letter-spacing: -.5px; font-variation-settings: 'SOFT' 80, 'WONK' 1, 'opsz' 40; }
.wordmark em { font-style: italic; }
/* nav = the tabs (Today·History·Achievements·Settings). Single row, never wraps. */
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
.navitem {
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  background: transparent; border: none; border-radius: 8px;
  padding: 7px 12px; text-decoration: none;
}
.navitem:hover { background: #F3F3F3; }   /* documented hover fill */
.navitem.on { background: #F3F3F3; font-weight: 600; }

/* ---- actions (component/action-pill) ---- */
.cta {
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--yellow);
  border: none; border-radius: 26px;
  padding: 12px 24px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: inset 0 0 0 1px var(--ink);
  transition: transform .3s var(--spring), box-shadow .3s var(--spring);
}
.cta:hover { transform: translateY(-4.875px); box-shadow: inset 0 0 0 1px var(--ink), 0 4.875px 0 0 var(--ink); }
.cta:active { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--ink), 0 1px 0 0 var(--ink); }
.cta.dark { background: var(--ink); color: #fff; box-shadow: none; }
.cta.dark:hover { box-shadow: 0 4.875px 0 0 var(--ink); }
.cta.outline { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.cta.outline:hover { box-shadow: inset 0 0 0 2px var(--ink), 0 4.875px 0 0 var(--ink); }
.cta.danger { background: transparent; box-shadow: inset 0 0 0 2px var(--err); color: var(--err); } /* marker per W-R2 error role */
.cta.danger:hover { box-shadow: inset 0 0 0 2px var(--err), 0 4.875px 0 0 var(--err); }
.cta.danger-solid { background: var(--err); color: #fff; box-shadow: none; }
.cta.sm { padding: 8px 16px; font-size: 12px; }
.cta:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.on-yellow .cta:focus-visible { outline-color: var(--ink); }
.cta.dark:focus-visible, .cta.danger:focus-visible, .cta.danger-solid:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
/* text link — kale role (W-R2) */
.link { color: var(--kale); text-decoration: underline; text-underline-offset: 2px; background: none; border: none; padding: 0; font-size: 13px; cursor: pointer; }
.link:hover { color: var(--ink); }

/* ---- cards (component/card: white, borderless, 16/24, warm shadow; tinted = parsnip) ---- */
.card1 { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.card1.lg { border-radius: 24px; }
.card2 { background: var(--parsnip); border-radius: 16px; padding: 32px; box-shadow: none; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.section-head .h2 { margin-right: auto; }
.stack { display: grid; gap: 16px; }

/* ---- today hero ---- */
.today-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.today-head .kicker { color: var(--muted); margin-bottom: 8px; }
.hero { display: grid; grid-template-columns: 172px 1fr; gap: 32px; align-items: center; }
.ringwrap { position: relative; width: 172px; height: 172px; }
.ringwrap svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--parsnip); }
.ring-fill { stroke: var(--yellow); transition: stroke-dashoffset .45s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ringpct { font-family: 'Fraunces', serif; font-size: 38px; line-height: 1; }
.ringsub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.hero-side .h2 { margin-bottom: 6px; }
.hero-stats { display: flex; align-items: center; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.statbig { display: flex; align-items: baseline; gap: 8px; }
.bignum { font-family: 'Fraunces', serif; font-size: 44px; line-height: 1; letter-spacing: -1px; }
.statbig .lbl { font-size: 13px; color: var(--muted); }

/* week banner (element 7 — improvised; ochre band role from source palette) */
.weekband { margin-top: 24px; background: var(--ochre); border-radius: 16px; padding: 20px 28px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.weekband .wb-title { font-weight: 600; font-size: 13.5px; margin-right: auto; }
.weekband .wb-metric { display: flex; align-items: baseline; gap: 7px; }
.weekband .wb-metric b { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; }
.weekband .wb-metric span { font-size: 12.5px; color: rgba(35,30,21,.75); }

/* ritual list */
.ritlist { display: grid; gap: 8px; }
.ritrow { display: grid; grid-template-columns: 20px 44px 1fr auto 38px; gap: 14px; align-items: center; padding: 13px 16px; border-radius: 12px; }
.ritrow:hover { background: var(--parsnip); cursor: pointer; }
.ritrow .rename { font-weight: 500; font-size: 15px; }
.ritrow .meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.ritrow .chips { display: flex; gap: 8px; align-items: center; }
.ritoicon { width: 40px; height: 40px; border-radius: 12px; background: var(--parsnip); display: flex; align-items: center; justify-content: center; }
.ritoicon svg { width: 22px; height: 22px; }
.draghandle { color: var(--muted); cursor: grab; padding: 6px 2px; display: flex; align-items: center; }
.ritrow.dragging { opacity: .45; }
.ritrow.dragover { box-shadow: inset 0 3px 0 0 var(--ink); border-radius: 12px; }

/* chips (element 34 — neutral variant improvised; streak chip element 15-family) */
.chip { display: inline-block; font-size: 11px; font-weight: 500; border-radius: 999px; padding: 4px 11px; }
.chip.tag { background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); color: var(--ink); }
.chip.streak { background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); color: var(--ink); }
.chip.streak b { font-weight: 600; }

/* check control (improvised; carries element 40's check-off moment) */
.check {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink);
  border: none; display: flex; align-items: center; justify-content: center;
  transition: transform .25s var(--spring), background .25s ease;
}
.check svg { width: 16px; height: 16px; opacity: 0; transform: scale(.5); transition: all .25s var(--spring); }
.check.on { background: var(--yellow); }
.check.on svg { opacity: 1; transform: scale(1); }
.check:hover { transform: translateY(-2px); }
.check:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.check.pop { animation: checkpop .5s var(--spring); }
@keyframes checkpop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .check.pop { animation: none; }
}

/* ---- history: charts ---- */
.chartcard { display: grid; gap: 20px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; align-items: end; height: 190px; }
.barcol { display: grid; align-content: end; gap: 8px; height: 100%; }
.barval { font-size: 12px; color: var(--muted); text-align: center; }
.bartrack { background: var(--parsnip); border-radius: 8px; height: 140px; display: flex; align-items: flex-end; overflow: hidden; }
.barfill { background: var(--yellow); border-radius: 8px 8px 0 0; width: 100%; box-shadow: inset 0 0 0 1px var(--ink); border-radius: 8px; }
.barlbl { font-size: 12px; text-align: center; color: var(--muted); }
.barcol.today .barlbl { color: var(--ink); font-weight: 600; }

.heatwrap { display: grid; gap: 10px; }
.heatgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heatcell { aspect-ratio: 1; border-radius: 6px; background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: var(--muted); }
.heatcell.h1 { background: var(--yellow); opacity: .3; box-shadow: none; }
.heatcell.h2 { background: var(--yellow); opacity: .55; box-shadow: none; }
.heatcell.h3 { background: var(--yellow); opacity: .8; box-shadow: none; }
.heatcell.h4 { background: var(--yellow); box-shadow: none; color: var(--ink); }
.heatcell.h1, .heatcell.h2, .heatcell.h3 { color: var(--muted); }
.heatleg { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-left: auto; }
.heatleg i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); }
.heatleg i.l2 { background: var(--yellow); opacity: .5; box-shadow: none; }
.heatleg i.l4 { background: var(--yellow); box-shadow: none; }
.weekhead { display: flex; gap: 6px; }
.weekhead span { flex: 1; font-size: 10.5px; color: var(--muted); text-align: center; }

/* snapshot row */
.snaprow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---- ledger (component/ledger) ---- */
.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; text-align: left; background: var(--parsnip); padding: 9px 12px; font-weight: 500; color: var(--ink); }
.ledger td { padding: 12px; border-bottom: 1px solid var(--border); }
.ledger tbody tr:hover { background: var(--parsnip); }
.ledger .num { font-variant-numeric: tabular-nums; }
.tabletools { display: flex; gap: 12px; align-items: center; margin: 18px 0 14px; flex-wrap: wrap; }
.searchbox { position: relative; flex: 1; min-width: 220px; }
.searchbox svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.searchbox input { width: 100%; font-size: 14px; padding: 9px 11px 9px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); color: var(--ink); }
.searchbox input:focus { outline: 3px solid var(--yellow); outline-offset: 2px; border-color: var(--ink); }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

/* ---- achievements ---- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { text-align: center; padding: 26px 16px; }
.tile .bignum { font-size: 40px; }
.tile .lbl { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.badgegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.badge { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 999px; background: var(--yellow); font-size: 13.5px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }
.badge .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.badge.locked { background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); font-weight: 500; }
.badge.locked .dot { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--muted); }

/* ---- fields (component/field-select) ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input[type="text"], .field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%; font-size: 14.5px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--yellow); outline-offset: 2px; border-color: var(--ink); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.field .errmsg { color: var(--err); font-size: 12.5px; margin-top: 5px; }
.field textarea { min-height: 84px; resize: vertical; }

/* platform controls (FALLBACK/controls — native semantics, field styling; improvised) */
.checkrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.checkrow input[type="checkbox"], .radiowrap input[type="radio"] { appearance: none; width: 18px; height: 18px; border: 1px solid var(--border); background: var(--paper); flex: none; cursor: pointer; }
input[type="checkbox"].cb { border-radius: 4px; display: inline-grid; place-content: center; }
input[type="checkbox"].cb:checked { background: var(--ink); border-color: var(--ink); }
input[type="checkbox"].cb:checked::before { content: ""; width: 10px; height: 10px; background: var(--yellow); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
input[type="radio"].rd { border-radius: 50%; display: inline-grid; place-content: center; }
input[type="radio"].rd:checked { border-color: var(--ink); background: var(--paper); }
input[type="radio"].rd:checked::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.checkrow input:focus-visible, .radiowrap input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.checkrow label { font-size: 13.5px; }
.radiowrap { display: flex; gap: 18px; padding-top: 2px; }
.radiowrap label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }

/* toggle switch (FALLBACK/controls — native checkbox presented as a switch; improvised) */
.switch { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); position: relative; cursor: pointer; flex: none; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px var(--ink), 0 2px 4px rgba(35,30,21,.2); transition: transform .2s var(--spring); }
.switch:checked { background: var(--yellow); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.switchrow:last-child { border-bottom: none; }
.switchrow .lbl { font-size: 14px; }
.switchrow .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* slider (improvised, meter logic from source layer: parsnip track, yellow fill) */
.sliderline { display: flex; align-items: center; gap: 16px; }
input[type="range"].slider { appearance: none; flex: 1; height: 10px; border-radius: 999px; background: var(--parsnip); box-shadow: inset 0 0 0 1px var(--border); outline-offset: 4px; }
input[type="range"].slider::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px var(--ink), 0 2px 5px rgba(35,30,21,.25); cursor: pointer; }
input[type="range"].slider:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sliderval { font-size: 14px; font-weight: 600; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

/* number stepper (improvised composition: field + outline pills) */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper input { width: 78px; text-align: center; font-size: 14.5px; padding: 10px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); color: var(--ink); }
.stepper input:focus { outline: 3px solid var(--yellow); outline-offset: 2px; border-color: var(--ink); }
.stepper .cta { padding: 8px 14px; font-size: 15px; line-height: 1; }
.stepval { font-size: 12px; color: var(--muted); }

/* ---- overlays: scrim + dialog vessel (improvised; warm ink scrim 35%) ---- */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.dialog { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-dialog); padding: 32px 36px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }
.dialog.narrow { max-width: 440px; }
.dialog.wide { max-width: 620px; }
.dialog h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px; margin-bottom: 8px; }
.dialog .consequence { font-size: 14px; margin: 10px 0 22px; }
.dialog .actions { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.dialog .actions .grow { margin-right: auto; }

/* wizard (element 37 — improvised) */
.dots { display: flex; gap: 8px; margin-top: 22px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.dots i.on { background: var(--yellow); box-shadow: 0 0 0 1px var(--ink); }
.wizard-step { display: none; }
.wizard-step.on { display: block; }

/* detail overlay bits */
.det-top { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.det-top .ritoicon { width: 52px; height: 52px; border-radius: 14px; }
.detsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0; }
.detblock { background: var(--parsnip); border-radius: 12px; padding: 16px; }
.detblock .kicker { color: var(--muted); font-size: 10.5px; margin-bottom: 10px; display: block; }
.minihist { display: grid; gap: 8px; font-size: 13px; }
.minihist .mh { display: flex; gap: 10px; }
.minihist .mh span:first-child { color: var(--muted); min-width: 64px; }
.sparkwrap { display: flex; align-items: flex-end; gap: 4px; height: 46px; }

/* toast (element 6 — improvised; ink pill, transient) */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  border-radius: 999px; padding: 12px 22px; display: flex; align-items: center; gap: 12px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  z-index: 300; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .tick { color: var(--yellow); font-weight: 700; }
.toast .undo { background: none; border: none; color: var(--yellow); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }

/* inline notice (element 36's undo host — improvised feedback surface) */
.noticeline { display: flex; align-items: center; gap: 14px; background: var(--parsnip); border-radius: 11px; padding: 12px 16px; font-size: 13px; margin-top: 16px; }
.noticeline .grow { margin-right: auto; }

/* spinner (element 10 — improvised, in-flight arc) */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
.spinner.ink { border: 2px solid var(--border); border-top-color: var(--ink); }
.cta.dark .spinner { border: 2px solid rgba(255,255,255,.35); border-top-color: var(--yellow); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* danger zone */
.dangerzone { border-radius: 16px; padding: 24px 32px; box-shadow: inset 0 0 0 2px var(--err); display: flex; align-items: center; gap: 16px; }
.dangerzone .grow { margin-right: auto; }
.dangerzone .lbl { font-weight: 600; font-size: 14px; }
.dangerzone .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* empty state (element 8 — improvised; parsnip panel + one sentence + one pill) */
.empty { text-align: center; padding: 44px 32px; }
.empty p { font-size: 14.5px; margin: 14px 0 18px; }
.empty .art { margin: 0 auto; }

/* ---- the ◌ marks system (required) ---- */
#marksBtn {
  position: fixed; right: 18px; bottom: 18px; z-index: 400;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper); color: var(--ink);
  border: none; box-shadow: inset 0 0 0 1px var(--ink), 0 8px 24px rgba(35,30,21,.25);
  font-size: 18px; line-height: 1;
}
#marksBtn:hover { background: var(--yellow); }
body.show-marks #marksBtn { background: var(--ink); color: var(--yellow); }

body.show-marks [data-improvised], body.show-marks [data-adapted] {
  outline: 2px dashed var(--ochre); outline-offset: 3px; border-radius: 8px;
}
body.show-marks [data-improvised]::before, body.show-marks [data-adapted]::before {
  position: absolute; left: 0; top: -9px; transform: translateY(-100%);
  background: var(--ink); color: var(--yellow);
  font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; z-index: 90;
  pointer-events: none; max-width: 340px; overflow: hidden; text-overflow: ellipsis;
}
body.show-marks [data-improvised], body.show-marks [data-adapted] { position: relative; }
body.show-marks [data-improvised]::before { content: "◌ " attr(data-improvised); }
body.show-marks [data-adapted]::before { content: "⚑ " attr(data-adapted); color: #fff; background: var(--err); }

/* ---- dark theme (FALLBACK/light-only: noncanonical, ink+yellow roles kept) ---- */
body.dark {
  --paper: #2A2318;
  --parsnip: #332B1E;
  --border: #4A4132;
  --muted: #C9BFAC;
  background: var(--ink);
  color: var(--parsnip);
}
body.dark .topbar { background: #231E15; border-color: #3A3226; }
body.dark .navitem:hover, body.dark .navitem.on { background: #3A3226; color: #F6F6F4; }
body.dark .cta { background: var(--yellow); color: var(--ink); }
body.dark .cta.dark { background: var(--yellow); color: var(--ink); box-shadow: none; }
body.dark .toast { background: #F6F6F4; color: var(--ink); }
body.dark .toast .tick, body.dark .toast .undo { color: #8a6d00; }
body.dark .weekband { color: var(--ink); }
body.dark .ledger th { background: #332B1E; color: #F6F6F4; }
body.dark .check, body.dark .searchbox input, body.dark .field input, body.dark .field select, body.dark .field textarea, body.dark .stepper input { background: #231E15; color: #F6F6F4; }
body.dark .check { box-shadow: inset 0 0 0 1px #F6F6F4; }
body.dark input[type="range"].slider { background: #3A3226; }
body.dark .ritrow:hover, body.dark .ledger tbody tr:hover { background: #332B1E; }
body.dark .cta.dark .spinner { border: 2px solid var(--border); border-top-color: var(--ink); }

/* ---- responsive: single-column collapse; tabs -> bottom nav on small screens ---- */
@media (max-width: 760px) {
  .shell { padding: 0 20px 120px; }
  .topbar .inner { padding: 12px 20px; }
  .topbar .tabs { display: none; }  /* tab bar moves to the bottom below */
  .display { font-size: 32px; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-stats { justify-content: center; }
  .tiles, .badgegrid, .snaprow { grid-template-columns: 1fr; }
  .detsplit { grid-template-columns: 1fr; }
  .bars { gap: 8px; }
  .ritrow { grid-template-columns: 20px 40px 1fr auto; row-gap: 6px; }
  .ritrow .chips { grid-column: 3 / 4; }
  .tabs-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--paper); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  }
  #marksBtn { bottom: 84px; }
}
@media (min-width: 761px) { .tabs-bottom { display: none; } }
