:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1b1a17;
  --muted: #6f6c64;
  --faint: #a8a49b;
  --line: #e8e5dd;
  --cell: #ebe8e0;
  --L: 0.66;
  --C: 0.15;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 24px rgba(27, 26, 23, .05);
  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --sans: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', sans-serif;
  --fs: 15px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --surface: #1a1a17;
    --ink: #ecebe6;
    --muted: #9a978e;
    --faint: #5f5c55;
    --line: #2a2925;
    --cell: #24231f;
    --L: 0.74;
    --C: 0.14;
    --shadow: none;
    color-scheme: dark;
  }
}
body.simple { --fs: 18px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.top {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mark { font: 500 20px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.mark span { color: var(--faint); }
#nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}
#nav a:hover { color: var(--ink); }
#nav a.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
body.simple #nav a { font-size: 16px; padding: 8px 12px; }

main { max-width: 760px; margin: 0 auto; padding: 12px 20px 96px; outline: none; }
main.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.2; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.stack > * + * { margin-top: var(--gap, 16px); }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  border: 1px solid var(--line);
}
@media (prefers-color-scheme: light) { .card { border-color: transparent; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: transform .1s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger { color: #c2410c; }
.btn.block { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- day header ---------- */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.daynav { display: flex; gap: 2px; }
.daynav a, .daynav span {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 18px;
}
.daynav a:hover { background: var(--surface); color: var(--ink); }
.daynav span { opacity: .3; }
.encourage { color: var(--muted); margin: 0 0 22px; }

/* ---------- habit rows (today) ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  --hc: oklch(var(--L) var(--C) var(--h));
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 14px 14px;
  border: 1px solid var(--line);
}
@media (prefers-color-scheme: light) { .row { border-color: transparent; } }
.row.rest { background: transparent; box-shadow: none; border: 1px dashed var(--line); }
.check {
  flex: none;
  width: 46px; height: 46px; border-radius: 999px;
  border: 2px solid var(--hc);
  background: transparent;
  display: grid; place-items: center;
  color: transparent;
  transition: background .2s ease, transform .15s ease, color .2s ease;
}
.check svg { width: 22px; height: 22px; }
.check:hover { background: oklch(var(--L) var(--C) var(--h) / .12); }
.check.on { background: var(--hc); color: #fff; }
.check.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.14); } }
body.simple .check { width: 58px; height: 58px; }
body.simple .check svg { width: 28px; height: 28px; }
.row-main { flex: 1; min-width: 0; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.simple .row-name { font-size: 20px; }
.row-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.strip { display: flex; gap: 3px; margin-top: 10px; }
.strip .c { flex: 1; min-width: 0; }

/* ---------- cells & year grid ---------- */
.c {
  display: block;
  aspect-ratio: 1;
  border-radius: 3px;
  background:
    linear-gradient(oklch(var(--L) var(--C) var(--h) / var(--a, 0)), oklch(var(--L) var(--C) var(--h) / var(--a, 0))),
    var(--cell);
}
.c.f { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.c.x { background: transparent; }
.c.t { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px oklch(var(--L) var(--C) var(--h) / .55); }
.yr.click .c[data-day]:not(.f) { cursor: pointer; }
.yr.click .c[data-day]:not(.f):hover { filter: brightness(.92); }

.yr { overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 4px 4px 2px; }
.yr::-webkit-scrollbar { display: none; }
.yr-in { min-width: calc(var(--w) * 11px); }
.mo, .cells { display: grid; grid-template-columns: repeat(var(--w), minmax(0, 1fr)); column-gap: 3px; }
.mo { font-size: 11px; color: var(--faint); height: 18px; }
.mo span { white-space: nowrap; overflow: visible; width: 0; }
.cells { grid-template-rows: repeat(7, auto); grid-auto-flow: column; row-gap: 3px; }

.habit-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.habit-card .title { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: oklch(var(--L) var(--C) var(--h)); flex: none; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); }
.legend .c { width: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 20px 0; }
.stat { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
@media (prefers-color-scheme: light) { .stat { border-color: transparent; } }
.stat b { display: block; font: 400 26px/1.15 var(--serif); }
.stat span { font-size: 12px; color: var(--muted); }
.meter { height: 4px; border-radius: 4px; background: var(--cell); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: oklch(var(--L) var(--C) var(--h)); border-radius: 4px; }

/* ---------- week plan ---------- */
.week { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
.week th { font-weight: 500; color: var(--faint); text-align: center; padding: 0 0 2px; }
.week th a { text-decoration: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; }
.week th.today a { background: var(--ink); color: var(--bg); }
.week td { text-align: center; padding: 0; }
.week td:first-child { text-align: left; padding-right: 8px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.wd { display: inline-block; width: 14px; height: 14px; border-radius: 999px; vertical-align: middle; }
.wd.plan { box-shadow: inset 0 0 0 1.5px oklch(var(--L) var(--C) var(--h) / .7); }
.wd.done { background: oklch(var(--L) var(--C) var(--h)); }
.wd.off { width: 4px; height: 4px; background: var(--line); }

/* ---------- empty / templates ---------- */
.empty { text-align: center; padding: 40px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  --hc: oklch(var(--L) var(--C) var(--h, 0));
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
}
.chip .dot { width: 8px; height: 8px; }
.chip.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- forms & sheet ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--ink); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 0; font-size: 13px; }
.daypick button.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.hues { display: flex; gap: 10px; flex-wrap: wrap; }
.hues button { width: 28px; height: 28px; border-radius: 999px; border: 0; background: oklch(var(--L) var(--C) var(--h)); }
.hues button.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px oklch(var(--L) var(--C) var(--h)); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle input[type="checkbox"] { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--cell); position: relative; transition: background .2s; flex: none; margin: 0; cursor: pointer; }
.toggle input[type="checkbox"]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input[type="checkbox"]:checked { background: var(--ink); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }
@media (prefers-color-scheme: dark) { .toggle input[type="checkbox"]:checked::after { background: var(--bg); } }

.sheet-wrap {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(18, 18, 16, 0);
  display: flex; align-items: flex-end; justify-content: center;
  transition: background .25s ease;
}
.sheet-wrap.open { background: rgba(18, 18, 16, .32); }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow: auto;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1);
}
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .2s ease; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.sheet-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 22px; }
.sheet-x { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--bg); color: var(--muted); font-size: 18px; line-height: 1; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- landing ---------- */
.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(40px, 10vw, 72px); line-height: 1; }
.hero p { font-size: 18px; color: var(--muted); max-width: 30em; margin: 18px 0 0; }

/* ---------- journal ---------- */
.posts { display: flex; flex-direction: column; }
.post-link { display: block; text-decoration: none; padding: 18px 0; border-top: 1px solid var(--line); }
.post-link:last-child { border-bottom: 1px solid var(--line); }
.post-link h3 { font-size: 21px; }
.post-link p { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prose { font-size: 17px; line-height: 1.7; max-width: 38em; }
.prose h2 { margin: 2em 0 .5em; font-size: 24px; }
.prose h3 { margin: 1.6em 0 .4em; font-size: 19px; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .25em 0; }
.prose blockquote { border-left: 2px solid var(--line); padding: 2px 0 2px 16px; color: var(--muted); font-size: 15px; }
.prose code { background: var(--cell); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a { text-underline-offset: 3px; }
.editor-title { font: 400 clamp(28px, 6vw, 38px)/1.15 var(--serif); border: 0; background: transparent; width: 100%; outline: none; padding: 0; }
.editor-body { width: 100%; min-height: 55vh; border: 0; background: transparent; outline: none; resize: vertical; font: 400 16px/1.7 var(--sans); padding: 0; }

/* ---------- people ---------- */
.person { display: block; text-decoration: none; }
.person .mini { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.person .mini .strip { margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--cell); display: grid; place-items: center; font: 500 15px var(--serif); flex: none; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; font-size: 13px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

.notes { list-style: none; padding: 0; margin: 0; }
.notes li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.notes li time { color: var(--faint); width: 64px; flex: none; }

.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--line); border-top-color: var(--muted); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .top { padding: 16px 16px 4px; }
  main { padding: 8px 16px 80px; }
  #nav a { padding: 6px 8px; }
  .row { gap: 12px; padding: 12px 14px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- sport colors (fixed order; validated for color-blind separation) ---------- */
:root {
  --t-run: oklch(0.62 0.14 35);
  --t-bike: oklch(0.70 0.14 140);
  --t-swim: oklch(0.55 0.14 245);
  --t-strength: oklch(0.68 0.14 330);
  --t-walk: oklch(0.76 0.14 95);
  --t-other: #a8a49b;
  --up: oklch(0.55 0.13 150);
  --down: oklch(0.58 0.15 30);
  --seq: 150;                     /* heatmap hue (one hue, light → dark) */
  --cell-strong: #d9d5cb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --t-run: oklch(0.53 0.14 35);
    --t-bike: oklch(0.665 0.14 140);
    --t-swim: oklch(0.49 0.14 245);
    --t-strength: oklch(0.665 0.14 330);
    --t-walk: oklch(0.62 0.14 95);
    --t-other: #6f6c64;
    --up: oklch(0.72 0.13 150);
    --down: oklch(0.70 0.14 30);
    --cell-strong: #3a3934;
  }
}

.status { color: var(--muted); margin: 0 0 18px; }
.warn { margin: 0 0 16px; font-size: 14px; color: var(--down); }
.w5 { font-weight: 500; }
code { font-size: .88em; background: var(--cell); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.flabel { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.btns { display: flex; gap: 6px; flex: none; }

/* body numbers on Today */
.body-row {
  display: flex; gap: 18px; flex-wrap: wrap; width: 100%;
  background: none; border: 0; padding: 0; margin: 0 0 14px; text-align: left; font-size: 14px;
}
.body-row .muted { margin-right: 4px; }

/* stat tiles deltas */
.stat em { font-style: normal; font-size: 11px; margin-left: 4px; }
.stat em.up { color: var(--up); }
.stat em.down { color: var(--down); }


/* lists */
.card.list { padding: 4px 0; }
.wrow { display: flex; gap: 12px; width: 100%; background: none; border: 0; text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); }
.wrow:first-child { border-top: 0; }
.list:not(.static) .wrow:hover { background: var(--bg); }
.static .wrow { cursor: default; }
.tdot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 6px; }
.wmain { flex: 1; min-width: 0; }
.wtop { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.wtop b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtop .small { white-space: nowrap; }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 500; }

.lrow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.lrow:first-child { border-top: 0; }
.lname { display: flex; flex-direction: column; min-width: 0; }
.lname b { font-weight: 500; }
.lval { text-align: right; font: 400 20px/1 var(--serif); }
.spark { width: 120px; height: 32px; display: block; }

/* reflect */
.energy { display: flex; align-items: center; gap: 6px; }
.energy .muted { margin-right: 6px; }
.energy button, .rpe button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; min-width: 36px; height: 36px; font-size: 14px; }
.energy button.sel, .rpe button.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rpe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.rpe button { min-width: 0; height: 32px; font-size: 13px; }

/* workout sets */
.setrow { display: grid; grid-template-columns: 1fr 52px 52px 64px 34px; gap: 6px; align-items: center; }
.setrow .input { padding: 10px; }

.howto { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.howto p { margin: 4px 0 0; line-height: 1.55; }
.input.time { width: 148px; flex: none; }

/* bottom tab bar on phones */
@media (max-width: 600px) {
  body.signed-in main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.signed-in #nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around; flex-wrap: nowrap; gap: 0;
    background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  body.signed-in #nav a { flex: 1; text-align: center; font-size: 12px; padding: 8px 2px; border-radius: 10px; }
  body.signed-in #nav a.on { background: var(--surface); }
  body.simple.signed-in #nav a { font-size: 15px; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .spark { width: 80px; }
  .setrow { grid-template-columns: 1fr 44px 44px 56px 30px; gap: 4px; }
}

/* ---------- charts ---------- */
.chart-card { padding: 16px 16px 12px; }
.vchart { position: relative; }
.vchart.empty { padding: 36px 0; text-align: center; }
.plot { position: relative; }
.vchart svg, .heat svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.axis { font: 400 11px var(--sans); fill: var(--faint); font-variant-numeric: tabular-nums; }
.dlabel { font: 500 11px var(--sans); fill: var(--muted); }
.grid { stroke: var(--line); stroke-dasharray: 2 4; }
.base { stroke: var(--line); }
.xhair { stroke: var(--faint); stroke-width: 1; opacity: 0; pointer-events: none; }
.xhair.on { opacity: 1; }
.hdots { pointer-events: none; }
.bk { transition: opacity .15s; }
.bk.dim { opacity: .3; }
.pdot { fill: var(--t-run); fill-opacity: .4; }
.pdot:hover { fill-opacity: 1; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-big { font: 400 26px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-foot { margin-top: 8px; text-align: right; }

.tip {
  position: absolute; top: 0; z-index: 5; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 10px;
  font-size: 12px; line-height: 1.5; min-width: 120px; max-width: 220px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.tip .th { font-weight: 600; margin-bottom: 2px; }
.tip div { display: flex; align-items: center; gap: 6px; }
.tip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; padding-left: 12px; }
.tip .tt { border-top: 1px solid color-mix(in oklab, var(--bg) 25%, transparent); margin-top: 4px; padding-top: 4px; }

/* chart controls: compact pills */
.controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pill { position: relative; }
.pill select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 6px 28px 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.pill::after { content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sports { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sports button {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 11px;
  font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
}
.sports button i { width: 8px; height: 8px; border-radius: 2px; opacity: .35; }
.sports button.sel { color: var(--ink); border-color: var(--ink); }
.sports button.sel i { opacity: 1; }

/* heatmap: one hue, 6 steps */
.heat { position: relative; }
.hc { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--cell); }
.hc.l1 { background: oklch(0.88 0.06 var(--seq)); }
.hc.l2 { background: oklch(0.78 0.10 var(--seq)); }
.hc.l3 { background: oklch(0.66 0.13 var(--seq)); }
.hc.l4 { background: oklch(0.54 0.13 var(--seq)); }
.hc.l5 { background: oklch(0.42 0.11 var(--seq)); }
.hc.f { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) {
  .hc.l1 { background: oklch(0.32 0.06 var(--seq)); }
  .hc.l2 { background: oklch(0.42 0.09 var(--seq)); }
  .hc.l3 { background: oklch(0.53 0.12 var(--seq)); }
  .hc.l4 { background: oklch(0.65 0.13 var(--seq)); }
  .hc.l5 { background: oklch(0.78 0.12 var(--seq)); }
}
.heat .legend .hc { width: 10px; }
.heat .hc[data-tip]:hover { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.welcome { margin: 18px 0 8px; }
/* the sport filter chips double as the legend */
.chart-card:has(.sports [data-sport]) .vchart .chart-legend { display: none; }
@media (max-width: 600px) {
  .pill select { padding: 5px 26px 5px 10px; font-size: 12px; }
  .chart-big { font-size: 22px; }
}
@media (max-width: 600px) { .strip .c { border-radius: 2px; } .strip { gap: 2px; } }
