/* Arx — CreativeOS Hub direction.
   Dark glass island on top, a dock of gradient tiles, bento glances, swipe decks,
   sticky-scroll chapters. Arx's own accent is its gold; every track keeps its hue. */

@font-face { font-family: "Space Grotesk"; src: url(../fonts/space-grotesk-latin-wght-normal.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(../fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
/* Screenplay pages in the Craft track keep Courier Prime. */
@font-face { font-family: "Courier Prime"; src: url(../fonts/courier-prime-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(../fonts/courier-prime-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Hub theme: warm black, signal red, marker yellow (dark mode) */
  color-scheme: dark;
  --bg-0: #0B0A09; --bg-1: #131110; --bg-2: #1A1715; --bg-3: #241F1C;
  --line: #2E2926; --line-2: #403933;
  --hi: #F6F1EA; --mid: #AEA49A; --lo: #8A7F75;
  --edge: rgba(255, 240, 225, .08); --shadow: 0 10px 34px rgba(0, 0, 0, .42); --glassA: 76%;
  --accent: #E5482D; --accent-hi: #FF6242; --accent-ink: #fff;
  --yellow: #E9B949; --yellow-ink: #141413; --link: #FF8A6F;
  --main: #E9B949; --support: #E5482D; --maintain: #D9CFC2; --foundation: #F6F1EA; --review: #F5892B; --reserve: #7A6F65;
  --bad: #FF6242; --ok: #8DBF6B;
  --code-bg: #0E0C0B; --glow: rgba(229, 72, 45, .10);
  --disp: "Space Grotesk", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(16px, 4vw, 34px);
  --r: 14px; --r-lg: 22px;
  /* legacy names used by older views */
  --night: var(--bg-0); --board: var(--bg-1); --board-2: var(--bg-2); --rule: var(--line); --bone: var(--hi); --dim: var(--mid); --ink: var(--accent-ink);
  --slug: var(--mono); --ui: var(--text); --code: var(--mono);
}
/* Light mode: paper, ink, the same red and yellow. Follows the phone unless you pick one. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #F6F1EA; --bg-1: #FFFCF7; --bg-2: #EFE7DB; --bg-3: #E3D8C8;
  --line: #DDD2C2; --line-2: #C8BAA6;
  --hi: #141413; --mid: #4F463E; --lo: #6E6359;
  --edge: rgba(20, 20, 19, .08); --shadow: 0 10px 30px rgba(60, 40, 20, .12); --glassA: 82%;
  --accent: #D23B20; --accent-hi: #B12F17; --accent-ink: #fff;
  --yellow: #E9B949; --yellow-ink: #141413; --link: #B12F17;
  --main: #E0A92A; --support: #D23B20; --maintain: #8C7F72; --foundation: #141413; --review: #DB7417; --reserve: #9A8E82;
  --bad: #C0311C; --ok: #4E8A2E;
  --code-bg: #FFFCF7; --glow: rgba(210, 59, 32, .07);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-0: #F6F1EA; --bg-1: #FFFCF7; --bg-2: #EFE7DB; --bg-3: #E3D8C8;
    --line: #DDD2C2; --line-2: #C8BAA6;
    --hi: #141413; --mid: #4F463E; --lo: #6E6359;
    --edge: rgba(20, 20, 19, .08); --shadow: 0 10px 30px rgba(60, 40, 20, .12); --glassA: 82%;
    --accent: #D23B20; --accent-hi: #B12F17; --accent-ink: #fff;
    --yellow: #E9B949; --yellow-ink: #141413; --link: #B12F17;
    --main: #E0A92A; --support: #D23B20; --maintain: #8C7F72; --foundation: #141413; --review: #DB7417; --reserve: #9A8E82;
    --bad: #C0311C; --ok: #4E8A2E;
    --code-bg: #FFFCF7; --glow: rgba(210, 59, 32, .07);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100dvh;
  background: radial-gradient(1200px 600px at 70% -10%, var(--glow), transparent 60%), var(--bg-0);
  background-attachment: fixed;
  color: var(--hi); font: 400 16px/1.55 var(--text);
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 50; border-radius: 99px; }
.skip:focus { left: 8px; }
h1, h2, h3 { font-family: var(--disp); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 20px; margin-top: 1.6em; }
h3 { font-size: 16.5px; }
p { margin: 0 0 .8em; }
.eyebrow { font: 600 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--lo); margin: 0 0 6px; }
.dim { color: var(--mid); }
.small { font-size: 13.5px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.warn { color: var(--accent-ink); background: var(--review); padding: 8px 14px; border-radius: 12px; }
code { font: .9em var(--mono); background: var(--bg-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
kbd { font: 500 10.5px var(--mono); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--lo); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.glass { background: color-mix(in srgb, var(--bg-1) var(--glassA), transparent); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.phone-only { display: none; }

/* ---------- shell: island, dock, tab bar ---------- */
.island {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30;
  width: calc(100% - 32px); max-width: 1080px; height: 54px;
  display: flex; align-items: center; gap: 10px; padding: 0 9px 0 12px; border-radius: 99px;
}
.ibrand { display: flex; align-items: center; gap: 9px; color: var(--hi); text-decoration: none; font: 700 17px var(--disp); letter-spacing: -.02em; }
.mark { width: 28px; height: 28px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.mark svg { width: 22px; height: 22px; }
.ipills { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.ipills::-webkit-scrollbar { display: none; }
.ipill { padding: 8px 14px; border-radius: 99px; font: 600 13px var(--text); color: var(--mid); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.ipill:hover { color: var(--hi); }
.ipill[aria-current="page"] { background: color-mix(in srgb, var(--hi) 11%, transparent); color: var(--hi); }
.iright { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.isearch { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); color: var(--lo); font: 500 13px var(--text); cursor: pointer; }
.isearch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.isearch:hover { color: var(--hi); border-color: var(--line-2); }
.net { display: flex; align-items: center; gap: 6px; font: 500 11px var(--mono); color: var(--lo); }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 70%, transparent); }
.net-label::after { content: "online"; }
body.offline .net-dot { background: var(--lo); box-shadow: none; }
body.offline .net-label::after { content: "offline · all works"; }
.av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(140deg, var(--yellow), color-mix(in srgb, var(--yellow) 55%, #6b3a00)); display: grid; place-items: center; font: 700 11.5px var(--disp); color: var(--yellow-ink); text-decoration: none; flex: 0 0 auto; }
.av[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--yellow); }
.itheme { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--mid); display: grid; place-items: center; cursor: pointer; }
.itheme:hover { color: var(--hi); border-color: var(--line-2); }
.itheme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.itheme .sun { display: none; }
:root[data-theme="light"] .itheme .sun { display: block; } :root[data-theme="light"] .itheme .moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .itheme .sun { display: block; } :root:not([data-theme="dark"]) .itheme .moon { display: none; } }

.dock { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 25; display: flex; gap: 9px; padding: 8px 11px; border-radius: 22px; }
.dk { --h: var(--accent); position: relative; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; text-decoration: none;
  background: linear-gradient(150deg, var(--h), color-mix(in srgb, var(--h) 52%, #000)); color: #fff; font: 700 13px var(--disp); text-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .18s var(--ease); }
.dk:hover, .dk:focus-visible { transform: translateY(-7px) scale(1.16); color: #fff; }
.dk i { position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--hi); color: var(--bg-0); font: 600 11px var(--text); padding: 3px 9px; border-radius: 99px; opacity: 0; pointer-events: none; transition: opacity .15s; font-style: normal; }
.dk:hover i, .dk:focus-visible i { opacity: 1; }

.tabbar { display: none; }

main { min-width: 0; outline: none; overflow-x: clip; }
.page { max-width: 1080px; margin: 0 auto; padding: 96px var(--pad) 130px; }
.page-head { margin-bottom: 22px; }
.page-head .row { margin-top: 10px; }
.lede { font-size: 17.5px; color: var(--mid); max-width: 62ch; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--mid); text-decoration: none; font: 500 13px var(--text); margin-bottom: 14px; }
.back::before { content: "←"; }
.back:hover { color: var(--hi); }

/* ---------- controls ---------- */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 18px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--hi); font: 600 14px var(--text); cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.btn:hover { border-color: var(--lo); color: var(--hi); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.file-btn { position: relative; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--hi); font: 600 14px var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--lo); }
.link { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 5px; margin: 8px 0; font-size: 13.5px; color: var(--mid); }
.field.inline { grid-template-columns: minmax(180px, 1fr) 220px; align-items: center; }
.field.grow { flex: 1; }
input, select, textarea { font: 15px var(--text); color: var(--hi); background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; min-height: 42px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input.search { width: auto; flex: 1; min-width: 180px; border-radius: 99px; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: auto; min-height: auto; accent-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.editor { font: 14px/1.6 var(--mono); tab-size: 4; background: var(--code-bg); border-radius: 14px; }
.tag { display: inline-block; font: 600 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mid); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 9px; margin-right: 4px; }
.meter { display: inline-block; vertical-align: middle; width: 90px; height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.meter-line { display: block; height: 4px; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin-top: 8px; }
.meter-line i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--lo); vertical-align: 1px; }
.s-main { background: var(--main); } .s-support { background: var(--support); } .s-maintain, .s-sprint { background: var(--maintain); }
.s-foundation { background: var(--foundation); } .s-reserve { background: transparent; outline: 1px dashed var(--lo); } .s-frozen { background: var(--line-2); }
.notice { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; }

/* ---------- tiles and bento ---------- */
.tile { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: relative; overflow: hidden; color: var(--hi); text-decoration: none; transition: border-color .15s, transform .2s var(--ease); }
a.tile:hover { border-color: var(--line-2); transform: translateY(-2px); color: var(--hi); }
.tile h2, .tile h3 { margin-top: 0; }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(108px, auto); gap: 14px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.rows-2 { grid-row: span 2; }
.bignum { font: 700 clamp(44px, 7vw, 76px)/.92 var(--disp); letter-spacing: -.05em; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }

/* ---------- Now ---------- */
.now-head { margin-bottom: 16px; }
.dateline { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lo); margin: 0 0 8px; }
.objective { font: 600 clamp(22px, 3.2vw, 30px)/1.2 var(--disp); letter-spacing: -.02em; margin: 0; max-width: 32ch; }
.objective a { color: var(--accent); text-decoration-color: var(--yellow); text-decoration-thickness: 3px; }
.live { --strip: var(--lo); background: linear-gradient(160deg, color-mix(in srgb, var(--strip) 26%, var(--bg-2)), var(--bg-1) 70%); border: 1px solid color-mix(in srgb, var(--strip) 34%, var(--line)); border-radius: 28px; padding: 22px; }
.live-when { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--strip); margin: 0 0 8px; }
.live-when span { color: var(--hi); }
.live .slug { font: 700 clamp(24px, 3.6vw, 36px)/1.05 var(--disp); letter-spacing: -.03em; margin: 0 0 8px; }
.live-range { color: var(--mid); font: 500 12.5px var(--mono); }
.live .note, .strip-panel .note { color: var(--mid); font-size: 14.5px; }
.why { color: var(--link); font-size: 14.5px; }
.plan-line { font-size: 15px; }
.ring-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.ring { display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--mid); font: 600 10.5px var(--mono); letter-spacing: .06em; }
.ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track-c { stroke: var(--bg-3); }
.ring .val-c { stroke: var(--yellow); stroke-linecap: round; }
.ring b { font: 700 13px var(--disp); color: var(--hi); margin-top: -40px; margin-bottom: 18px; transform: none; }
.ring-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; }
.live.k-life .live-when, .live.k-reserve .live-when { color: var(--mid); }
.book-card .cover-shelf { display: none; }
.reading-tile { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.reading-tile strong { display: block; font: 600 17px/1.2 var(--disp); margin: 2px 0; }
.next-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.next-list li { display: flex; gap: 10px; font-size: 14px; }
.next-list time { font: 500 12px var(--mono); color: var(--lo); min-width: 44px; padding-top: 2px; }
.tile-link { position: absolute; inset: 0; z-index: 1; }

.k-main { --strip: var(--main); } .k-support { --strip: var(--support); } .k-maintain { --strip: var(--maintain); }
.k-anchor, .k-foundation { --strip: var(--foundation); } .k-review { --strip: var(--review); } .k-reserve { --strip: var(--reserve); } .k-life { --strip: var(--line-2); }

/* ---------- stripboard ---------- */
.board { margin-top: 26px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.board-head h2 { margin: 0 0 12px; }
.strips { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.strip-hit {
  width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: color-mix(in srgb, var(--strip) 13%, var(--bg-2)); color: var(--hi);
  border: 1px solid color-mix(in srgb, var(--strip) 30%, var(--line)); border-radius: 12px;
  box-shadow: inset 7px 0 0 var(--strip); padding: 11px 14px 11px 20px; text-align: left; cursor: pointer;
  font: 600 13px/1.25 var(--text); transition: transform .15s var(--ease), border-color .15s;
}
.strip-hit:hover { border-color: color-mix(in srgb, var(--strip) 55%, var(--line)); }
.strip-time { font: 500 11.5px var(--mono); color: var(--mid); }
.strip-slug { font: 600 12.5px var(--mono); letter-spacing: .02em; }
.strip-meta { font: 600 11.5px var(--mono); color: var(--mid); font-variant-numeric: tabular-nums; }
.strip.k-life .strip-hit { background: transparent; border-color: transparent; box-shadow: none; color: var(--lo); font-weight: 400; padding-block: 5px; }
.strip.k-main .strip-hit { background: color-mix(in srgb, var(--yellow) 16%, var(--bg-2)); }
.strip.k-life .strip-slug { font-weight: 400; }
.strip.k-reserve .strip-hit { background: repeating-linear-gradient(135deg, var(--bg-1) 0 8px, var(--bg-2) 8px 10px); box-shadow: inset 7px 0 0 var(--line-2); }
.strip.is-now .strip-hit { animation: lit 2.2s ease-in-out infinite; border-color: var(--strip); }
@keyframes lit { 50% { box-shadow: inset 7px 0 0 var(--strip), 0 0 0 4px color-mix(in srgb, var(--strip) 22%, transparent); } }
.strip.is-done .strip-hit { opacity: .45; }
.strip.is-done .strip-slug { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.strip.is-skipped .strip-hit { opacity: .3; }
.strip.is-displaced .strip-hit { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--strip) 20%, var(--bg-2)) 0 10px, var(--bg-1) 10px 14px); }
.strip-panel { background: var(--bg-1); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 14px 16px; margin-top: -8px; padding-top: 18px; }

/* ---------- tables, prose ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 1em 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--lo); font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--bg-1); }
.prose { max-width: 70ch; }
.prose p, .prose li { line-height: 1.7; }
.prose h2 { font-size: 21px; } .prose h3 { font-size: 17px; }
.prose blockquote { margin: 1.2em 0; padding: 6px 0 6px 18px; border-left: 3px solid var(--accent); color: var(--hi); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--lo); }
.prose strong { color: var(--hi); font-weight: 600; }
.code { font: 13.5px/1.6 var(--mono); background: var(--code-bg); border: 1px solid var(--line); padding: 14px 16px; border-radius: var(--r); overflow-x: auto; white-space: pre; }
.code code { background: none; padding: 0; border: 0; }
.code.err { border-color: var(--bad); color: var(--bad); white-space: pre-wrap; }
.formula { font: 400 19px/1.6 "Times New Roman", Georgia, serif; font-style: italic; text-align: center; padding: 12px; margin: 1em 0; background: var(--bg-1); border-radius: var(--r); }
.cloze-reveal { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--yellow) 22%, transparent); padding: 0 3px; border-radius: 4px; }
ul.plain { list-style: none; padding: 0; } ul.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); }

/* ---------- week, campaign ---------- */
.daytabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 18px; }
.daytabs a { display: grid; justify-items: center; padding: 9px 0; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line); color: var(--lo); text-decoration: none; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.daytabs a b { font: 700 22px var(--disp); color: var(--hi); letter-spacing: -.03em; text-transform: none; }
.daytabs a[aria-current="date"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .daytabs a[aria-current="date"] b { color: var(--accent-ink); }
.daytabs a.is-today:not([aria-current="date"]) { border-color: var(--accent); }
.lectures { list-style: none; padding: 0; } .lectures li { display: flex; justify-content: space-between; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin-bottom: 6px; font: 500 13px var(--mono); }
.phases { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-left: 1px solid var(--line-2); }
.phase { position: relative; padding: 4px 0 22px 24px; }
.phase::before { content: ""; position: absolute; left: -6px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg-0); border: 1px solid var(--line-2); }
.phase.is-now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); }
.phase.is-past::before { background: var(--line-2); }
.phase.is-past { opacity: .7; }
.phase h2 { margin: 2px 0 6px; font-size: 19px; }
.phase-when { font: 500 11.5px var(--mono); color: var(--lo); letter-spacing: .06em; }
.gate { font-size: 14.5px; }
.gate.ok strong { color: var(--ok); } .gate.open strong { color: var(--review); }

