:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #1a1b18;
  --panel-strong: #22241f;
  --line: #373a33;
  --text: #f0eee6;
  --muted: #b9b5a8;
  --soft: #8f8a7d;
  --accent: #89b482;
  --accent-strong: #b6d98f;
  --warn: #d6a657;
  --danger: #e67e80;
  --shadow: rgba(0, 0, 0, 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  /* Break long unbreakable tokens (URLs, model filenames, hashes) so comment
     and report text never force horizontal scroll on narrow screens. */
  overflow-wrap: break-word;
}

.comment p,
.post-body p,
.report code,
.ask-answer p,
.ask-answer li,
.report-rendered p,
.report-rendered li {
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

button,
.button,
select,
input,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

button:hover,
.button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button:active,
.button:active {
  transform: translateY(1px);
}

/* Keyboard users get a clear accent ring; mouse clicks stay clean. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline-offset: 0;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

.js-hidden {
  display: none !important;
}

.button.secondary,
button.secondary {
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 15, 0.96);
  backdrop-filter: blur(8px);
}

.session-banner {
  padding: 10px 22px;
  background: color-mix(in srgb, var(--danger) 15%, var(--panel));
  border-bottom: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.session-banner code {
  font-size: 0.85em;
  color: var(--warn);
}

.scrape-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 16%, var(--panel));
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.scrape-pill-critical {
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  background: color-mix(in srgb, var(--danger) 18%, var(--panel));
}

.scrape-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.scrape-pill-critical .scrape-dot {
  background: var(--danger);
}

.incident-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incident-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  background: var(--panel);
}

.incident-card.severity-critical {
  border-left-color: var(--danger);
}

.incident-card.resolved {
  opacity: 0.55;
}

.incident-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.incident-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
}

.severity-critical .incident-dot {
  background: var(--danger);
}

.incident-kind {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.incident-tag {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.incident-tag.resolved-tag {
  color: var(--accent);
}

.incident-when {
  margin-left: auto;
  color: var(--soft);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.incident-url {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.incident-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  margin: 10px 0 0;
  font-size: 0.82rem;
}

.incident-detail dt {
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

.incident-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.incident-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.incident-nobundle {
  color: var(--soft);
  font-size: 0.8rem;
  font-style: italic;
}

.button.secondary.active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.brand {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--text);
}

.topnav a.active {
  position: relative;
  color: var(--accent-strong);
}

.topnav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -12px;
  left: 0;
  height: 2px;
  background: var(--accent-strong);
}

.catchup-nav {
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.top-action {
  margin: 0;
}

.top-action-read button {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.top-action button.is-loading {
  position: relative;
  opacity: 0.75;
  cursor: progress;
  padding-left: 30px;
}

.top-action button.is-loading::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.muted {
  color: var(--muted);
}

.thread-note {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 58px);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  background: #151612;
}

.topic-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.topic-link {
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topic-link.active,
.topic-link:hover {
  background: var(--panel-strong);
  color: var(--text);
}

/* Unread counts as quiet pills; zero counts aren't rendered at all. */
.topic-count {
  justify-self: end;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.topic-link.active .topic-count,
.topic-link:hover .topic-count {
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-strong));
}

.feed {
  width: min(980px, 100%);
  min-width: 0;
  padding: 24px;
}

