/* knowbase: dense newsroom wall.
   Amber accent marks "new" and hot items. Each section has its own hue so groups are
   recognizable at a glance. Green/red in the strip mean real state (markets, status).
   Radius system: panes and cards 10px, chips, badges and buttons full pill. */

:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --surface-2: #eceef0;
  --line: #dde1e4;
  --text: #15181b;
  --muted: #5b636a;
  --faint: #8a9298;
  --accent: #a8670c;
  --accent-soft: rgb(168 103 12 / 0.12);
  --up: #1d7a4c;
  --down: #c03a33;
  --warn: #a8670c;
  --shadow: 0 1px 2px rgb(20 24 28 / 0.06);
  --radius: 10px;
  --font: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono Variable', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --pane-h: 560px;
  --c-growth: #8f6b00;
  --c-news: #2563b0;
  --c-ai: #6d4fc4;
  --c-security: #c03a33;
  --c-pulse: #b5631b;
  --c-chess: #a8407a;
  --c-local: #1d7a4c;
  --c-knowledge: #1b7f88;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0f11;
    --surface: #14171a;
    --surface-2: #1b1f23;
    --line: #262b30;
    --text: #e4e7ea;
    --muted: #949ca3;
    --faint: #6a7279;
    --accent: #e0a43a;
    --accent-soft: rgb(224 164 58 / 0.13);
    --up: #4cb782;
    --down: #ef6b62;
    --warn: #e0a43a;
    --shadow: none;
    --c-growth: #e2b84a;
    --c-growth: #e2b84a;
  --c-news: #6aa5ec;
    --c-ai: #a990ee;
    --c-security: #ef6b62;
    --c-pulse: #eb9a52;
    --c-chess: #e383b2;
    --c-local: #52c08a;
    --c-knowledge: #4cc2cb;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0d0f11;
  --surface: #14171a;
  --surface-2: #1b1f23;
  --line: #262b30;
  --text: #e4e7ea;
  --muted: #949ca3;
  --faint: #6a7279;
  --accent: #e0a43a;
  --accent-soft: rgb(224 164 58 / 0.13);
  --up: #4cb782;
  --down: #ef6b62;
  --warn: #e0a43a;
  --shadow: none;
  --c-growth: #e2b84a;
  --c-news: #6aa5ec;
  --c-ai: #a990ee;
  --c-security: #ef6b62;
  --c-pulse: #eb9a52;
  --c-chess: #e383b2;
  --c-local: #52c08a;
  --c-knowledge: #4cc2cb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar {
  display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--text); color: var(--bg); font: 700 12px/1 var(--mono);
}
.brand-name { font-size: 15px; }
.jump { display: flex; gap: 2px; }
.jump a {
  padding: 6px 10px; border-radius: 999px; color: var(--muted); font-size: 13px;
  transition: background-color .2s, color .2s;
}
.jump a:hover { background: var(--surface-2); color: var(--text); }
.jump a::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px;
  background: var(--hue);
}
.jump a[href='#today'] { --hue: var(--c-growth); }
.jump a[href='#news'] { --hue: var(--c-news); }
.jump a[href='#ai'] { --hue: var(--c-ai); }
.jump a[href='#security'] { --hue: var(--c-security); }
.jump a[href='#pulse'] { --hue: var(--c-pulse); }
.jump a[href='#chess'] { --hue: var(--c-chess); }
.jump a[href='#local'] { --hue: var(--c-local); }
.jump a[href='#knowledge'] { --hue: var(--c-knowledge); }
.clocks { display: flex; gap: 16px; margin-left: auto; font: 12px/1.2 var(--mono); }
.clock { display: flex; flex-direction: column; align-items: flex-end; }
.clock b { font-weight: 500; font-size: 13px; color: var(--text); }
.clock span { color: var(--faint); font-size: 10.5px; }
.weather { display: flex; align-items: center; gap: 8px; font: 12px/1.2 var(--mono); color: var(--muted); }
.weather i { font-size: 20px; color: var(--accent); }
.weather b { color: var(--text); font-weight: 500; font-size: 13px; }
.controls { display: flex; gap: 4px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: transform .15s, border-color .2s, background-color .2s;
}
.pill-btn:hover { border-color: var(--text); }
.pill-btn:active { transform: scale(0.97); }
.pill-btn[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill-btn i { font-size: 15px; }

/* ---------- strip ---------- */
.strip {
  display: flex; align-items: center; gap: 24px;
  padding: 8px 20px; border-bottom: 1px solid var(--line);
  font: 12px/1.3 var(--mono); overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.tickers, .statuses { display: flex; gap: 18px; }
.ticker { display: flex; gap: 6px; align-items: baseline; }
.ticker .n { color: var(--muted); }
.ticker .v { font-variant-numeric: tabular-nums; }
.ticker .c { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.statuses { padding-left: 18px; border-left: 1px solid var(--line); }
.status { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status[data-s='none']::before { background: var(--up); }
.status[data-s='minor']::before, .status[data-s='maintenance']::before { background: var(--warn); }
.status[data-s='major']::before, .status[data-s='critical']::before { background: var(--down); }
.freshness { margin-left: auto; color: var(--faint); }

/* ---------- groups & grid ---------- */
main { padding: 8px 20px 40px; max-width: 2200px; margin: 0 auto; }
.group { padding-top: 28px; }
.group[data-hue='growth'] { --hue: var(--c-growth); }
.group[data-hue='news'] { --hue: var(--c-news); }
.group[data-hue='ai'] { --hue: var(--c-ai); }
.group[data-hue='security'] { --hue: var(--c-security); }
.group[data-hue='pulse'] { --hue: var(--c-pulse); }
.group[data-hue='chess'] { --hue: var(--c-chess); }
.group[data-hue='local'] { --hue: var(--c-local); }
.group[data-hue='knowledge'] { --hue: var(--c-knowledge); }
.group h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.group h2::before { content: ''; width: 4px; height: 20px; border-radius: 2px; background: var(--hue); }
.grid-contents { display: contents; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* Wide screens: fixed column count per group so rows fill evenly. */
@media (min-width: 1200px) {
  .grid[data-cols] { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}

/* ---------- pane ---------- */
.pane {
  display: flex; flex-direction: column; height: var(--pane-h); min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--hue, var(--line));
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.pane-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px 9px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--hue, var(--surface)) 10%, var(--surface));
}
.pane-head .pi { font-size: 16px; color: var(--hue); }
.pane-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-meta { font: 11px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.pane-meta.stale { color: var(--down); }
.pane-btn {
  display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 999px;
  background: transparent; color: var(--faint); cursor: pointer;
}
.pane-btn:hover { background: var(--surface-2); color: var(--text); }
.pane-btn[aria-pressed='true'] { color: var(--accent); }
/* The page owns the mouse wheel. A pane takes the wheel only after you click into it
   (or Tab to it), and lets go when the pointer leaves or Esc is pressed. */
.viewport { position: relative; flex: 1; overflow: hidden; scrollbar-width: thin; }
.viewport.engaged { overflow-y: auto; overscroll-behavior: contain; box-shadow: inset 0 0 0 2px var(--hue, var(--accent)); }
.scroll-hint {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; pointer-events: none;
  padding: 3px 9px; border-radius: 999px; font: 500 11px/1.4 var(--mono);
  background: var(--text); color: var(--bg); opacity: 0; transform: translateY(4px);
  transition: opacity .2s, transform .2s;
}
.pane { position: relative; }
.pane:hover .scroll-hint { opacity: .85; transform: none; }
.pane:has(.viewport.engaged) .scroll-hint { opacity: 0; }
@media (hover: none) { .scroll-hint { display: none; } }
.viewport::after {
  content: ''; position: sticky; display: block; bottom: 0; height: 28px; margin-top: -28px; pointer-events: none;
  background: linear-gradient(transparent, var(--surface));
}
.track { list-style: none; margin: 0; padding: 0; }

.item { padding: 9px 14px 10px; border-bottom: 1px solid var(--line); position: relative; }
.item.new::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); border-radius: 2px; }
.item .t { display: block; font-size: 13.5px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.item .m { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; font: 11px/1.3 var(--mono); color: var(--faint); }
.item .m .src { color: var(--muted); }
.item .s {
  margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font: 500 10.5px/1.5 var(--mono);
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
button.badge { border: 0; cursor: pointer; font-family: var(--mono); }
.badge.hot { background: var(--accent-soft); color: var(--accent); }
.badge.free { background: var(--accent); color: var(--bg); }
.item .m a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }

.empty, .error-note { padding: 28px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.error-note { padding: 8px 14px; text-align: left; font: 11px/1.4 var(--mono); color: var(--faint); border-top: 1px solid var(--line); }

/* skeleton */
.skeleton .item { pointer-events: none; }
.skeleton .bar { height: 11px; border-radius: 6px; background: var(--surface-2); margin: 3px 0; }
.skeleton .bar.w2 { width: 62%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .bar { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .45; } }
}

/* ---------- LA events ---------- */
.grid-local { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.grid-local-side { display: grid; gap: 14px; align-content: start; }
.grid-local-side .pane { height: 403px; } /* two of these + gap = events pane height */
.pane-events { height: 820px; }
.grid-local-side .item { padding: 7px 14px 8px; }
.ev-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.seg button {
  border: 0; background: transparent; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.ev-controls select {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px;
}
.ev-day {
  position: sticky; top: 0; z-index: 1; padding: 6px 14px; font: 600 11.5px/1.4 var(--mono); letter-spacing: .02em;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.ev { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ev .t { font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.ev .m { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 10px; font: 11px/1.4 var(--mono); color: var(--faint); }
.ev .s { grid-column: 1; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.ev-side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ev-side .mi { font: 11px/1 var(--mono); color: var(--muted); }
.ics { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 8px; cursor: pointer; color: var(--muted); font: 11px/1.2 var(--mono); display: inline-flex; gap: 4px; align-items: center; }
.ics:hover { color: var(--accent); border-color: var(--accent); }
.places { border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.places h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; }
.places ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.places li { font-size: 12.5px; }
.places li span { display: block; font: 11px/1.3 var(--mono); color: var(--faint); }

/* ---------- knowledge ---------- */
.knowledge { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--hue, var(--line));
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.card h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.card .big { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.card .big small { font: 500 13px/1 var(--mono); color: var(--accent); margin-right: 8px; vertical-align: 3px; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.card li { font-size: 13px; line-height: 1.45; }
.card li b { font: 600 12px/1 var(--mono); color: var(--accent); margin-right: 6px; }
.card-concept { grid-column: span 4; }
.card-attack { grid-column: span 4; }
.card-featured { grid-column: span 4; }
.card-featured img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.card-news { grid-column: span 6; }
.card-otd { grid-column: span 6; }
.concept-nav { display: flex; gap: 6px; margin-top: auto; }

/* ---------- chess puzzle ---------- */
.pane-puzzle { height: auto; min-height: var(--pane-h); }
.pane-puzzle .puzzle-body { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; width: 100%; max-width: 300px; align-self: center;
  border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0;
}
.sq { display: grid; place-items: center; position: relative; font-size: clamp(18px, 2.2vw, 30px); line-height: 1; }
.sq.l { background: #e9dcc3; }
.sq.d { background: #a9825f; }
.sq.hl::after { content: ''; position: absolute; inset: 0; background: rgb(214 170 40 / .42); }
.pc { position: relative; z-index: 1; }
.pc.w { color: #fbfaf7; text-shadow: 0 0 1px #222, 0 0 1px #222, 0 1px 1px #222; }
.pc.b { color: #1c1a18; }
.puzzle-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 12px/1.4 var(--mono); color: var(--muted); }
.puzzle-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.puzzle-actions a, .puzzle-actions summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; list-style: none;
}
.puzzle-actions a:hover, .puzzle-actions summary:hover { border-color: var(--hue); color: var(--hue); }
.puzzle-actions summary::-webkit-details-marker { display: none; }
.puzzle-actions details[open] summary { border-color: var(--hue); color: var(--hue); }
.solution { margin-top: 8px; font: 12.5px/1.6 var(--mono); }
.daily-other { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.daily-other span { display: block; font: 11px/1.4 var(--mono); color: var(--faint); }

/* ---------- today / growth ---------- */
.today { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: 14px; }
.today .card { --hue: var(--c-growth); }
.quote-card { grid-column: span 12; flex-direction: row; align-items: center; gap: 18px; padding: 14px 18px; }
.quote-card i { font-size: 26px; color: var(--hue); flex-shrink: 0; }
.quote-card blockquote { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; flex: 1; }
.quote-card cite { display: block; margin-top: 4px; font: 12px/1.4 var(--mono); font-style: normal; color: var(--muted); }
.quote-card .zen { flex: 0 1 34%; padding-left: 18px; border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.card-challenge { grid-column: span 5; }
.card-habits { grid-column: span 4; }
.card-book { grid-column: span 3; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.score { font: 12px/1.3 var(--mono); color: var(--muted); text-align: right; }
.score b { color: var(--hue); font-size: 15px; font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.check {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background-color .15s;
}
.check:hover { background: var(--surface-2); }
.check input { appearance: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1.5px solid var(--faint); border-radius: 5px; cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--hue); border-color: var(--hue); }
.check input:checked::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { outline: 2px solid var(--hue); outline-offset: 2px; }
.check .txt { font-size: 13.5px; line-height: 1.45; }
.check.done .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.check .tag { font: 10.5px/1.4 var(--mono); color: var(--faint); display: block; margin-top: 2px; }
.check .rm { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 4px; opacity: 0; }
.check:hover .rm, .check .rm:focus-visible { opacity: 1; }
.inline-form { display: flex; gap: 6px; margin-top: 4px; }
.inline-form input, .stack-form input, .stack-form select, .field input, .field textarea, .field select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px;
}
.inline-form input::placeholder, .stack-form input::placeholder, .field textarea::placeholder, .field input::placeholder { color: var(--faint); }
.inline-form input:focus, .stack-form input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--hue, var(--accent)); outline-offset: 1px; }
.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field textarea { border-radius: 10px; resize: vertical; min-height: 64px; line-height: 1.45; }
.field input, .field select { border-radius: 999px; }
.stack-form { display: grid; gap: 8px; }
.stack-form .pill-btn, .inline-form .pill-btn { justify-self: start; }
.card-journal, .card-reading, .card-cards { grid-column: span 4; }
.card-week { grid-column: span 12; }
.saved { font: 11px/1 var(--mono); color: var(--hue); }
.muted { color: var(--muted); font-size: 13px; }
.nudge-card { box-shadow: inset 0 0 0 1px var(--hue); }
.past { border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; font-size: 12.5px; }
.past summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.past ul { margin-top: 8px; max-height: 220px; overflow: auto; }
.past li { color: var(--text); }
.past li b { display: block; font: 600 11px/1.4 var(--mono); color: var(--hue); margin: 0; }
.past li span { display: block; color: var(--muted); }
.card-row { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.card-row .rm { opacity: .7; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--hue); }
.pill-btn.primary { background: var(--hue, var(--accent)); border-color: var(--hue, var(--accent)); color: var(--bg); }
.reading { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.reading img, .reading .nocover { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.reading .nocover { display: grid; place-items: center; font: 600 10px/1.2 var(--mono); color: var(--muted); padding: 4px; text-align: center; }
.reading b { display: block; font-size: 14.5px; line-height: 1.3; }
.by { display: block; font: 11.5px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); margin: 8px 0 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--hue); border-radius: inherit; }
.flash { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.flash .front { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; }
.flash .back { margin: 0; font-size: 13px; line-height: 1.5; max-height: 160px; overflow: auto; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stats div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.stats b { display: block; font: 600 20px/1.2 var(--mono); color: var(--text); }
.stats span { font-size: 12px; color: var(--muted); }
.review-form summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.review-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.group h2 .sync-btn { margin-left: auto; font-size: 12px; letter-spacing: 0; }
.sync-btn.warn { border-color: var(--down); color: var(--down); }

.sync-dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .4);
}
.sync-dialog::backdrop { background: rgb(0 0 0 / .5); }
.sync-dialog form { position: relative; display: grid; gap: 12px; padding: 22px 22px 18px; --hue: var(--c-growth); }
.sync-dialog h3 { margin: 0; font-size: 17px; }
.sync-dialog p, .sync-dialog li { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sync-dialog ol { margin: 0 0 4px; padding-left: 18px; display: grid; gap: 6px; }
.sync-dialog a { color: var(--hue); text-decoration: underline; }
.sync-dialog [data-when] { display: grid; gap: 12px; }
.sync-dialog [data-when][hidden] { display: none; }
.sync-dialog [data-when] > .pill-btn { justify-self: start; }
.sync-msg { min-height: 1em; color: var(--text) !important; }
.dialog-close { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 999px; }
.dialog-close:hover { background: var(--surface-2); color: var(--text); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: auto; padding-top: 8px; }
.week div { text-align: center; font: 10px/1.2 var(--mono); color: var(--faint); }
.week span { display: block; height: 22px; border-radius: 4px; margin-bottom: 3px; background: color-mix(in srgb, var(--hue) calc(var(--f) * 85%), var(--surface-2)); }
.book { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.book img, .book .nocover { width: 88px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: var(--surface-2); box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.book .nocover { display: grid; place-items: center; font: 600 11px/1.3 var(--mono); color: var(--muted); padding: 6px; text-align: center; }
.book b { display: block; font-size: 15px; line-height: 1.3; }
.book span { display: block; font: 12px/1.4 var(--mono); color: var(--muted); margin: 2px 0 6px; }
.book p { font-size: 13px; }
.upnext { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.upnext li { font-size: 12.5px; color: var(--muted); }

/* focus mode hides the feed sections */
body.focus .feed-group, body.focus .strip .tickers, body.focus .jump a[data-feed] { display: none; }
.time-today { font: 12px/1 var(--mono); color: var(--faint); margin-right: 4px; white-space: nowrap; }
.time-today.over { color: var(--down); }

.nudge {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg);
  box-shadow: 0 10px 30px rgb(0 0 0 / .3);
}
.nudge[hidden] { display: none; }
.nudge p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.nudge .pill-btn { background: var(--bg); color: var(--text); border-color: var(--bg); }

.foot { padding: 24px 20px 40px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .clocks .clock:nth-child(n+3) { display: none; }
}
@media (max-width: 1100px) {
  .grid-local { grid-template-columns: 1fr; }
  .grid-local-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .grid-local-side .pane { height: var(--pane-h); }
  .pane-events { height: 820px; }
  .card-concept, .card-attack, .card-featured { grid-column: span 6; }
  .card-challenge { grid-column: span 12; }
  .card-habits, .card-book { grid-column: span 6; }
  .card-journal, .card-reading, .card-cards { grid-column: span 6; }
  .review-fields { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-card { flex-wrap: wrap; }
  .quote-card .zen { flex-basis: 100%; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .card-featured { grid-column: span 12; }
  .jump { display: none; }
}
@media (max-width: 767px) {
  :root { --pane-h: 480px; }
  .weather { display: none; }
  .pill-btn { padding: 0 10px; }
  .topbar { gap: 12px; padding: 0 16px; }
  .brand-name { display: none; }
  .clocks .clock:nth-child(n+2) { display: none; }
  .weather .wx-extra { display: none; }
  .strip { padding: 8px 16px; }
  main { padding: 4px 16px 32px; }
  .grid { grid-template-columns: 1fr; }
  .grid-local-side { grid-template-columns: 1fr; }
  .knowledge > *, .today > * { grid-column: span 12 !important; }
  .time-today { display: none; }
  .clocks { display: none; }
  .pill-btn { padding: 0 9px; gap: 4px; font-size: 12px; }
  .controls { margin-left: auto; }
  .pane-events { height: 760px; }
}