/* ---------- tracks: decks ---------- */
.track { margin-top: 30px; }
.track h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.track h2 small { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.deck { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 6px calc(var(--pad) * -1) 0; padding: 10px var(--pad) 16px; scrollbar-width: none; }
.deck::-webkit-scrollbar { display: none; }
.dcard { --h: var(--accent); flex: 0 0 min(300px, 78vw); scroll-snap-align: start; min-height: 220px; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--hi);
  background: linear-gradient(165deg, color-mix(in srgb, var(--h) 30%, var(--bg-2)), var(--bg-1) 70%); border: 1px solid color-mix(in srgb, var(--h) 32%, var(--line)); transition: transform .2s var(--ease), border-color .15s; }
.dcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--h) 60%, var(--line)); color: var(--hi); }
.dcard .eyebrow { color: color-mix(in srgb, var(--h) 70%, var(--hi)); }
.dcard h3 { font: 600 19px/1.15 var(--disp); margin: 0; }
.dcard .bignum { font-size: 52px; margin-top: auto; }
.dcard .meter-line i { background: var(--h); }
.dcard .dstats { font: 500 12px var(--mono); color: var(--mid); }
.dcard.small { min-height: 180px; flex-basis: min(240px, 66vw); }
.packlist { list-style: none; padding: 0; display: grid; gap: 6px; }
.packlist a { display: grid; grid-template-columns: 1fr 100px minmax(160px, auto); gap: 12px; align-items: center; padding: 12px 14px; background: var(--bg-1); border: 1px solid var(--line); color: var(--hi); text-decoration: none; border-radius: 14px; }
.packlist a:hover { border-color: var(--line-2); }
.pl-stats { color: var(--mid); font: 500 12.5px var(--mono); text-align: right; } .pl-stats b { color: var(--accent); font-weight: 600; }
.graph-wrap { overflow-x: auto; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.graph-wrap svg { display: block; }
.edge { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.node rect { fill: var(--bg-2); stroke: var(--line-2); rx: 8; }
.node text { font: 600 12px var(--text); fill: var(--mid); }
.node .fill { fill: var(--maintain); stroke: none; }
.node.ready rect:first-of-type { stroke: var(--accent); stroke-width: 2; } .node.ready text { fill: var(--hi); }
.node.held rect:first-of-type { stroke: var(--maintain); } .node.held text { fill: var(--hi); }
.node.started text { fill: var(--hi); }
.node.locked { opacity: .55; }
.node:hover rect:first-of-type { fill: var(--bg-3); }
.concepts { padding-left: 1.4em; } .concepts li { padding: 4px 0; } .concepts a { display: flex; justify-content: space-between; gap: 10px; color: var(--hi); text-decoration: none; max-width: 640px; }
.concepts li.ready::marker { color: var(--accent); } .concepts li.held a span:first-child { color: var(--maintain); }
.items { list-style: none; padding: 0; } .items li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.notes { list-style: none; padding: 0; } .notes li { background: var(--bg-1); border: 1px solid var(--line); padding: 12px 16px; margin-bottom: 8px; border-radius: var(--r); }

/* ---------- session ---------- */
.sess-head { margin-bottom: 18px; }
.sess-bar { height: 4px; background: var(--bg-3); margin: 10px 0; border-radius: 99px; overflow: hidden; } .sess-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.card { background: linear-gradient(170deg, var(--bg-2), var(--bg-1) 70%); border: 1px solid var(--line); padding: 26px; border-radius: 26px; max-width: 780px; box-shadow: var(--shadow); }
.card .q { font: 500 20px/1.5 var(--text); }
.lesson h1 { font-size: 32px; }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.rate { flex-direction: column; gap: 0; min-height: 60px; border-radius: 16px; }
.rate small { font: 500 11px var(--mono); color: var(--lo); }
.rate.r1 { border-color: var(--bad); } .rate.r3 { border-color: var(--accent); }
.options { list-style: none; padding: 0; display: grid; gap: 8px; }
.opt { width: 100%; text-align: left; padding: 14px 16px; background: var(--bg-1); color: var(--hi); border: 1px solid var(--line-2); border-radius: 16px; font: 15.5px/1.45 var(--text); cursor: pointer; }
.opt:hover { border-color: var(--lo); }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--bg-1)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--bg-1)); }
.opt.muted { opacity: .55; } .opt.picked { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.feedback { margin-top: 14px; }
.num input { max-width: 220px; }
.lab { max-width: 900px; }
.lab h2 { margin-top: 0; }
.lab-out { font: 13.5px/1.6 var(--mono); }
.tests { list-style: none; padding: 0; font: 500 13.5px var(--mono); } .tests li { padding: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.stats div { background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; } .stats dt { color: var(--lo); font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; } .stats dd { margin: 4px 0 0; font: 700 28px var(--disp); letter-spacing: -.03em; }
.score { font: 700 64px var(--disp); letter-spacing: -.05em; margin: 10px 0; }
.clock { font: 600 18px var(--mono); color: var(--accent); }
.qdots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.qdots button { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--lo); font: 500 12px var(--mono); cursor: pointer; }
.qdots .ans { background: var(--bg-2); color: var(--hi); } .qdots .cur { border-color: var(--accent); color: var(--accent); }
details summary { cursor: pointer; color: var(--link); margin: 6px 0; }

/* ---------- labs, explore, inbox, more ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 16px; color: var(--mid); text-decoration: none; border-radius: 99px; font: 600 13px var(--text); white-space: nowrap; border: 1px solid var(--line); }
.tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.recs { list-style: none; padding: 0; display: grid; gap: 8px; }
.recs a { display: grid; gap: 3px; padding: 14px 16px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; color: var(--hi); text-decoration: none; box-shadow: inset 5px 0 0 var(--maintain); }
.recs a:hover { border-color: var(--line-2); }
.rec-title { font: 600 16px var(--disp); } .rec-why { color: var(--mid); font: 500 12.5px var(--mono); }
.stages { list-style: none; padding: 0; counter-reset: stage; }
.stage { counter-increment: stage; border-top: 1px solid var(--line); padding: 14px 0; }
.stage h3::before { content: counter(stage, decimal-leading-zero) "  "; color: var(--accent); font-family: var(--mono); font-size: 12px; }
.repos { list-style: none; padding: 0; display: grid; gap: 6px; } .repos li { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; font-size: 14.5px; } .repos a { font-family: var(--mono); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.facts > * { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.facts h2 { margin-top: 0; }
.readme { max-height: 60vh; overflow: auto; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.drop { display: grid; place-items: center; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; color: var(--mid); cursor: pointer; margin: 8px 0; }
.drop.over { border-color: var(--accent); color: var(--hi); }
.drop input { display: none; }
.queue { padding-left: 1.2em; } .queue li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; } .queue li.is-done label { opacity: .5; text-decoration: line-through; }
.focus-card { background: var(--bg-0); border: 1px solid var(--line); padding: 14px 16px; border-radius: var(--r); margin-bottom: 10px; }
.focus-card h3 { margin-bottom: 4px; }
.oob td:first-child { white-space: nowrap; }
.more-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.more-list a { display: block; padding: 18px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--hi); text-decoration: none; font: 600 17px var(--disp); }
.more-list a:hover { border-color: var(--line-2); }
.more-list small { display: block; font: 400 13.5px var(--text); color: var(--mid); margin-top: 4px; }

/* ---------- library ---------- */
.shelf { margin-top: 30px; }
.shelf h2 { margin: 0 0 12px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; }
.book-card { display: grid; gap: 10px; text-decoration: none; color: var(--hi); }
.book-card:hover .cover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.book-meta { display: grid; gap: 2px; font-size: 13px; }
.book-name { font: 600 15px/1.2 var(--disp); }
.book-stats { font: 500 11px var(--mono); color: var(--lo); }
.pdf-tag { color: var(--accent); font-weight: 600; }
.cover { --c1: #222; --c2: #555; position: relative; display: flex; flex-direction: column; aspect-ratio: 2 / 3; border-radius: 6px 14px 14px 6px; padding: 14px 12px 12px 16px; overflow: hidden;
  background: radial-gradient(90% 40% at var(--mx, 60%) 100%, rgba(255, 255, 255, .07), transparent 70%), linear-gradient(var(--ang, 160deg), var(--c2), var(--c1) 75%); color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .42), inset 4px 0 0 rgba(0, 0, 0, .28), inset 6px 0 0 rgba(255, 255, 255, .08); transition: transform .25s var(--ease), box-shadow .25s; }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 60% at 90% 0%, rgba(255, 255, 255, .16), transparent 55%); pointer-events: none; }