.feed-toolbar {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.feed-toolbar p,
.post-meta,
.section-heading p {
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.on-demand-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.on-demand-form input {
  width: min(330px, 34vw);
}

.on-demand-form button.is-loading {
  position: relative;
  opacity: 0.75;
  cursor: progress;
  padding-left: 30px;
}

.on-demand-form button.is-loading::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

select,
input,
textarea {
  padding: 0 10px;
}

textarea {
  padding-top: 10px;
  line-height: 1.45;
  resize: vertical;
}

.checkline {
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.checkline input {
  min-height: 18px;
  width: 18px;
}

.post-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px var(--shadow);
  transition: opacity 0.4s ease, border-color 0.25s ease;
}

.post-card:hover {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

/* Auto-read: the post under the focus line gets a lightly highlighted border
   while you dwell on it. The same cue marks the j/k keyboard selection. */
.post-card.focused,
.post-card.kbd-selected {
  border-color: var(--accent);
}

.post-card.seen {
  opacity: 0.58;
}

/* While the focus line is still over a just-read post, keep it fully readable —
   no dimming mid-read. A calmer green border is the only hint that it's now
   marked read; it dims to the seen state above once you scroll on. */
.post-card.seen.focused {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.post-main {
  min-width: 0;
}

.post-title {
  display: block;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.post-title:hover {
  color: var(--accent-strong);
}

.post-meta {
  margin-top: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.reason {
  margin: 10px 0 0;
  color: #ded8c8;
  overflow-wrap: anywhere;
}

.post-blurb {
  margin-top: 9px;
}

.blurb {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}

.blurb-text {
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Provenance: which model wrote a blurb / report. Kept quiet so it reads as
   metadata, not content. */
.blurb-model {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--soft);
  white-space: nowrap;
  vertical-align: baseline;
}

.report-provenance {
  font-variant-numeric: tabular-nums;
  color: var(--soft);
}

.blurb-pending,
.blurb-muted {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.blurb-pending .blurb-text,
.blurb-muted .blurb-text {
  color: var(--muted);
}

.verdict {
  display: inline-block;
  vertical-align: baseline;
  margin-right: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
}

.verdict-must-read {
  color: #11110f;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.verdict-worth-a-skim {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, var(--panel));
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}

.verdict-skippable {
  color: var(--soft);
  background: color-mix(in srgb, var(--soft) 12%, var(--panel));
  border-color: var(--line);
}

/* Triage category chip — read as quiet metadata, subtler than the verdict chips. */
.triage-cat {
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: baseline;
  color: var(--soft);
  background: var(--panel-strong);
}

/* Signal categories get a faint positive tint; noise categories (only visible in
   the muted view) a faint muted/warn tint. */
.triage-cat-firmware-software,
.triage-cat-product-news,
.triage-cat-troubleshooting,
.triage-cat-deal,
.triage-cat-guide {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent-strong) 14%, var(--panel));
  border-color: color-mix(in srgb, var(--accent-strong) 36%, transparent);
}

.triage-cat-showoff,
.triage-cat-meme-fluff,
.triage-cat-buyinghelp {
  color: var(--soft);
  background: color-mix(in srgb, var(--soft) 12%, var(--panel));
  border-color: var(--line);
}

/* Muted view: toggle in the toolbar + the recovery banner. */
.muted-toggle {
  align-self: center;
}

.muted-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--soft);
  white-space: nowrap;
}

.muted-link.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent-strong) 40%, transparent);
}

.muted-banner {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-size: 12.5px;
  color: var(--soft);
}

.post-action-keep {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent-strong) 40%, transparent);
}

.spinner-sm {
  width: 13px;
  height: 13px;
}

.reason-secondary {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--soft);
}

.post-actions,
.thread-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.post-actions {
  display: grid;
  grid-template-columns: 36px;
  grid-auto-rows: 36px;
  align-self: center;
  justify-content: end;
  gap: 4px;
  min-width: 0;
}

.post-actions form,
.thread-actions form {
  margin: 0;
}

