/* Cadence — built against Design Authority pack 'leader' (v0.1.0).
   Registers: Gelasio (serif: headlines/body), Inter (sans: nav/meta/labels),
   Archivo Black (display: big statics only). White ground, 2px ink rules,
   hairlines, Chicago blue interactive layer, red punctuation. Radius ~8. */

@font-face { font-family: 'Gelasio'; src: url('fonts/Gelasio-VF.ttf') format('truetype'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-VF.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('fonts/ArchivoBlack-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --red: #E3120B;
  --red60: #F6423C;
  --blue: #2E45B8;
  --blue-deep: #141F52;
  --ground: #FFFFFF;
  --ink: #1A1A1A;
  --mute: #666666;
  --line: #D9D9D9;
  --wash: #F2F2F2;
  --rowhover: #FEE7E7;
  --amber: #B45309;
  --amber-bg: #FFFBEB;
  --amber-tx: #7C4A03;
  --r: 8px;
  --serif: 'Gelasio', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --disp: 'Archivo Black', 'Arial Black', sans-serif;
  --t: background-color .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

html[data-theme="dark"] {
  --ground: #1A1A1A;
  --ink: #F2F2F2;
  --mute: #A3A3A3;
  --line: #3C3C3C;
  --wash: #242424;
  --rowhover: #242424;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ground);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color .12s ease, color .12s ease;
}
img, svg { display: block; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.b-red:focus-visible, .b-navy:focus-visible {
  /* L-23: on fills, white inner + ink outer ring */
  outline: 2px solid var(--ink); outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ground);
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- registers & structure ---------- */
.lab { font: 700 11.5px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.meta { font: 500 12.5px/1.5 var(--sans); color: var(--mute); }
.disp { font-family: var(--disp); font-weight: 400; letter-spacing: -1px; }
h1.head { font: 700 32px/1.15 var(--serif); letter-spacing: -.3px; margin: 8px 0 6px; }
.dek { font: 400 16.5px/1.5 var(--serif); color: var(--mute); max-width: 62ch; }
.view { padding: 26px 0 60px; }
.viewhead { margin-bottom: 8px; }
.section { margin-top: 30px; }
.rule2 { border: 0; border-top: 2px solid var(--ink); }
.hairline { border: 0; border-top: 1px solid var(--line); }
.stack { display: grid; gap: 0; }

/* ---------- top bar / tabs / bottom nav ---------- */
.topbar { background: var(--ground); border-bottom: 2px solid var(--ink); }
.topbar .wrap { display: flex; align-items: center; gap: 26px; height: 58px; }
.wordmark { font: 700 21px/1 var(--serif); letter-spacing: -.2px; }
.tabs { display: flex; gap: 20px; margin-left: auto; align-self: stretch; }
.tab {
  font: 500 14px/58px var(--sans); color: var(--ink); border-bottom: 2px solid transparent;
  padding: 0 2px; margin-bottom: -2px; cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0;
  transition: var(--t);
}
.tab:hover { color: var(--blue); }
.tab.on { border-bottom-color: var(--blue); color: var(--ink); }
.avatar {
  width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font: 700 15px/1 var(--serif); background: none; cursor: default; color: var(--ink);
}
.tabbar { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 var(--sans); border-radius: var(--r); padding: 10px 16px; cursor: pointer; border: 2px solid transparent; transition: var(--t); background: none; color: var(--ink); }
.b-navy { background: var(--blue); border-color: var(--blue); color: #fff; }
.b-navy:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.b-out { border-color: var(--ink); background: none; }
.b-out:hover { background: var(--wash); }
.b-red { background: var(--red); border-color: var(--red); color: #fff; }
.b-red:hover { background: var(--red60); border-color: var(--red60); }
.b-txt { border: 0; border-bottom: 1px solid var(--blue); border-radius: 0; padding: 4px 1px; color: var(--blue); }
.b-txt:hover { color: var(--blue-deep); border-bottom-color: var(--blue-deep); }
html[data-theme="dark"] .b-txt { color: #D9D9D9; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.danger-tx { border-color: var(--ink); color: var(--red); }
.btn.danger-tx:hover { background: var(--wash); }

/* ---------- tags (deck L-13) ---------- */
.tag { display: inline-block; border: 1px solid var(--ink); border-radius: 0; padding: 2px 6px 1px; font: 600 11px/1.45 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.tag.attn { background: var(--red); border-color: var(--red); color: #fff; }
.tag.mute { border-color: var(--line); color: var(--mute); }

/* ---------- notice (component/notice) ---------- */
.notice-slot { min-height: 0; }
.notice { border-left: 2px solid var(--ink); padding: 10px 14px; margin: 16px 0 0; display: flex; align-items: center; gap: 12px; background: var(--ground); }
.notice p { font: 400 15px/1.45 var(--serif); }
.notice .act { margin-left: auto; }

/* ---------- hero ---------- */
.hero { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: flex; align-items: center; gap: 26px; }
.hero .ringbox { flex: 0 0 auto; text-align: center; }
.hero .ringbox svg { margin: 0 auto; }
.ring-cap { margin-top: 6px; font: 500 12.5px/1.4 var(--sans); color: var(--mute); }
.hero .vdiv { width: 1px; align-self: stretch; background: var(--line); }
.hero .streak { min-width: 132px; }
.streaknum { font-family: var(--disp); font-size: 46px; line-height: 1; letter-spacing: -1px; }
.streaklab { font: 500 12.5px/1.5 var(--sans); color: var(--mute); margin-top: 4px; }
.hero .statustag { margin-top: 10px; }
.stamp { display: none; margin-top: 12px; align-items: baseline; gap: 5px; }
.stamp.on { display: flex; }
.stamp i { display: inline-block; background: var(--ink); }
.stamp i:last-child { background: var(--red); }
.hero .spacer { flex: 1; }

/* ---------- week banner ---------- */
.banner { margin-top: 26px; border-top: 2px solid var(--ink); padding: 14px 2px 2px; display: flex; align-items: flex-start; gap: 18px; }
.banner .b-copy { font: 400 16px/1.5 var(--serif); max-width: 56ch; }
.banner .b-copy b { font-weight: 700; }
.banner .tagbox { margin-left: auto; padding-top: 2px; }

/* ---------- ritual list ---------- */
.listhead { display: flex; align-items: baseline; gap: 14px; margin-top: 30px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.listhead .meta { margin-left: auto; }
.rituals { list-style: none; }
.ritual { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: var(--t); border-radius: var(--r); }
.ritual:hover { background: var(--rowhover); }
.handle { width: 14px; height: 22px; cursor: grab; flex: 0 0 auto; opacity: .55; background: none; border: 0; padding: 0; }
.handle i { display: block; width: 10px; height: 2px; background: var(--ink); margin: 3px 0; }
.ritual.dragover { box-shadow: 0 -2px 0 0 var(--red); }
.ritual .glyph { flex: 0 0 24px; height: 24px; display: flex; align-items: flex-end; gap: 3px; }
.glyph i { display: inline-block; background: var(--ink); }
.glyph i.hollow { background: none; border: 2px solid var(--ink); }
.glyph i.redsq { background: var(--red); }
.ritual .name { font: 400 17px/1.3 var(--serif); }
.ritual .sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ritual .sub .meta { margin: 0; }
.ritual .tags { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.check { width: 30px; height: 30px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: var(--r); background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--t); }
.check:hover { background: var(--wash); }
.check svg { width: 15px; height: 15px; opacity: 0; }
.check.on { background: var(--blue); border-color: var(--blue); }
.check.on svg { opacity: 1; }

/* ---------- panels (ruled; fallback/ruled-panel) ---------- */
.panel { border-top: 2px solid var(--ink); margin-top: 22px; padding: 20px 2px 6px; }
.panel .phead { display: flex; align-items: baseline; gap: 14px; }
.panel .phead .act { margin-left: auto; }
.panel h2 { font: 700 24px/1.2 var(--serif); letter-spacing: -.2px; margin: 8px 0 6px; }
.panel .pact { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.panel .pdek { font: 400 15.5px/1.5 var(--serif); color: var(--mute); }
.confirm { border-left: 2px solid var(--red); }
.confirm .pdek { color: var(--ink); }

/* ---------- fields ---------- */
.field { margin-bottom: 16px; max-width: 420px; }
.field > label { display: block; font: 700 11.5px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.field input[type="text"], .field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%; background: var(--ground); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 11px; font: 500 14.5px/1.4 var(--sans);
}
.field textarea { min-height: 84px; resize: vertical; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231A1A1A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
html[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F2F2F2' stroke-width='2'/%3E%3C/svg%3E"); }
.field .err { display: none; margin-top: 7px; font: 500 12.5px/1.4 var(--sans); color: var(--red); align-items: center; gap: 7px; }
.field .err::before { content: ""; width: 18px; height: 2px; background: var(--red); display: inline-block; flex: 0 0 auto; }
.field.invalid .err { display: flex; }
.row2 { display: flex; gap: 18px; flex-wrap: wrap; }
.row2 .field { flex: 1 1 180px; }

/* stepper */
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper input { max-width: 90px; }
.stepper .sbtn { width: 40px; height: 40px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: var(--r); background: none; color: var(--ink); font: 600 16px/1 var(--sans); cursor: pointer; transition: var(--t); }
.stepper .sbtn:hover { background: var(--wash); }

/* checkbox */
.cb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: var(--r); background: none; cursor: pointer; flex: 0 0 auto; display: inline-block; vertical-align: middle; position: relative; top: 3px; margin-right: 8px; transition: var(--t); }
.cb:checked { background-color: var(--blue); border-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10'%3E%3Cpath d='M1 5.5L4.2 8.7 11 1' fill='none' stroke='%23fff' stroke-width='2.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }
/* radio */
.rd { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: var(--r); background: none; cursor: pointer; display: inline-block; vertical-align: middle; position: relative; top: 3px; margin-right: 8px; transition: var(--t); }
.rd:checked { border-color: var(--ink); }
.rd:checked::after { content: ""; position: absolute; left: 4px; top: 4px; width: 8px; height: 8px; background: var(--blue); border-radius: 3px; }

/* switch (fallback/platform-controls: native checkbox, field skin) */
.sw { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); max-width: 420px; cursor: pointer; }
.sw .sw-lab { font: 500 14px/1.4 var(--sans); }
.sw input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; }
.sw .track { width: 44px; height: 24px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: var(--r); position: relative; transition: var(--t); }
.sw .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--ink); border-radius: 4px; transition: left .12s ease, background-color .12s ease; }
.sw input:checked ~ .track { background: var(--blue); border-color: var(--blue); }
.sw input:checked ~ .track::after { left: 22px; background: #fff; }
.sw input:focus-visible ~ .track { outline: 2px solid var(--red); outline-offset: 2px; }

/* slider (fallback/platform-controls) */
.rng-wrap { max-width: 420px; }
.rng { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; height: 24px; cursor: pointer; }
.rng::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; background: var(--ink); border: 2px solid var(--ground); border-radius: 4px; }
.rng::-moz-range-track { height: 2px; background: var(--line); }
.rng::-moz-range-thumb { width: 16px; height: 16px; background: var(--ink); border: 2px solid var(--ground); border-radius: 4px; }
.rng-readout { font: 600 13px/1.4 var(--sans); margin-left: 4px; }

/* loading (improvised stepped meter; L-16 static register) */
.loading { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.loading .track { width: 180px; height: 6px; background: var(--line); }
.loading .track i { display: block; height: 100%; width: 0; background: var(--red); }
.loading .meta { margin: 0; }

/* ---------- charts ---------- */
.chartbox { margin-top: 12px; }
.bars { display: flex; align-items: flex-end; gap: 16px; height: 150px; border-bottom: 2px solid var(--ink); padding: 0 2px; max-width: 520px; }
.bar-col { flex: 0 0 30px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar-col .val { font: 600 12px/1 var(--sans); color: var(--mute); margin-bottom: 4px; }
.bar-col .bar { width: 24px; background: var(--ink); }
.bar-col .bar.zero { background: none; border-bottom: 2px solid var(--line); }
.days { display: flex; gap: 16px; max-width: 520px; padding: 6px 2px 0; }
.days span { flex: 0 0 30px; text-align: center; font: 500 12px/1.4 var(--sans); color: var(--mute); }

.heat { margin-top: 12px; max-width: 520px; }
.heat .hrow { display: flex; gap: 6px; margin-bottom: 6px; }
.heat .hday { width: 60px; font: 500 11.5px/24px var(--sans); color: var(--mute); }
.heat i { width: 24px; height: 24px; display: inline-block; flex: 0 0 24px; }
.heat i.lv0 { border: 1px solid var(--line); }
.heat i.lv1 { background: var(--wash); border: 1px solid var(--line); }
.heat i.lv2 { background: var(--line); }
.heat i.lv3 { background: var(--mute); }
.heat i.lv4 { background: var(--ink); }
.heat i.blank { border: 0; }
.heat i.today { box-shadow: inset 0 0 0 2px var(--red); }
.heat .legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.heat .legend .meta { margin: 0; }
.heat .legend i { width: 16px; height: 16px; flex: 0 0 16px; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin: 10px 0 4px; max-width: 220px; border-bottom: 1px solid var(--line); }
.spark i { width: 8px; background: var(--ink); }
.spark i.hi { background: var(--red); }

/* ---------- ledger table (deck L-18) ---------- */
.tools { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: var(--r); padding: 8px 12px; width: 260px; background: var(--ground); }
.search input { border: 0; outline: none; background: none; color: var(--ink); font: 500 13.5px/1.4 var(--sans); flex: 1; min-width: 0; }
.search input:focus-visible { outline: none; }
.search .cursor { width: 2px; height: 15px; background: var(--ink); flex: 0 0 auto; }
.ledger { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ledger th { text-align: left; font: 700 11.5px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); border-bottom: 2px solid var(--ink); padding: 8px 10px; }
.ledger td { border-bottom: 1px solid var(--line); padding: 11px 10px; font: 500 13.5px/1.4 var(--sans); }
.ledger td.rit { font: 400 15.5px/1.4 var(--serif); }
.ledger td.num, .ledger th.num { text-align: right; }
.ledger tbody tr { transition: var(--t); }
.ledger tbody tr:hover { background: var(--rowhover); }
.ledger .emptyrow td { color: var(--mute); font-weight: 500; }
.ledgerwrap { overflow-x: auto; }
.pagefoot { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.pagefoot .act { margin-left: auto; }
.pagemeta { font: 500 12.5px/1.4 var(--sans); color: var(--mute); }

/* ---------- stats & badges ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.tile { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; }
.tile .tval { font-family: var(--disp); font-size: 34px; line-height: 1; letter-spacing: -1px; }
.tile .tlab { margin-top: 7px; font: 700 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.badge { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.badge .glyph { height: 26px; display: flex; align-items: flex-end; gap: 3px; margin-bottom: 12px; }
.badge .bname { font: 400 16px/1.3 var(--serif); }
.badge .btag { margin-top: 9px; }
.badge.locked .glyph i { background: var(--line); }
.badge.locked .bname { color: var(--mute); }
.empty-toggle { margin-top: 26px; border-top: 2px solid var(--ink); padding-top: 14px; }

/* empty state (deck L-17: ruled statement block, one action, no illustration) */
.empty { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 22px 2px 24px; max-width: 560px; }
.empty .eglyph { display: flex; align-items: flex-end; gap: 4px; margin-bottom: 14px; }
.empty .eglyph i { display: inline-block; background: var(--ink); }
.empty h3 { font: 700 22px/1.25 var(--serif); }
.empty .pdek { font: 400 15.5px/1.5 var(--serif); color: var(--mute); margin: 8px 0 16px; max-width: 46ch; }

/* ---------- wizard (fallback/ruled-panel: in-flow) ---------- */
.wizard { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 26px 2px 28px; margin-top: 22px; }
.wizard .wtop { display: flex; align-items: baseline; gap: 14px; }
.wizard .wtop .act { margin-left: auto; }
.wizard h2 { font: 700 30px/1.15 var(--serif); letter-spacing: -.3px; margin: 12px 0 10px; max-width: 22ch; }
.wizard .pdek { font: 400 16px/1.5 var(--serif); color: var(--mute); max-width: 52ch; }
.wizard .wbody { margin-top: 18px; max-width: 460px; }
.dots { display: flex; gap: 8px; margin-top: 22px; align-items: center; }
.dots i { width: 9px; height: 9px; border: 2px solid var(--ink); display: inline-block; }
.dots i.on { background: var(--red); border-color: var(--red); }
.wizard .wnav { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.wizard .wnav .skip { margin-left: auto; }

/* ---------- settings ---------- */
.settings-grid { max-width: 520px; margin-top: 10px; }
.sblock { margin-top: 26px; border-top: 2px solid var(--ink); padding-top: 16px; }
.sblock h3 { font: 700 20px/1.25 var(--serif); margin-bottom: 12px; }
.radios { display: flex; gap: 22px; align-items: center; margin-top: 4px; }
.radios label { font: 500 14px/1.4 var(--sans); cursor: pointer; }
.actions-row { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; align-items: center; }

/* ---------- marks (provenance toggle) ---------- */
.cbrow { padding: 11px 0; border-bottom: 1px solid var(--line); max-width: 420px; }
.cbrow label { font: 500 14px/1.4 var(--sans); cursor: pointer; }
.cbrow .cb { top: 0; }

/* mark picker (photo-upload adaptation) */
.markpicker { display: flex; gap: 8px; flex-wrap: wrap; }
.markbtn { width: 44px; height: 40px; border: 2px solid var(--line); border-radius: var(--r); background: none; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 8px 0 9px; transition: var(--t); }
.markbtn:hover { background: var(--wash); }
.markbtn.on { border-color: var(--blue); }
.markbtn .glyph { gap: 2px; }
.markbtn .glyph i { background: var(--ink); }
.markbtn .glyph i.hollow { background: none; }

/* heat legend (generic) */
.legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.legend .meta { margin: 0; }
.legend i { width: 16px; height: 16px; }
.legend i.lv1 { background: var(--wash); border: 1px solid var(--line); }
.legend i.lv2 { background: var(--line); }
.legend i.lv3 { background: var(--mute); }
.legend i.lv4 { background: var(--ink); }

.marks-btn {
  position: fixed; right: 14px; bottom: 14px; z-index: 140;
  width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--ground); color: var(--ink); font: 600 17px/1 var(--sans); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--t);
}
.marks-btn:hover { background: var(--wash); }
body.show-marks [data-improvised], body.show-marks [data-adapted] { outline: 1px dashed var(--amber); outline-offset: 2px; }
body.show-marks [data-improvised] { position: relative; }
body.show-marks [data-adapted] { position: relative; }
body.show-marks [data-improvised]::before, body.show-marks [data-adapted]::before {
  position: absolute; top: -10px; left: 6px; z-index: 130;
  max-width: min(360px, 78vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--amber-bg); border: 1px dashed var(--amber); color: var(--amber-tx);
  font: 600 10.5px/1.5 var(--sans); padding: 0 6px; border-radius: 4px; pointer-events: none;
}
body.show-marks [data-improvised]::before { content: "improvised · " attr(data-improvised); }
body.show-marks [data-adapted]::before { content: "adapted · " attr(data-adapted); }
body.show-marks .topbar [data-improvised]::before, body.show-marks .topbar [data-adapted]::before { top: calc(100% + 8px); left: auto; right: 0; }

/* ---------- responsive (deck L-22: single-column collapse) ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .topbar .wrap { gap: 14px; }
  .tabs { display: none; }
  h1.head { font-size: 27px; }
  .wizard h2 { font-size: 25px; }
  .hero { flex-wrap: wrap; gap: 18px; }
  .hero .vdiv { display: none; }
  .hero .streak { min-width: 100px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .badges { grid-template-columns: 1fr 1fr; }
  .bars, .days { gap: 10px; }
  .bars .bar-col, .days span { flex-basis: 24px; }
  .bars .bar-col .bar { width: 20px; }
  body { padding-bottom: 66px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    background: var(--ground); border-top: 2px solid var(--ink);
  }
  .tabbar a { flex: 1; text-align: center; font: 500 12.5px/1.3 var(--sans); padding: 11px 0 9px; color: var(--mute); border-top: 2px solid transparent; margin-top: -2px; }
  .tabbar a.on { color: var(--ink); border-top-color: var(--blue); }
  .marks-btn { bottom: 74px; }
  .search { width: 100%; }
  .ledger { min-width: 520px; }
}