.cover-shelf { font: 600 8.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.cover-title { font: 700 clamp(15px, 2.2vw, 19px)/1.04 var(--disp); letter-spacing: -.02em; margin-top: 10px; text-wrap: balance; }
.cover-author { margin-top: auto; font: 500 10.5px var(--text); opacity: .85; }
.cover-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .3); }
.cover-bar i { display: block; height: 100%; background: var(--yellow); }
.cover.sm { width: 64px; padding: 7px 6px 6px 9px; border-radius: 3px 8px 8px 3px; }
.cover.sm .cover-title { font-size: 10px; margin-top: 4px; }
.cover.sm .cover-shelf, .cover.sm .cover-author { display: none; }
.cover.lg { width: min(220px, 46vw); padding: 20px 16px 16px 22px; }
.cover.lg .cover-title { font-size: clamp(20px, 3vw, 28px); }
.books-recent { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: auto; }
.book-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; margin-bottom: 22px; }
.book-hero h1 { margin-bottom: 4px; }
.by { color: var(--mid); font-size: 16px; margin-bottom: 12px; }
.stat-row { display: flex; gap: 22px; margin: 10px 0 6px; }
.stat { display: grid; } .stat b { font: 700 28px var(--disp); letter-spacing: -.03em; } .stat small { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lo); }
.copy-box h2 { margin: 0 0 6px; font-size: 17px; }
.copy-box { margin: 10px 0 24px; }
.chapter-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.chapter-list a { display: grid; grid-template-columns: 44px minmax(0, 1fr) 70px 22px; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line); color: var(--hi); text-decoration: none; }
.chapter-list a:hover { border-color: var(--line-2); }
.ch-num { font: 600 12px var(--mono); color: var(--lo); }
.ch-name { font: 500 14.5px/1.3 var(--text); }
.ch-held { height: 4px; border-radius: 99px; background: var(--bg-3); overflow: hidden; } .ch-held i { display: block; height: 100%; background: var(--yellow); }
.ch-tick { color: var(--yellow); font-weight: 700; text-align: center; }
.chapter-list .is-read .ch-name { color: var(--mid); }
.chapter-list .is-resume a { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.ch-handout a { background: linear-gradient(160deg, color-mix(in srgb, var(--yellow) 22%, var(--bg-2)), var(--bg-1)); border-color: color-mix(in srgb, var(--yellow) 50%, var(--line)); }
.ch-handout .ch-num { color: var(--accent); font-size: 16px; }
.assign { list-style: none; padding: 0; display: grid; gap: 8px; } .assign li { display: grid; grid-template-columns: 1fr minmax(180px, 260px); gap: 10px; align-items: center; font: 500 12.5px var(--mono); }

/* reader: sticky-scroll chapters */
body.reading .dock { display: none; }
.reader { --size: 18px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; max-width: 1080px; margin: 0 auto; padding: 96px var(--pad) 140px; }
.reader.size-0 { --size: 16px; } .reader.size-2 { --size: 20.5px; }
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: transparent; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.read-rail { position: sticky; top: 92px; max-height: calc(100dvh - 120px); overflow-y: auto; scrollbar-width: thin; }
.read-rail ol { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.read-rail ol::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.read-rail li a { position: relative; display: block; padding: 4px 0 4px 20px; font: 500 12px/1.35 var(--text); color: var(--lo); text-decoration: none; }
.read-rail li a span { display: none; }
.read-rail li a::before { content: ""; position: absolute; left: 0; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg-0); border: 1px solid var(--line-2); }
.read-rail li.is-read a::before { background: var(--line-2); }
.read-rail li.is-current a { color: var(--hi); }
.read-rail li.is-current a::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); }
.read-rail a:hover { color: var(--hi); }
.read-col { min-width: 0; max-width: 72ch; }
.reader.wide .read-col { max-width: none; }
.read-head { position: relative; margin-bottom: 26px; }
.read-num { display: block; font: 700 clamp(72px, 13vw, 140px)/.85 var(--disp); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px var(--line-2); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.read-head h1 { font-size: clamp(28px, 4.2vw, 42px); }
.read-body { font-size: var(--size); max-width: none; }
.read-body p, .read-body li { line-height: 1.75; }
.read-body em:only-child { color: var(--lo); }
.read-end { height: 2px; }
.read-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; }
.read-tools { position: fixed; right: max(16px, calc((100vw - 1080px) / 2)); bottom: 18px; z-index: 26; display: flex; gap: 6px; padding: 6px; border-radius: 99px; }
.sheet-chapters { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; display: grid; gap: 2px; }
.sheet-chapters a { display: block; padding: 9px 10px; border-radius: 10px; color: var(--hi); text-decoration: none; font-size: 14.5px; }
.sheet-chapters .is-current a { background: var(--bg-2); box-shadow: inset 3px 0 0 var(--accent); }