.post-action {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.post-action-state {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.post-card.seen .post-action-state {
  border-color: var(--line);
  color: var(--muted);
}

.action-icon {
  flex: none;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.action-icon circle {
  fill: currentColor;
  stroke: none;
}

.action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.empty-state a {
  color: var(--accent-strong);
}

/* Keyboard-triage hint under the feed; pointless on touch-only devices. */
.kbd-hint {
  margin: 18px 4px 0;
  color: var(--soft);
  font-size: 12px;
}

.kbd-hint kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

@media (hover: none) and (pointer: coarse) {
  .kbd-hint {
    display: none;
  }
}

.thread-layout {
  display: grid;
  grid-template-columns: minmax(0, 880px) 300px;
  gap: 24px;
  align-items: start;
  padding: 24px;
}

.thread-main {
  min-width: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent-strong);
  text-decoration: none;
}

.thread-header,
.post-body,
.comments,
.report,
.package-panel,
.settings-layout section,
.login-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thread-header,
.post-body,
.comments,
.report {
  padding: 18px;
  margin-bottom: 14px;
  min-width: 0;
}

.report-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.report-progress p {
  margin: 0;
}

.on-demand-blank h1 {
  color: var(--text);
}

.on-demand-status .error-text {
  margin: 12px 0 0;
}

.on-demand-placeholder {
  color: var(--muted);
}

.on-demand-progress-panel h2 {
  margin-bottom: 12px;
}

.on-demand-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: demand-step;
}

.on-demand-steps li {
  counter-increment: demand-step;
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.on-demand-steps li::before {
  content: counter(demand-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.on-demand-steps li.active {
  color: var(--text);
}

.on-demand-steps li.active::before {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.report-elapsed {
  font-variant-numeric: tabular-nums;
}

.report-heading {
  align-items: center;
  flex-wrap: wrap;
}

.report-heading h2,
.report-heading p,
.report-empty p {
  margin-bottom: 0;
}

.report-actions,
.report-action-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

.thread-header h1 {
  max-width: 820px;
  overflow-wrap: anywhere;
}

.thread-header p,
.post-body a {
  overflow-wrap: anywhere;
}

.post-body {
  color: #e4dfd2;
  line-height: 1.6;
}

/* Preserve the selftext's own line breaks — but only inside the paragraph, so
   the template's indentation whitespace doesn't render as huge empty gaps. */
.post-body p {
  margin: 0;
  white-space: pre-wrap;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.comment {
  margin: 0 0 10px calc((var(--depth) - 1) * 18px);
  padding: 12px 12px 12px 14px;
  min-width: 0;
  border-left: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow-wrap: anywhere;
}

/* Depth-cycled rail colors (Reddit-style) so eye can track which level a
   reply belongs to when trees get deep. */
.comment-c0 {
  border-left-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.comment-c1 {
  border-left-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}

.comment-c2 {
  border-left-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.comment-c3 {
  border-left-color: color-mix(in srgb, var(--soft) 55%, var(--line));
}

.comment header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.comment header strong,
.comment header span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.comment p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.comment-toggle {
  flex: none;
  width: 20px;
  min-height: 20px;
  padding: 0;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--soft);
  font-size: 13px;
  line-height: 1;
}

.comment-toggle:hover {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.comment-replies {
  margin-left: auto;
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

/* Collapsed subtree: hide the body and nested replies, keep the header as the
   handle; the header stays scannable so it's obvious what was folded. */
.comment.collapsed > p,
.comment.collapsed > .comment {
  display: none;
}

.comment.collapsed > header {
  color: var(--soft);
}

.package-panel {
  position: sticky;
  top: 82px;
  padding: 16px;
}

.package-panel form {
  display: grid;
  gap: 12px;
}

.panel-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.report-output {
  display: grid;
  gap: 16px;
}

.report-synopsis {
  display: grid;
  gap: 12px;
}

.report-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
}

.report-synopsis h3,
.report-section h3,
.report-rendered h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.report-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.report-point {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.report-point:nth-child(-n + 2) {
  border-top: 0;
}

.report-point:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.report-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
}

.report-point p {
  margin: 0;
  color: #e4dfd2;
  line-height: 1.55;
}

.report-section,
.report-rendered {
  color: #e4dfd2;
  line-height: 1.6;
}

.report-section {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.report-section h2,
.report-rendered h2 {
  margin: 0;
  font-size: 18px;
}

.report-section p,
.report-rendered p,
.report-rendered ul,
.report-rendered ol,
.report-rendered blockquote,
.report-rendered pre {
  margin: 0;
}

.report-section ul,
.report-section ol,
.report-rendered ul,
.report-rendered ol {
  padding-left: 20px;
}

.report-section li + li,
.report-rendered li + li {
  margin-top: 6px;
}

.report-section dl,
.report-rendered dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.report-section dt,
.report-rendered dt {
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
}

.report-section dd,
.report-rendered dd {
  margin: 0;
  color: #e4dfd2;
  line-height: 1.6;
}

.report-section blockquote,
.report-rendered blockquote {
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: #d7d1c2;
}

.report-section code,
.report-rendered code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #0b0c0a;
  color: #ece6d7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.report-section pre,
.report-rendered pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0c0a;
}

.report-details {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.report-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.report-details[open] summary {
  margin-bottom: 12px;
  color: var(--accent-strong);
}

.report-rendered {
  display: grid;
  gap: 12px;
}

.report-page {
  width: min(920px, 100%);
  padding: 24px;
}

.report-standalone {
  padding: 18px;
}

.settings-layout,
.login-layout {
  padding: 24px;
}

.settings-layout section {
  max-width: 980px;
  padding: 20px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.retrieval-graph {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 68%, var(--panel));
}

.retrieval-window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.retrieval-window {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.retrieval-window-head,
.retrieval-window-meta,
.retrieval-source-head,
.retrieval-legend {
  display: flex;
  align-items: center;
}

.retrieval-window-head {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.retrieval-window-head strong {
  color: var(--text);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.retrieval-stack {
  position: relative;
  display: flex;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0c0a;
}

.retrieval-stack.is-empty {
  justify-content: center;
  align-items: center;
  color: var(--soft);
  font-size: 0.76rem;
}

.retrieval-segment {
  display: block;
  min-width: 0;
}

.retrieval-cache {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.retrieval-reddit {
  background: linear-gradient(90deg, var(--warn), #e7c77a);
}

.retrieval-window-meta {
  flex-wrap: wrap;
  gap: 10px;
  color: var(--soft);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.retrieval-source-graph {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.retrieval-source-head {
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.retrieval-source-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.2fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.retrieval-source-name {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.8;
}

.retrieval-source-bars {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.retrieval-source-barline {
  display: grid;
  grid-template-columns: 28px minmax(70px, 1fr) max-content;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.retrieval-source-period {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.retrieval-source-bar {
  position: relative;
  display: block;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b0c0a;
}

.retrieval-source-week,
.retrieval-source-day {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
}

.retrieval-source-week {
  width: var(--week);
  background: color-mix(in srgb, var(--warn) 32%, var(--panel-strong));
}

.retrieval-source-day {
  width: var(--day);
  background: color-mix(in srgb, var(--accent-strong) 82%, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-strong) 28%, transparent);
}

.retrieval-source-counts {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.retrieval-legend {
  flex-wrap: wrap;
  gap: 12px;
  color: var(--soft);
  font-size: 0.74rem;
}

.retrieval-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend-cache {
  background: var(--accent);
}

.legend-reddit {
  background: var(--warn);
}

.metric-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.metric-table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.metric-table th,
.metric-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.metric-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-table td:not(:first-child),
.metric-table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.config-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.config-details summary:hover {
  color: var(--accent-strong);
}

.config-details[open] summary {
  margin-bottom: 10px;
  color: var(--accent-strong);
}

.config-json {
  max-width: 100%;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0c0a;
  color: #e8e1cf;
}

.login-layout {
  display: grid;
  min-height: calc(100vh - 58px);
  place-items: center;
}

.login-box {
  width: min(380px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.error-text {
  color: var(--danger);
}

/* --- Search / Ask ------------------------------------------------------- */
.navquery {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto auto;
  align-items: center;
  min-width: min(100%, 390px);
  margin: 0 0 0 auto; /* push to the right edge of the nav */
}

.navquery input[type="search"] {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 8px 0 0 8px;
}

.navquery button {
  min-height: 34px;
  margin-left: -1px;
  padding: 0 11px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.navquery button:last-child {
  border-radius: 0 8px 8px 0;
}

.navquery-ask {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-strong));
}

.search-heading {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
}

.search-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-summary-row p {
  margin: 0;
}

.search-ask-upgrade {
  margin: 0;
}

.search-ask-upgrade button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
}

.search-controls .search-q input {
  min-width: 280px;
}

.search-snippet {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-snippet mark {
  background: transparent;
  color: var(--accent-strong);
  font-weight: 650;
}

.seen-tag {
  color: var(--soft);
}

/* --- Ask --------------------------------------------------------------- */
.ask-form {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ask-form textarea {
  width: 100%;
  min-height: 92px;
}

.ask-form button {
  justify-self: start;
}

.ask-followup .ask-form {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Live Research source control: a two-up segmented toggle. */
.ask-source-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.source-option {
  position: relative;
  display: block;
  margin: 0;
  min-width: 0;
}

.source-option-wide {
  grid-column: 1 / -1;
}

.source-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.source-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.source-name {
  font-weight: 750;
}

.source-sub {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.source-option input:checked + .source-pill {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.source-option input:focus-visible + .source-pill {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.source-option input:disabled + .source-pill {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Inline Live / Stored tag in headers and history rows. */
.source-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.source-tag.is-live {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.source-tag.is-rapid {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

.live-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ask-live-notice {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}

.ask-live-notice-info {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

.ask-live-notice p {
  margin: 0;
  color: #e4dfd2;
  line-height: 1.5;
}

.ask-live-details {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

/* Per-thread acquisition status chips in the Reddit-threads audit. */
.source-list .evidence-meta {
  align-items: center;
}

.source-status {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.source-status.status-done {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.source-status.status-error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.source-status.status-fetching,
.source-status.status-candidate {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}

.source-query {
  margin: 4px 0 0;
  font-size: 13px;
}

.ask-history {
  display: grid;
  /* minmax(0, …) lets cards shrink below content min-width on phones; a bare
     auto track would blow out the layout on long unbreakable tokens. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.ask-progress-detail p {
  margin: 0;
}

/* Live "now reading" thread list shown while an ask is still running, so the
   user sees which articles it is working through rather than a bare counter. */
.ask-progress-threads {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.ask-progress-threads li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.ask-progress-threads .thread-mark {
  flex: none;
  width: 1em;
  text-align: center;
  font-weight: 700;
}

.ask-progress-threads .thread-done .thread-mark {
  color: var(--accent-strong);
}

.ask-progress-threads .thread-fetching .thread-mark {
  color: var(--warn);
}

.ask-progress-threads .thread-title {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-progress-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.ask-rendered a,
.evidence-list a {
  color: var(--accent-strong);
}

.ask-evidence summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 750;
}

.evidence-list,
.query-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.evidence-list li {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.evidence-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.evidence-title {
  margin: 6px 0;
  color: var(--text);
  font-weight: 700;
}

.evidence-body {
  margin: 0 0 8px;
  color: #e4dfd2;
  line-height: 1.55;
}

.query-list code {
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  /* Two-row topbar: brand + refresh up top, nav/search underneath. The old
     layout dropped Settings, incidents, and search entirely on phones. */
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 8px 12px;
  }

  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 4px;
  }

  .navquery {
    flex: 1 1 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-width: 0;
    margin-left: 0;
  }

  .app-shell,
  .thread-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topic-link {
    min-width: 170px;
  }

  .feed {
    padding: 16px;
  }

  .feed-toolbar,
  .post-card,
  .section-heading {
    display: grid;
  }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
  }

  .post-actions {
    grid-template-columns: repeat(3, 40px);
    grid-auto-rows: 40px;
    align-self: auto;
    justify-content: start;
  }

  .thread-layout {
    padding: 16px;
  }

  .package-panel {
    position: static;
  }

  .report-points {
    grid-template-columns: 1fr;
  }

  .report-point:nth-child(-n + 2) {
    border-top: 1px solid var(--line);
  }

  .report-point:first-child {
    border-top: 0;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 54px;
    padding: 8px 12px;
    gap: 4px 10px;
  }

  .top-action button {
    min-height: 38px;
    padding: 0 12px;
  }

  .navquery button {
    padding: 0 9px;
  }

  .sidebar {
    padding: 10px 8px;
  }

  .topic-link {
    min-width: 138px;
  }

  .feed {
    padding: 12px;
  }

  .feed-toolbar {
    gap: 14px;
  }

  .report-actions,
  .report-action-form {
    width: 100%;
    justify-content: flex-start;
  }

  .report-actions .button,
  .report-action-form button {
    width: 100%;
  }

  .controls,
  .on-demand-form,
  .controls label,
  .controls button,
  .controls select,
  .on-demand-form input,
  .on-demand-form button {
    width: 100%;
  }

  .on-demand-form {
    flex-direction: column;
    align-items: stretch;
  }

  .controls .checkline {
    width: max-content;
  }

  .post-card {
    padding: 14px;
  }

  .post-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 42px;
    justify-content: stretch;
    gap: 6px;
  }

  .post-action {
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
  }

  .action-icon {
    width: 19px;
    height: 19px;
  }

  .retrieval-window-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .retrieval-window-head {
    align-items: flex-start;
  }

  .retrieval-source-row {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
  }

  .retrieval-source-name,
  .retrieval-source-counts,
  .retrieval-source-period {
    font-size: 0.76rem;
  }

  .retrieval-source-barline {
    grid-template-columns: 26px minmax(56px, 1fr) max-content;
    gap: 6px;
  }

  .retrieval-legend {
    gap: 8px;
  }
}

/* --- Catch Up --------------------------------------------------------- */
.catchup-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: 34px 36px 42px;
}

.catchup-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
}

.catchup-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.035em;
}

.catchup-heading p,
.catchup-metrics {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.catchup-command {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.catchup-metrics {
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.catchup-refresh {
  margin: 0;
}

.catchup-refresh button {
  gap: 8px;
  min-height: 42px;
  color: var(--accent-strong);
  font-size: 13.5px;
  font-weight: 700;
}

.catchup-refresh button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.catchup-refresh-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catchup-refresh button.is-loading {
  position: relative;
  padding-left: 34px;
}

.catchup-refresh button.is-loading .catchup-refresh-icon {
  display: none;
}

.catchup-refresh button.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -7px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.catchup-loading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 180px;
  padding: 28px 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catchup-loading h2,
.catchup-loading p {
  margin: 0;
}

.catchup-loading p {
  max-width: 620px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.catchup-empty {
  margin-top: 8px;
}

.catchup-empty .button {
  margin-top: 6px;
}

.catchup-notice {
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 7%, transparent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.catchup-notice strong {
  color: var(--warn);
}

.catchup-overview {
  margin-bottom: 26px;
  padding: 0 0 0 18px;
  border-left: 4px solid var(--accent);
}

.catchup-overview p {
  max-width: 830px;
  margin: 0;
  color: #e4dfd2;
  font-size: 16px;
  line-height: 1.62;
}

.catchup-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.catchup-section + .catchup-section {
  margin-top: 16px;
}

.catchup-section > h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.catchup-priority-list,
.catchup-theme-list,
.catchup-quick-list {
  display: grid;
}

.catchup-priority-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 22px;
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.catchup-priority-row:hover,
.catchup-priority-row:focus-visible,
.catchup-theme-row:hover,
.catchup-theme-row:focus-visible,
.catchup-quick-row:hover,
.catchup-quick-row:focus-visible {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.catchup-rank {
  color: #74766f;
  font-size: 38px;
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.catchup-priority-copy,
.catchup-item-title,
.catchup-takeaway,
.catchup-why,
.catchup-item-meta {
  display: block;
  min-width: 0;
}

.catchup-item-title {
  color: var(--text);
  font-size: 15.5px;
  font-weight: 750;
  line-height: 1.35;
}

.catchup-must {
  display: inline-block;
  margin-left: 8px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.catchup-takeaway {
  margin-top: 2px;
  color: #ddd8cc;
  font-size: 13.5px;
  line-height: 1.45;
}

.catchup-why {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.catchup-item-meta {
  margin-top: 5px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.catchup-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catchup-theme-list {
  gap: 0;
}

.catchup-theme {
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
  gap: 22px;
  padding: 12px 0 12px 17px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}

.catchup-theme header h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15.5px;
  line-height: 1.35;
}

.catchup-theme header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.42;
}

.catchup-theme-items {
  display: grid;
  min-width: 0;
}

.catchup-theme-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(160px, 1fr) max-content 18px;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  padding: 5px 4px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
}

.catchup-theme-title {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.catchup-theme-takeaway {
  color: var(--muted);
}

.catchup-theme-meta {
  color: var(--soft);
  white-space: nowrap;
}

.catchup-quick-list {
  padding-bottom: 8px;
}

.catchup-quick-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) max-content 18px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 5px;
  text-decoration: none;
}

.catchup-quick-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
}

.catchup-quick-copy {
  color: #ddd8cc;
  font-size: 13.5px;
  line-height: 1.42;
}

.catchup-quick-meta {
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.catchup-skipped {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catchup-skipped summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}

.catchup-skipped summary::-webkit-details-marker {
  display: none;
}

.catchup-skipped summary strong {
  margin-right: 10px;
  color: var(--text);
  font-size: 15px;
}

.catchup-skip-action {
  flex: none;
  color: var(--accent-strong);
  white-space: nowrap;
}

.catchup-skipped[open] .catchup-skip-action {
  color: var(--muted);
}

.catchup-skipped-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  padding: 0 0 14px;
}

.catchup-skipped-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
}

.catchup-skipped-list a:hover {
  color: var(--text);
}

.catchup-skipped-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.catchup-skipped-list small {
  flex: none;
  color: var(--soft);
  white-space: nowrap;
}

.catchup-finish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.catchup-finish-alert {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: 7px;
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.45;
}

.catchup-finish-copy {
  min-width: 0;
}

.catchup-finish-copy strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.catchup-finish-copy p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.48;
}

.catchup-finish-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 15px;
  border-color: color-mix(in srgb, var(--accent-strong) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.catchup-finish-form button:hover:not(:disabled),
.catchup-finish-form button:focus-visible:not(:disabled) {
  border-color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
}

.catchup-finish-form button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catchup-finish.is-done {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
}

.catchup-finish-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 55%, var(--line));
  border-radius: 50%;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
}

.catchup-provenance {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
  color: var(--soft);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .topnav a.active::after {
    bottom: -5px;
  }

  .catchup-shell {
    padding: 24px 18px 34px;
  }

  .catchup-hero {
    display: grid;
    gap: 18px;
  }

  .catchup-command {
    justify-content: space-between;
  }

  .catchup-theme {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .catchup-theme-row {
    grid-template-columns: minmax(0, 1fr) max-content 18px;
  }

  .catchup-theme-takeaway {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .catchup-theme-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .catchup-theme-row .catchup-chevron {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 520px) {
  body:has(.catchup-shell) .navquery {
    display: none;
  }

  .catchup-shell {
    padding: 18px 14px 30px;
  }

  .catchup-heading h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .catchup-command {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .catchup-metrics {
    white-space: normal;
  }

  .catchup-refresh button {
    min-height: 42px;
    padding-right: 11px;
    padding-left: 11px;
    font-size: 12.5px;
  }

  .catchup-overview {
    padding-left: 14px;
  }

  .catchup-overview p {
    font-size: 15px;
    line-height: 1.55;
  }

  .catchup-priority-row {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    gap: 10px;
    padding: 12px 0;
  }

  .catchup-rank {
    align-self: start;
    padding-top: 2px;
    font-size: 25px;
  }

  .catchup-item-title {
    font-size: 14.5px;
  }

  .catchup-must {
    display: block;
    margin: 3px 0 0;
  }

  .catchup-theme {
    padding-left: 12px;
  }

  .catchup-theme-row {
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 4px 8px;
    padding: 8px 2px;
  }

  .catchup-theme-meta {
    grid-column: 1;
    grid-row: 3;
  }

  .catchup-theme-takeaway {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .catchup-theme-row .catchup-chevron {
    grid-column: 2;
    grid-row: 1;
  }

  .catchup-quick-row {
    grid-template-columns: 8px minmax(0, 1fr) 18px;
    gap: 8px;
    align-items: start;
    padding: 8px 2px;
  }

  .catchup-quick-dot {
    margin-top: 7px;
  }

  .catchup-quick-meta {
    grid-column: 2;
    white-space: normal;
  }

  .catchup-quick-row .catchup-chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .catchup-skipped summary {
    display: grid;
    gap: 8px;
  }

  .catchup-skip-action {
    white-space: normal;
  }

  .catchup-skipped-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .catchup-finish {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
  }

  .catchup-finish.is-done {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .catchup-finish-form button {
    width: 100%;
    white-space: normal;
  }
}

/* ----- Post media (images / galleries / video) ----- */
.post-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.media-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}
.media-video {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.media-video figcaption {
  font-size: 0.85rem;
}
.media-fallback {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--border, #2a3a40);
  border-radius: 8px;
  width: fit-content;
}

/* Feed-card thumbnail: a small preview that links into the thread. */
.post-thumb {
  display: block;
  position: relative;
  margin: 8px 0;
  width: fit-content;
}
.post-thumb img {
  display: block;
  max-height: 140px;
  max-width: 100%;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.post-thumb-video::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
