/* The Autonomic Wheel companion site.
   Palette from the cover: paper ground, dark-wood ink, stone-grey neutrals, twine ochre, indigo cloth accent,
   vine green and coral for the score bands. Ghost wheels are stone grey on purpose. */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --ground: #EFE4CE;
  --surface: #F8F1E2;
  --surface-2: #E6D9C0;
  --line: #D6C6A6;
  --line-strong: #A89777;
  --ink: #2B221A;
  --ink-2: #5C4E3E;
  --ink-3: #8A7A65;
  --accent: #3E5A8E;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(62, 90, 142, 0.14);
  --twine: #B8862B;
  --wood: #7A4F2A;
  --stone: #8C8A84;
  --coral: #D1705F;
  --ghost: #8C8A84;
  --ghost-fill: rgba(140, 138, 132, 0.12);
  --nail: #9B4A2C;
  --crisis: #B4463A;
  --fragile: #B8862B;
  --patchy: #7E8F3A;
  --solid: #3E5A8E;
  --thriving: #2A7A6B;
  --focus: #3E5A8E;
  --primary: #B84A35; /* 5.2:1 with white text (was #C4553F, 4.45:1) */
  --primary-ink: #FFFFFF;
  --sky: linear-gradient(100deg, #C9BFD9 0%, #A9C3C8 45%, #D9C8A8 100%);
  /* The cover's dusk: lavender-grey sky into teal, over a plum-brown road. Used on the masthead, the book band,
     the story card and the trailer hero, always with the cream --dusk-ink on top. Dark enough for 4.5:1 at small sizes. */
  --dusk: linear-gradient(100deg, #4A4A5C 0%, #5C6670 50%, #46696B 100%);
  --dusk-ink: #F4EEE4; --dusk-ink-2: #E8E2D8; --dusk-warm: #F5DAB6;
  /* One hue per spoke, from the cover's materials: earth, twine, vine, teal, coral, indigo, berry, lavender, wood, sky. */
  --sp-safety: #B5533C; --sp-body: #C08A2B; --sp-sensory: #6B8E3F; --sp-emotion: #2E8B84; --sp-relationships: #D1705F;
  --sp-purpose: #3E5A8E; --sp-play: #C4467A; --sp-learning: #7B5EA7; --sp-habits: #8A6A3C; --sp-authenticity: #3A8FB7;
  --shadow: 0 1px 2px rgba(43, 34, 26, 0.08), 0 10px 28px rgba(43, 34, 26, 0.08);
  --radius: 10px;
  --font-display: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --nav-teal: #7CC4BD; --nav-on-teal: #13302C; --nav-teal-text: #24655F;
  --nav-soft: rgba(47, 138, 130, 0.12); --nav-track: rgba(30, 32, 40, 0.06);
  --bottom-nav-space: 0px;
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.2 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* Dusk, the default since the front page became The Long Road: the cover's evening sky (lavender-grey into
   teal) over a plum road, cream type, streetlight amber for small labels and the cover's coral for actions.
   The paper theme above stays one click away (Theme), and "dark" from older saved settings maps here too. */
:root:not([data-theme="light"]) {
  --ground: #2A2833; --surface: #34323E; --surface-2: #3F3C4A; --line: #4A4757; --line-strong: #67637A;
  --ink: #F4EEE4; --ink-2: #D6CEC4; --ink-3: #A9A1A3; --accent: #86BDB6; --accent-ink: #172524; --accent-soft: rgba(134, 189, 182, 0.16);
  --twine: #EBC79A; --wood: #C49264; --stone: #9A97A0; --coral: #EE8E78; --ghost: #8A8692; --ghost-fill: rgba(138, 134, 146, 0.16); --nail: #E08A62;
  --crisis: #EE8272; --fragile: #EBC07A; --patchy: #B8C76A; --solid: #9DB4E0; --thriving: #6CC4B4; --focus: #EBC79A;
  --primary: #E5735C; --primary-ink: #2A1714; /* dark text on the cover's coral: 5.6:1 (cream was 2.85:1) */
  --sky: linear-gradient(100deg, #4A4A5C 0%, #5C6670 50%, #46696B 100%);
  --dusk: linear-gradient(100deg, #46465A 0%, #56606C 50%, #3F6264 100%);
  --dusk-ink: #F4EEE4; --dusk-ink-2: #E8E2D8; --dusk-warm: #F5DAB6;
  --sp-safety: #E9806A; --sp-body: #E6B65A; --sp-sensory: #A9C46A; --sp-emotion: #66C6BC; --sp-relationships: #F29E8C;
  --sp-purpose: #9DB4E0; --sp-play: #EE84B2; --sp-learning: #B9A2E2; --sp-habits: #CFA676; --sp-authenticity: #78C0E2;
  --shadow: 0 1px 2px rgba(10, 8, 16, 0.4), 0 14px 34px rgba(10, 8, 16, 0.38);
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.86 0 0 0 0 0.8 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --nav-teal-text: #8FD3CC; --nav-soft: rgba(124, 196, 189, 0.16); --nav-track: rgba(255, 255, 255, 0.06);
  --night: linear-gradient(180deg, #3C3D4F 0px, #2F2E3B 520px, #2A2833 1100px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); background-image: var(--paper), var(--night, none); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; padding-inline: 16px; padding-block: 0 56px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
h3, h2.h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.eyebrow { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }
.num { font-variant-numeric: tabular-nums; }
.measure { max-width: 62ch; }
.display-quote { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; }
[hidden] { display: none !important; }

/* Shell */
.shell { max-width: 1240px; margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-inline: -16px; border-bottom: 1px solid var(--line); background: var(--sky); position: relative; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: linear-gradient(90deg, var(--sp-safety), var(--sp-body), var(--sp-sensory), var(--sp-emotion), var(--sp-relationships), var(--sp-purpose), var(--sp-play), var(--sp-learning), var(--sp-habits), var(--sp-authenticity)); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand .cover-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 5px; box-shadow: 0 4px 14px rgba(20, 16, 22, 0.45); }
.brand .title { display: block; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.01em; }
.brand .sub { display: block; font-size: 0.78rem; color: var(--ink-3); }
.masthead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stone); display: inline-block; margin-right: 6px; }
.sync-dot.synced { background: var(--thriving); } .sync-dot.pending { background: var(--twine); } .sync-dot.error { background: var(--crisis); }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1px solid transparent; background: transparent; border-radius: 999px; padding: 8px 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab:hover { background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Variant 1b: one pill track and a caret joining the selected parent to its panel. */
#nav-main { display: flex; width: max-content; max-width: 100%; gap: 2px; padding: 4px; margin-block: 18px 14px; border-radius: 999px; background: var(--nav-track); overflow: visible; }
#nav-main .tab { position: relative; display: flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 0 22px; font-size: 1rem; font-weight: 600; text-decoration: none; }
#nav-main .tab[aria-current] { background: var(--nav-teal); border-color: var(--nav-teal-text); color: var(--nav-on-teal); }
#nav-main[data-has-sub="true"] .tab[aria-current]::after { content: ""; position: absolute; top: calc(100% + 11px); left: 50%; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: var(--surface); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); z-index: 2; pointer-events: none; }
.nav-icon { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav-main .nav-icon { display: none; }
.subnav { position: relative; display: flex; align-items: center; flex-wrap: wrap; width: max-content; min-width: min(100%, 760px); max-width: 100%; gap: 4px; padding: 6px; margin-bottom: 6px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.book-pages, .book-formats { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
#nav-sub .subtab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; max-width: 100%; margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); font-size: 0.875rem; text-decoration: none; }
#nav-sub .subtab:hover { background: var(--nav-track); color: var(--ink); }
#nav-sub .subtab[aria-current="page"] { background: var(--nav-soft); border-color: var(--nav-teal-text); color: var(--ink); font-weight: 700; }
#nav-sub .subtab .nav-icon { color: var(--nav-teal-text); }
.nav-divider { flex: none; width: 1px; height: 20px; background: var(--line-strong); margin-inline: 6px; }
.nav-formats-label { color: var(--ink-2); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; margin-right: 4px; }
.section-nav-page .masthead :is(.btn, input) { min-height: 44px; }
/* Keep this breakpoint in step with nav.js. Book's compact panel renders formats only. */
@media (max-width: 800px) {
  html.section-nav-page { --bottom-nav-space: calc(69px + env(safe-area-inset-bottom, 0px)); scroll-padding-bottom: calc(var(--bottom-nav-space) + 16px); }
  /* Must outrank the later body.realtor reset used by the Drill Library. */
  html.section-nav-page body { padding-bottom: calc(56px + var(--bottom-nav-space)); }
  #nav-main { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 10; width: 100%; margin: 0; padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); gap: 0; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); }
  #nav-main .tab { min-height: 60px; padding: 4px 0; border: 0; border-radius: 12px; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 500; line-height: 1.1; }
  #nav-main .tab[aria-current] { background: transparent; color: var(--nav-teal-text); font-weight: 700; }
  #nav-main .tab[aria-current]::after { display: none; }
  #nav-main .nav-icon { display: block; width: 46px; max-width: 100%; height: 28px; padding: 3px 12px; border-radius: 14px; }
  #nav-main .tab[aria-current] .nav-icon { background: var(--nav-soft); }
  #nav-main .tab:focus-visible { outline-offset: -3px; }
  #nav-sub { width: 100%; min-width: 0; margin-top: 14px; padding: 0 0 4px; border: 0; border-radius: 0; background: transparent; gap: 6px; }
  #nav-sub::before { content: attr(data-section-label); flex-basis: 100%; margin: 0 4px 2px; color: var(--nav-teal-text); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
  #nav-sub .book-formats { display: grid; grid-template-columns: 0.8fr 1.1fr 1.3fr; width: 100%; gap: 4px; }
  #nav-sub .book-formats .subtab { gap: 4px; padding: 8px 4px; font-size: clamp(0.75rem, 3.5vw, 0.875rem); white-space: nowrap; }
  #nav-sub .book-formats .nav-icon { width: 16px; height: 16px; }
  /* Tighter pills on phones so a section's pages fit on two rows (My Wheel's six included). */
  #nav-sub:not(:has(.book-formats)) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  #nav-sub:not(:has(.book-formats))::before { grid-column: 1 / -1; }
  #nav-sub:not(:has(.book-formats)) .subtab { min-height: 42px; padding: 4px 6px; font-size: clamp(0.72rem, 3.3vw, 0.84rem); line-height: 1.15; text-align: center; }
  .section-nav-page :is(input, textarea, select, button, a, [tabindex]) { scroll-margin-bottom: calc(var(--bottom-nav-space) + 16px); }
  .section-nav-page .toast { bottom: calc(var(--bottom-nav-space) + 20px); }
  .section-nav-page .preview-bar { bottom: calc(var(--bottom-nav-space) + 14px); max-height: calc(100dvh - var(--bottom-nav-space) - 28px); overflow-y: auto; }
  .section-nav-page body:has(.preview-bar) { padding-bottom: calc(var(--bottom-nav-space) + 14rem); }
  /* Low on the right edge, just above the bottom menu, so it never sits over the page menu or the page title. */
  .section-nav-page .wobble-tab { min-width: 40px; top: auto; bottom: calc(var(--bottom-nav-space) + 14px); transform: none; padding: 12px 6px; font-size: 0.78rem; }
  .section-nav-page .wobble-panel { top: auto; bottom: calc(var(--bottom-nav-space) + 14px); transform: none; max-height: calc(100dvh - var(--bottom-nav-space) - 32px); overflow-y: auto; }
  html.section-nav-page:has(body.reading-focus) { --bottom-nav-space: 0px; }
}
.site-map { margin-top: 18px; }
.fav > summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.fav > summary::-webkit-details-marker { display: none; }
.fav-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.fav-sum { color: var(--ink-2); font-style: italic; }
.fav-body { margin-top: 10px; }
.fav-body ol { margin: 0; padding-left: 1.3em; }
@media print { .fav { break-inside: avoid; } }
/* Pieces only the paper look shows (papercraft.css turns them on). */
.paper-only { display: none; }
.start-here { margin: 14px 0 26px; }
.start-head h1 { margin: 6px 0 2px; }
.start-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.start-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.start-card .t { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.2; color: var(--ink); text-decoration: none; }
.start-card .t::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.start-card p { margin: 0; color: var(--ink-2); flex: 1; }
.start-card .row { position: relative; z-index: 1; gap: 6px; margin-top: 6px; }
.start-n { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; color: var(--ink-3); }
.start-card:hover { border-color: var(--accent); }
.start-drills { border-top: 4px solid var(--twine); }
.start-book { border-top: 4px solid var(--accent); }
.start-wheel { border-top: 4px solid var(--sp-purpose); }
.start-charts { border-top: 4px solid var(--primary); }
.home-h { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); font-family: var(--font-body); margin: 0 0 8px; }
.today-title { font-size: 2rem; margin: 4px 0; }
.site-map + .book-band { margin-top: 18px; }
@media (max-width: 1040px) { .start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .start-grid { grid-template-columns: 1fr; } }
/* The wobble tab: a small pull tab on the right edge of every page, and the panel it opens. */
.wobble-tab { position: fixed; right: 0; top: 50%; z-index: 20; transform: translateY(-50%); writing-mode: vertical-rl; rotate: 180deg; padding: 14px 7px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 0.82rem; letter-spacing: 0.04em; cursor: pointer; box-shadow: var(--shadow); opacity: 0.85; }
.wobble-tab:hover, .wobble-tab[aria-expanded="true"] { opacity: 1; color: var(--ink); }
.wobble-panel { position: fixed; right: 40px; top: 50%; z-index: 21; transform: translateY(-50%); width: min(300px, calc(100vw - 64px)); display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.wobble-panel p { margin: 0; color: var(--ink-2); }
.wobble-panel .btn { text-align: center; text-decoration: none; }
.wobble-panel .wobble-h { font-family: var(--font-display); font-size: 1.2rem; }
@media (max-width: 560px) { .start-grid { grid-template-columns: 1fr; gap: 10px; } .start-card { padding: 14px; } .start-card .t { font-size: 1.2rem; } }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.map-card { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.map-card:hover { border-color: var(--accent); }
.map-card .t { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.map-card .map-pages { color: var(--ink-3); margin-top: 4px; }
.map-drills, .map-charts { border-color: var(--twine); }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.subtab { border: 0; background: transparent; padding: 8px 12px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }

.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 20px; }
.view-head { display: grid; gap: 6px; max-width: 72ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 9px 14px; cursor: pointer; line-height: 1.2; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-2); }
.btn.danger { color: var(--crisis); }
.btn.sm { padding: 6px 10px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.done { background: color-mix(in srgb, var(--thriving) 16%, transparent); border-color: var(--thriving); color: var(--thriving); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel.lift { box-shadow: var(--shadow); border-color: var(--line-strong); }
.lib-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.lib-more .btn { margin-left: auto; }
.old-videos { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.old-videos > summary { cursor: pointer; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.old-videos[open] > summary { border-bottom: 1px solid var(--line); }
.old-videos > .stack { padding: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.callout { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.callout.example { border-left-color: var(--stone); background: var(--ghost-fill); }
.example-note { font-size: 0.85rem; color: var(--ink-3); margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; font-size: 0.78rem; color: var(--ink-3); border-top: 1px solid var(--line); margin-top: 40px; padding-block: 16px 8px; }
.site-foot a { color: var(--ink-2); }
.notice { border: 1px dashed var(--line-strong); padding: 10px 14px; border-radius: 8px; color: var(--ink-2); }

/* Wheel */
.wheel-layout { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.today-layout { display: grid; grid-template-columns: minmax(300px, 1.3fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.checkin-layout { display: grid; grid-template-columns: minmax(300px, 1.3fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 880px) { .wheel-layout, .today-layout, .checkin-layout { grid-template-columns: minmax(0, 1fr); } .wheel-layout > *, .today-layout > *, .checkin-layout > * { min-width: 0; } .wheel-stage { position: static !important; } }
.wheel-stage { position: sticky; top: 12px; }
.wheel-figure { width: 100%; max-width: 720px; margin: 0 auto; aspect-ratio: 800 / 660; }
.wheel-figure.compact { max-width: 360px; aspect-ratio: 1; }
.wheel-figure svg { width: 100%; height: 100%; display: block; touch-action: none; }
.wheel-figure svg text { font-family: var(--font-body); }
.wheel-figure .spoke-label { font-size: 15px; fill: var(--ink-2); cursor: pointer; font-weight: 700; }
.wheel-figure .spoke-label.active { text-decoration: underline; }
.wheel-figure .spoke-label.compact { font-size: 17px; }
.wheel-figure.compact { max-width: 440px; aspect-ratio: 684 / 552; }
.wheel-figure .ring { fill: none; stroke: var(--line); stroke-width: 1; }
.wheel-figure .rim-seg { fill: none; stroke: var(--stone); stroke-width: 7; stroke-linecap: butt; opacity: 0.8; }
.wheel-figure .spoke { stroke: var(--wood); stroke-width: 2.5; opacity: 0.85; }
.wheel-figure .wedge { opacity: 0.09; }
.wheel-figure .spoke-hit { stroke: transparent; stroke-width: 30; cursor: pointer; }
.wheel-figure .ring-num { font-size: 10px; fill: var(--ink-3); }
.wheel-figure .hub { fill: var(--coral); stroke: var(--surface); stroke-width: 2; }
.wheel-figure .hub-text { font-family: var(--font-display); font-size: 13px; fill: #fff; text-anchor: middle; font-style: italic; }
.wheel-figure .ghost { fill: var(--ghost-fill); stroke: var(--ghost); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linejoin: round; }
.wheel-figure .ghost-dot { fill: var(--surface); stroke: var(--ghost); stroke-width: 1.5; }
.wheel-figure .shape { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.wheel-figure .handle { stroke: var(--surface); stroke-width: 2.5; cursor: grab; }
.wheel-figure .handle.active { stroke: var(--ink); }
.wheel-figure .handle.dragging { cursor: grabbing; }
.wheel-figure .handle-hit { fill: transparent; cursor: grab; }
.wheel-figure .nail-mark { stroke: var(--nail); stroke-width: 2.5; stroke-linecap: round; }
.wheel-figure .nail-head { fill: var(--nail); }
.wheel-figure .drop { stroke: var(--crisis); stroke-width: 2; stroke-dasharray: 2 3; opacity: 0.8; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 0.85rem; color: var(--ink-2); margin-top: 8px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.legend .sw.ghost { border: 1.5px dashed var(--ghost); }
.legend .sw.now { background: var(--accent); }

/* Score bands */
.band-crisis { --band: var(--crisis); } .band-fragile { --band: var(--fragile); } .band-patchy { --band: var(--patchy); } .band-solid { --band: var(--solid); } .band-thriving { --band: var(--thriving); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: var(--band, var(--ink-2)); background: color-mix(in srgb, var(--band, var(--ink-3)) 14%, transparent); letter-spacing: 0.02em; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--band, var(--ink-3)); }
.chip.plain { --band: var(--ink-3); } .chip.accent { --band: var(--accent); } .chip.nail { --band: var(--nail); } .chip.twine { --band: var(--twine); }

/* Sliders with live readout */
.slider { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; height: 28px; }
.slider .readout { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; min-width: 3ch; text-align: right; color: var(--band, var(--ink)); font-variant-numeric: tabular-nums; line-height: 1; }
.slider .readout small { font-size: 0.7rem; font-family: var(--font-body); font-weight: 700; display: block; letter-spacing: 0.06em; text-transform: uppercase; color: var(--band, var(--ink-3)); }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }

/* Spoke rows */
.spoke-list { display: grid; gap: 8px; }
.spoke-row { border: 1px solid var(--line); border-left: 5px solid var(--sp, var(--line)); border-radius: 8px; background: var(--surface); padding: 10px 12px; display: grid; gap: 6px; }
.spoke-row .name { color: var(--sp, var(--ink)); }
.spoke-row.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.spoke-row .top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.spoke-row .name { font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); }
.spoke-row .delta { font-size: 0.8rem; color: var(--ink-3); }
.delta.up { color: var(--thriving); } .delta.down { color: var(--crisis); }
.spoke-row .detail { display: grid; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 0.92rem; color: var(--ink-2); }
.spoke-row .detail .q { color: var(--ink); font-style: italic; font-family: var(--font-display); font-size: 1.05rem; }
.spoke-row .ends { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 0.85rem; }
.spoke-row .ends b { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.spoke-row .flags { display: flex; gap: 6px; flex-wrap: wrap; }

.savebar { display: grid; gap: 10px; }
.savebar .fields { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
@media (max-width: 520px) { .savebar .fields { grid-template-columns: 1fr; } }
input[type="text"], input[type="date"], input[type="email"], input[type="password"], input[type="search"], textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
textarea { min-height: 70px; resize: vertical; }
label.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 0.85rem; color: var(--ink-2); }
label.field > span, .field > span { font-weight: 700; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 0.85rem; color: var(--ink-2); }

/* Reading the shape */
.shape-read { display: grid; gap: 14px; }
.ranked { display: grid; gap: 6px; }
.ranked .r { display: grid; grid-template-columns: 9rem 1fr auto; gap: 10px; align-items: center; font-size: 0.92rem; }
@media (max-width: 480px) { .ranked .r { grid-template-columns: 7rem 1fr auto; } }
.bar { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--band); border-radius: 4px; }
.bar > b { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ghost); }
.profile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.profile .n { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.questions { display: grid; gap: 10px; }

/* Today */
.today-card .q { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.3; }
.panel.tinted { border-top: 6px solid var(--sp); background: linear-gradient(180deg, color-mix(in srgb, var(--sp) 10%, var(--surface)) 0, var(--surface) 140px); }
#today-title { color: var(--sp, var(--ink)); }
.step { border-left: 5px solid var(--sp, var(--line)); }
.step .sh h3, .step .sh h2 { color: var(--sp, var(--ink)); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.week-strip .d { text-align: center; font-size: 0.72rem; padding: 6px 2px; border-radius: 6px; background: color-mix(in srgb, var(--sp, var(--stone)) 16%, transparent); color: var(--ink-2); display: grid; gap: 2px; border-bottom: 3px solid var(--sp, var(--stone)); }
.week-strip .d b { font-family: var(--font-display); font-size: 0.95rem; color: var(--sp, var(--ink)); }
.week-strip .d.today { outline: 2px solid var(--accent); }
.week-strip .d.done { background: color-mix(in srgb, var(--thriving) 18%, transparent); }
.tool-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; gap: 6px; }
.tool-card .h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tool-card .t { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.tool-card .tg { flex-basis: 100%; order: 1; font-family: var(--font-display); font-style: italic; color: var(--ink-2); font-size: 1rem; line-height: 1.35; margin-top: 2px; }
.tool-card .k { order: 2; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 700; }
.tool-card dl { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 0.9rem; }
.tool-card dd { overflow-wrap: anywhere; }
.tool-card dt { color: var(--ink-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; padding-top: 3px; }
.tool-card dd { margin: 0; }
.tool-card .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.filters { gap: 12px; }
.stat-line { font-size: 0.95rem; }
.stat-line b { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }

/* Timeline */
.timeline { display: grid; gap: 12px; margin-top: 12px; }
.scrub { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.scrub input[type="range"] { width: 100%; accent-color: var(--accent); }
.snap-list { display: grid; gap: 8px; }
.snap { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.snap.current { border-color: var(--accent); }
.snap .d { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.snap .n { color: var(--ink-2); font-size: 0.92rem; }
.snap .avg { font-size: 0.8rem; color: var(--ink-3); }
.spark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.spark { border: 1px solid var(--line); border-top: 4px solid var(--sp, var(--line)); border-radius: 8px; padding: 10px; background: var(--surface); display: grid; gap: 4px; }
.spark .t b { color: var(--sp, var(--ink)); }
.spark .t { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; }
.spark svg { width: 100%; height: 48px; display: block; }
.spark .path { fill: none; stroke: var(--sp, var(--accent)); stroke-width: 2; }
.spark .area { fill: var(--sp, var(--accent)); opacity: 0.12; }
.spark .pt { fill: var(--sp, var(--accent)); }
.spark .daily { fill: var(--twine); opacity: 0.7; }
.spark .g { stroke: var(--line); stroke-width: 1; }

/* Nails */
.nail-card { border: 1px solid var(--line); border-left: 3px solid var(--nail); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.nail-card .h { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.nail-card .t { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 0.88rem; background: var(--surface); position: relative; }
.checks label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.checks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checks.nails label:has(input:checked) { background: color-mix(in srgb, var(--nail) 14%, transparent); border-color: var(--nail); color: var(--nail); }

/* Plan */
.keystones { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.keystone { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); display: grid; gap: 6px; }
.keystone .l { font-weight: 700; }
.keystone .hint { font-size: 0.85rem; color: var(--ink-2); }
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.month { border-top: 2px solid var(--twine); padding-top: 8px; font-size: 0.92rem; }
.month b { font-family: var(--font-display); font-size: 1.1rem; }
.checkin { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); display: grid; gap: 4px; font-size: 0.92rem; }
.checkin .d { font-weight: 700; }
.checkin b { color: var(--ink-3); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Check-in steps */
.step { display: grid; gap: 10px; }
.step .sh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.step .sh h3, .step .sh h2 { font-size: 1.3rem; }
.step .qq { display: grid; gap: 4px; }
.step .qq .qt { font-family: var(--font-display); font-size: 1.1rem; }

/* States / emergency */
.states { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.state-btn { text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); cursor: pointer; display: grid; gap: 4px; }
.state-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.state-btn .n { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.state-btn[data-state="overdrive"] { border-top: 5px solid var(--sp-safety); } .state-btn[data-state="underdrive"] { border-top: 5px solid var(--sp-purpose); } .state-btn[data-state="falseokay"] { border-top: 5px solid var(--sp-body); }
.state-btn .tag { font-size: 0.78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.tool-steps { display: grid; gap: 10px; counter-reset: tool; }
.tool-step { display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: start; }
.tool-step::before { counter-increment: tool; content: counter(tool); font-family: var(--font-display); font-size: 1.7rem; color: var(--twine); line-height: 1; }
.tool-step b { display: block; }
.protocol { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.crisis-line { border: 1px solid var(--crisis); border-radius: 8px; padding: 12px 14px; background: color-mix(in srgb, var(--crisis) 8%, transparent); }
.crisis-line b { color: var(--crisis); }
.crisis-list { margin: 0; padding-left: 1.2em; font-size: 0.92rem; display: grid; gap: 4px; }
.crisis-list b { color: var(--ink); }
.breath { display: grid; place-items: center; gap: 10px; padding: 12px; }
.breath .orb { width: 120px; height: 120px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); transform: scale(0.7); transition: transform 4s ease-in-out; }
.breath .orb.in { transform: scale(1); transition-duration: 4s; }
.breath .orb.out { transform: scale(0.7); transition-duration: 8s; }
.breath .phase { font-family: var(--font-display); font-size: 1.2rem; }

/* Library */
.glossary { display: grid; gap: 8px; margin-top: 12px; }
.glossary .g { border-bottom: 1px solid var(--line); padding-block: 8px; }
.glossary .g b { font-family: var(--font-display); font-size: 1.15rem; }
.book-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 800px) { .book-layout { grid-template-columns: 1fr; } }
.toc { display: grid; gap: 2px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.toc button { text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); cursor: pointer; font-size: 0.9rem; }
.toc button[aria-current="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.toc button:hover { background: var(--surface-2); }
.reader { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 48px); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.6; max-width: 72ch; }
.reader h1 { font-size: 2rem; margin-block: 0 0.6em; }
.reader h2 { font-size: 1.5rem; margin-block: 1.4em 0.5em; }
.reader h3 { font-size: 1.25rem; margin-block: 1.2em 0.4em; }
.reader h4 { font-size: 1.1rem; margin-block: 1em 0.3em; font-style: italic; }
.reader p { margin-block: 0 1em; }
.reader blockquote { margin: 1em 0; padding: 0.5em 1em; border-left: 3px solid var(--twine); color: var(--ink-2); font-style: italic; }
.reader hr { border: 0; border-top: 1px solid var(--line); margin-block: 1.5em; }
.reader ul, .reader ol { padding-left: 1.4em; margin-block: 0 1em; }
.reader .table-wrap { overflow-x: auto; margin-block: 1em; font-family: var(--font-body); font-size: 0.9rem; }
.reader table { border-collapse: collapse; min-width: 100%; }
.reader th, .reader td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.reader th { background: var(--surface-2); }
.reader-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; font-family: var(--font-body); }
.reader-meta { font-family: var(--font-body); font-size: 0.8rem; color: var(--ink-3); margin-bottom: 1em; }
.emergency { font-size: 1rem; }
.emergency h1 { font-size: 1.7rem; } .emergency h2 { font-size: 1.3rem; margin-top: 1.2em; }
.emergency .table-wrap { overflow-x: auto; }
.emergency table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.emergency th, .emergency td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }

/* Rolling wheel */
.roll-panel { display: grid; gap: 10px; }
.roll-wrap { border: 1px solid var(--line-strong); border-radius: 10px; overflow-x: auto; overflow-y: hidden; background: var(--surface); }
.roll-wrap canvas { display: block; width: 100%; min-width: 680px; height: auto; }
.road-edit { display: grid; gap: 8px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.road-form { flex-wrap: wrap; } .road-form input[type=text] { flex: 1 1 220px; min-width: 0; } .road-form select, .road-form .btn { flex: 0 0 auto; width: auto; }
.road-chips .chip { --band: var(--sp, var(--ink-3)); font-size: 0.82rem; gap: 8px; }
.road-chips .chip button { all: unset; cursor: pointer; opacity: 0.7; font-weight: 700; padding: 0 2px; } .road-chips .chip button:hover { opacity: 1; }
.road-chips .chip.hill { border: 1px dashed var(--nail); }
#road-suggest .linkish { margin-right: 8px; }

/* Daily session */
.session { position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(4px); overflow: auto; padding: 16px; }
.ses-shell { max-width: 720px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 16px; }
.ses-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.ses-dots { display: flex; gap: 6px; }
.ses-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.ses-dots i.on { background: var(--sp, var(--accent)); }
.ses-body { display: grid; gap: 14px; min-height: 260px; }
.ses-nav { display: flex; justify-content: space-between; }
.ses-q { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.35; }
.ses-why { font-size: 0.92rem; color: var(--ink-2); }
.breath-stage { display: grid; place-items: center; gap: 10px; padding: 12px; }
.breath-stage .orb { width: 160px; height: 160px; border-radius: 50%; background: color-mix(in srgb, var(--sp, var(--accent)) 25%, transparent); border: 3px solid var(--sp, var(--accent)); transform: scale(0.6); transition: transform 1s linear; }
.breath-stage .phase { font-family: var(--font-display); font-size: 1.4rem; }
.breath-stage .count { font-size: 2.2rem; font-family: var(--font-display); color: var(--sp, var(--accent)); font-variant-numeric: tabular-nums; }
.breath-stage .round { font-size: 0.8rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.med-line { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.4; min-height: 4em; text-align: center; padding: 20px 10px; transition: opacity 0.6s; }
.med-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; } .med-bar i { display: block; height: 100%; width: 0; background: var(--sp, var(--accent)); transition: width 0.5s linear; }
.pick { display: grid; gap: 8px; }
.pick label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: var(--surface); }
.pick label:has(input:checked) { border-color: var(--sp, var(--accent)); background: color-mix(in srgb, var(--sp, var(--accent)) 8%, var(--surface)); }
.pick b { display: block; } .pick small { color: var(--ink-2); }
.session-launch { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border-left: 5px solid var(--sp, var(--accent)); }
.session-launch .t { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.session-launch .streak { font-size: 0.85rem; color: var(--ink-2); }
.streak-days { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.streak-days i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); } .streak-days i.on { background: var(--thriving); }
.btn.google { background: #fff; color: #1b1b1b; border-color: #dadce0; }
@media (max-width: 560px) { .session-launch { grid-template-columns: 1fr; } }

/* Listen / watch */
.player .np { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.track-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.track, .book-ch { text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--twine); border-radius: 8px; background: var(--surface); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.track:hover, .book-ch:hover { background: var(--surface-2); }
.track.current, .book-ch.current { border-color: var(--primary); border-left-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent); }
.track .tt, .book-ch .tt { font-weight: 700; }
.book-ch { font: inherit; color: inherit; }
.track.missing { opacity: 0.55; }
.track-h { margin-top: 6px; }
.downloads summary { cursor: pointer; color: var(--ink-2); }
.downloads .row { margin: 8px 0; }
.download-list { columns: 2 260px; margin: 0; padding-left: 18px; }
.download-list li { break-inside: avoid; padding: 2px 0; }
.video-wrap { aspect-ratio: 16 / 9; max-width: 100%; }
.video-card h3, .video-card h2 { font-size: 1.1rem; } .video-wrap iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }
/* Charts: an index beside a reader. Wide book tables arrive as cards (scripts/build-charts.mjs). */
.charts-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.charts-index { display: grid; gap: 16px; position: sticky; top: 12px; }
.charts-group { display: grid; gap: 4px; }
.chart-link { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.chart-link .t { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.2; }
.chart-link:hover { background: var(--surface-2); }
.chart-link[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); }
.charts-reader { display: grid; gap: 14px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.chart-head h2 { margin-top: 2px; }
.chart-find { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.chart-body { display: grid; gap: 18px; }
.chart-group { display: grid; gap: 10px; }
.chart-body h2 { font-size: 1.45rem; margin-top: 8px; }
.chart-body h3 { font-size: 1.25rem; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.chart-body p, .chart-body li { color: var(--ink-2); max-width: 75ch; }
.chart-body ul, .chart-body ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.chart-body hr { display: none; }
.chart-body .lede { font-size: 1.05rem; }
.chart-body .table-wrap { overflow-x: auto; }
.chart-body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.chart-body th, .chart-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.chart-body th { background: var(--surface-2); }
.chart-body td:first-child { font-family: var(--font-display); font-size: 1.02rem; min-width: 9em; }
.chart-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--twine); border-radius: 8px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.chart-card h4 { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.2; }
.chart-card dl { margin: 0; display: grid; gap: 6px; }
.chart-card dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--ink-3); }
.chart-card dd { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.chart-figures { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.chart-figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.chart-figure img { width: 100%; height: auto; display: block; background: #FBF8F1; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.chart-figure figcaption { font-size: 0.9rem; color: var(--ink-2); }
.chart-more { display: grid; gap: 10px; position: relative; padding-top: 8px; }
.chart-more::before { content: ""; position: absolute; left: 0; right: 0; top: -60px; height: 60px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.charts-card { display: grid; gap: 4px; text-decoration: none; color: inherit; border-left: 4px solid var(--twine); }
.charts-card .t { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.charts-card:hover { background: var(--surface-2); }
/* On a narrow screen the index shrinks to titles so the chart itself is close to the top. */
@media (max-width: 880px) { .charts-layout { grid-template-columns: minmax(0, 1fr); } .charts-index { position: static; gap: 10px; } .chart-link { padding: 6px 10px; } .chart-link .small { display: none; } }
@media print { .charts-index, .chart-find, #view-charts .view-head, .chart-more::before { display: none !important; } .charts-layout { display: block; } .chart-card { break-inside: avoid; } }

/* Chapter highlights: the player beside a numbered list, stacked on narrow screens. */
.series { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.series-stage { display: grid; gap: 10px; }
.series-stage video, .series-locked { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #0E0F12; display: block; }
.series-locked { position: relative; overflow: hidden; display: grid; place-items: center; padding: 16px; }
.series-locked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.series-locked .locked { position: relative; max-width: 420px; }
.series-now h3, .series-now h2 { font-size: 1.3rem; }
.series-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.series-item { width: 100%; display: grid; grid-template-columns: 96px minmax(0, 1fr) 1.2em; gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.series-item:hover { background: var(--surface-2); }
.series-item[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); }
.series-item img, .series-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: #0E0F12; display: block; }
.series-text { display: grid; gap: 2px; min-width: 0; }
.series-text .t { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; }
.series-mark { color: var(--ink-3); text-align: center; }
.series-group { font-family: var(--font-display); font-size: 1rem; color: var(--ink-2); padding: 10px 6px 2px; border-top: 1px solid var(--line); }
.series-group:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 880px) { .series { grid-template-columns: minmax(0, 1fr); } .series-list { max-height: none; } }
/* The book, front and center */
.book-band { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--sky); box-shadow: var(--shadow); }
.book-band img { width: 132px; height: 132px; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 28px rgba(20, 16, 22, 0.5); }
.book-band .bt { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.book-band .bs { font-family: var(--font-display); font-style: italic; color: var(--ink-2); }
.book-band .bq { font-size: 0.95rem; color: var(--ink-2); max-width: 60ch; margin-top: 6px; }
.book-band .row { margin-top: 10px; }
/* Dusk surfaces take their look from the cover. The book band also carries the cover itself, blurred, behind it. */
.masthead, .book-band, .story-card { background: var(--dusk); color: var(--dusk-ink); border-color: transparent; }
.masthead .sub, .book-band .eyebrow, .book-band .bs, .book-band .bq, .story-card .eyebrow, .story-card .muted { color: var(--dusk-ink-2); }
.book-band .bs { color: var(--dusk-warm); }
.masthead .btn.quiet { color: var(--dusk-ink-2); }
.masthead .btn.quiet:hover { background: rgba(255, 255, 255, 0.12); }
.book-band { position: relative; overflow: hidden; isolation: isolate; }
.book-band::before { content: ""; position: absolute; inset: -60px; z-index: -1; background: url("assets/cover-320.jpg") center 40% / cover; filter: blur(36px) saturate(1.1); opacity: 0.4; }
@media (max-width: 560px) { .book-band { grid-template-columns: 1fr; } .book-band img { width: 112px; height: 112px; } }
@media (max-width: 560px) {
  .book-band { gap: 14px; padding: 13px 14px; }
  .book-band img { width: 76px; height: 76px; }
  .book-band .bt { font-size: 1.22rem; }
  .book-band .bs { font-size: 0.92rem; }
  .book-band .bq { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.88rem; margin-top: 4px; }
  .book-band .row { margin-top: 8px; gap: 6px; }
  .book-band .row .btn { padding: 6px 11px; font-size: 0.85rem; }
}
.from-book { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 0.82rem; color: var(--ink-3); }
.from-book a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.quote-card { border-left: 3px solid var(--twine); background: color-mix(in srgb, var(--twine) 8%, var(--surface)); }
.quote-card .q { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; line-height: 1.35; }
.author { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.author-cover { width: 180px; max-width: 40vw; border-radius: 6px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .author { grid-template-columns: 1fr; } }
.story-card { display: grid; gap: 4px; text-decoration: none; }
.story-card .t { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.story-card:hover { filter: brightness(1.03); }
a.tab { text-decoration: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.92rem; margin: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); font-size: 0.92rem; opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 10; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }

/* ------------------------------------------------- affirmation, Today tab */
.affirm { border-left: 4px solid var(--sp, var(--twine)); background: linear-gradient(120deg, color-mix(in srgb, var(--sp, var(--twine)) 10%, var(--surface)), var(--surface) 70%); display: grid; gap: 8px; }
.affirm .af { font-family: var(--font-display); font-size: 1.32rem; line-height: 1.38; margin: 0; color: var(--ink); }
.affirm .af-foot { gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------- spoke materials */
.wheel-figure .materials { pointer-events: none; }
.wheel-figure .materials .weathered { opacity: 0.55; filter: saturate(0.45); }
.wheel-figure.has-materials .spoke, .wheel-figure svg.has-materials .spoke { opacity: 0.16; }
.mat-swatch { flex: 0 0 auto; overflow: visible; }
.mat-panel { display: grid; gap: 12px; }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.mat-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; border: 1px solid var(--line); border-left: 4px solid var(--sp, var(--line)); border-radius: 8px; background: var(--surface); padding: 10px 12px; }
.mat-row.weathered { opacity: 0.82; }
.mat-row .mi { display: grid; gap: 4px; min-width: 0; }
.mat-row .n { font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mat-row .mm { font-size: 0.78rem; font-weight: 600; color: var(--sp, var(--ink-3)); text-transform: lowercase; }
.mbar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink-3) 28%, transparent); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--sp, var(--accent)); border-radius: 3px; }
.warn-line { color: var(--fragile); }
.mat-ladder summary { cursor: pointer; font-weight: 700; font-size: 0.92rem; color: var(--accent); }
.mat-ladder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; padding-top: 10px; }
.mat-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.ses-mat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; margin-top: 12px; text-align: left; }
.ses-mat .t { font-weight: 700; }

/* ------------------------------------------------------------- milestones */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.ms { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface); opacity: 0.55; }
.ms.done { opacity: 1; border-color: color-mix(in srgb, var(--solid) 45%, var(--line)); background: color-mix(in srgb, var(--solid) 6%, var(--surface)); }
.ms .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; background: color-mix(in srgb, var(--ink-3) 16%, transparent); color: var(--ink-3); }
.ms.done .mk { background: var(--solid); color: #fff; }

/* ---------------------------------------------------------------- journal */
.journal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.journal-layout > * { min-width: 0; }
.jr-write { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.jr-kind { gap: 6px; flex-wrap: wrap; } .jr-kind .btn { flex: 1 1 auto; min-width: 0; }
.jr-prompt { font-family: var(--font-display); font-size: 1.2rem; font-style: italic; color: var(--ink-2); margin: 0; }
.jr-write textarea { width: 100%; min-width: 0; resize: vertical; }
.jr-read { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; border-left: 3px solid var(--accent); }
.jr-hit { display: grid; gap: 6px; border: 1px solid var(--line); border-left: 4px solid var(--sp, var(--accent)); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.jr-hit p { margin: 0; font-size: 0.94rem; }
.jr-hit.dream { border-left-color: var(--twine); }
.jr-quote { font-style: italic; color: var(--ink-3); font-size: 0.9rem !important; }
.jr-terms { font-size: 0.78rem !important; font-variant: small-caps; letter-spacing: 0.03em; }
.jr-nudge { border-top: 1px dashed var(--line); padding-top: 7px; display: grid; gap: 2px; }
.jr-ask { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.94rem; }
.jr-dreams { display: grid; gap: 4px; }
.jr-up { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; }
.jr-entry { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.jr-entry summary { cursor: pointer; padding: 9px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }
.jr-entry summary .small { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-body { padding: 0 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 0.95rem; }
.jr-body p { margin: 0; white-space: pre-wrap; }
.jr-dream-text { border-left: 3px solid var(--twine); padding-left: 10px; color: var(--ink-2); font-style: italic; display: grid; gap: 2px; }
.jr-spokes { display: grid; gap: 6px; }
.jr-sp { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr) 1.6rem; gap: 8px; align-items: center; font-size: 0.88rem; }
.jr-sp .b { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink-3) 14%, transparent); overflow: hidden; }
.jr-sp .b i { display: block; height: 100%; background: var(--sp, var(--accent)); border-radius: 4px; }
.linkish.danger { color: var(--crisis); margin-left: auto; }
.linkish.sm { font-size: 0.82rem; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 880px) { .journal-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .mat-grid, .ms-grid, .mat-ladder-grid { grid-template-columns: 1fr; }
  .affirm .af { font-size: 1.15rem; }
  .jr-prompt { font-size: 1.06rem; }
  .jr-kind { display: grid; grid-template-columns: minmax(0, 1fr); }
  .jr-sp { grid-template-columns: 4.6rem minmax(0, 1fr) 1.5rem; }
  .ses-mat, .jr-up { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ------------------------------------------------------- welcome / intake */
.intake { position: fixed; inset: 0; z-index: 20; background: var(--ground); background-image: var(--paper); overflow-y: auto; padding: 16px; }
.in-shell { max-width: 940px; margin: 0 auto; display: grid; gap: 14px; padding-block: 8px 40px; }
.in-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.in-top h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }
.in-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.in-nav { display: flex; gap: 10px; }
.in-lede { color: var(--ink-2); max-width: 64ch; }
.in-q { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; }
.in-foot { max-width: 64ch; }
.in-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.in-choices.row-choices { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.in-choice { display: grid; gap: 3px; text-align: left; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); cursor: pointer; color: inherit; font: inherit; transition: border-color 0.15s, background 0.15s; }
.in-choice b { font-size: 1.05rem; }
.in-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.in-choice.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.in-choice.crisis { border-color: var(--crisis); border-style: dashed; }
.in-choice.crisis:hover { background: color-mix(in srgb, var(--crisis) 10%, var(--surface)); border-color: var(--crisis); }
.in-wheel-layout { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.in-wheel-layout > * { min-width: 0; }
.in-wheel-side { position: sticky; top: 12px; display: grid; gap: 10px; justify-items: center; }
.in-readout { text-align: center; }
.in-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.in-row { border: 1px solid var(--line); border-left: 4px solid var(--sp, var(--line)); border-radius: 9px; background: var(--surface); padding: 11px 13px; display: grid; gap: 6px; }
.in-row .h { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.in-row .h b { color: var(--sp, var(--ink)); }
.in-row .v { margin-left: auto; font-size: 1.2rem; font-weight: 700; color: var(--band, var(--ink-2)); }
.in-ask { font-size: 0.88rem; color: var(--ink-2); margin: 0; }
.in-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.74rem; }
.in-ends span { flex: 1 1 0; } .in-ends span:last-child { text-align: right; }
.in-read { display: grid; gap: 10px; }
.in-of-course { font-family: var(--font-display); font-size: 1.45rem; font-style: italic; line-height: 1.3; color: var(--ink); }
.in-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 4px 0 0; font-size: 0.92rem; }
.in-facts dt { color: var(--ink-3); } .in-facts dd { margin: 0; font-weight: 700; }
.in-next { border: 1px solid var(--line-strong); border-left: 5px solid var(--sp, var(--accent)); border-radius: 10px; background: var(--surface); padding: 14px 16px; display: grid; gap: 5px; }
.in-next .t { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--sp, var(--ink)); }
.in-keep { border-top: 1px dashed var(--line-strong); padding-top: 14px; display: grid; gap: 8px; }
@media (max-width: 760px) {
  .in-wheel-layout { grid-template-columns: minmax(0, 1fr); }
  .in-wheel-side { position: static; }
  .in-wheel-side .wheel-figure { max-width: 300px; }
  .in-of-course { font-size: 1.22rem; }
}

/* ------------------------------------------------------------- membership */
.mb-status { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--line-strong); }
.mb-status.on { border-left-color: var(--thriving); background: color-mix(in srgb, var(--thriving) 6%, var(--surface)); }
.mb-status .t { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.mb-list, .mb-grid { display: grid; gap: 8px; }
.mb-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.mb-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.mb-item .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.76rem; font-weight: 700;
  background: color-mix(in srgb, var(--ink-3) 16%, transparent); color: var(--ink-3); }
.mb-item.on .mk { background: var(--thriving); color: #fff; }
.mb-code { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding: 6px 0; }
/* Admin: the classic vs paper look test. */
.ab-split { gap: 6px; align-items: flex-end; }
.ab-split .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ab-days { margin-left: auto; }
.ab-stats .table-wrap { overflow-x: auto; }
.ab-table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.ab-table :is(th, td) { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ab-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.ab-table tbody th { font-weight: 600; }
.mb-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 0.04em; }
.mb-code.off code { opacity: 0.55; }
.mb-joined, .mb-edit { flex-basis: 100%; }
.mb-joined ul { margin: 4px 0 0; padding-left: 18px; }
.mb-bulk > summary { cursor: pointer; color: var(--ink-2); }
.mb-bulk[open] > summary { margin-bottom: 8px; }
.mb-mint { flex-wrap: wrap; align-items: flex-end; }
.mb-mint .field { flex: 0 0 auto; } .mb-mint .field.grow { flex: 1 1 200px; }
.mb-mint input { width: 100%; }
#mb-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.locked { border: 1px dashed var(--line-strong); border-radius: 10px; background: color-mix(in srgb, var(--twine) 6%, var(--surface)); padding: 16px 18px; display: grid; gap: 8px; }
.locked.sm { padding: 12px 14px; }
.lk-head { display: flex; gap: 9px; align-items: center; }
.lk-mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--twine); color: #fff; font-size: 0.72rem; }
.ok-line { color: var(--thriving); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .wobble-tab, .wobble-panel, .tabs, .subnav, .masthead-actions, .savebar, .btn, .subtabs { display: none !important; } body { background: white; color: black; } }

/* Dusk dressing: the masthead sits on the opening painting of The Long Road, the eyebrows take the streetlight
   amber, and panels get a faint top light like the copy panels on the front page. Paper theme is unaffected. */
:root:not([data-theme="light"]) .masthead { background: linear-gradient(90deg, rgba(36, 34, 46, 0.86), rgba(36, 34, 46, 0.55) 55%, rgba(36, 34, 46, 0.78)), url("assets/journey/00.jpg") center 58% / cover; border-bottom-color: transparent; padding-block: 18px; }
:root:not([data-theme="light"]) .masthead::after { height: 3px; opacity: 0.85; }
:root:not([data-theme="light"]) .brand .title { font-size: 1.5rem; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45); }
:root:not([data-theme="light"]) .masthead .sub { color: var(--dusk-warm); letter-spacing: 0.04em; }
:root:not([data-theme="light"]) .eyebrow { color: var(--dusk-warm); letter-spacing: 0.14em; font-weight: 600; }
:root:not([data-theme="light"]) .panel { background: linear-gradient(180deg, rgba(255, 247, 238, 0.035), rgba(255, 247, 238, 0) 120px), var(--surface); }
:root:not([data-theme="light"]) .panel.lift { box-shadow: var(--shadow); }
:root:not([data-theme="light"]) .btn { background: rgba(255, 247, 238, 0.04); }
:root:not([data-theme="light"]) .btn.primary { background: var(--primary); }
:root:not([data-theme="light"]) .btn.quiet { background: transparent; }
:root:not([data-theme="light"]) :is(input[type="text"], input[type="date"], input[type="email"], input[type="password"], input[type="search"], textarea, select) { background: #2B2935; }
:root:not([data-theme="light"]) .book-band::before { opacity: 0.55; }
:root:not([data-theme="light"]) h1 { font-weight: 500; letter-spacing: 0.005em; }
.toc-part { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--twine); margin: 12px 0 2px; padding-inline: 10px; }
.book-files { gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; }
.book-files .row { gap: 6px; flex-wrap: wrap; }

/* My Day: the morning check, tasks and focus, the evening close (day.js). */
.day-bar { align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 0.92rem; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.day-voice { gap: 10px; align-items: center; }
.day-voice select { padding: 4px 8px; font-size: 0.85rem; }
.day-grid { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .day-grid { grid-template-columns: 1fr; } }
.day-states { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.day-state { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.day-state span { color: var(--ink-3); }
.day-state[aria-pressed="true"] { border-color: var(--twine); box-shadow: inset 0 0 0 1px var(--twine); background: color-mix(in srgb, var(--twine) 12%, var(--surface)); }
.task-list { display: grid; gap: 8px; }
.task { border: 1px solid var(--line); border-left: 4px solid var(--sp, var(--line-strong)); border-radius: 8px; padding: 9px 11px; display: grid; gap: 6px; background: var(--surface-2); }
.task.done .task-t { text-decoration: line-through; color: var(--ink-3); }
.task-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.task-main input, .steps input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.task-t { flex: 1 1 12rem; min-width: 0; }
.spoke-chip { --band: var(--sp, var(--ink-3)); }
.task-actions { gap: 4px; flex-wrap: wrap; }
.task-next { padding-left: 28px; }
.steps { margin: 0; list-style: none; padding-left: 28px; display: grid; gap: 4px; font-size: 0.93rem; }
.steps label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.steps label.done { color: var(--ink-3); text-decoration: line-through; }
.task-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-add input[type="text"] { flex: 1 1 14rem; width: auto; }
.task-add .spoke-pick { width: auto; flex: none; }
.mic.on { color: var(--primary); }
.day-dialog { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.day-dialog::backdrop { background: rgba(20, 18, 28, 0.6); }
.bd-row input { flex: 1; }
.focus-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
@media (max-width: 560px) { .focus-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.focus-ring { --p: 0; width: 180px; height: 180px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative;
  background: radial-gradient(closest-side, var(--surface) 84%, transparent 85% 100%), conic-gradient(var(--sp, var(--primary)) calc(var(--p) * 1turn), var(--line) 0); }
.fr-time { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.fr-sub { color: var(--ink-3); }
.focus-line { margin: 0; color: var(--ink-2); }
.focus-check { border: 1px solid var(--twine); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: color-mix(in srgb, var(--twine) 10%, var(--surface)); }
.focus-setup .row input[type="text"] { flex: 1; }
.audiobook-next { border-left: 3px solid var(--twine); }
.day-grid input[type="range"] { flex: 1; accent-color: var(--primary); }
.field-row { gap: 6px; flex-wrap: nowrap; align-items: flex-start; }
.field-row > input, .field-row > textarea { flex: 1; }
.night-line { color: var(--twine); font-size: 1.05rem; }
.reroute-line { gap: 8px; border-bottom: 1px solid var(--line); padding-block: 4px; }

/* ---- The Book: reading controls (site/reader.js) */
.reader { --r-bg: var(--surface); --r-ink: var(--ink); --r-ink-2: var(--ink-2); --r-line-c: var(--line); --r-accent: var(--twine); --r-mark: rgba(235, 199, 154, 0.22);
  background: var(--r-bg); color: var(--r-ink); border-color: var(--r-line-c); max-width: calc(var(--r-width, 70ch) + 2 * clamp(18px, 4vw, 48px)); }
.reader-body { font-family: var(--r-font, var(--font-display)); font-size: var(--r-size, 1.15rem); line-height: var(--r-line, 1.75); word-spacing: var(--r-word, 0); letter-spacing: var(--r-letter, 0); max-width: var(--r-width, 70ch); }
.reader-body h1, .reader-body h2, .reader-body h3, .reader-body h4 { font-family: inherit; line-height: 1.25; }
.reader-body .table-wrap, .reader-body figcaption { font-size: max(0.9rem, calc(var(--r-size, 1.15rem) * 0.78)); }
.reader-body a { color: inherit; }
.reader blockquote { color: var(--r-ink-2); border-left-color: var(--r-accent); }
.reader th, .reader td, .reader hr { border-color: var(--r-line-c); }
.reader .speaking { background: var(--r-mark); box-shadow: 0 0 0 6px var(--r-mark); border-radius: 4px; }
.reader[data-rtheme="paper"]   { --r-bg: #FBF6EC; --r-ink: #2B2620; --r-ink-2: #4B443B; --r-line-c: #DDD2BE; --r-accent: #9C6B3F; --r-mark: rgba(156, 107, 63, 0.16); }
.reader[data-rtheme="sepia"]   { --r-bg: #F1E3C8; --r-ink: #3B2F22; --r-ink-2: #5A4A37; --r-line-c: #D6C3A0; --r-accent: #8A5A2E; --r-mark: rgba(138, 90, 46, 0.18); }
.reader[data-rtheme="night"]   { --r-bg: #16151B; --r-ink: #C9C1B6; --r-ink-2: #A39B90; --r-line-c: #2E2C36; --r-accent: #B8946A; --r-mark: rgba(184, 148, 106, 0.18); }
.reader[data-rtheme="hc-dark"] { --r-bg: #000; --r-ink: #FFF; --r-ink-2: #FFF; --r-line-c: #FFF; --r-accent: #FFD60A; --r-mark: rgba(255, 214, 10, 0.35); }
.reader[data-rtheme="hc-light"]{ --r-bg: #FFF; --r-ink: #000; --r-ink-2: #000; --r-line-c: #000; --r-accent: #0039A6; --r-mark: rgba(255, 214, 10, 0.6); }
.reader[data-rtheme^="hc"] .reader-body a { text-decoration-thickness: 2px; }
.reader[data-rtheme^="hc"] .reader-body img { background: #fff; }
.reader-tools { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: calc(-1 * clamp(18px, 4vw, 48px)) calc(-1 * clamp(18px, 4vw, 48px)) 18px;
  padding: 10px clamp(12px, 3vw, 24px) 12px; background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; font-family: var(--font-body); font-size: 0.9rem; }
.rt-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-size { min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.rt-swatch { border: 2px solid transparent; border-radius: 8px; padding: 2px; background: none; cursor: pointer; }
.rt-swatch[aria-pressed="true"] { border-color: var(--primary); }
.rt-swatch span { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 5px; font-family: var(--font-display); font-size: 1rem; border: 1px solid rgba(127, 127, 127, 0.4); }
[data-swatch="site"] { background: #34323E; color: #F4EEE4; } [data-swatch="paper"] { background: #FBF6EC; color: #2B2620; } [data-swatch="sepia"] { background: #F1E3C8; color: #3B2F22; }
[data-swatch="night"] { background: #16151B; color: #C9C1B6; } [data-swatch="hc-dark"] { background: #000; color: #FFF; font-weight: 700; } [data-swatch="hc-light"] { background: #FFF; color: #000; font-weight: 700; }
.rt-more { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.rt-more[hidden] { display: none; }
.rt-field { display: grid; gap: 2px; font-size: 0.8rem; color: var(--ink-2); }
.rt-field select { width: auto; }
.reader-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.15s linear; }
.reader-meta { color: var(--r-ink-2); font-family: var(--font-body); font-size: 0.85rem; margin-bottom: 12px; }
.resume-note { gap: 10px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid var(--r-line-c); border-radius: 10px; font-family: var(--font-body); font-size: 0.95rem; }
.toc button.read::after { content: " ✓"; color: var(--accent); }
.reader-nav { flex-wrap: wrap; }
@media (max-width: 600px) { .rt-swatch span { width: 30px; height: 28px; } .reader-tools { gap: 8px; } }
/* Focus mode: just the page. */
body.reading-focus .masthead, body.reading-focus .tabs, body.reading-focus .subnav, body.reading-focus .book-head, body.reading-focus .toc, body.reading-focus .site-foot { display: none !important; }
body.reading-focus .book-layout { grid-template-columns: 1fr; }
body.reading-focus .reader { margin-inline: auto; border-radius: 0; min-height: 100vh; }
body.reading-focus { background: var(--ground); }
@media print { .reader-tools, .resume-note, .reader-nav { display: none; } }
.reader-body > * { scroll-margin-top: 110px; }
@media (max-width: 800px) {
  .book-layout .toc { position: static; max-height: none; display: none; }
  .book-layout .toc.open { display: grid; }
  .reader-tools { gap: 6px; padding: 8px 10px; }
  .rt-swatch span { width: 27px; height: 27px; font-size: 0.85rem; }
}
@media (min-width: 801px) { .rt-contents { display: none; } }

/* ---- Your voice edition (site/voice.js) */
.stack-sm { display: grid; gap: 6px; }
.measure-wide { max-width: 760px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.danger-text { color: var(--coral, #E5735C); min-height: 1em; margin: 0; }
.danger-text:empty { display: none; }
label.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: 0.3em; width: 1.1em; height: 1.1em; flex: none; accent-color: var(--primary); }
.voice-how { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.vo-tips, .vo-notes { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.vo-script { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.6; max-height: 46vh; overflow: auto; }
.vo-script p { margin: 0 0 0.8em; } .vo-script .eyebrow { font-family: var(--font-body); margin-bottom: 0.3em; }
.vo-controls { align-items: center; gap: 12px; }
.vo-timer { font-size: 1.4rem; min-width: 4ch; }
.vo-meter { flex: 1; min-width: 80px; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.vo-meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.08s linear; }
.btn.recording { animation: vo-pulse 1.4s ease-in-out infinite; }
@keyframes vo-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 115, 92, 0.3); } }
@media (prefers-reduced-motion: reduce) { .btn.recording { animation: none; } }
.vo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vo-steps li { padding-left: 28px; position: relative; color: var(--ink-3); }
.vo-steps li::before { content: ""; position: absolute; left: 4px; top: 0.35em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); }
.vo-steps li.done { color: var(--ink); } .vo-steps li.done::before { background: var(--accent); border-color: var(--accent); }
.vo-steps li.now { color: var(--ink); } .vo-steps li.now::before { border-color: var(--twine); background: var(--twine); }
/* ---- gift page (site/gift.html) and the gift panel */
.vo-for { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; } .vo-for legend { margin-bottom: 6px; }
.vo-link input { flex: 1; min-width: 0; font-size: 0.85rem; }
.gift-page { padding-top: 24px; }
.gift-wrap { max-width: 720px; margin: 0 auto; gap: 20px; }
.gift-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.gift-cover { width: 140px; height: 140px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.gift-head h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.gift-sub { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--twine); margin: 0; }
.gift-note { margin: 0; padding: 16px 20px; border-left: 3px solid var(--twine); background: var(--surface); border-radius: 0 12px 12px 0; font-family: var(--font-display); font-size: 1.2rem; }
.gift-note p { margin: 0 0 6px; white-space: pre-line; } .gift-note footer { font-family: var(--font-body); color: var(--ink-2); }

/* My practice (practice.js) */
.pr-list, .pr-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pr-list > li, .pr-files > li { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
ol.pr-list { counter-reset: pr; } ol.pr-list > li { counter-increment: pr; } ol.pr-list > li > div:first-child::before { content: counter(pr) ". "; color: var(--ink-3); }
.pr-list .chip, .pr-files .chip { margin-left: 6px; vertical-align: middle; }
.pr-rate .btn { min-width: 44px; }
.pr-player { width: 100%; }
#practice-root select, #practice-root input[type=text] { max-width: 100%; }
.np-skip { gap: 8px; justify-content: center; }
.np-skip .btn { min-width: 44px; min-height: 40px; justify-content: center; flex: 1 1 0; max-width: 180px; }
/* The Listen player stays in view while the chapter list scrolls under it. */
#player { position: sticky; top: 8px; z-index: 6; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
@media (max-width: 640px) {
  #player { top: 0; padding: 10px 12px; gap: 6px; border-top-left-radius: 0; border-top-right-radius: 0; }
  /* The routine resume hint is hidden to save room; a playback error still shows. */
  #player #np-hint:not(.np-error) { display: none; }
  #player .np { font-size: 0.95rem; }
}

/* Join: the band on Home and the join page's two doors (have a code / ask for one). */
.join-band { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 12px 16px; border: 1px dashed var(--twine); border-radius: var(--radius); color: var(--ink-2); text-decoration: none; }
.join-band:hover { border-style: solid; }
.join-band b { color: var(--ink); }
.mb-join { margin-bottom: 4px; }
.mb-join form .field input { width: 100%; }
.mb-pitch { border-top: 4px solid var(--twine); }
.preview-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 12px; background: #2B221A; color: #F8F1E2; box-shadow: 0 6px 24px rgba(0,0,0,0.25); font-size: 0.9rem; }
.preview-bar .btn, .preview-bar .btn:hover, :root:not([data-theme="light"]) .preview-bar .btn { background: #F8F1E2; color: #2B221A; border-color: #F8F1E2; }
.mb-preview { flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.mb-preview p { flex: 1 1 260px; margin: 0; }
.pw-form { border-top: 1px dashed var(--line); padding-top: 12px; }
.pw-form h3, .pw-form h2 { margin: 0; }
.pw-form.asks { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; background: var(--accent-soft); }

/* Light/dark: a sun in dark mode, a moon in light mode */
.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); color: var(--dusk-ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-toggle:hover { background: rgba(255, 255, 255, 0.18); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun { display: none; } .theme-toggle.dark .i-sun { display: block; } .theme-toggle.dark .i-moon { display: none; }

/* The members' entrance in the masthead */
.entrance { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; padding: 6px 6px 6px 12px; border-radius: 999px;
  border: 1px solid rgba(235, 199, 154, 0.55); background: rgba(20, 16, 22, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 18px rgba(20, 16, 22, 0.25); }
.entrance input { width: 9.5rem; min-width: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.1); color: var(--dusk-ink); font-size: 0.88rem; }
.entrance #ent-code { width: 7rem; padding: 7px 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
/* Hint text in boxes: readable on both themes (the browser default grey was 3.1:1 on dusk). */
:root:not([data-theme="light"]) input::placeholder, :root:not([data-theme="light"]) textarea::placeholder { color: var(--ink-3); opacity: 1; }
.entrance #ent-code::placeholder { text-transform: none; letter-spacing: 0; }
.entrance input::placeholder { color: rgba(244, 238, 228, 0.66); }
.entrance input:focus { outline: 2px solid var(--dusk-warm); outline-offset: 1px; background: rgba(255, 255, 255, 0.16); }
.entrance .btn { border-radius: 999px; }
/* The hint sits just under the pill so the boxes stay on one line while they slide. */
.entrance-msg { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; width: max-content; max-width: 24rem; margin: 0; padding: 7px 12px; border-radius: 12px; background: rgba(20, 16, 22, 0.82); font-size: 0.8rem; color: var(--dusk-ink-2); box-shadow: 0 6px 18px rgba(20, 16, 22, 0.3); }
.entrance-msg.warn { color: #F6C2B5; }
/* Step two: the code box folds away, the email slides left into its place, and the password box slides out where the email was. */
.entrance #ent-code, .entrance #ent-pw { transition: max-width .38s ease, flex .38s ease, padding .38s ease, margin .38s ease, opacity .25s ease, border-width .38s ease; max-width: 12rem; }
.entrance:not(.step2) #ent-pw, .entrance.step2 #ent-code { max-width: 0; padding-left: 0; padding-right: 0; border-width: 0; margin-right: -6px; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .entrance #ent-code, .entrance #ent-pw { transition: none; } }
@media (max-width: 760px) {
  .masthead-actions { flex: 1 1 100%; justify-content: space-between; }
  .theme-toggle { position: absolute; top: 14px; right: 14px; }
  .brand { padding-right: 46px; }
  .entrance { flex: 1 1 100%; flex-wrap: wrap; border-radius: 16px; padding: 8px; }
  .entrance-msg { position: static; flex-basis: 100%; width: auto; max-width: none; padding: 2px 4px; background: none; box-shadow: none; }
  .entrance input { flex: 1 1 130px; width: auto; }
  .entrance #ent-code { flex: 0 1 7.5rem; width: auto; }
  .entrance #ent-code, .entrance #ent-pw { max-width: 100%; }
  .entrance:not(.step2) #ent-pw, .entrance.step2 #ent-code { max-width: 0; flex-basis: 0; flex-grow: 0; }
  .entrance .btn { flex: 0 0 auto; }
}

/* The logo: the wheel turns slowly behind the brain, which stays put. */
.logo-spin { position: relative; flex: none; width: 66px; height: 66px; margin: -6px 0; }
.logo-spin img { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo-spin .lw { animation: wheel-turn 90s linear infinite; filter: drop-shadow(0 0 6px rgba(235, 199, 154, 0.35)); }
@keyframes wheel-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo-spin .lw { animation: none; } }

/* Compact the real mobile masthead without hiding its account/referral controls. */
@media (max-width: 760px) {
  :root.section-nav-page .masthead { padding-block: 10px; gap: 8px; }
  :root.section-nav-page .brand { gap: 8px; }
  :root.section-nav-page .logo-spin { width: 44px; height: 44px; margin: 0; }
  :root.section-nav-page .brand .title { font-size: 1.1rem; line-height: 1.2; }
  :root.section-nav-page .brand .sub { font-size: .72rem; line-height: 1.35; letter-spacing: 0; }
  :root.section-nav-page .theme-toggle { top: 8px; }
}

/* ------------------------------------------------ spoken check-in (guided.js) */
.guided .ses-shell { max-width: 880px; }
.gd-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.gd-wheel svg { width: 100%; height: auto; }
.gd-prompt { margin: 0; }
.gd-anchors { white-space: pre-line; }
.gd-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.gd-pad:empty { display: none; }
.gd-n { font: 600 1.35rem/1 var(--font-display); min-height: 54px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--band, var(--line-strong)) 60%, transparent); background: color-mix(in srgb, var(--band, var(--ink-3)) 12%, var(--surface)); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.gd-n:hover, .gd-n:focus-visible { background: color-mix(in srgb, var(--band, var(--ink-3)) 28%, var(--surface)); }
.gd-n.was { box-shadow: 0 0 0 3px var(--sp, var(--accent)); }
.gd-n.band-crisis { --band: var(--crisis); } .gd-n.band-fragile { --band: var(--fragile); } .gd-n.band-patchy { --band: var(--patchy); }
.gd-n.band-solid { --band: var(--solid); } .gd-n.band-thriving { --band: var(--thriving); }
.gd-status { min-height: 1.4em; font-weight: 600; color: var(--ink-2); }
.gd-status.on { color: var(--sp, var(--accent)); animation: gd-pulse 1.4s ease-in-out infinite; }
@keyframes gd-pulse { 50% { opacity: 0.55; } }
.gd-controls { flex-wrap: wrap; gap: 8px; }
.gd-prefs { border-top: 1px solid var(--line); padding-top: 10px; }
.guided-start { display: grid; gap: 14px; justify-items: start; max-width: 720px; }
.gd-big { font-size: 1rem; padding: 11px 18px; }
@media (max-width: 680px) { .gd-grid { grid-template-columns: 1fr; } .gd-wheel { max-width: 250px; margin: 0 auto; width: 100%; } .gd-n { min-height: 46px; } .gd-pad { grid-template-columns: repeat(6, 1fr); } }
@media (prefers-reduced-motion: reduce) { .gd-status.on { animation: none; } }
.gd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.gd-step { position: relative; display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.gd-step-ic { width: 54px; height: 54px; color: var(--accent); }
.gd-step-ic svg { width: 100%; height: 100%; display: block; }
.gd-step:nth-child(2) .gd-step-ic { color: var(--sp-body); } .gd-step:nth-child(3) .gd-step-ic { color: var(--sp-play); } .gd-step:nth-child(4) .gd-step-ic { color: var(--sp-emotion); }
.gd-step-n { position: absolute; top: 8px; left: 10px; font: 700 0.8rem/1 var(--font-body); color: var(--ink-3); }
.gd-step-t { font-weight: 700; line-height: 1.25; }
@media (max-width: 560px) { .gd-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gd-start-card { display: grid; gap: 18px; justify-items: center; width: 100%; max-width: 760px; padding: 18px; }
.gd-start-card .gd-steps { max-width: none; }
.gd-go { display: grid; justify-items: center; gap: 6px; width: min(100%, 220px); }
.gd-go .gd-big { width: 100%; }

/* Readability pass (impeccable scan, 1 Nov 2026). On dusk, spoke-coloured labels lean a little toward cream so
   small text clears 4.5:1; the dots and bars keep the pure spoke colour. */
:root:not([data-theme="light"]) .chip { color: color-mix(in srgb, var(--band, var(--ink-2)) 72%, var(--ink)); }
:root:not([data-theme="light"]) .week-strip .d b { color: color-mix(in srgb, var(--sp, var(--ink)) 72%, var(--ink)); }
:root:not([data-theme="light"]) .map-card .map-pages { color: var(--ink-2); }
/* Long reading text: about 80 characters a line at most on wide screens. */
.glossary .g .small, .emergency p, .emergency li, #lib-emergency .panel p, .view-head > p.muted { max-width: 36em; }
:root:not([data-theme="light"]) .step .sh h2, :root:not([data-theme="light"]) .step .sh h3 { color: color-mix(in srgb, var(--sp, var(--ink)) 72%, var(--ink)); }
/* Quiet buttons on the book band sit over the sky gradient: give them a faint fill so the label always reads. */
.book-band .btn:not(.primary) { background: rgba(20, 16, 22, 0.28); color: var(--dusk-ink); }

/* Before the book is on Amazon: the curtain over the book and the audiobook (app.js, preLaunchCurtain). */
#reader, #tracks { position: relative; z-index: 0; }
.prelaunch { position: absolute; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; min-height: 360px;
  background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 10px; }
.prelaunch-card { max-width: 34rem; text-align: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 28px 24px; box-shadow: 0 18px 40px rgba(0,0,0,0.25); }
.prelaunch-card h2 { margin: 0; text-wrap: balance; }
.prelaunch-card .btn { justify-self: center; }