/* your PDF */
.pdfview { padding: 80px 0 40px; }
.pdf-bar { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 26; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 99px; max-width: calc(100% - 24px); }
.pdf-bar .back { margin: 0; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-page-label { font: 600 12px var(--mono); color: var(--mid); padding: 0 6px; white-space: nowrap; }
.pdf-loading { text-align: center; margin-top: 80px; }
.pdf-pages { width: 100%; max-width: 900px; margin: 60px auto 0; display: grid; gap: 12px; padding: 0 10px; }
.pdf-page { width: 100%; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.pdf-page canvas { display: block; width: 100%; height: auto; }

/* handout */
.handout-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.handout-tools .back { margin: 0; }
.handout { background: var(--bg-1); border: 1px solid var(--line); border-radius: 26px; padding: clamp(20px, 4vw, 40px); max-width: 820px; margin: 0 auto 26px; }
.handout header { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px; }
.handout h1 { margin-bottom: 2px; }
.hmeta { font: 500 11.5px var(--mono); color: var(--lo); margin: 6px 0 0; }
.handout h2 { font-size: 13px; font-family: var(--mono); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 22px 0 10px; }
.master { font: 600 clamp(18px, 2.4vw, 22px)/1.35 var(--disp); letter-spacing: -.01em; }
.hlines { padding-left: 0; list-style: none; counter-reset: hl; display: grid; gap: 6px; margin: 0; }
.hlines li { counter-increment: hl; display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 14px; font-size: 14.5px; line-height: 1.45; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hlines b { font-weight: 600; }
.hwatch, .hdrills, .hq, .answers ol { padding-left: 1.2em; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.5; margin: 0; }
.answers { color: var(--mid); font-size: 13.5px; }
.answers ol { font-size: 13.5px; }

/* ---------- toast, dialogs, palette ---------- */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; background: var(--hi); color: var(--bg-0); padding: 11px 18px; border-radius: 99px; font: 600 14px var(--text); z-index: 60; transition: .25s var(--ease); max-width: 90vw; box-shadow: var(--shadow); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }
dialog { background: var(--bg-1); color: var(--hi); border: 1px solid var(--line-2); border-radius: 24px; padding: 22px; max-width: min(540px, 92vw); width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgb(5 5 7 / .72); backdrop-filter: blur(4px); }
dialog h2 { margin-top: 0; }
.palette { padding: 0; top: 12vh; margin-top: 0; overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: 500 17px var(--text); padding: 16px 18px; background: transparent; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.palette li small { color: var(--lo); font: 500 11.5px var(--mono); }
.palette li[aria-selected="true"] { background: var(--bg-2); box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- small screens: island shrinks, tab bar floats ---------- */
@media (max-width: 900px) {
  .ipills, .dock, .net-label, .isearch span, .isearch kbd { display: none; }
  .island { height: 52px; top: 10px; width: calc(100% - 20px); }
  .isearch { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25; border-radius: 22px; padding: 6px; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0 5px; border-radius: 16px; color: var(--lo); text-decoration: none; font: 600 10.5px var(--text); }
  .tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--hi); background: color-mix(in srgb, var(--hi) 10%, transparent); }
  .tabbar a[aria-current="page"] svg { stroke: var(--accent); }
  .itheme { width: 38px; height: 38px; }
  .page { padding-top: 80px; padding-bottom: 120px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .span-2, .span-3 { grid-column: span 1; } .span-4, .span-6, .m-full { grid-column: span 2; }
  .rows-2 { grid-row: auto; }
  .tile { padding: 15px; border-radius: 20px; }
  .strip-hit { grid-template-columns: 44px minmax(0, 1fr); padding-left: 18px; }
  .strip-meta { display: none; }
  .packlist a { grid-template-columns: 1fr auto; } .pl-meter { display: none; }
  .facts { grid-template-columns: 1fr; }
  .repos li { grid-template-columns: 1fr; gap: 0; }
  .field.inline { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ratings { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 18px; border-radius: 22px; }
  .live { padding: 18px; border-radius: 24px; }
  .reader { grid-template-columns: 1fr; padding-top: 78px; gap: 0; }
  .read-rail { display: none; }
  .read-tools { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .phone-only { display: grid; }
  .book-hero { grid-template-columns: 1fr; gap: 16px; justify-items: start; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .book-card .cover { padding: 10px 8px 9px 11px; border-radius: 4px 10px 10px 4px; }
  .book-card .cover-title { font-size: 13px; margin-top: 2px; }
  .book-card .cover-author { font-size: 9px; }
  .book-meta .book-name, .book-meta > .dim { display: none; }
  .cover.lg { width: 150px; }
  .ring svg { width: 50px; height: 50px; } .ring b { margin-top: -36px; margin-bottom: 15px; }
  .ring-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .chapter-list a { grid-template-columns: 34px minmax(0, 1fr) 22px; }
  .chapter-list .ch-held { display: none; }
  .hlines li { grid-template-columns: 1fr; gap: 2px; }
  .assign li { grid-template-columns: 1fr; }
  .pdf-bar { top: 70px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .bento { grid-template-columns: 1fr; } .span-2, .span-3, .span-4, .span-6 { grid-column: span 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- maths (KaTeX) ---------- */
.katex { font-size: 1.06em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; margin: .8em 0; }
.prose .katex, .card .katex, .lesson .katex { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }
.prose, .card, .lesson { overflow-wrap: anywhere; }
.prose pre, .prose table { overflow-wrap: normal; }

/* ---------- print: handouts on white ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #111; font-size: 11pt; }
  .island, .dock, .tabbar, .no-print, .toast, .read-tools { display: none !important; }
  .page { padding: 0; max-width: none; }
  .handout { background: #fff; border: 0; border-radius: 0; padding: 0; max-width: none; margin: 0 0 10mm; color: #111; break-after: page; }
  .handout:last-child { break-after: auto; }
  .handout h1 { color: #111; font-size: 24pt; }
  .handout h2 { color: #7a5a00; break-after: avoid; }
  .handout .eyebrow, .hmeta, .by, .answers { color: #555; }
  .hlines li { border-bottom-color: #ddd; break-inside: avoid; }
  .master { color: #111; }
  a { color: #111; text-decoration: none; }
}
