/* Writing Course: paper and ink, with an editor's red pencil. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --surface-2: #f0ebe2;
  --ink: #1d1b18;
  --ink-2: #3a3530;
  --muted: #736a5e;
  --line: #e3dccf;
  --line-strong: #cfc5b4;
  --accent: #a33d1c;
  --accent-ink: #fffdf9;
  --accent-soft: #f5e4da;

  --key: #a33d1c;      --key-bg: #f8ebe3;
  --practice: #2e6a4c; --practice-bg: #e6f0ea;
  --check: #86620d;    --check-bg: #f6eed8;
  --added: #475a6e;    --added-bg: #eaeef2;

  --serif: "Literata", ui-serif, "New York", Georgia, serif;
  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 36rem;
  --gutter: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --shadow: 0 1px 2px rgb(40 30 20 / 0.05), 0 4px 16px rgb(40 30 20 / 0.06);

  --fs: 18px;
  color-scheme: light;
}
:root[data-size="s"] { --fs: 16px; }
:root[data-size="l"] { --fs: 20.5px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --surface: #1e1b16;
    --surface-2: #272320;
    --ink: #ede7dc;
    --ink-2: #d4ccbf;
    --muted: #a0968a;
    --line: #322d27;
    --line-strong: #463f37;
    --accent: #e8866a;
    --accent-ink: #1b140f;
    --accent-soft: #3a2219;
    --key: #e8866a;      --key-bg: #2c1d17;
    --practice: #7cc39c; --practice-bg: #182720;
    --check: #d9b565;    --check-bg: #2a2416;
    --added: #9fb3c8;    --added-bg: #1d232a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f;
  --surface: #1e1b16;
  --surface-2: #272320;
  --ink: #ede7dc;
  --ink-2: #d4ccbf;
  --muted: #a0968a;
  --line: #322d27;
  --line-strong: #463f37;
  --accent: #e8866a;
  --accent-ink: #1b140f;
  --accent-soft: #3a2219;
  --key: #e8866a;      --key-bg: #2c1d17;
  --practice: #7cc39c; --practice-bg: #182720;
  --check: #d9b565;    --check-bg: #2a2416;
  --added: #9fb3c8;    --added-bg: #1d232a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

main { max-width: calc(var(--measure) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- reading progress ---------- */

.progress-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.progress-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
body:not(.is-reading) .progress-bar { display: none; }

/* ---------- top bar (reader) ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.back { display: inline-flex; align-items: center; gap: 2px; padding: 10px 10px 10px 4px; text-decoration: none; color: var(--accent); font-weight: 550; font-size: 15px; }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn { background: none; border: 0; padding: 10px; border-radius: 999px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- reader ---------- */

.page-head { padding: 18px 0 8px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 8.2vw, 40px);
  line-height: 1.12;
  font-weight: 620;
  letter-spacing: -0.018em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.dek { font-family: var(--serif); font-size: calc(var(--fs) * 1.02); line-height: 1.5; color: var(--ink-2); margin: 0 0 14px; font-style: italic; text-wrap: pretty; }
.meta { font-size: 13.5px; color: var(--muted); margin: 0; }

.toc { margin: 18px 0 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.toc summary { list-style: none; cursor: pointer; padding: 12px 14px; font-size: 14.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); margin-left: 10px; transition: transform .2s; }
.toc[open] summary::after { transform: rotate(-135deg); }
.toc-count { margin-left: auto; font-weight: 450; color: var(--muted); font-size: 13px; }
.toc ol { margin: 0; padding: 0 14px 12px 34px; font-size: 14.5px; }
.toc li { padding: 5px 0; }
.toc a { text-decoration: none; color: var(--ink-2); }

.prose {
  font-family: var(--serif);
  font-size: var(--fs);
  line-height: 1.68;
  color: var(--ink);
  padding-top: 8px;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 18px; }
