:root {
  --ink: #0D1014;
  --paper: #F3F4F1;
  --band: #E8EAE4;
  --card: #FFFFFF;
  --muted: #4A515C;
  --faint: #8A919B;
  --line: #D9DCD4;
  --brand: #EE4E39;
  --brand-text: #BA3D2C;
  --ok: #1F7A4D;
  --warn: #9A6A00;
  --radius: 14px;
  --display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; font-optical-sizing: auto; font-feature-settings: "cv11"; text-rendering: optimizeLegibility; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }

/* Layout */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(243,244,241,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--band); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--paper); }
.who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
main { max-width: 1080px; width: 100%; margin: 0 auto; padding: 40px 24px 96px; flex: 1; }

.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-text); margin: 0 0 10px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.025em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.1; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
.lede { color: var(--muted); font-size: 17px; max-width: 640px; margin: 14px 0 0; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 10px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s ease, background .15s; }
.btn:hover { background: #262B33; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.brand:hover { background: #D9402C; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--band); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--brand-text); border-color: #EBC5BF; }
.btn.danger:hover { background: #FBEDEA; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 600; }
.input, select.input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13,16,20,.08); }
.input.big { font-size: 18px; padding: 14px 18px; font-family: var(--display); font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.error { color: var(--brand-text); font-size: 14px; margin: 8px 0 0; }
.hint { color: var(--faint); font-size: 13px; }

.seg { display: inline-flex; background: var(--band); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; user-select: none; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.static { cursor: default; }
.chip .x { opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--ink); color: var(--paper); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(238,78,57,.55), transparent 65%); }
.auth-hero h1 { font-size: clamp(36px, 4.6vw, 60px); max-width: 520px; position: relative; z-index: 1; }
.auth-hero h1 em { font-style: normal; color: var(--brand); }
.auth-hero .lede { color: #B7BCC4; position: relative; z-index: 1; }
.mini-story { position: relative; z-index: 1; border-left: 2px solid #2A3038; padding-left: 20px; display: grid; gap: 16px; max-width: 440px; }
.mini-story div { font-size: 14px; color: #C9CDD3; }
.mini-story b { display: block; color: var(--paper); font-family: var(--display); font-size: 16px; }
.mini-story .mono { color: var(--brand); }
.auth-pane { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 30px; margin-bottom: 6px; }

/* Onboarding / sources */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps span { height: 4px; width: 48px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--brand); }
.src-group { margin-top: 28px; }
.src-group h3 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.src { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; transition: border-color .15s; }
.src.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.src input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); cursor: pointer; }
.src-name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.src-domain { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.src-scope { grid-column: 2; margin-top: 6px; font-size: 13px; }
.src-scope .pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--band); color: var(--muted); }
.src-scope .pill.lim { background: #FBEDEA; color: var(--brand-text); }
.scope-editor { grid-column: 1 / -1; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.stickybar { position: sticky; bottom: 0; z-index: 5; margin-top: 32px; padding: 14px 0; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -12px 24px -12px rgba(13,16,20,.12); display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* Topics */
.freq { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; width: 100%; }
.freq .input { width: 100%; min-width: 0; text-overflow: ellipsis; }
.freq .input[hidden] { display: none; }

/* Home composer */
.home-h1 { font-size: clamp(26px, 3.6vw, 40px); }
.composer { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 0; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13,16,20,.06); }
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 12px 12px; }
.composer-input::placeholder { color: var(--faint); }
.composer-go { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.composer-go:hover { background: var(--brand); }
.composer-go:disabled { opacity: .5; cursor: default; }
.composer-sum { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-top: 1px solid var(--band); background: transparent; margin-top: 6px; padding: 10px 12px; font-size: 13px; color: var(--muted); cursor: pointer; text-align: left; }
.composer-sum:hover { color: var(--ink); }
.composer-sum svg { transition: transform .15s; }
.composer-sum[aria-expanded="true"] svg { transform: rotate(180deg); }
.composer-opts { padding: 4px 12px 14px; display: grid; gap: 12px; }
.composer-opts[hidden] { display: none; }
.opt { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; }
.opt-label { font-size: 13px; color: var(--muted); }
.opt-ctl { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.opt-ctl .input { padding: 8px 10px; font-size: 14px; }
.opt-ctl input[type=date] { width: auto; max-width: 100%; }
.composer-opts .hint { margin: 0; font-size: 12px; }
.sugg { display: flex; gap: 6px; overflow-x: auto; margin: 12px -24px 0; padding: 0 24px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sugg::-webkit-scrollbar { display: none; }
.sugg-chip { flex: none; white-space: nowrap; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sugg-chip:hover { border-color: var(--ink); color: var(--ink); }

/* Account menu */
.acct { position: relative; }
.acct-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; display: grid; place-items: center; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--ink); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(13,16,20,.12); padding: 6px; z-index: 30; }
.acct-menu[hidden] { display: none; }
.acct-email { font-size: 12px; color: var(--faint); padding: 8px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: transparent; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--band); }
.plan-pill.upgrade { background: transparent; color: var(--brand-text); border: 1px solid var(--brand); }
.plan-pill.upgrade:hover { background: var(--brand); color: #fff; }

.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--band); color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: #E3F2EA; color: var(--ok); }
.status.active::before { animation: pulse 1.6s ease-in-out infinite; }
.status.paused { background: #FFF3D6; color: var(--warn); }
.status.stopped { background: #EDEEEB; color: var(--muted); }
.status.archived { background: #EDEEEB; color: var(--faint); }
.status.idle { background: #EEF0FF; color: #3A47B5; }
@keyframes pulse { 50% { opacity: .3; } }
.empty { text-align: center; padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Topic page */
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 20px; }
.back:hover { color: var(--ink); }
.errbar { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #FBEDEA; color: var(--brand-text); font-size: 13px; }

/* Topic page */
.back { margin-bottom: 14px; font-size: 13px; }
.th-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-cats { font-size: 12px; color: var(--faint); }
.th-title { font-size: clamp(26px, 3.4vw, 38px); margin-top: 8px; }
.th-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.th-bar { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; }
.tb:hover { border-color: var(--ink); }
.tb:disabled { opacity: .6; cursor: default; }
.tb-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tb-primary:hover { background: var(--brand); border-color: var(--brand); }
.tb-icon { width: 34px; padding: 0; justify-content: center; }
.tb svg { flex: none; }
#setToggle svg { transition: transform .15s; color: var(--muted); }
#setToggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.tb .spin { width: 12px; height: 12px; }
.more-wrap { position: relative; }
.more-menu { position: absolute; left: 0; top: calc(100% + 6px); min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(13,16,20,.12); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.more-menu[hidden] { display: none; }
.more-menu .btn { border: 0; background: transparent; justify-content: flex-start; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); width: 100%; }
.more-menu .btn:hover { background: var(--band); }
.more-menu .btn.danger { color: #B42318; }
.th-settings { margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 12px; max-width: 560px; }
.th-settings[hidden] { display: none; }
.th-settings .hint { margin: 0; font-size: 12px; }
.th-settings input[type=date] { width: auto; }

.story { margin-top: 28px; max-width: 760px; }
.story-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.story-head h2 { font-size: 20px; }
.seg-sm button { padding: 5px 11px; font-size: 12px; }
.timeline { position: relative; max-width: 720px; padding-left: 20px; margin-top: 4px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 26px; bottom: 26px; width: 1px; background: var(--line); }
.tl { position: relative; padding: 18px 0 16px; }
.tl + .tl { border-top: 1px solid var(--band); }
.tl::before { content: ""; position: absolute; left: -20px; top: 24px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--paper); }
.tl.new::before { background: var(--brand); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; font-size: 12px; color: var(--faint); }
.tl-meta > * + *::before { content: "·"; margin: 0 6px; color: var(--line); }
.tl-meta b { color: var(--ink); font-weight: 600; }
.tl-new { color: var(--brand-text); font-weight: 600; }
.tl h3 { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 4px 0 6px; }
.tl .narrative { margin: 0; font-size: 16px; line-height: 1.65; color: #252A31; letter-spacing: -.003em; }
.tl .pending { margin: 0; color: var(--muted); font-size: 14px; font-style: italic; }
.tl .topcov { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.tl-src { margin-top: 10px; font-size: 12px; }
.tl-src summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--muted); }
.tl-src summary::-webkit-details-marker { display: none; }
.tl-src summary > span + span::before { content: "·"; margin: 0 6px; color: var(--line); }
.tl-src summary i { font-style: normal; font-size: 10px; color: var(--faint); margin-left: 3px; }
.tl-src summary:hover { color: var(--ink); }
.tl-src summary::after { content: "Show reports"; margin-left: 10px; color: var(--brand-text); font-weight: 500; }
.tl-src[open] summary::after { content: "Hide"; }
.tl-src ul { margin: 8px 0 0; padding-left: 16px; font-size: 13px; }
.tl-src li { margin: 5px 0; }
.tl-src a { text-decoration: none; color: var(--ink); }
.tl-src a:hover { text-decoration: underline; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px); opacity: 0; visibility: hidden; background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 14px; transition: transform .25s ease, opacity .25s ease, visibility .25s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 24px; gap: 32px; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px 0; }
  .logo { font-size: 18px; } .logo-mark { width: 24px; height: 24px; border-radius: 7px; }
  .who { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 0; margin: 0 -8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 9px 10px; border-radius: 0; font-size: 14px; border-bottom: 2px solid transparent; }
  .nav a.active { background: transparent; color: var(--ink); border-bottom-color: var(--ink); }
  .nav a:hover { background: transparent; }
  .sugg { margin: 14px -20px 0; padding: 0 20px 2px; }
  .composer-input { font-size: 16px; }
}



/* PWA / notifications */
.nav a { display: inline-flex; align-items: center; gap: 6px; }
.bell { flex: none; }
.nudge { margin-top: 16px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; font-size: 14px; }
.nudge > svg { color: var(--brand); flex: none; }
.nudge-text { flex: 1; min-width: 0; color: var(--ink); }
.nudge-go { flex: none; font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--brand-text); }
.nudge-go:hover { background: var(--band); }
.nudge-x { flex: none; border: 0; background: transparent; color: var(--faint); font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.nudge-x:hover { background: var(--band); color: var(--ink); }
.ok-line { color: var(--ok); font-weight: 600; }
.steps-list { margin: 8px 0 0; padding-left: 20px; }
.steps-list li { margin: 6px 0; }
.card h3 { margin-bottom: 10px; }
.notify-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--band); }
.notify-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 860px) { .nav-label { display: none; } }
@media (display-mode: standalone) { .topbar { padding-top: env(safe-area-inset-top); } }

/* Plans & billing */
.who-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pill { font-size: 12px; font-weight: 600; text-decoration: none; padding: 5px 11px; border-radius: 999px; background: var(--band); color: var(--ink); white-space: nowrap; }
.plan-pill.plus { background: #FDE9E5; color: var(--brand-text); }
.plan-pill.pro { background: var(--ink); color: var(--paper); }
.meter { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.meter-bar { width: 80px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ink); border-radius: 6px; }
.meter.full .meter-bar i { background: var(--brand); }
.locked-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #FBFBF9; border-style: dashed; }
.locked-card h3 { display: flex; align-items: center; gap: 8px; }
.lock-sm { opacity: .7; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 24px; font-size: 14px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; align-items: stretch; }
.price-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.price-card.featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 18px 40px -24px rgba(13,16,20,.35); }
.price-card.current { background: #FBFBF9; }
.price-card h2 { font-size: 28px; }
.price-card .badge { position: absolute; top: -11px; left: 24px; background: var(--brand); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.amount { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.amount b { font-family: var(--display); font-size: 40px; letter-spacing: -.03em; }
.amount span { color: var(--muted); font-size: 13px; }
.price-card .cta { margin-top: auto; padding-top: 8px; }
.price-card .cta .btn { width: 100%; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,16,20,.45); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--paper); border-radius: 20px; padding: 28px; max-width: 440px; width: 100%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } .who-email { display: none; } }
.tl-meta, .th-meta, .trow-meta, .meter, .plan-pill { font-variant-numeric: tabular-nums; }
.tl.overview::before { background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 4px var(--paper); }
.tl.overview .tl-meta b { color: var(--brand-text); }
.sugg { align-items: center; transition: opacity .15s; }
.sugg.swap { opacity: 0; }
.sugg-label { flex: none; font-size: 12px; font-weight: 600; color: var(--faint); padding-right: 2px; }

/* ===== Type scale & spacing: calm, readable, generous negative space ===== */
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 650; }
.home-h1 { font-size: 28px; }
.th-title { font-size: 32px; line-height: 1.15; margin-top: 10px; }
.th-meta { margin-top: 8px; }
.th-bar { margin-top: 18px; }
.section { margin-top: 44px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 17px; }
.lede { font-size: 15px; line-height: 1.6; }
.story { margin-top: 40px; }
.story-head { padding-bottom: 12px; }
.story-head h2 { font-size: 18px; }
.tl { padding: 26px 0 24px; }
.tl::before { top: 32px; }
.tl h3 { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 6px 0 8px; }
.tl .narrative { font-size: 16px; line-height: 1.7; }
.tl-src { margin-top: 12px; }
.tl-more { padding: 20px 0 4px; text-align: center; }
.tl-more[hidden] { display: none; }

/* ===== Topic list: one quiet card, divided rows ===== */
.tfilter { margin-bottom: 12px; }
.tlist { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.trow { position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr) 32px; gap: 14px; align-items: start; padding: 16px 10px 16px 18px; cursor: pointer; }
.trow[hidden] { display: none; }
.trow + .trow { border-top: 1px solid var(--band); }
.trow:first-child { border-radius: 14px 14px 0 0; }
.trow:last-child { border-radius: 0 0 14px 14px; }
.trow:only-child { border-radius: 14px; }
.trow:hover { background: #FAFAF8; }
.trow-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--line); }
.trow-dot.s-active { background: var(--ok); }
.trow-dot.s-paused { background: var(--warn); }
.trow-dot.s-idle { background: #8C95E6; }
.trow h3 { font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.trow.unread h3 { font-weight: 700; }
.trow.unread h3::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: 2px; }
.trow-latest { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: #3A4048; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trow-meta { display: flex; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--faint); }
.trow-meta span + span::before { content: "·"; margin: 0 6px; }
.trow-note { margin-top: 4px; font-size: 12.5px; color: var(--warn); }
.trow-more { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer; }
.trow-more:hover { background: var(--band); color: var(--ink); }
.trow-menu { position: absolute; right: 10px; top: 50px; z-index: 20; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(13,16,20,.12); padding: 6px; display: flex; flex-direction: column; }
.trow-menu[hidden] { display: none; }
.trow-menu .btn { border: 0; background: transparent; justify-content: flex-start; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); width: 100%; }
.trow-menu .btn:hover { background: var(--band); }
.trow-menu .btn.danger { color: #B42318; }
.tgroup { margin-top: 28px; }
.tgroup[hidden] { display: none; }
.tgroup h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tgroup h4 span { color: var(--faint); font-weight: 500; margin-left: 4px; }

@media (max-width: 860px) {
  main { padding: 26px 20px 96px; }
  h1 { font-size: 24px; line-height: 1.2; }
  .home-h1 { font-size: 22px; }
  .th-title { font-size: 24px; line-height: 1.2; }
  h2 { font-size: 17px; }
  .section { margin-top: 36px; }
  .story { margin-top: 32px; }
  .story-head h2 { font-size: 17px; }
  .tl { padding: 24px 0 22px; }
  .tl h3 { font-size: 16.5px; }
  .tl .narrative { font-size: 15.5px; line-height: 1.65; }
  .trow { padding: 15px 6px 15px 16px; gap: 12px; }
  .trow h3 { font-size: 15.5px; }
  .trow-latest { font-size: 13.5px; }
  .composer { margin-top: 16px; }
  .sugg { margin-top: 14px; }
}

/* Sharing & visibility */
.tl-meta { align-items: center; }
.tl-share { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer; }
.tl-share:hover { background: var(--band); color: var(--ink); }
.tl-meta .tl-share::before { content: none !important; }
.vis-link { font-size: 12.5px; color: var(--muted); align-self: center; overflow-wrap: anywhere; }
.vis-link:hover { color: var(--ink); }

/* Invite page */
.invite-link { display: flex; gap: 8px; margin-top: 10px; }
.invite-link .input { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.invite-share { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.invite-share .btn { display: inline-flex; align-items: center; gap: 6px; }
.invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.invite-stats div { background: var(--card); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.invite-stats b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.invite-stats span { color: var(--faint); font-size: 13px; }
@media (max-width: 640px) { .invite-stats b { font-size: 19px; } .invite-stats div { padding: 12px; } }
.invite { max-width: 640px; }
.invite-share .btn { height: 40px; padding: 0 16px; flex: none; }
.invite-share .icon-btn { width: 40px; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Motion & icons ---------- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1); }
.ic { flex: none; display: inline-block; vertical-align: middle; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@keyframes ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(.7); opacity: .55; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flash { from { background: rgba(238, 78, 57, .07); } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* Page content arrives with a short rise; the first few blocks are staggered */
main > * { animation: rise .42s var(--ease) backwards; }
main > :nth-child(2) { animation-delay: .04s; }
main > :nth-child(3) { animation-delay: .08s; }
main > :nth-child(4) { animation-delay: .12s; }
main > :nth-child(n+5) { animation-delay: .16s; }

/* Topic rows and chapters cascade in */
.trow { animation: rise .4s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms + 80ms); }
.quiet .trow { animation: none; }
.tl { animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* Nav and buttons */
.nav a { transition: background .18s, color .18s; }
.nav a .ic { opacity: .85; }
.btn, .tb, .trow-more, .tl-share, .seg button, .sugg-chip, .composer-go, .acct-btn { transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .15s; }
.btn:active:not(:disabled), .tb:active:not(:disabled), .trow-more:active, .tl-share:active, .sugg-chip:active, .composer-go:active:not(:disabled), .acct-btn:active { transform: scale(.96); }
.composer-go svg { transition: transform .2s var(--ease); }
.composer-go:hover svg { transform: translateX(2px); }
.seg button { transition: background .2s, color .2s, box-shadow .2s; }
.sugg-chip:hover { transform: translateY(-1px); }
.sugg-label { display: inline-flex; align-items: center; gap: 4px; }
.sugg-label .ic { color: var(--brand); }

/* Topbar gains a soft edge once you scroll */
.topbar { transition: box-shadow .2s; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(13, 16, 20, .05); }

/* Menus pop open */
.acct-menu:not([hidden]) { animation: pop .16s var(--ease); transform-origin: top right; }
.trow-menu:not([hidden]) { animation: pop .16s var(--ease); transform-origin: top right; }
.more-menu:not([hidden]) { animation: pop .16s var(--ease); transform-origin: top left; }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 10px; }
.acct-menu .ic, .trow-menu .ic, .more-menu .ic { color: var(--muted); }
.trow-menu .btn.danger .ic, .more-menu .btn.danger .ic { color: inherit; }
.trow-menu .btn, .more-menu .btn { gap: 10px; }
.menu-tag { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--brand-text); background: rgba(238, 78, 57, .09); padding: 2px 7px; border-radius: 999px; }
.th-settings:not([hidden]) { animation: pop .2s var(--ease); transform-origin: top left; }
.tl-src[open] ul { animation: rise .25s var(--ease); }

/* Back link nudges left on hover */
.back { align-items: center; }
.back .ic { transition: transform .2s var(--ease); }
.back:hover .ic { transform: translateX(-3px); }

/* Topic header meta with icons */
.th-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.th-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.th-meta .ic { color: var(--faint); }
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin: 0 2px; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ring 2.4s var(--ease) infinite; }

/* Refresh: the icon itself turns while checking */
.tb.busy .ic, .tb.busy svg { animation: turn .9s linear infinite; }

/* Latest chapter: brand dot with a slow pulse while the story is live */
.tl.latest::before { background: var(--brand); }
.tl.latest.live::after { content: ""; position: absolute; left: -20px; top: 32px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: ring 2.4s var(--ease) infinite; pointer-events: none; }
.tl-latest { color: var(--brand-text); font-weight: 600; }
.tl.new { animation: rise .45s var(--ease) backwards, flash 2.4s ease-out .4s; border-radius: 10px; }

/* Unread topics: the red dot breathes */
.trow.unread h3::after { animation: breathe 2.6s ease-in-out infinite; }
.trow-dot.s-active { box-shadow: 0 0 0 3px rgba(31, 122, 77, .12); }

/* Empty states */
.empty-ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.empty-ic.busy .ic { animation: bob 1.8s ease-in-out infinite; color: var(--brand); }

/* Toast with an icon, springing up */
#toast { display: flex; align-items: center; gap: 10px; transition: transform .35s var(--spring), opacity .2s ease, visibility .2s; }
.toast-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast-ic.check { background: var(--ok); color: #fff; }
.toast-ic.alert { background: var(--brand); color: #fff; }
.toast-ic .ic { width: 12px; height: 12px; stroke-width: 2.6; }

/* Loading skeleton */
.skel { max-width: 760px; }
.skel i { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--band) 0%, #F0F1EC 40%, var(--band) 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-ch { padding: 22px 0; border-bottom: 1px solid var(--band); }
.skel-ch:first-of-type { margin-top: 10px; }

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* Polish fixes */
#toast { width: max-content; max-width: min(520px, calc(100% - 32px)); border-radius: 16px; line-height: 1.4; padding: 11px 18px 11px 12px; }
.acct-menu { min-width: 240px; }
.acct-menu a, .acct-menu button { white-space: nowrap; }
.tl-meta { padding-right: 34px; }
.tl-share { position: absolute; right: -4px; top: 20px; margin: 0; }
@media (max-width: 480px) {
  #setToggle > .ic { display: none; }
  .th-meta { gap: 4px 12px; }
}
.tl-meta > b { order: 0; }
.tl-meta > span { order: 2; }
.tl-meta > .tl-latest, .tl-meta > .tl-new { order: 1; margin: 0 2px 0 8px; padding: 1px 8px; border-radius: 999px; background: rgba(238, 78, 57, .09); font-size: 11px; line-height: 17px; }
.tl-meta > .tl-latest::before, .tl-meta > .tl-new::before { content: none !important; }
@media (max-width: 480px) { .tl-meta > .tl-n { display: none; } }

/* New-topic block: full for new readers, one line once they follow 2+ topics */
.adder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adder-cta { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; color: var(--ink); transition: border-color .15s, box-shadow .2s, transform .12s var(--ease); }
.adder-cta:hover { border-color: var(--ink); box-shadow: 0 6px 20px rgba(13, 16, 20, .06); }
.adder-cta:active { transform: scale(.99); }
.adder-cta[hidden] { display: none; }
.adder-plus { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: background .15s, transform .25s var(--spring); }
.adder-cta:hover .adder-plus { background: var(--brand); transform: rotate(90deg); }
.adder-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adder-text b { font-size: 15px; font-weight: 600; }
.adder-text span { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adder-key { flex: none; font-size: 11px; font-weight: 600; color: var(--faint); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
@media (hover: none), (max-width: 640px) { .adder-key { display: none; } }
/* Open (compact mode): no box around the box. A small header, then the same composer as the full version */
.adder.compact .adder-body:not([hidden]) { animation: pop .22s var(--ease); transform-origin: top center; }
.adder-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.adder-plus.sm { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); }
.adder.compact .composer { margin-top: 10px; box-shadow: 0 6px 24px rgba(13, 16, 20, .06); }
.adder.compact .composer:focus-within { box-shadow: 0 0 0 3px rgba(13, 16, 20, .06), 0 6px 24px rgba(13, 16, 20, .06); }
.adder.compact .sugg { margin-top: 10px; }
.adder-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer; }
.adder-x:hover { background: var(--band); color: var(--ink); }
.adder.compact ~ .section { margin-top: 28px; }
.adder.compact ~ #pushnudge:empty + .section { margin-top: 28px; }

/* Suggestion chips stay short even when a suggestion is long */
.sugg-chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.adder-x { margin-right: -6px; }
@media (max-width: 480px) { .sugg-chip { max-width: 200px; } }

/* "Building your storyline": the logo draws itself on a loop, straight on the page */
.building { display: block; width: 64px; height: 64px; margin: 0 auto 14px; }
.bm-anim { --bm: 4.2s; --draw: cubic-bezier(.45, 0, .25, 1); --soft: cubic-bezier(.33, 0, .2, 1); animation: bm-fade var(--bm) ease-in-out infinite both; }
.bm-anim .bm-bar, .bm-anim .bm-spine { stroke-dasharray: 44 100; }
.bm-anim .bm-spine { animation: bm-spine var(--bm) var(--draw) infinite both; }
.bm-anim .bm-b3 { animation: bm-draw3 var(--bm) var(--draw) infinite both; }
.bm-anim .bm-b2 { animation: bm-draw2 var(--bm) var(--draw) infinite both; }
.bm-anim .bm-b1 { animation: bm-draw1 var(--bm) var(--draw) infinite both; }
.bm-anim .bm-dot, .bm-anim .bm-ring { transform-box: fill-box; transform-origin: center; }
.bm-anim .bm-d3 { animation: bm-pop3 var(--bm) var(--soft) infinite both; }
.bm-anim .bm-d2 { animation: bm-pop2 var(--bm) var(--soft) infinite both; }
.bm-anim .bm-d1 { animation: bm-pop1 var(--bm) var(--soft) infinite both; }
.bm-anim .bm-ring { animation: bm-ring var(--bm) var(--soft) infinite both; }
@keyframes bm-fade { 0%, 84% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes bm-spine { 0%, 2% { stroke-dashoffset: 48; } 66%, 100% { stroke-dashoffset: 0; } }
@keyframes bm-draw3 { 0%, 6% { stroke-dashoffset: 48; } 30%, 100% { stroke-dashoffset: 0; } }
@keyframes bm-draw2 { 0%, 24% { stroke-dashoffset: 48; } 48%, 100% { stroke-dashoffset: 0; } }
@keyframes bm-draw1 { 0%, 42% { stroke-dashoffset: 48; } 66%, 100% { stroke-dashoffset: 0; } }
@keyframes bm-pop3 { 0%, 2% { transform: scale(.4); opacity: 0; } 14%, 100% { transform: scale(1); opacity: .32; } }
@keyframes bm-pop2 { 0%, 20% { transform: scale(.4); opacity: 0; } 32%, 100% { transform: scale(1); opacity: .62; } }
@keyframes bm-pop1 { 0%, 58% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 76%, 100% { transform: scale(1); opacity: 1; } }
@keyframes bm-ring { 0%, 68% { transform: scale(.7); opacity: 0; } 74% { opacity: .45; } 96%, 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bm-anim, .bm-anim * { animation: none !important; stroke-dashoffset: 0 !important; transform: none !important; }
}

/* No timeline spine beside an empty storyline */
.timeline:has(> .empty)::before { display: none; }
.timeline:has(> .empty) { padding-left: 0; }

/* Private beta sign-up */
.beta-row { display: flex; gap: 8px; }
.beta-row .input { flex: 1; min-width: 0; }
.beta-row .btn { flex: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--faint); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.beta-form .ok-line { margin-top: 10px; }

/* Admin waitlist */
.wl { max-width: 720px; }
.wl-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wl-list .empty { border: 0; }
.wl-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--band); cursor: pointer; }
.wl-row:first-child { border-top: 0; }
.wl-row:hover { background: #FAFAF8; }
.wl-row input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.wl-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.wl-meta { font-size: 13px; color: var(--faint); white-space: nowrap; }
.wl-state { width: 18px; display: grid; place-items: center; color: var(--faint); flex: none; }
.wl-state.ok { color: var(--ok); }

/* Report an error */
.tl-acts { position: absolute; right: -4px; bottom: 18px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.tl:hover > .tl-acts, .tl-acts:focus-within { opacity: 1; }
@media (hover: none) { .tl-acts { opacity: .7; } }
.tl-act { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--faint); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.tl-act:hover { background: var(--band); color: var(--ink); }
.tl-act[data-nr]:hover { color: var(--brand-text, #C2371F); }
.report-dlg { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(13, 16, 20, .18); color: var(--ink); background: #fff; }
.report-dlg::backdrop { background: rgba(13, 16, 20, .35); }
.report-dlg[open] { animation: pop .2s var(--ease); }
.report-dlg h2 { font-size: 19px; margin: 0 0 4px; }
.report-dlg textarea { min-height: 96px; resize: vertical; }
.rp-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--band); }
.rp-row:first-child { border-top: 0; }
.rp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rp-where { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-msg { font-size: 15px; line-height: 1.5; }
.rp-row .wl-meta { white-space: normal; }

/* Chapter importance: quiet days are smaller, and runs of them fold into one line */
.tl.minor h3 { font-size: 15px; font-weight: 600; margin: 4px 0 4px; }
.tl.minor .narrative { font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.tl.minor { padding-top: 16px; padding-bottom: 14px; }
.tl-fold { border-top: 1px solid var(--band); animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.tl-fold + .tl, .tl + .tl-fold { border-top: 1px solid var(--band); }
.tl-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-size: 13px; color: var(--faint); }
.tl-fold > summary::-webkit-details-marker { display: none; }
.tl-fold > summary b { color: var(--muted); font-weight: 600; }
.tl-fold > summary::after { content: "Show"; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.tl-fold[open] > summary::after { content: "Hide"; }
.tl-fold > summary:hover { color: var(--ink); }
.tl-fold[open] > .tl:first-of-type { border-top: 0; }
/* A later report corrected this chapter */
.tl-fix { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #FBF4E6; color: #6B4E16; font-size: 13.5px; line-height: 1.5; }
.tl-fix svg { flex: none; margin-top: 2px; }
.tl-fix b { font-weight: 600; margin-right: 4px; }
/* Topic settings: what the storyline covers, suggested official sources */
.opt-brief { align-items: flex-start; }
.opt-brief textarea { font: inherit; width: 100%; resize: vertical; min-height: 72px; font-size: 14px; line-height: 1.5; }
.brief-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.brief-foot .hint { margin: 0; }
.sugsrc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.sugsrc li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.sugsrc li > span { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.sugsrc li > span a { color: var(--faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugsrc li > span svg { flex: none; color: var(--faint); }

/* Admin: golden-set scores */
.q-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.q-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.q-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.q-table td { padding: 10px 12px; border-top: 1px solid var(--band); white-space: nowrap; }
.q-table td b { display: block; font-weight: 600; }
.q-ok { color: #1F7A4D; font-weight: 600; }
.q-miss { color: var(--brand-text); font-weight: 600; }
