  /* Tokens (v2): ground, surface steps, ink, muted, accent amber (next + main action), good green (checked work and earned XP) */
  :root {
    --ground: #101214; --surface: #181B1E; --surface-2: #22262A; --ink: #EDEBE6; --muted: #9C9D98;
    --accent: #F2B544; --accent-ink: #1A1406; --good: #7DBF8E; --line: #2A2E33;
    --r: 14px; --gutter: 16px;
    --fs-xl: 44px; --fs-l: 24px; --fs-m: 18px; --fs-s: 15px; --fs-xs: 13px;
  }
  :root[data-theme="light"] {
    --ground: #F3F2EE; --surface: #FFFFFF; --surface-2: #E9E7E1; --ink: #17191B;
    --muted: #5F615E; --accent: #9A6406; --accent-ink: #FFFFFF; --good: #2F7A47; --line: #DAD8D2;
  }
  html { color-scheme: dark; }
  :root[data-theme="light"] { color-scheme: light; }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  body {
    margin: 0; background: var(--ground); color: var(--ink);
    font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
    font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
    touch-action: manipulation; overflow-x: hidden;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  button, input, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; touch-action: manipulation; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .num { font-variant-numeric: tabular-nums; }
  .wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

  /* Header */
  header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 8px; }
  .date { font-size: var(--fs-m); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
  .date small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); letter-spacing: 0; }
  nav.tabs { display: none; }
  .icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
  .icon-btn .sun { display: none; }
  :root[data-theme="light"] .icon-btn .sun { display: block; }
  :root[data-theme="light"] .icon-btn .moon { display: none; }

  /* Sticky progress strip: the one memorable thing */
  .strip { position: sticky; top: 0; z-index: 6; background: var(--ground); padding: 8px 0; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
  .strip-bar { width: 100%; min-height: 52px; border: 0; border-radius: var(--r); background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 14px; text-align: left; }
  .s-lvl { font-size: var(--fs-s); color: var(--muted); white-space: nowrap; }
  .s-lvl b { color: var(--ink); font-weight: 600; margin-left: 4px; }
  .s-xp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
  .s-streak { margin-left: auto; }
  @media (min-width: 900px) { .s-xp { flex: 0 1 460px; } }
  .s-xpnum { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
  .s-streak { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-s); font-weight: 600; white-space: nowrap; }

  /* Fire = streak (red, warm). Ice = freeze (blue, cool). Earned XP = green (checked work); hatched faded green = saved, counts at tonight's check */
  :root { --fire: #FF5B3A; --fire-core: #FFC34D; --fire-bg: rgba(255, 91, 58, .14); --fire-glow: rgba(255, 91, 58, .55); --ice: #8FDCFF; --ice-bg: rgba(143, 220, 255, .12); --frost: rgba(255, 255, 255, .22); }
  :root[data-theme="light"] { --fire: #C2301A; --fire-core: #F29A1F; --fire-bg: rgba(194, 48, 26, .10); --fire-glow: rgba(194, 48, 26, .25); --ice: #18708F; --ice-bg: rgba(24, 112, 143, .10); --frost: rgba(255, 255, 255, .7); }
  .xpbar { position: relative; flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: var(--ground); overflow: hidden; }
  .xpbar .earned { position: absolute; inset: 0; background: var(--good); transform-origin: left center; transform: scaleX(var(--p, 0)); animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; }
  .xpbar .ghost { position: absolute; top: 0; bottom: 0; left: calc(var(--p, 0) * 100%); width: calc(var(--q, 0) * 100%); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--good) 50%, transparent) 0 3px, color-mix(in srgb, var(--good) 20%, transparent) 3px 6px); animation: ghost-in .6s ease .6s both, breathe 3.2s ease-in-out 1.4s infinite; }
  @keyframes grow { from { transform: scaleX(0); } }
  @keyframes ghost-in { from { opacity: 0; } }
  @keyframes breathe { 50% { opacity: .5; } }
  .flame { flex: 0 0 auto; transform-origin: 50% 90%; filter: drop-shadow(0 0 4px var(--fire-glow)); animation: flicker 1.8s ease-in-out infinite; }
  @keyframes flicker { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 30% { transform: scale(1.05, .95) rotate(1.5deg); } 60% { transform: scale(.96, 1.06) rotate(-1deg); } 80% { transform: scale(1.03, .98) rotate(2deg); } }
  .s-streak .n { color: var(--fire); }
  .s-tonight { font-size: var(--fs-xs); color: var(--good); white-space: nowrap; }
  .s-more { display: none; gap: 14px; font-size: var(--fs-s); color: var(--muted); white-space: nowrap; }
  .s-more b { color: var(--ink); font-weight: 600; margin-left: 4px; }
  @media (min-width: 900px) { .s-more { display: inline-flex; } .s-tonight::after { content: " tonight"; } }
  .chev { color: var(--muted); flex: 0 0 auto; transition: transform .2s ease; }
  .strip-bar[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .strip-bar[aria-expanded="true"] { border-radius: var(--r) var(--r) 0 0; }

  .prog { background: var(--surface); border-radius: 0 0 var(--r) var(--r); padding: 4px 16px 16px; max-height: calc(100dvh - 150px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
  .prog-grid { display: grid; gap: 20px; padding-top: 12px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
  .chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); font-size: var(--fs-s); }
  .chip.fire { background: var(--fire-bg); }
  .chip.fire b { color: var(--fire); font-weight: 600; }
  .chip.ice { background: var(--ice-bg); color: var(--ice); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ice) 35%, transparent); }
  .chip.ice::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, var(--frost) 50%, transparent 65%); transform: translateX(-110%); animation: sheen 6s ease-in-out 1.2s infinite; pointer-events: none; }
  @keyframes sheen { 25%, 100% { transform: translateX(110%); } }
  .aspects { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
  .asp-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--fs-s); }
  .asp-hd b { font-weight: 600; margin-left: 4px; }
  .asp-xp { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
  .prog .xpbar { height: 10px; margin-top: 6px; }
  .asp-ft { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; min-height: 1.5em; }
  .asp-ft .tonight { color: var(--good); }
  .asp-ft .up { color: var(--ink); font-weight: 600; }
  h3 { font-size: var(--fs-s); font-weight: 500; color: var(--muted); margin: 0 0 8px; display: flex; justify-content: space-between; gap: 12px; }
  h3 b { color: var(--ink); font-weight: 600; }
  .ledger { list-style: none; margin: 0; padding: 0; font-size: var(--fs-s); }
  .ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
  .ledger li:first-child { border-top: 0; }
  .ledger li b { font-weight: 600; color: var(--good); white-space: nowrap; }
  .ledger li.pending { color: var(--muted); }
  .ledger li.pending b { color: var(--good); font-weight: 500; opacity: .75; }
  h3 .pend { color: var(--good); font-weight: 500; }
  .ledger .empty { color: var(--muted); display: block; }
  .rule { font-size: var(--fs-xs); color: var(--muted); margin: 10px 0 0; }
  .hide-btn { margin-top: 14px; }

  /* Week rings + heatmap (moved into the strip) */
  .week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-bottom: 14px; }
  .week svg { width: 100%; max-width: 36px; height: auto; display: block; margin: 0 auto 4px; }
  .week span { font-size: var(--fs-xs); color: var(--muted); }
  .week .today span { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
  .heat { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 360px; }
  .heat .col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }
  .heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); display: block; }
  .heat i.l1 { background: color-mix(in srgb, var(--good) 35%, var(--surface-2)); }
  .heat i.l2 { background: color-mix(in srgb, var(--good) 65%, var(--surface-2)); }
  .heat i.l3 { background: var(--good); }
  .heat i.t { outline: 2px solid var(--ink); outline-offset: 1px; }
  .heat-cap { display: flex; justify-content: space-between; max-width: 360px; font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }

  /* Preview switch (design mock only) */
  .preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); margin: 4px 0 12px; }
  .preview a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: var(--fs-s); }
  .preview a[aria-current="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--surface-2); }

  /* Sections */
  .grid { display: grid; gap: 12px; padding-bottom: 24px; }
  .col-main, .col-side { display: grid; gap: 12px; align-content: start; }
  section.block { background: var(--surface); border-radius: var(--r); padding: 16px; }
  h2 { font-size: var(--fs-s); font-weight: 500; color: var(--muted); margin: 0 0 10px; letter-spacing: 0; }
  .hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; }
  .hd h2 { margin: 0; }
  .meta { font-size: var(--fs-xs); color: var(--muted); }
  section.intent { background: transparent; padding: 8px 0 4px; }
  .intent p { margin: 0; font-size: var(--fs-l); line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; max-width: 30ch; }
  .intent .claude { margin-top: 8px; font-size: var(--fs-s); color: var(--muted); font-weight: 400; letter-spacing: 0; max-width: 60ch; }

  /* Next */
  .next-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
  .next-time { font-size: var(--fs-xl); line-height: 0.95; font-weight: 600; letter-spacing: -0.04em; color: var(--accent); margin: 0; }
  .next-time small { font-size: var(--fs-m); letter-spacing: 0; font-weight: 500; }
  .next-in { font-size: var(--fs-s); color: var(--muted); text-align: right; margin: 0; }
  .next-in b { display: block; color: var(--ink); font-size: var(--fs-m); font-weight: 600; }
  .next-title { font-size: var(--fs-m); font-weight: 500; margin: 10px 0 2px; }
  .next-where { font-size: var(--fs-s); color: var(--muted); margin: 0; }

  /* Day line */
  .day { margin-top: 18px; }
  .track { position: relative; height: 40px; border-radius: 8px; background: var(--ground); overflow: hidden; }
  .seg { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; background: var(--surface-2); }
  .seg.done { background: color-mix(in srgb, var(--good) 35%, var(--surface-2)); }
  .seg.is-next { background: var(--accent); }
  .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
  .ticks { position: relative; height: 20px; font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
  .ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
  .ticks span:first-child, .ticks span:last-child { transform: none; }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--muted); margin-top: 10px; }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
  .later { list-style: none; margin: 12px 0 0; padding: 0; font-size: var(--fs-s); }
  .later li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 4px 0; }
  .later time { color: var(--muted); }
  .link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; font-size: var(--fs-s); }

  /* Buttons: one corner shape (10px), flat */
  .btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--surface-2); font-weight: 500; font-size: var(--fs-s); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
  .btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
  .btn:active { transform: scale(.98); }

  /* Collapsed "done" rows */
  details.done > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; font-size: var(--fs-s); color: var(--muted); }
  details.done > summary::-webkit-details-marker { display: none; }
  details.done > summary .tick { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
  details.done > summary .tick svg { color: var(--good); flex: 0 0 auto; }
  details.done > summary .more { white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
  details.done[open] > summary .more-open { display: none; }
  details.done:not([open]) > summary .more-close { display: none; }
  details.past { margin-top: 14px; border-top: 1px solid var(--line); }
  details.past > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; font-size: var(--fs-s); color: var(--ink); }
  details.past > summary::-webkit-details-marker { display: none; }
  details.past > summary .more { color: var(--muted); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
  details.past[open] > summary .more-open, details.past:not([open]) > summary .more-close { display: none; }
  .past-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
  .past-list li { padding: 12px 0; border-top: 1px solid var(--line); }
  .past-list li:first-child { border-top: 0; }
  .past-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .past-day { font-weight: 600; }
  .past-res { font-size: var(--fs-s); color: var(--muted); }
  .past-res.ok { color: var(--good); }
  .past-part { margin-top: 10px; }
  .past-lbl { display: block; font-size: var(--fs-xs); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
  .past-sit, .past-reply { margin: 2px 0 0; overflow-wrap: anywhere; }
  .past-sit { color: var(--muted); }
  .past-endbox { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
  .past-moves { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
  .past-moves li { display: grid; gap: 2px; overflow-wrap: anywhere; }
  .past-move { font-size: var(--fs-s); font-weight: 600; }
  .past-moves li.none { color: var(--muted); font-size: var(--fs-s); }

  /* Drill */
  #drill.is-now { background: var(--surface-2); }
  .now-tag { font-size: var(--fs-s); color: var(--ink); font-weight: 600; margin: 0 0 4px; }
  #drill.is-now textarea { background: var(--surface); }
  .card-q { margin: 0; font-size: var(--fs-m); line-height: 1.55; }
  .card-q b { color: var(--muted); font-weight: 500; }
  .reply-label { display: block; margin: 14px 0 6px; font-size: var(--fs-s); color: var(--muted); }
  textarea { width: 100%; min-height: 88px; resize: vertical; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); padding: 12px; font-size: 16px; line-height: 1.5; }
  .card-foot { font-size: var(--fs-s); color: var(--muted); margin: 10px 0 12px; }
  .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .marks { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
  .marks legend { padding: 0; margin-bottom: 4px; font-size: 14px; color: var(--muted); }
  .mark { display: flex; align-items: center; gap: 12px; }
  .mark-txt { flex: 1; min-width: 0; }
  .mark-txt b { display: block; font-weight: 600; }
  .mark-txt span { display: block; font-size: 14px; color: var(--muted); }
  .grade { display: flex; gap: 6px; flex-shrink: 0; }
  .grade button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 18px; }
  .grade button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
  .status { font-size: var(--fs-s); color: var(--muted); min-height: 1.5em; margin: 8px 0 0; }
  .saved-reply { margin: 8px 0 4px; padding: 12px; border-radius: 10px; background: var(--ground); font-size: var(--fs-s); }
  .saved-reply p { margin: 0 0 6px; }
  .saved-reply p:last-child { margin: 0; }

  /* Cues */
  .cue { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
  .cue-list .cue:first-child { border-top: 0; padding-top: 0; }
  .check { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; transition: transform .18s ease, background-color .18s ease; }
  .check svg { opacity: 0; transform: scale(.6); transition: transform .2s ease, opacity .2s ease; }
  .cue.is-done .check { background: var(--good); border-color: var(--good); color: var(--ground); }
  .cue.is-done .check svg { opacity: 1; transform: scale(1); }
  .cue.is-done .cue-text { color: var(--muted); }
  .cue-aspect { font-size: var(--fs-xs); color: var(--muted); }
  .cue-text { font-size: var(--fs-s); margin: 2px 0 0; }
  .cue-log { display: none; margin-top: 8px; gap: 8px; }
  .cue.is-open .cue-log { display: flex; }
  .cue-log input { flex: 1; min-width: 0; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); padding: 0 12px; font-size: 16px; }
  .rung { font-size: var(--fs-xs); color: var(--muted); }
  .cue-done-list { border-top: 1px solid var(--line); margin-top: 6px; }
  .cue-done-list .cue:first-of-type { border-top: 0; }
  .all-done { color: var(--muted); font-size: var(--fs-s); margin: 0; }

  /* Table Topics: no red; the record button is ink, state is a shape + a word */
  .due { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
  .due b { font-size: var(--fs-l); font-weight: 600; letter-spacing: -0.02em; }
  .due span { color: var(--muted); font-size: var(--fs-s); }
  .tt { display: grid; grid-template-columns: 1fr 56px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
  .tt p { margin: 0; font-size: var(--fs-s); }
  .tt .carried { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
  .tt .tt-state { display: block; font-size: var(--fs-xs); color: var(--ink); font-weight: 500; margin-top: 2px; }
  .rec { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; color: var(--ink); }
  .rec .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: border-radius .2s ease, transform .2s ease; }
  .rec[aria-pressed="true"] { border-color: var(--ink); }
  .rec[aria-pressed="true"] .dot { border-radius: 3px; transform: scale(.9); }
  .tt.is-saved .rec { border-color: var(--good); background: var(--good); color: var(--ground); }
  .tt.is-saved .rec .dot { display: none; }
  .rec .ok { display: none; }
  .tt.is-saved .rec .ok { display: block; }
  .tt .tt-video { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); cursor: pointer; }
  .tt .tt-video input { width: 20px; height: 20px; margin: 0; accent-color: var(--good); flex: none; }
  .tt.is-video .tt-video { color: var(--ink); font-weight: 500; }
  /* Ballot: his score in ink, the main action amber, nothing red */
  .ballot { grid-column: 1 / -1; padding: 12px; border-radius: 10px; background: var(--ground); font-size: var(--fs-s); }
  .b-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .b-total { color: var(--muted); white-space: nowrap; }
  .b-total b { color: var(--ink); font-size: var(--fs-l); font-weight: 600; letter-spacing: -0.02em; }
  .b-src { margin: 2px 0 8px; font-size: var(--fs-xs); color: var(--muted); }
  .b-area { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
  .b-area label { flex: 1; min-width: 0; cursor: pointer; }
  .b-nm { display: block; font-weight: 600; }
  .b-hint { display: block; font-size: var(--fs-xs); color: var(--muted); }
  .b-in { display: flex; align-items: center; gap: 6px; flex: none; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
  .b-in input { width: 64px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 8px; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums; touch-action: manipulation; }
  .b-in input[aria-invalid="true"] { border-color: var(--ink); border-style: dashed; }
  .ballot .b-act { margin-top: 12px; }
  .ballot .grade button { color: var(--ink); touch-action: manipulation; }
  .b-sum { display: flex; gap: 24px; }
  .b-score { margin: 0; display: grid; }
  .b-score span, .b-score small { font-size: var(--fs-xs); color: var(--muted); }
  .b-score b { font-size: var(--fs-l); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
  .b-table, .tts-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--fs-s); }
  .b-table th, .b-table td, .tts-table th, .tts-table td { text-align: left; padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
  .b-table thead th, .tts-table thead th { border-top: 0; font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
  .b-table tbody th, .tts-table tbody th { font-weight: 400; }
  .b-table td, .tts-table td, .b-table thead th + th, .tts-table thead th + th { white-space: nowrap; width: 1%; text-align: right; padding-left: 16px; }
  .b-foot { margin: 10px 0; font-size: var(--fs-xs); color: var(--muted); }
  .tts-day { display: block; font-size: var(--fs-xs); color: var(--muted); }
  .tts-q { display: block; overflow-wrap: anywhere; }

  /* Reading */
  .book { font-size: var(--fs-m); font-weight: 500; margin: 0; }
  .pages { color: var(--muted); font-size: var(--fs-s); margin: 2px 0 12px; }
  .rbar { height: 6px; border-radius: 3px; background: var(--ground); overflow: hidden; }
  .rbar i { display: block; height: 100%; width: 18%; background: var(--ink); }
  .bar-cap { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }

  /* Bottom bar (phone) */
  .bar-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 7; }
  .bar-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: 12px; }
  .bar-nav a[aria-current="page"] { color: var(--ink); }
  .bar-nav a[aria-current="page"] svg { color: var(--accent); }

  @media (max-width: 420px) {
    .ticks .t-mid { display: none; }
    .s-xpnum { display: none; }
    .strip-bar { gap: 10px; }
  }
  @media (min-width: 900px) {
    :root { --gutter: 32px; --fs-xl: 64px; --fs-l: 30px; }
    body { padding-bottom: 0; }
    .bar-nav { display: none; }
    nav.tabs { display: flex; gap: 4px; }
    nav.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: var(--fs-s); }
    nav.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); }
    header.top { padding: 24px 0 12px; }
    .strip-bar { padding: 8px 16px 8px 20px; gap: 20px; }
    .prog { padding: 4px 22px 22px; }
    .prog-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .prog .lvl { font-size: 52px; }
    .grid { grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; padding-bottom: 48px; }
    .col-main, .col-side { gap: 16px; }
    section.block { padding: 22px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
  }

  /* ---- Built site additions (me-site). Write page rules come from the v4c write.html, scoped. ---- */
  a.strip-bar { text-decoration: none; }
  .hdr-r { display: flex; align-items: center; gap: 10px; }
  .sync { font-size: var(--fs-xs); color: var(--muted); text-align: right; margin: 0; }
  .sync b { display: block; color: var(--ink); font-weight: 500; font-size: var(--fs-s); }
  @media (max-width: 420px) { .sync { display: none; } }
  .targets { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
  .targets button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-size: var(--fs-s); color: var(--muted); }
  .targets button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 500; }
  .q-pick { display: none; margin-bottom: 12px; }
  .q-pick.is-on { display: block; }
  .q-pick label, .field-label { display: block; font-size: var(--fs-s); color: var(--muted); margin-bottom: 6px; }
  select { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); padding: 0 12px; font-size: 16px; }
  .composer textarea { min-height: 160px; padding: 14px; font-size: 18px; line-height: 1.6; }
  .composer textarea:focus { border-color: var(--muted); }
  .composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
  .tomorrow { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-s); color: var(--muted); cursor: pointer; }
  .tomorrow input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
  .lands { font-size: var(--fs-xs); color: var(--muted); margin: 10px 0 0; }
  .status.ok { color: var(--good); }
  .queue { list-style: none; margin: 0; padding: 0; }
  .queue li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
  .queue li:first-child { border-top: 0; padding-top: 0; }
  .queue .text { grid-column: 1 / -1; font-size: var(--fs-s); margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
  .queue .tgt { grid-row: 2; grid-column: 1; align-self: center; font-size: var(--fs-xs); color: var(--muted); }
  .queue .state { grid-row: 2; grid-column: 2; min-height: 44px; display: flex; align-items: center; gap: 4px; }
  .queue .edit { grid-column: 1 / -1; display: grid; gap: 8px; }
  .queue .edit .row { display: flex; gap: 8px; flex-wrap: wrap; }
  .pill { font-size: var(--fs-xs); color: var(--muted); }
  .pill.ok { color: var(--good); }
  .icon-btn.ghost-btn { background: transparent; color: var(--muted); }
  .icon-btn.ghost-btn:hover { background: var(--surface-2); color: var(--ink); }
  .note h3 { font-size: var(--fs-s); font-weight: 600; margin: 16px 0 6px; }
  .note h3:first-child { margin-top: 0; }
  .note p, .note li { font-size: var(--fs-s); margin: 0 0 4px; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); overflow-wrap: anywhere; }
  .note ul { margin: 0; padding-inline-start: 20px; }
  .note .q { color: var(--muted); font-size: var(--fs-xs); }
  .note details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--ink); font-size: var(--fs-s); }
  .note .site-block { margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--ground); }
  .note .site-block li { color: var(--ink); }
  .note .done-task { text-decoration: line-through; color: var(--muted); }
  @media (min-width: 900px) { .composer textarea { min-height: 220px; } }
  /* Loading and error states */
  .loading { color: var(--muted); font-size: var(--fs-s); padding: 24px 0; }
  .alert { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin: 0 0 12px; font-size: var(--fs-s); }
  .alert b { display: block; margin-bottom: 2px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* Chat: command buttons */
  .cmds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .cmds li { background: var(--surface); border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
  .cmds code { font-family: inherit; font-weight: 600; font-size: var(--fs-m); }
  .cmds .what { grid-column: 1; font-size: var(--fs-s); color: var(--muted); margin: 0; }
  .cmds .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  @media (max-width: 420px) { .cmds li { grid-template-columns: 1fr; } .cmds .acts { grid-row: auto; grid-column: 1; justify-content: flex-start; } }
  .login { max-width: 420px; margin: 12vh auto 0; }
  .login input { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); padding: 0 14px; font-size: 16px; margin: 6px 0 12px; }
  .empty { color: var(--muted); font-size: var(--fs-s); margin: 0; }
  .single { max-width: 720px; display: grid; gap: 12px; padding-bottom: 96px; }
  .single .block p { margin: 0; }
  .login .btn.primary { width: 100%; justify-content: center; }
  .note audio, .tt audio { display: block; }
  @media (min-width: 900px) { .single { padding-bottom: 48px; } }

/* Quote for today */
.quote blockquote { margin: 0 0 .6rem; padding-inline-start: .8rem; border-inline-start: 3px solid var(--accent, currentColor); font-size: 1.05rem; line-height: 1.5; }
.quote p { margin: .35rem 0; }
/* Mokhbir Pro on Today: the summary as written; each lesson folds open */
.read-go { margin: 14px 0 0; }