.prose p { margin: 0 0 1em; text-wrap: pretty; }
.prose h2 {
  font-family: var(--serif);
  font-size: 1.3em; line-height: 1.25; font-weight: 640; letter-spacing: -0.01em;
  margin: 2em 0 .6em;
  text-wrap: balance;
  hyphens: manual;
}
.prose h3 { font-family: var(--sans); font-size: .9em; font-weight: 680; line-height: 1.35; margin: 1.7em 0 .4em; hyphens: manual; }
.prose h4 { font-family: var(--sans); font-size: .82em; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.5em 0 .4em; }
.prose strong { font-weight: 660; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; padding-left: .15em; }
.prose li::marker { color: var(--muted); }
.prose ol > li::marker { font-family: var(--sans); font-size: .85em; font-weight: 600; }
.prose blockquote {
  margin: 1.4em 0; padding: .1em 0 .1em 1em;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote strong { font-weight: 620; color: var(--ink); }
.prose code { font-size: .86em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.table-wrap { overflow-x: auto; margin: 1.2em calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.prose table { border-collapse: collapse; font-family: var(--sans); font-size: 14.5px; line-height: 1.45; min-width: 100%; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 650; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- callouts ---------- */

.callout {
  --c: var(--key); --cbg: var(--key-bg);
  position: relative;
  margin: 1.5em 0;
  padding: 16px 18px 4px;
  border-radius: var(--radius);
  background: var(--cbg);
  font-size: .94em;
  line-height: 1.6;
}
.callout-label {
  font-family: var(--sans);
  font-size: 12px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c);
  margin: 0 0 8px !important;
  display: flex; align-items: center; gap: 8px;
}
.callout-label::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.callout ul, .callout ol { padding-left: 1.15em; }
.callout li::marker { color: var(--c); }
.callout-key { --c: var(--key); --cbg: var(--key-bg); }
.callout-key li { margin: .5em 0; }
.callout-practice { --c: var(--practice); --cbg: var(--practice-bg); }
.callout-check { --c: var(--check); --cbg: var(--check-bg); }
.callout-source { font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--muted); }
.callout-added { --c: var(--added); --cbg: var(--added-bg); border: 1.5px dashed color-mix(in srgb, var(--added) 45%, transparent); }
.prose > .callout-key:first-child { margin-top: 18px; }

/* ---------- complete + pager ---------- */

.complete { margin: 2.2em 0 1.2em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-size: 15.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-complete { width: 100%; }
.btn-complete .lbl-done { display: none; }
.btn-complete[aria-pressed="true"] { background: var(--practice); border-color: var(--practice); color: var(--bg); }
.btn-complete[aria-pressed="true"] .lbl-todo { display: none; }
.btn-complete[aria-pressed="true"] .lbl-done { display: inline; }
.btn-quiet { min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 550; }
.btn-danger { color: var(--accent); }
.btn-text { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14.5px; padding: 10px 0; cursor: pointer; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 1.2em 0 0; }
.pager-link {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; min-width: 0;
}
.pager-next { text-align: right; grid-column: 2; }
.pager-dir { font-size: 12px; color: var(--muted); font-weight: 550; }
.pager-eyebrow { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; color: var(--accent); }
.pager-title { font-family: var(--serif); font-size: 15px; line-height: 1.3; font-weight: 560; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ---------- index pages ---------- */

.index-head, .home-head { padding: calc(var(--safe-t) + 34px) 0 6px; }
.index-head h1, .home-head h1 {
  font-family: var(--serif); font-weight: 640; letter-spacing: -0.02em;
  font-size: 38px; line-height: 1.1; margin: 0 0 10px;
}
.home-head h1 { font-size: clamp(28px, 7.6vw, 36px); text-wrap: balance; }
.lede { color: var(--muted); font-size: 16px; margin: 0; text-wrap: pretty; }

.group { margin: 28px 0 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.group-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.more { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.group-desc { margin: -2px 0 14px; color: var(--muted); font-size: 14.5px; }

.part { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.part + .part { margin-top: 10px; }
.part summary { list-style: none; cursor: pointer; padding: 16px 44px 16px 16px; position: relative; display: grid; gap: 3px; }
.part summary::-webkit-details-marker { display: none; }
.part summary::after { content: ""; position: absolute; right: 20px; top: 24px; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.part[open] summary::after { transform: rotate(-135deg); top: 28px; }
.part-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.part-name { font-family: var(--serif); font-size: 19px; line-height: 1.25; font-weight: 620; }
.part-desc { font-size: 14px; color: var(--muted); }
.part-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.meter { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; width: var(--w, 0%); background: var(--practice); border-radius: 99px; transition: width .3s; }
.part .rows { border-top: 1px solid var(--line); }

.rows { list-style: none; margin: 0; padding: 0; }
.group > .rows { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rows li + li .row { border-top: 1px solid var(--line); }
.row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; text-decoration: none; }
.row:active { background: var(--surface-2); }
.row-num { flex: none; width: 26px; padding-top: 2px; font-size: 13px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.rows-plain .row-num:empty { display: none; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-title { font-family: var(--serif); font-size: 16.5px; line-height: 1.3; font-weight: 560; }
.row-sub { font-size: 13.5px; line-height: 1.45; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-check { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 99px; border: 1.5px solid var(--line-strong); }
.is-done .row-check, .is-done > .row-check {
  border-color: var(--practice); background: var(--practice);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.rows-plain .row-check { display: none; }

.weeks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.week {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 6px 10px; align-items: start;
  min-height: 96px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; position: relative;
}
.week-num { font-family: var(--serif); font-size: 26px; line-height: 1; font-weight: 640; color: var(--accent); grid-row: 1; }
.week-title { grid-column: 1 / -1; font-size: 14px; line-height: 1.35; font-weight: 560; }
.week .row-check { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; }
.week.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  display: flex; flex-direction: column; gap: 10px; min-height: 108px;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.card-letter {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-weight: 700; font-size: 17px;
}
.card-title { font-size: 14.5px; line-height: 1.35; font-weight: 560; }

/* ---------- home ---------- */

.hero-card {
  margin: 22px 0 0; padding: 18px; border-radius: 18px;
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow);
}
.hero-start { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.card-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.hero-link { display: grid; gap: 4px; text-decoration: none; position: relative; padding-right: 36px; }
.hero-link::after { content: "→"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; opacity: .8; }
.hero-eyebrow { font-size: 13px; font-weight: 600; opacity: .8; }
.hero-title { font-family: var(--serif); font-size: 22px; line-height: 1.22; font-weight: 600; }
.hero-card:not(.hero-start) .hero-eyebrow { color: color-mix(in srgb, var(--accent) 60%, var(--bg)); opacity: 1; }

.today { margin: 30px 0 0; }
.today-date { font-size: 13px; color: var(--muted); }
.today-card {
  display: grid; gap: 6px; padding: 18px; margin: 0 0 10px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; position: relative; overflow: hidden;
}
.today-idea { background: var(--key-bg); border-color: transparent; }
.today-drill { background: var(--practice-bg); border-color: transparent; }
.today-kind { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.today-idea .today-kind { color: var(--key); }
.today-drill .today-kind { color: var(--practice); }
.today-eyebrow { font-size: 13px; color: var(--muted); font-weight: 550; }
.today-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; font-weight: 620; }
.today-sub { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink-2); }

.stats { margin: 30px 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  display: grid; justify-items: center; gap: 6px; padding: 16px 8px 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.ring {
  --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--practice) calc(var(--p) * 1%), var(--surface-2) 0);
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring-num { position: relative; font-family: var(--serif); font-size: 20px; font-weight: 650; }
.stat-label { font-size: 13.5px; font-weight: 600; }
.stat-of { font-size: 12px; color: var(--muted); margin-top: -4px; }
.next-week {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-size: 14.5px;
}
.next-week b { color: var(--accent); }

.settings { margin: 36px 0 0; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-stack { flex-direction: column; align-items: stretch; }
.setting-label { font-size: 14.5px; font-weight: 550; }
.setting-stack .setting-label { font-weight: 450; color: var(--muted); font-size: 13.5px; }
.setting-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; min-width: 52px; height: 34px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg[data-setting="size"] button:nth-child(1) { font-size: 12px; }
.seg[data-setting="size"] button:nth-child(2) { font-size: 15px; }
.seg[data-setting="size"] button:nth-child(3) { font-size: 18px; }
.build-note { font-size: 12px; color: var(--muted); margin: 14px 0 0; text-align: center; }

/* ---------- search ---------- */

.search-form { margin-top: 14px; }
.search-form input {
  width: 100%; height: 50px; padding: 0 16px 0 44px;
  border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: 17px; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23887d70' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 20px; background-position: 14px center;
  -webkit-appearance: none; appearance: none;
}
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-status { color: var(--muted); font-size: 14px; margin: 16px 0 10px; }
.results { border: 0 !important; background: none !important; }
.results .row { padding: 14px 0; }
.results .row-num { display: none; }
.result-eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.results .row-sub { -webkit-line-clamp: 3; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 6px 4px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  transition: transform .25s ease;
}
.tabbar.is-hidden { transform: translateY(100%); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 12px; }
.tab svg { width: 24px; height: 24px; }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { stroke-width: 2.1; }

/* ---------- larger screens ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .weeks { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .tabbar { left: 50%; right: auto; width: 460px; transform: translateX(-50%); bottom: 16px; border-radius: 22px; border: 1px solid var(--line); height: 64px; padding: 6px; box-shadow: var(--shadow); }
  .tabbar.is-hidden { transform: translate(-50%, 140%); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
