/*
 * Geist, self-hosted. These faces used to arrive via a stylesheet on
 * fonts.googleapis.com, which cost the page a render-blocking request to a
 * third-party origin that then referenced a *second* origin (fonts.gstatic.com)
 * for the files themselves -- DNS + TCP + TLS twice over, on the critical path,
 * before any text could paint. Serving them from /assets puts them on the
 * connection the page already has and behind the same CDN behavior as every
 * other asset.
 *
 * Only the latin and latin-ext subsets are carried; the upstream stylesheet
 * also offered cyrillic, cyrillic-ext and vietnamese, which this UI has no
 * copy for. `unicode-range` is what makes that safe rather than lossy: a
 * browser asked to render a character outside these ranges simply falls
 * through to the next family in the --font-sans / --font-mono stack instead of
 * downloading anything.
 *
 * Both files are variable fonts spanning weight 100-900, so the single face per
 * subset covers every weight the UI asks for. `font-display: swap` matches what
 * Google served: text paints immediately in the fallback and re-renders when
 * the face lands, which is the right trade for a reading app.
 *
 * These are versioned by filename, not by query string. If a face is ever
 * replaced, rename the file -- backend/app/main.py caches /assets/fonts/*.woff2
 * as immutable for a year and will not notice edits in place.
 */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*
 * Dark is the default theme; `html.light` flips the same tokens to the light
 * scale. The `--gray-*` / `--green-*` ramps are ordered light-to-dark by NAME
 * (gray-50 = the page's lowest-contrast surface, gray-900 = highest-contrast
 * text) rather than by literal lightness, so every existing `var(--gray-N)`
 * usage keeps its intent when the ramps are swapped.
 */
:root {
  /* ── Accent ramp (indigo) ── */
  --green-50:  #0d0d1f;
  --green-100: #1a1a3d;
  --green-200: #26265c;
  --green-300: #4f46e5;
  --green-400: #6366f1;
  --green-500: #6366f1;
  --green-600: #7b7ef4;
  --green-700: #8b93f8;
  --green-800: #a5b0ff;
  --green-900: #c7cbff;

  /* ── Neutral ramp ── */
  --gray-50:  #000000;
  --gray-100: #0a0a0a;
  --gray-200: #171717;
  --gray-300: #262626;
  --gray-400: #3d3d3d;
  --gray-500: #7d7d7d;
  --gray-600: #a1a1a1;
  --gray-700: #c4c4c4;
  --gray-800: #dcdcdc;
  --gray-900: #ededed;

  /* ── Semantic tokens ── */
  --bg:            var(--gray-50);
  --bg-strong:     var(--gray-100);
  --panel:         var(--gray-100);
  --panel-strong:  var(--gray-200);
  --ink:           var(--gray-900);
  --muted:         var(--gray-600);
  --faint:         var(--gray-500);
  --accent:        #6366f1;
  --accent-strong: var(--green-800);
  --accent-hover:  #4f46e5;
  --accent-soft:   rgba(99, 102, 241, 0.14);
  --accent-wash:   rgba(99, 102, 241, 0.05);
  --warn:          #f0803c;
  --line:          var(--gray-300);
  --line-faint:    var(--gray-200);
  --line-strong:   var(--gray-400);
  --header-bg:     rgba(0, 0, 0, 0.8);
  --shadow:        0 18px 40px rgba(0, 0, 0, 0.55);

  /*
   * Aliases for names that inline styles reference as `var(--name, #fallback)`.
   * They were never defined, so every one of those call sites silently used its
   * light-mode literal. Defining them here routes all of them through the
   * ramps above, which means they follow the theme.
   */
  --fg:             var(--ink);
  --text:           var(--ink);
  --text-primary:   var(--ink);
  --text-secondary: var(--muted);
  --text-muted:     var(--muted);
  --text-on-dark:   #ffffff;
  --bg-card:        var(--panel);
  --bg-secondary:   var(--panel-strong);
  --bg-tertiary:    var(--line);
  --bg-hover:       var(--panel-strong);
  --surface:        var(--panel-strong);
  --wash:           var(--panel-strong);
  --border:         var(--line);
  --gray-150:       var(--gray-300);
  --link:           var(--accent-strong);
  --primary:        var(--accent);
  --accent-subtle:  var(--accent-wash);

  --success:        #4ade80;
  --success-bg:     rgba(74, 222, 128, 0.12);
  --error:          #f87171;
  --danger:         #f87171;
  --color-danger:   #f87171;
  --error-bg:       rgba(248, 113, 113, 0.12);
  --error-soft:     rgba(248, 113, 113, 0.12);
  --warning:        #e8a33d;
  --warn-amber:     #e8a33d;
  --warning-strong: #f5c06a;
  --warning-bg:     rgba(232, 163, 61, 0.12);
  --warning-soft:   rgba(232, 163, 61, 0.14);
  --yellow-50:      rgba(232, 163, 61, 0.10);
  --yellow-200:     rgba(232, 163, 61, 0.30);

  --blue-300:   #7ab8f5;
  --blue-400:   #60a5fa;
  --blue-900:   #1e3a5f;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-900: #7c2d12;
  --red-400:    #f87171;
  --red-600:    #ef4444;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  color-scheme: dark;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
}

html.light {
  --green-50:  #f5f5ff;
  --green-100: #e6e6fb;
  --green-200: #c9caf6;
  --green-300: #8b8df3;
  --green-400: #6366f1;
  --green-500: #6366f1;
  --green-600: #5a5de8;
  --green-700: #4f46e5;
  --green-800: #4338ca;
  --green-900: #312e81;

  --gray-50:  #fafafa;
  --gray-100: #ffffff;
  --gray-200: #f0f0f0;
  --gray-300: #e4e4e4;
  --gray-400: #cfcfcf;
  --gray-500: #737373;
  --gray-600: #666666;
  --gray-700: #454545;
  --gray-800: #2b2b2b;
  --gray-900: #171717;

  --panel:         #ffffff;
  --accent-strong: var(--green-800);
  --accent-soft:   rgba(99, 102, 241, 0.12);
  --accent-wash:   rgba(99, 102, 241, 0.06);
  --warn:          #b45309;
  --header-bg:     rgba(250, 250, 250, 0.85);
  --shadow:        0 18px 40px rgba(13, 27, 32, 0.08);

  /* Status hues need more depth to carry against light surfaces. */
  --success:        #15803d;
  --success-bg:     rgba(21, 128, 61, 0.10);
  --error:          #dc2626;
  --danger:         #dc2626;
  --color-danger:   #dc2626;
  --error-bg:       rgba(220, 38, 38, 0.08);
  --error-soft:     rgba(220, 38, 38, 0.08);
  --warning:        #b45309;
  --warn-amber:     #b45309;
  --warning-strong: #92400e;
  --warning-bg:     rgba(180, 83, 9, 0.08);
  --warning-soft:   rgba(180, 83, 9, 0.10);
  --yellow-50:      rgba(180, 83, 9, 0.07);
  --yellow-200:     rgba(180, 83, 9, 0.22);

  --blue-300:   #7ab8f5;
  --blue-400:   #2563eb;
  --blue-900:   #1e3a5f;
  --orange-300: #fdba74;
  --orange-400: #ea580c;
  --orange-900: #7c2d12;
  --red-400:    #ef4444;
  --red-600:    #dc2626;

  color-scheme: light;
}

html[data-env="test"] {
  --accent:       #d97706;
  --accent-hover: #b45309;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/*
 * Form controls default to a UA white field, which is unreadable against the
 * dark text tokens. Give every control a themed surface up front; components
 * that want something else still override it.
 */
input,
textarea,
select {
  font: inherit;
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

select option {
  background: var(--panel);
  color: var(--ink);
}

/* Range thumbs / checkboxes / radios pick this up instead of UA blue. */
input[type="range"],
input[type="checkbox"],
input[type="radio"],
progress {
  accent-color: var(--accent);
}

#app {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(460px, 100%);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.auth-panel h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--panel);
  color: var(--ink);
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-link-button {
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: #f5fbfa;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.link-button {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: var(--line);
}

.admin-button {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.auth-footer {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
}

.flash {
  margin-top: 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 12px 14px;
}

.flash.error,
.reader-status.error {
  background: rgba(231, 147, 136, 0.14);
  color: #e79388;
}

.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 9999;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-success {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.toast-error {
  background: rgba(231, 147, 136, 0.14);
  color: #e79388;
}

/* The document scrolls (so the header can stick), not an inner pane. */
.reader-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pane-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.pane-eyebrow {
  color: var(--accent);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.admin-badge,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 0.76rem;
}

.admin-badge,
.pill.flagged {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.pill.stage-raw {
  background: var(--panel-strong);
  color: var(--muted);
  border-color: var(--line);
}

.pill.stage-fetched {
  background: rgba(127, 162, 240, 0.14);
  color: #7fa2f0;
  border-color: #b6d0f7;
}

.pill.stage-enriched {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.unread-pill {
  background: var(--warning-soft);
}

.reader-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink);
  flex-shrink: 0;
  overflow: visible;
}

.reader-navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.reader-navbar-brand .brand-mark {
  flex-shrink: 0;
  display: block;
}

.reader-navbar-brand .brand-word {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.reader-navbar-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 6px;
  flex-shrink: 0;
}

.reader-navbar-links a {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 120ms cubic-bezier(.25, .46, .45, .94);
}

.reader-navbar-links a:hover {
  color: var(--ink);
}

.reader-navbar-prompt-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 120ms ease, background 120ms ease;
}

.reader-navbar-prompt-edit:hover,
.reader-navbar-prompt-edit:focus-visible {
  color: var(--ink);
  background: var(--panel-strong);
}

.reader-newsletter-selector {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.reader-newsletter-name {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 6px 6px 10px;
  border-radius: 6px 0 0 6px;
  transition: background 120ms ease;
  line-height: 1.2;
}

.reader-newsletter-name:hover {
  background: var(--panel-strong);
}

.reader-newsletter-chevron {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  transition: background 120ms ease, color 120ms ease;
  display: flex;
  align-items: center;
  line-height: 1;
}

.reader-newsletter-chevron:hover {
  background: var(--panel-strong);
  color: var(--ink);
}

.reader-newsletter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.reader-newsletter-dropdown-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 120ms ease, color 120ms ease;
}

.reader-newsletter-dropdown-item:hover,
.reader-newsletter-dropdown-item.active {
  background: var(--panel-strong);
  color: var(--ink);
}

/* Primary in-app destinations. Quiet by default; the active one is filled. */
.reader-special-channel-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 120ms cubic-bezier(.25, .46, .45, .94), color 120ms cubic-bezier(.25, .46, .45, .94);
}

.reader-special-channel-btn:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.reader-special-channel-btn.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.reader-navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Keyboard-shortcut hint chips (j/k navigate, o expand). */
.reader-hotkey-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reader-hotkey-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.reader-hotkey-hint span {
  font-size: 12px;
  color: var(--faint);
}

.reader-hotkey-hint .hint-gap {
  margin-left: 6px;
}

/* The admin-mode hint is also the control, so touch devices have a way in. */
.reader-hotkey-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.reader-hotkey-toggle:hover kbd,
.reader-hotkey-toggle:focus-visible kbd {
  border-color: var(--line-strong);
  color: var(--ink);
}

.reader-hotkey-toggle:hover span {
  color: var(--muted);
}

/* Admin mode is on: the 'a' key reads as engaged. */
.reader-hotkey-hint kbd.active {
  background: var(--accent-soft, var(--panel-strong));
  border-color: var(--line-strong);
  color: var(--ink);
}

.reader-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 120ms cubic-bezier(.25, .46, .45, .94), color 120ms cubic-bezier(.25, .46, .45, .94);
}

.reader-theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.reader-navbar-user {
  font-size: 13px;
  color: var(--muted);
}

.reader-navbar-user-link {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color 120ms ease;
}

.reader-navbar-user-link:hover {
  color: var(--ink);
}

.reader-navbar-signout {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 120ms ease, color 120ms ease;
}

.reader-navbar-signout:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.reader-navbar-gear-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 120ms ease;
}

.reader-navbar-gear-btn:hover {
  color: var(--ink);
}

.reader-navbar-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 120ms ease, background 120ms ease;
}

.reader-navbar-search-btn:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

/* ── Marketing band under the header (subscribe CTA) ── */
.tldr-marketing {
  border-bottom: 1px solid var(--line-faint);
  padding: 14px clamp(16px, 4vw, 48px);
}

.tldr-marketing h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

.tldr-marketing-sub {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--faint);
}

.tldr-marketing-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  max-width: 400px;
}

.tldr-marketing-form input {
  height: 32px;
  flex: 1 1 160px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}

.tldr-marketing-form input:focus {
  border-color: var(--accent);
}

.tldr-marketing-form button {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms cubic-bezier(.25, .46, .45, .94);
}

.tldr-marketing-form button:hover {
  background: var(--accent-hover);
}

.tldr-marketing-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

.tldr-marketing-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Footer ── */
.reader-footer {
  border-top: 1px solid var(--line-faint);
  padding: 20px clamp(16px, 4vw, 48px) 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.reader-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-footer-brand span {
  font-size: 12px;
  color: var(--faint);
}

.reader-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.reader-footer-links a {
  font-size: 12.5px;
  color: var(--faint);
  text-decoration: none;
  cursor: pointer;
}

.reader-footer-links a:hover {
  color: var(--muted);
}

/* The hint chips and marketing nav are the first things to go when narrow. */
@media (max-width: 860px) {
  .reader-hotkey-hint {
    display: none;
  }
}

@media (max-width: 760px) {
  .reader-navbar-links {
    display: none;
  }
}

.reader-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.story-list-pane,
.story-detail-pane {
  padding: 28px 24px;
  min-width: 0;
  overflow-y: auto;
}

.story-list-pane {
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.story-detail-pane {
  background: var(--panel);
  outline: none;
}

.story-detail-pane--focused {
  box-shadow: inset 2px 0 0 var(--accent);
}

.pane-header h1,
.story-detail h2 {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.05;
}

.reader-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.feed-source {
  font-weight: 500;
  color: var(--ink);
}

/* ── Full-width reader layout ── */

.reader-main-full {
  flex: 1;
  background: var(--bg);
}

/* Full-bleed list: rows run edge to edge, separated only by hairlines. */
.feed-list-pane {
  padding: 0 0 8px;
}

.feed-list-pane > .feed-list-header,
.feed-list-pane > *:not(.feed-list) {
  padding-left: clamp(16px, 4vw, 48px);
  padding-right: clamp(16px, 4vw, 48px);
}

.feed-list-header {
  margin-bottom: 16px;
}

.feed-list {
  display: flex;
  flex-direction: column;
}

/* Migration notice above the legacy search composer. */


/* Full-width search composer. Secondary controls live underneath it. */
.search-composer-row {
  display: flex;
  align-items: flex-start;
}

.search-composer-box {
  position: relative;
  flex: 1 1 auto;
  min-width: min(100%, 380px);
}

.search-composer-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 9px;
}

.search-composer-under {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-top: 3px;
}

/* One row whenever the controls fit, and a wrapped row when they do not — but
   never a crushed one. Flex items shrink before they wrap, and
   `.search-window-toggle` sets `overflow: hidden`, which drops its automatic
   minimum size to zero; under the old `flex-wrap: nowrap` that made it the one
   control with no width floor, so it was squeezed to a sliver and then out of
   existence as soon as an admin's extra controls (stopwatch, audit link) made
   the row too wide. Refusing to shrink turns that into a wrap. */
.search-composer-under > * {
  flex-shrink: 0;
}

/* Logged-out composer: says why the disabled search button is disabled. */
.search-composer-signin-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-composer-signin-note a {
  color: var(--link);
  text-decoration: underline;
}

.search-composer-under .search-pill {
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 0.78rem;
}

.search-composer-under .search-toolbar-save {
  margin-left: 2px;
}

.search-composer-under .search-toolbar-save .search-save-input {
  width: 190px;
}

.search-submit {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.search-submit:hover:not(:disabled),
.search-submit:focus-visible:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.search-submit:disabled {
  cursor: default;
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--faint);
}

/*
 * Segmented lookback control. The dark theme's --panel sits ~1 step off --bg,
 * so a panel-on-page chip with a --line hairline reads as nothing at all; use
 * the stronger surface + border so the control is visibly a control, and label
 * it so two bare "24h/72h" chips aren't the only cue for what it does.
 */
.search-window-toggle {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-strong);
}

.search-window-toggle button {
  padding: 3px 10px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.search-window-toggle button:hover:not(.active) {
  background: var(--bg-hover);
}

.search-window-toggle button:last-child {
  border-right: 0;
}

.search-window-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

/* Admin stopwatch, matching the lookback toggle it sits beside. Tabular
   figures and a fixed min-width keep the digits from shifting the row as they
   count up. */
.search-stopwatch {
  display: inline-block;
  min-width: 52px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: default;
}

.search-stopwatch.running {
  border-color: var(--green-300);
  color: var(--ink);
}

.search-composer-input {
  width: 100%;
  box-sizing: border-box;
  display: block;
  max-height: 168px;
  overflow-y: auto;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--panel);
}

.search-composer-input::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

.search-composer-input:focus {
  outline: none;
  border-color: var(--green-300);
  box-shadow: 0 0 0 3px rgba(43, 158, 151, 0.12);
}


.search-composer-submit:hover:not(:disabled),




.saved-search-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.saved-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 13px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.saved-search-pill:hover,
.saved-search-pill:focus-visible {
  border-color: var(--line);
  background: var(--panel-strong);
}

.saved-search-dropdown-wrap {
  position: relative;
}

.saved-search-dropdown-toggle svg {
  flex: 0 0 auto;
}

.saved-search-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(320px, calc(100vw - 48px));
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(24, 39, 47, 0.14);
  background: var(--panel);
  padding: 6px;
}

.saved-search-dropdown-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.saved-search-dropdown-item:hover,
.saved-search-dropdown-item:focus-visible {
  background: var(--panel-strong);
}

.saved-search-dropdown-item.is-muted {
  color: var(--muted);
  cursor: default;
}

.search-options-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.search-options-summary::-webkit-details-marker {
  display: none;
}

.search-options-summary svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.feed-list-editor {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.feed-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line-faint);
  cursor: pointer;
  /* Clears the sticky header when keyboard nav scrolls a row into view. */
  scroll-margin-top: 72px;
  transition: background 100ms ease;
}

/* Unread signal: a hairline accent rule on the row's leading edge. */
.feed-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
}

.feed-item:hover {
  background: var(--bg-strong);
}

/* Keyboard focus uses several cues so read rows stay obvious in either theme. */
.feed-item.keyboard-focused,
.feed-item.keyboard-focused:hover {
  background: var(--accent-soft);
  opacity: 1;
}

.feed-item.keyboard-focused::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 4px;
  background: var(--accent);
}

.feed-item.read {
  opacity: 0.55;
}

.feed-item.read:hover {
  opacity: 0.85;
}

.feed-item-line1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

/* Only acts as a flex line-break in the mobile media query; inert otherwise. */
.feed-item-row-break {
  display: none;
}

.feed-item-title {
  display: flex;
  align-items: baseline;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

/* Keep fixed title markers visible: only the title text is allowed to shrink
   and ellipsize. Rows without markers reserve no marker space. */
.feed-item-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The marker's own leading space collapses when it becomes a flex item, so
   restore the gap between the title text and the marker explicitly. */
.feed-item-title > .gated-marker {
  flex-shrink: 0;
  margin-left: 0.3em;
}

.feed-item.unread .feed-item-title {
  font-weight: 600;
}

.feed-item-title a {
  color: inherit;
  text-decoration: none;
}

.feed-item-title a:hover {
  text-decoration: underline;
}

.feed-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.story-permalink-control {
  position: relative;
  display: inline-flex;
}

.story-permalink-message {
  position: static;
  margin-left: 4px;
  width: max-content;
  max-width: 220px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.story-permalink-message.error {
  color: #b91c1c;
}

.feed-item-external-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
  text-decoration: none;
}

.feed-item-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  width: 20px;
  height: 20px;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  opacity: 1;
  transition: opacity 0.15s;
}

.feed-item:hover .feed-item-external-link,
.feed-item.keyboard-focused .feed-item-external-link {
  opacity: 1;
}

.feed-item-action-btn.flagged,
.feed-item-action-btn.active {
  opacity: 1;
}

.feed-item-external-link:hover {
  color: var(--accent);
}

.feed-item-action-btn:hover {
  color: var(--accent);
}

.feed-item-action-btn.flagged {
  color: var(--warn, #d97706);
}

.feed-item-action-btn.active {
  color: var(--accent);
}

.feed-item-action-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

.feed-item-action-btn:disabled:hover {
  color: var(--muted);
}

.flag-action-menu {
  position: relative;
  display: inline-flex;
}

.flag-action-menu-popover {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 150px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.flag-action-menu:hover .flag-action-menu-popover,
.flag-action-menu:focus-within .flag-action-menu-popover,
.flag-action-menu-popover.context-open {
  display: flex;
  flex-direction: column;
}

.flag-action-menu-popover button {
  padding: 5px 8px;
  border: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.flag-action-menu-popover button:hover,
.flag-action-menu-popover button:focus-visible {
  background: #f3f4f6;
}

.feed-item-line2 {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
}

/* Age sits on the title line, right-aligned against the expand chevron. */
.feed-item-line1 .feed-item-age {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  opacity: 1;
}

.feed-item-domain {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  min-width: 0;
  max-width: min(36ch, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-item-via {
  font-weight: 400;
  color: var(--muted);
}
.feed-item-domain-link {
  color: inherit;
  text-decoration: none;
}
.feed-item-domain-link:hover {
  text-decoration: underline;
}

.feed-item-source {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item-source::before {
  content: "via ";
  opacity: 0.6;
}

.feed-item-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--panel-strong);
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item-age {
  color: var(--muted);
  opacity: 0.7;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.72rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item-reading-time {
  color: var(--muted);
  opacity: 0.55;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.72rem;
  white-space: nowrap;
}

.detail-reading-time {
  opacity: 0.7;
}

.detail-gated {
  color: var(--warning, #b45309);
  opacity: 0.8;
  font-weight: 500;
}

/* Newsletter relevance badges */
.nl-badges {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.nl-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  line-height: 1.4;
  transition: opacity 0.15s;
}

.nl-badge:hover {
  opacity: 0.8;
}

.nl-badge-4 {
  background: rgba(76, 175, 80, 0.18);
  color: #4caf50;
}

.nl-badge-5 {
  background: rgba(46, 125, 50, 0.22);
  color: #2e7d32;
}

.nl-badge-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 3px;
  border: 1px dashed var(--line);
  background: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}

.nl-badge-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feed-item-stats {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  align-items: center;
}

.feed-item-score-btn {
  background: none;
  border: none;
  padding: 1px 4px;
  font-size: inherit;
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
  border-bottom: 1px dashed transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.feed-item-score-btn:hover {
  background: rgba(100, 149, 237, 0.15);
  color: cornflowerblue;
  border-bottom-color: cornflowerblue;
}

/* Admin score breakdown — inline with meta */
.feed-item-score-components {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  opacity: 0.75;
}

.score-total {
  font-weight: 600;
}

.score-sep {
  opacity: 0.4;
}

.feed-item-base-score {
  all: unset;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500, var(--muted));
  background: var(--gray-100, var(--panel-strong));
  border: 1px solid var(--line, var(--line));
  border-radius: 4px;
  padding: 0 5px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.5;
}

.feed-item-title-score {
  flex: 0 0 auto;
}
.feed-item-base-score:hover {
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-700, var(--ink));
}

/* Graded score chips: strong judgments read teal, weak ones fade. */
.feed-item-base-score.score-high {
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--green-700);
}
.feed-item-base-score.score-high:hover {
  background: var(--accent-soft);
  color: var(--green-800);
}
.feed-item-base-score.score-low {
  background: transparent;
  border-color: transparent;
  color: var(--gray-400, var(--muted));
}
.feed-item-base-score.score-low:hover {
  background: var(--gray-100, var(--panel-strong));
  color: var(--gray-600, var(--ink));
}

.judgment-run-tag {
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.68rem;
  background: var(--gray-800, #1f2937);
  color: var(--gray-400, var(--muted));
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid var(--gray-700, #374151);
  letter-spacing: 0.02em;
}
.judgment-run-tag:hover {
  color: var(--gray-200, #e5e7eb);
  border-color: var(--gray-600, #4b5563);
}

.feed-item-score-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.score-rule-chip {
  opacity: 0.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-rule-chip.matched {
  opacity: 0.8;
}

.score-rule-field {
  font-weight: 500;
}

/* Curator override edit button — tiny pencil icon inline */
.curator-override-btn {
  background: none;
  border: none;
  padding: 0 2px;
  margin-left: 3px;
  cursor: pointer;
  color: var(--gray-400, var(--muted));
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  vertical-align: middle;
  line-height: 1;
}
.curator-override-btn:hover {
  opacity: 1;
  color: cornflowerblue;
}

/* Score feedback modal */
.score-feedback-modal {
  max-width: 380px;
  width: 100%;
  padding: 20px 24px;
}

.admin-score-modal {
  max-width: 440px;
}

.admin-score-modal-copy {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.admin-score-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-score-picker-btn {
  height: 40px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.admin-score-picker-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.admin-score-picker-btn.selected {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.admin-score-picker-btn:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.admin-score-modal-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.admin-score-comment {
  min-height: 96px;
}

.score-feedback-modal-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.score-feedback-modal-article {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-feedback-modal-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.score-feedback-modal-label {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-feedback-select {
  font-size: 0.85rem;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
}

.score-feedback-justification {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-strong);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.score-feedback-comment {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  resize: vertical;
  margin-bottom: 14px;
}

.score-feedback-modal-actions {
  display: flex;
  gap: 8px;
}

.score-feedback-modal-done {
  font-size: 0.85rem;
  color: var(--accent);
  padding: 8px 0;
}

/* ── Feed membership feedback button ──────────────────────────────────── */
.feed-membership-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.feed-membership-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.feed-item-introspect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}

.feed-item-introspect-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.modal-content.smart-feed-events-modal {
  max-width: 760px;
  width: 100%;
  padding: 20px 24px;
}

.smart-feed-events-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.smart-feed-events-title {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--ink);
}

.smart-feed-events-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.smart-feed-events-empty {
  font-size: 0.84rem;
  color: var(--muted);
}

.smart-feed-events-error {
  color: #b91c1c;
}

.smart-feed-events-list {
  display: grid;
  gap: 12px;
}

.smart-feed-event-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
}

.smart-feed-event-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.smart-feed-event-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smart-feed-event-badge.is-in {
  background: rgba(138, 229, 173, 0.14);
  color: #8ae5ad;
}

.smart-feed-event-badge.is-out {
  background: rgba(234, 134, 134, 0.14);
  color: #ea8686;
}

.smart-feed-event-current {
  font-size: 0.72rem;
  font-weight: 600;
  color: #819eee;
  background: rgba(129, 158, 238, 0.14);
  border-radius: 999px;
  padding: 2px 8px;
}

.smart-feed-event-time {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

.smart-feed-event-meta {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.4;
}

.smart-feed-event-mono {
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
}

.smart-feed-event-justification {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.45;
}

/* ── Feed membership modal ───────────────────────────────────────────── */
.feed-membership-modal {
  max-width: 520px;
  width: 100%;
  padding: 20px 24px;
}

.feed-membership-article-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-membership-loading,
.feed-membership-error {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 12px 0;
}

.feed-membership-error {
  color: var(--warn, #ef4444);
}

.feed-membership-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 50vh;
  overflow-y: auto;
}

.feed-membership-row {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.feed-membership-row:last-child {
  border-bottom: none;
}

.feed-membership-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-membership-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}
.feed-membership-indicator.in-feed {
  background: var(--green-100, rgba(132, 235, 171, 0.14));
  color: var(--green-700, #84ebab);
}
.feed-membership-indicator.not-in-feed {
  background: var(--gray-100, var(--panel-strong));
  color: var(--gray-400, var(--muted));
}

.feed-membership-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-membership-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.feed-membership-prior {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.feed-membership-prior.prior-should {
  background: var(--green-100, rgba(132, 235, 171, 0.14));
  color: var(--green-700, #84ebab);
}
.feed-membership-prior.prior-shouldnt {
  background: rgba(236, 131, 131, 0.14);
  color: #ec8383;
}

.feed-membership-saved {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.feed-membership-action-btn {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.feed-membership-action-btn:hover {
  background: var(--gray-100, var(--panel-strong));
  border-color: var(--accent);
}

.feed-membership-cancel-btn {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.feed-membership-expand {
  margin-top: 8px;
  margin-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-membership-justification {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  background: var(--panel);
  color: var(--ink);
}
.feed-membership-justification:focus {
  outline: none;
  border-color: var(--accent);
}

.feed-membership-expand .primary-button {
  align-self: flex-start;
  font-size: 0.78rem;
  padding: 5px 14px;
}

.feed-membership-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Curation data table */
.curation-data-table-wrap {
  overflow-x: auto;
}

.curation-data-table {
  width: 100%;
  min-width: 1080px;
  table-layout: auto;
}

.curation-data-table td,
.curation-data-table th {
  padding: 14px 12px;
  vertical-align: top;
}

.curation-data-table th {
  background: var(--panel);
}

.curation-data-row:hover {
  background: rgba(197, 232, 255, 0.14);
}

.curation-data-title {
  min-width: 320px;
  width: 34%;
}

.curation-data-title-link {
  display: inline-block;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}

.curation-data-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.curation-data-pill-quality {
  background: rgba(151, 216, 163, 0.14);
  color: #97d8a3;
}

.curation-data-pill-topic {
  background: rgba(239, 175, 129, 0.14);
  color: #efaf81;
}

.curation-data-pill-duplicate {
  background: rgba(146, 156, 222, 0.14);
  color: #929cde;
}

.curation-data-pill-neutral {
  background: var(--panel-strong);
  color: var(--muted);
}

.curation-data-detail-cell {
  min-width: 180px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.curation-data-detail-change {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.curation-data-detail-link,
.curation-data-detail-topic {
  color: var(--ink);
}

.curation-data-score {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.curation-data-score-new {
  font-weight: 600;
  color: var(--accent);
}

.curation-data-comment {
  min-width: 220px;
  max-width: 280px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.curation-data-curator {
  white-space: nowrap;
}

.curation-data-curator-name {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.curation-data-empty-value {
  color: var(--muted);
  font-style: italic;
}

.curation-data-when {
  min-width: 170px;
}

.curation-data-when-relative {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.curation-data-when-absolute {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.35;
}

.curation-data-actions {
  width: 120px;
  white-space: nowrap;
}

.curation-data-open-btn,
.curation-data-delete-btn {
  font-size: 0.76rem;
  padding: 5px 9px;
}

.curation-data-open-btn {
  margin-right: 8px;
}

.curation-data-delete-btn {
  color: #b83232;
}

.comment-expand-btn {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: inherit;
}

.comment-expand-btn:hover {
  text-decoration: underline;
}

/* Filter dropdowns */
.filter-header {
  display: inline-block;
}

.filter-header-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.filter-header-btn:hover {
  color: var(--accent);
}

.filter-chevron {
  font-size: 0.65rem;
  opacity: 0.6;
}

.filter-active-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
}

.filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  z-index: 10;
  min-width: 140px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.filter-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: var(--ink);
  white-space: nowrap;
}

.filter-dropdown-item:hover {
  background: var(--bg-hover, var(--panel-strong));
}

.filter-dropdown-item-active {
  font-weight: 600;
  color: var(--accent);
}

.filter-dropdown-clear {
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
  padding-bottom: 6px;
}

/* Sortable headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--accent);
}

.sort-chevron {
  font-size: 0.55rem;
  margin-left: 3px;
  opacity: 0.25;
  vertical-align: middle;
}

.sort-chevron-active {
  opacity: 0.8;
  color: var(--accent);
}

.feed-item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.feed-item-meta > * {
  flex: 0 0 auto;
}

.feed-item-meta .feed-item-domain,
.feed-item-meta .feed-item-source {
  flex: 0 0 auto;
}

.feed-item-meta .feed-item-tag,
.feed-item-meta .feed-item-age {
  flex: 0 1 auto;
}

.feed-item-topic-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: 0 1 auto;
}

.feed-item-topic {
  all: unset;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.72;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
}

/* Only the topic text ellipsizes; the "(N)" count stays visible after it. */
.feed-item-topic-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.feed-item-topic:hover {
  color: var(--ink);
  opacity: 1;
}

.feed-item-topic-count {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Placeholder for rows with nothing to expand — keeps the age aligned. */
.feed-item-summary-toggle-spacer {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin: -4px 0;
  flex-shrink: 0;
}

/* Chevron on the title line — rotates 180° when the row is open. */
.feed-item-summary-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -4px 0;
  background: none;
  border: none;
  padding: 0;
  color: var(--faint);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: color 120ms cubic-bezier(.25, .46, .45, .94);
}

.feed-item-summary-toggle:hover {
  color: var(--ink);
}

.feed-item-summary-toggle svg {
  transition: transform 160ms cubic-bezier(.25, .46, .45, .94);
}

.feed-item-summary-toggle.expanded svg {
  transform: rotate(180deg);
}

/* Give the main feed's otherwise minimal expand affordance a little more
   presence without turning it into a competing visual element. */
.feed-item.compact-reader .feed-item-summary-toggle {
  width: 28px;
  height: 28px;
  margin: -6px 0;
  color: var(--muted);
}

.feed-item.compact-reader .feed-item-summary-toggle svg {
  width: 14px;
  height: 14px;
}

.feed-item-expanded {
  margin: 12px 0 2px 0;
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

/* Sections in the expanded panel are separated by space, not rules. */
.feed-item-expanded > * + * {
  margin-top: 18px;
  padding-top: 0;
  border-top: none;
}

.feed-item-expanded-summary {
  position: relative;
}

.feed-item-section-header {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 10px;
}

/* Hydration stops at the backend's TOPIC_MATE_HYDRATE_LIMIT, so a mega-cluster
   lists fewer sources than the topic count beside the headline claims. Say so
   rather than letting the two numbers silently disagree. */
.feed-item-section-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.feed-item-summary-actions {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed-item-summary {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  text-wrap: pretty;
}

.feed-item-details-empty {
  color: var(--muted);
  font-style: italic;
}

.feed-item-summary-edit-btn {
  background: none;
  border: none;
  padding: 1px 2px;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.4;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.15s;
}

.feed-item-summary-edit-btn:hover {
  opacity: 1;
}

.feed-item-summary-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-item-summary-textarea {
  width: 100%;
  font-size: 0.82rem;
  font-family: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
}

.feed-item-summary-edit-actions {
  display: flex;
  gap: 6px;
}

.summary-save-btn,
.summary-cancel-btn {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--line);
}

.summary-save-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.summary-save-btn:disabled,
.summary-cancel-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.summary-cancel-btn {
  background: none;
  color: var(--muted);
}

/* ── Topic alternates ── */

.feed-item-alternates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-item-alternates-list a {
  color: var(--accent-strong);
  text-decoration: none;
}

.feed-item-alternates-list a:hover {
  text-decoration: underline;
}

.feed-item-alternates-meta {
  display: inline;
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 6px;
}

.feed-item-alternates-meta > span + span::before {
  content: " · ";
}

.feed-item-alternates-domain {
  color: var(--muted);
  font-size: 0.72rem;
}

.feed-item-alternates-age {
  color: var(--muted);
  font-size: 0.72rem;
}

.feed-item-alternates-reading {
  color: var(--muted);
  font-size: 0.72rem;
}

.feed-item-context-list {
  margin: 0;
  padding-left: 1.1rem;
}

/* Semantic bullets keep the prose and its citations in one compact column. */
.feed-item-context-fact {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 2px;
}

.feed-item-context-fact:last-child {
  margin-bottom: 0;
}

.feed-item-context-fact::marker {
  content: "•  ";
  color: var(--line-strong);
}

.feed-item-context-sources {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  line-height: 1.45;
  margin-top: 2px;
}

.feed-item-context-sources::before {
  content: "Sources: ";
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.feed-item-context-sources a {
  color: inherit;
  text-decoration: none;
}

.feed-item-context-sources a:hover,
.feed-item-context-sources a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.feed-item-discussion-picks {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-item-discussion-pick-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.feed-item-discussion-pick-meta {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 6px;
}

.feed-item-discussion-pick-summary {
  color: var(--ink);
}

.feed-item-discussion-pick-link:hover .feed-item-discussion-pick-summary {
  text-decoration: underline;
}

/* ── Summary edit in article detail view ── */

.summary-edit-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-edit-textarea {
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}

.summary-edit-actions {
  display: flex;
  gap: 8px;
}

/* ── Article read page ── */

.article-read-navbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 44px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.article-read-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px 4px 2px;
  border-radius: 6px;
  transition: background 100ms ease;
}

.article-read-back:hover {
  background: var(--accent-soft);
}

.article-read-domain {
  font-size: 0.78rem;
  color: var(--muted);
}

.article-read-main {
  flex: 1;
  overflow-y: auto;
  background: var(--panel);
}

.article-read-main .story-detail-pane {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 32px 64px;
  background: var(--panel);
  border: none;
}

@media (max-width: 720px) {
  .article-read-main .story-detail-pane {
    padding: 20px 16px 48px;
  }
}

.story-detail {
  max-width: 820px;
}

.story-detail-header {
  display: grid;
  gap: 8px;
}

.story-detail-header h2 {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.title-external-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 120ms ease, color 120ms ease;
  vertical-align: middle;
}

.title-external-link:hover {
  opacity: 1;
  color: var(--accent-strong);
}

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.detail-author {
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 500;
}

.detail-score-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: 0.7;
  margin-left: 4px;
}

.detail-score-item {
  font-size: inherit;
}

.detail-score-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: inherit;
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}

.detail-score-btn:hover {
  background: var(--panel-strong);
  color: var(--fg);
  opacity: 1;
}

.detail-status-icons {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.status-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.55;
  transition: opacity 120ms ease, color 120ms ease;
}

.status-icon-btn:hover {
  opacity: 1;
  color: var(--ink);
}

.status-icon-btn.read {
  opacity: 1;
  color: var(--accent);
}

.status-icon-btn.flagged {
  opacity: 1;
  color: var(--accent-strong);
}

.status-icon-btn.note-open {
  opacity: 1;
  color: var(--accent);
}

.status-icon-btn.note-has-content {
  opacity: 0.8;
  color: var(--accent);
}

.article-note-panel {
  margin-top: 10px;
  padding: 10px 12px 8px;
  background: var(--bg-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.article-note-textarea {
  display: block;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--panel);
  outline: none;
  transition: border-color 120ms ease;
}

.article-note-textarea:focus {
  border-color: var(--accent);
}

.article-note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  min-height: 15px;
}

.article-note-status {
  font-size: 11px;
  color: var(--muted);
}

.article-note-delete-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.6;
}

.article-note-delete-btn:hover {
  color: var(--danger, #c0392b);
  opacity: 1;
}

.article-note-loading {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 10px;
  background: var(--accent-soft);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.admin-topic-badge {
  font-size: 0.78rem;
  padding: 1px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  margin-left: auto;
}

.admin-topic-badge--empty {
  background: none;
  color: var(--muted);
  font-style: italic;
  opacity: 0.6;
  border: 1px dashed var(--muted);
}

.admin-topic-badge:hover {
  opacity: 0.8;
  filter: brightness(0.95);
}

.admin-topic-badge--empty:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent-strong);
}

.admin-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent-strong);
  border-radius: 4px;
  opacity: 0.65;
  transition: opacity 120ms ease, background 120ms ease;
}

.admin-icon-link:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.lifecycle-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.lifecycle-arrow {
  color: var(--line);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0 2px;
}

.lifecycle-step {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: default;
  line-height: 1.4;
}

.lifecycle-step.step-done {
  color: var(--muted);
}

.lifecycle-step.step-current {
  background: var(--bg-strong);
  color: var(--ink);
}

.lifecycle-step.step-available {
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform 100ms ease, background 100ms ease;
}

.lifecycle-step.step-available:hover {
  transform: translateY(-1px);
  background: var(--accent);
  color: #fff;
}

.lifecycle-step.step-locked {
  color: var(--muted);
  opacity: 0.45;
}

.lifecycle-step.step-queued {
  background: var(--warning-soft, rgba(241, 170, 126, 0.14));
  color: var(--warning-strong, #f1aa7e);
  cursor: default;
}

.lifecycle-dropdown {
  position: relative;
  display: inline-flex;
}

.lifecycle-step-dropdown {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lifecycle-step-dropdown:hover {
  color: var(--ink);
}

.lifecycle-dropdown-caret {
  font-size: 0.6rem;
  opacity: 0.5;
  line-height: 1;
}

.lifecycle-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  z-index: 100;
  min-width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lifecycle-dropdown-item {
  display: block;
  width: 100%;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
}

.lifecycle-dropdown-item:hover {
  background: var(--bg-strong);
}

.linked-url-row {
  margin-top: 14px;
}

.linked-url-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  transition: color 120ms ease, border-color 120ms ease;
}

.linked-url-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.content-updated-notice {
  margin-top: 16px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--text-secondary, var(--muted));
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid rgba(59, 130, 246, 0.4);
  border-radius: 2px;
}

.detail-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}


.detail-section h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-section p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.7;
}

.detail-content {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.detail-content p,
.detail-content blockquote,
.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6,
.detail-content ul,
.detail-content ol,
.detail-content pre,
.detail-content hr,
.detail-content figure {
  margin-bottom: 12px;
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6 {
  margin-top: 24px;
}

.detail-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin-left: 0;
  color: var(--muted);
}

.detail-content img {
  max-width: 100%;
  height: auto;
}

.feed-list-more {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
}

.feed-list-more .secondary-button:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
}

.empty-panel {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.detail-empty {
  min-height: 60vh;
}

.admin-shell {
  min-height: 100vh;
  padding: 0 24px 40px;
}

.admin-shell .reader-navbar {
  margin: 0 -24px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-crumb {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 10px;
}

.admin-crumb:hover {
  color: var(--accent);
}

.segmented-control {
  display: inline-flex;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  margin-bottom: 24px;
}

.segmented-control-item {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.segmented-control-item:hover {
  background: var(--gray-200);
  color: var(--ink);
}

.segmented-control-item.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-page-title {
  margin-bottom: 20px;
}

.admin-page-title h1 {
  margin: 0;
}

.change-detail-source-card {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.change-detail-source-label {
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.change-detail-source-grid {
  display: grid;
  gap: 12px;
}

.change-detail-source-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.change-detail-source-key {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.change-detail-source-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.change-detail-source-meta {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.change-detail-source-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.admin-header h1,
.site-card h3 {
  margin: 0;
}

.admin-panel h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.admin-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-grid,
.tuning-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow-x: auto;
}

.admin-panel.tuning-form {
  max-width: 800px;
  margin: 0 auto;
}

.score-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.score-settings-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.score-settings-group h2 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.score-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.score-setting-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.score-setting-copy {
  min-width: 0;
}

.score-setting-key {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink);
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
}

.score-setting-description,
.score-setting-meta {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.score-setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-setting-control input {
  width: 92px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.9rem;
}

.relevance-multiplier-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}

.relevance-multiplier-slider input[type='range'] {
  width: 160px;
  padding: 0;
  border: 0;
  background: transparent;
}

.relevance-multiplier-readout {
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
}

.score-setting-error {
  grid-column: 1 / -1;
  color: var(--error, #dc2626);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .score-settings-grid {
    grid-template-columns: 1fr;
  }

  .score-setting-row {
    grid-template-columns: 1fr;
  }

  .score-setting-control {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.tuning-prompt-textarea {
  font-size: 1rem;
  line-height: 1.6;
  font-family: inherit;
  min-height: 320px;
  resize: vertical;
}

.site-card-actions.panel-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.site-form,
.site-form-grid {
  display: grid;
  gap: 14px;
}

.site-form label,
.site-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-field-group {
  display: grid;
  gap: 18px;
}

.field-help {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.site-form input,
.site-form textarea,
.site-form-grid input,
.site-form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-form input:focus,
.site-form textarea:focus,
.site-form-grid input:focus,
.site-form-grid textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.sites-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sites-filter-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--ink);
}

.sites-sort-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.sites-sort-controls select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
}

.sites-sort-dir-button {
  padding: 8px 12px !important;
  font-size: 0.85rem;
}

.site-list,
.tuning-list {
  display: grid;
  gap: 14px;
}

.site-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 18px;
}

.site-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.site-domain,
.site-meta {
  color: var(--muted);
}

.site-meta {
  margin-top: 8px;
  font-size: 0.9rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-fetch-status {
  color: var(--ink);
  opacity: 0.7;
}

.site-fetch-error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 12px 0;
  background: var(--error-soft);
  padding: 8px 12px;
  border-radius: 10px;
  word-break: break-all;
}

.site-form-grid {
  margin-top: 14px;
}

.site-notes-row {
  grid-column: 1 / -1;
}

.site-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.danger-button {
  color: #7c2d20;
  border-color: #d7a193;
}

.inactive-pill {
  background: var(--gray-200);
  color: var(--gray-600);
}

.site-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-domain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.score-pill {
  font-size: 0.75rem;
  padding: 2px 7px;
  font-weight: 600;
}

.score-1 { background: rgba(233, 134, 134, 0.14); color: #e98686; }
.score-2 { background: rgba(241, 185, 126, 0.14); color: #f1b97e; }
.score-3 { background: rgba(241, 215, 126, 0.14); color: #f1d77e; }
.score-4 { background: rgba(126, 241, 209, 0.14); color: #7ef1d1; }
.score-5 { background: rgba(126, 241, 211, 0.14); color: #7ef1d3; }

/* ── Inline score editor popover (Sites table) ──────────────────── */
.score-cell {
  position: relative;
  display: inline-block;
}

.score-pill.score-empty {
  opacity: 0.5;
  color: var(--muted);
}

.score-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.score-popover-options {
  display: flex;
  gap: 6px;
}

.score-popover-option {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.score-popover-option:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.score-popover-option.is-current {
  border-color: var(--accent-strong);
}

.score-popover-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.score-popover-error {
  font-size: 0.75rem;
  color: var(--warn);
}

.score-popover-suggest {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
}

.score-popover-suggest:hover {
  color: var(--ink);
}

.stories-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.stories-search-bar .sites-filter-input {
  flex: 1;
}

.fetch-recent-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.fetch-hours-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

.fetch-hours-input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
  font-size: 0.875rem;
  text-align: center;
  color: var(--ink);
}

.fetch-hours-input:disabled {
  opacity: 0.5;
}

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

/* Admin overlay data loading over the reader's rows (admin mode switched on). */
.feed-admin-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.story-domain-link {
  color: var(--accent);
  text-decoration: none;
}

.story-domain-link:hover {
  text-decoration: underline;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.recent-searches-table {
  font-size: 0.78rem;
}

.recent-searches-table th,
.recent-searches-table td {
  padding: 6px 8px;
  white-space: nowrap;
}

.recent-searches-table td:first-child {
  white-space: normal;
  min-width: 240px;
}

.admin-table-sort {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

.search-type-badge {
  border-radius: 3px;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 5px;
  text-transform: uppercase;
}

.search-type-badge.ordinary { background: var(--panel-strong); color: var(--muted); }
.search-type-badge.fast { background: rgba(139, 228, 181, 0.14); color: #8be4b5; }

.users-table th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.users-table td {
  color: var(--ink);
}

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

.add-article-btn {
  background: none;
  border: none;
  padding: 0 4px;
  margin-left: 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.1s;
}

.add-article-btn:hover {
  color: var(--accent);
}

/* Articles table */
.articles-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.articles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.articles-table th,
.articles-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.articles-table th {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.articles-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.1s;
}

.articles-table th.sortable:hover {
  color: var(--accent-strong);
}

.articles-table th .th-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.articles-table th .sort-icon {
  opacity: 0;
  font-size: 0.85em;
  transition: opacity 0.1s;
  letter-spacing: 0;
}

.articles-table th.sortable:hover .sort-icon {
  opacity: 0.3;
}

.articles-table th.sorted .sort-icon {
  opacity: 0.7;
}

.articles-table tbody tr:hover td {
  background: var(--bg-strong);
}

.articles-table tbody tr:last-child td {
  border-bottom: none;
}

.articles-table .col-title {
  min-width: 320px;
  max-width: 560px;
  width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.articles-table .col-title a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.articles-table .col-title a:hover {
  text-decoration: underline;
}

.articles-table .col-topic {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}
.articles-table .col-topic.expanded {
  white-space: normal;
  overflow: visible;
  max-width: 240px;
}

.col-title-topic {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.col-title-topic--empty {
  opacity: 0.45;
  font-style: italic;
}

.articles-table .col-site {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.82rem;
}

.articles-table .col-rank {
  width: 52px;
  text-align: center;
  color: var(--muted);
}

.articles-table .col-uuid {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.uuid-copy-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: border-color 0.15s, color 0.15s;
}

.uuid-copy-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.uuid-copy-btn.uuid-copied {
  border-color: var(--green-600, #16a34a);
  color: var(--green-600, #16a34a);
}

.uuid-copy-icon {
  font-size: 0.72rem;
}

.score-high { color: var(--accent); }
.score-mid  { color: var(--warn-amber, #b45309); }
.score-low  { color: var(--warn); }
.score-null { color: var(--muted); }

.scores-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.6rem;
  padding: 0 2px;
  line-height: 1;
  vertical-align: middle;
}

.scores-expand-btn:hover {
  color: var(--ink);
}

.newsletter-scores-row td {
  padding: 6px 16px 10px;
  background: var(--bg-strong);
}

.newsletter-scores-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ns-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ns-badge .ns-score {
  font-weight: 700;
}

.score-high .ns-score { color: var(--accent); }
.score-mid  .ns-score { color: var(--warn-amber, #b45309); }
.score-low  .ns-score { color: var(--warn); }
.score-null .ns-score { color: var(--muted); }

.ns-empty {
  font-size: 0.8rem;
  color: var(--muted);
}

.articles-table .col-score {
  width: 46px;
  text-align: right;
  padding-left: 2px;
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted);
}

.articles-table .col-tier {
  width: 30px;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
  color: var(--muted);
}

.articles-table .col-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.articles-table .col-fetched,
.articles-table .col-bool {
  width: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding-left: 2px;
  padding-right: 2px;
}

.articles-table th.col-bool-header {
  width: 28px;
  padding: 0 2px;
  text-align: center;
}

.articles-table th.col-bool-header .th-inner {
  white-space: nowrap;
  font-size: 0.7rem;
  line-height: 1;
}

.articles-table .col-links {
  width: 132px;
}

.article-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel, var(--panel-strong));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-badge-load {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.1s, border-color 0.1s;
}

.score-badge-load:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.score-badge-load:disabled {
  cursor: default;
  opacity: 0.6;
}

.article-links a,
.article-link-copy {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s;
}

.article-links a:hover,
.article-link-copy:hover:not(:disabled) {
  color: var(--accent);
}

.article-link-disabled {
  color: var(--line);
  font-size: 0.85rem;
  cursor: default;
}

.article-link-copy:disabled {
  opacity: 0.5;
  cursor: default;
}

.curation-notes-table .curation-notes-id {
  font-family: monospace;
  font-size: 12px;
  white-space: nowrap;
}

.curation-notes-table .curation-notes-title {
  max-width: 280px;
}

.curation-notes-extlink {
  margin-left: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.curation-notes-action {
  font-size: 12px;
  white-space: nowrap;
}

.curation-notes-eye {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 0 4px;
}

.curation-notes-eye:hover {
  color: var(--accent);
}

.curation-notes-when {
  font-size: 12px;
  white-space: nowrap;
}

.curation-notes-expand td {
  padding-top: 0;
  padding-bottom: 12px;
}

.curation-notes-pre {
  margin: 0;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-strong);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--ink);
}

/* ── My Activity page ─────────────────────────────────────── */

.my-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.my-activity-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.my-activity-user-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.my-activity-user-picker label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.my-activity-user-picker input,
.my-activity-user-picker select,
.my-activity-filter select {
  font-size: 0.82rem;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.my-activity-count {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.my-activity-table {
  table-layout: fixed;
}

.my-activity-table th:nth-child(1) { width: 150px; }
.my-activity-table th:nth-child(2) { width: auto; }
.my-activity-table th:nth-child(3) { width: 140px; }
.my-activity-table th:nth-child(4) { width: 170px; }

.my-activity-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-activity-extlink {
  margin-left: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.my-activity-extlink:hover {
  color: var(--accent);
}

.my-activity-domain {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-activity-when {
  font-size: 0.82rem;
  white-space: nowrap;
}

.activity-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-strong);
  color: var(--muted);
}

.activity-badge--flag      { background: rgba(241, 170, 126, 0.14); color: #f1aa7e; }
.activity-badge--unflag    { background: var(--panel-strong); color: var(--muted); }
.activity-badge--expand    { background: rgba(241, 170, 126, 0.14); color: #f1aa7e; }
.activity-badge--click_external { background: rgba(133, 157, 234, 0.14); color: #859dea; }
.activity-badge--return_to_feed { background: rgba(126, 199, 241, 0.14); color: #7ec7f1; }
.activity-badge--read      { background: rgba(126, 241, 209, 0.14); color: #7ef1d1; }
.activity-badge--unread    { background: var(--panel-strong); color: var(--muted); }
.activity-badge--show_summary  { background: rgba(241, 170, 126, 0.14); color: #f1aa7e; }
.activity-badge--expand_topic  { background: rgba(126, 199, 241, 0.14); color: #7ec7f1; }

.subtle-link {
  color: inherit;
  text-decoration: none;
}

.subtle-link:hover {
  color: var(--accent);
}

.sites-table {
  width: 100%;
  border-collapse: collapse;
}

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

.sites-table th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.sites-table td {
  color: var(--ink);
}

.sites-table tbody tr:hover {
  background: var(--accent-soft);
}

/* ── Modal: use .modal-backdrop + .modal-content for ALL modals ──────────
   RULE: modals must be visually sharp and fully opaque against the page.
   - .modal-backdrop: fixed full-screen dark overlay (z-index 1000)
   - .modal-content:  solid card (background: var(--panel) — never var(--bg)
     or any semi-transparent value; always fully opaque)
   Do NOT add opacity, rgba backgrounds, or backdrop-filter to these classes.
   SAME RULE applies to ALL dropdowns and popovers.
──────────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  position: relative;
}

.modal-content.tldr-prompt-modal {
  max-width: 720px;
}
.tldr-prompt-modal-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.story-list-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 10px;
}

.modal-content.subscribe-feed-modal {
  max-width: 440px;
}
.modal-content.confirm-modal {
  max-width: 480px;
}
.modal-content.rule-set-create-modal {
  max-width: 420px;
}
.modal-content.api-key-modal {
  max-width: 540px;
}
.modal-content.prompt-edit-modal {
  max-width: 760px;
}
.modal-content.score-breakdown-modal {
  max-width: 620px;
  padding: 20px 24px;
}
.score-breakdown-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.score-breakdown-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.score-breakdown-score {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.score-breakdown-cluster-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #f1aa7e;
  background: rgba(241, 170, 126, 0.14);
  border: 1px solid #fde68a;
  border-radius: 6px;
}
.score-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.score-breakdown-table td {
  padding: 4px 0;
  font-size: 0.82rem;
  color: var(--ink);
}
.score-breakdown-section td {
  padding-top: 10px;
  padding-bottom: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.score-breakdown-section:first-child td {
  padding-top: 0;
  border-top: 0;
}
.score-breakdown-label {
  font-weight: 500;
}
.score-breakdown-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
}
.score-breakdown-row-strong td {
  padding-top: 6px;
  font-weight: 700;
  color: var(--ink);
}
.score-breakdown-row-detail td {
  padding-top: 1px;
  padding-bottom: 1px;
  font-size: 0.74rem;
  color: var(--muted);
}
.score-breakdown-row-detail .score-breakdown-label {
  padding-left: 14px;
  font-weight: 400;
}
.score-breakdown-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-bottom: 16px;
}
.score-breakdown-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 2px 0;
  gap: 16px;
}
.score-breakdown-detail-row span:last-child {
  text-align: right;
}
.score-breakdown-mono {
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
}
.score-breakdown-justification {
  display: block;
}
.score-breakdown-justification span {
  display: block;
  text-align: left;
}
.score-breakdown-justification span:first-child {
  margin-bottom: 2px;
}
.score-breakdown-llm-judgments {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
.score-breakdown-llm-judgments h4 {
  margin: 0 0 0.65rem;
  color: var(--ink);
}
.score-breakdown-llm-judgment {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
  background: var(--panel);
}
.score-breakdown-llm-judgment-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.score-breakdown-llm-judgment-provenance {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.score-breakdown-llm-judgment p {
  margin: 0.35rem 0 0;
}
.score-breakdown-computed {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}
.score-breakdown-empty {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 12px 0;
}
.score-breakdown-close {
  all: unset;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 0;
  cursor: pointer;
  border-radius: 8px;
}
.score-breakdown-close:hover {
  background: var(--panel-strong);
  color: var(--ink);
}

.modal-content.article-search-modal {
  max-width: 960px;
  width: min(960px, 96vw);
  padding-bottom: 18px;
}

.article-search-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.article-search-modal-header h2 {
  margin: 0;
  color: var(--ink);
}

.article-search-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-search-modal-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
  max-height: calc(85vh - 220px);
  overflow-y: auto;
  padding-right: 4px;
}

.pane-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.pane-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}

.pane-action-btn:hover {
  opacity: 1;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.channel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.channel-heading-left {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.channel-heading-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-top: 1px;
}

.channel-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.channel-heading-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.channel-heading-name {
  margin: 0;
  font-weight: 500;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-heading-description {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 820px;
}

.channel-heading-description-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.channel-heading-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
  width: 100%;
  max-width: 960px;
}

.channel-setting-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--ink);
}

.channel-setting-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.channel-setting-endpoint {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.channel-setting-value {
  font-size: 0.78rem;
  color: var(--gray-600, var(--muted));
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.channel-setting-reset {
  padding: 1px 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.channel-setting-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.channel-setting-confirm {
  padding: 4px 16px;
  font-size: 0.78rem;
}

.channel-setting-cancel {
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.channel-heading-freshness {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
}

.channel-composer-empty {
  align-items: stretch;
  padding: 32px 24px;
}

.channel-composer-shell {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

.channel-composer-copy {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.inspect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.inspect-header h2 {
  font-size: 1rem;
  margin: 0;
}

.inline-fetch-button {
  padding: 2px 5px;
  font-size: 0.85rem;
  margin-left: 6px;
  opacity: 0.4;
  vertical-align: middle;
}

.inline-fetch-button:hover {
  opacity: 1;
}

.section-heading-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.section-heading-row h3 {
  margin: 0;
}

.inspect-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.inspect-section-btn:hover {
  opacity: 1;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.modal-content.inspect-html-modal {
  max-width: 860px;
  width: 90vw;
}

/* ── Add link modal ──────────────────────────────── */
.modal-content.add-link-modal {
  max-width: 520px;
}

.add-link-paste-hint {
  padding: 0.55rem 1rem;
  background: var(--accent-subtle, rgba(99, 102, 241, 0.1));
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  border-radius: 10px 10px 0 0;
}

.add-link-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.add-link-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 3px;
}

.add-link-modal-subtitle {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
}

.add-link-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
}

.add-link-close-btn:hover {
  color: var(--ink);
}

.add-link-form {
  display: grid;
  gap: 16px;
}

.add-link-label {
  display: grid;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.add-link-required {
  color: var(--warn);
}

.add-link-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.7;
}

.add-link-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.add-link-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.add-link-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.add-link-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.add-link-tier-picker {
  display: flex;
  gap: 7px;
}

.add-link-tier-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.add-link-tier-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-link-tier-btn.active {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.add-link-status {
  font-size: 0.88rem;
  padding: 9px 13px;
  border-radius: 8px;
}

.add-link-status.error {
  color: var(--warn);
  background: rgba(173, 63, 47, 0.08);
}

.add-link-status.success {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.add-link-flag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.add-link-flag-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.add-link-flag-toggle:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.add-link-list-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.add-link-list-items {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.add-link-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 0.84rem;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}
.add-link-list-item:hover {
  background: var(--bg-strong);
}
.add-link-list-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.add-link-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.add-link-kbd-hint {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: monospace;
  align-self: center;
}

.inspect-html-pre {
  margin: 0;
  font-family: monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

@media (max-width: 1040px) {
  .reader-shell {
    grid-template-columns: 1fr;
  }

  .reader-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reader-main {
    grid-template-columns: 1fr;
  }

  .story-list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-grid,
  .tuning-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Narrow (phone) fallback — three-row wrapping layout. At wider widths the
     packed two-line layout (title, then everything on one meta line) fits and
     is preferred; below this the meta line can't fit, so we wrap it:
       row 1 — title (full width)
       row 2 — score · icons · domain · feed · badge · time · reading time
       row 3 — (view summary) · topic (with source count)
     We flatten the two stacked row wrappers with display:contents so all their
     children live in one wrapping flex row, then re-group them with `order` and
     two zero-height full-width breaks. */
  .feed-item {
    padding: 5px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 6px;
    row-gap: 3px;
  }

  .feed-item-line1,
  .feed-item-line2,
  .feed-item-meta {
    display: contents;
  }

  .feed-item-row-break {
    display: block;
    flex-basis: 100%;
    width: 100%;
    height: 0;
    margin: 0;
  }

  /* Row 1 — title only. A phone-width row holds roughly forty characters, so
     headlines wrap onto a second line instead of ellipsizing mid-word. */
  .feed-item-title {
    order: 2;
    flex: 1 1 100%;
    font-size: 0.84rem;
    white-space: normal;
  }
  .feed-item-title-text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  /* break before row 2 */
  .feed-item > .feed-item-row-break:first-of-type {
    order: 5;
  }

  /* Row 2 */
  .feed-item-title-score {
    order: 6;
    font-size: 0.68rem;
    padding: 0 4px;
  }
  .feed-item-actions {
    order: 7;
    gap: 2px;
  }
  .feed-item-action-btn {
    width: 18px;
    height: 18px;
  }
  .feed-item-domain {
    order: 8;
    flex: 0 1 auto;
    min-width: 0;
  }
  .feed-item-source {
    order: 10;
    flex: 0 1 auto;
  }
  .feed-item-tag {
    order: 11;
    flex: 0 1 auto;
    max-width: 88px;
  }
  .feed-item-age {
    order: 12;
    flex: 0 1 auto;
  }
  /* Pack reading time next to the age instead of letting its base
     margin-left:auto shove it to the far right, which left mid-width rows
     with a large gap and split age/reading-time across wrapped lines. */
  .feed-item-reading-time {
    order: 13;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 0;
  }

  /* The compact TLDR row has no third metadata row; keep its expand control
     beside the publisher and reading time instead of floating underneath. */
  .feed-item.compact-reader .feed-item-summary-toggle {
    order: 14;
    margin-left: auto;
  }

  /* break before row 3 */
  .feed-item > .feed-item-row-break:last-of-type {
    order: 16;
  }

  /* Row 3 */
  .feed-item-summary-toggle {
    order: 17;
  }
  /* No chevron column to align against on mobile — drop the placeholder. */
  .feed-item-summary-toggle-spacer {
    display: none;
  }
  /* Fill the rest of row 3 beside (view summary) and ellipsize, so a long
     topic stays on the same line instead of wrapping to a fourth row. */
  .feed-item-topic-wrap {
    order: 18;
    min-width: 0;
    flex: 1 1 0;
  }
  .feed-item-topic {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
  }

  /* Expanded blocks always span the full width, below the three rows */
  .feed-item-expanded,
  .feed-item-summary-edit {
    order: 20;
    flex-basis: 100%;
    width: 100%;
  }

  /* Page chrome shares the row's gutter so the logo, the subscribe band and
     the story titles all start on the same vertical line. */
  .reader-navbar,
  .tldr-marketing,
  .reader-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* The header has to fit the phone's width. Tighten the gaps and the button
     padding, and let the account name — the one piece that can lose
     characters — shrink, instead of pushing "Sign out" past the right edge
     and leaving the page horizontally scrollable. */
  .reader-navbar {
    gap: 4px;
  }
  .reader-navbar-right {
    gap: 8px;
    min-width: 0;
  }
  .reader-special-channel-btn {
    padding: 5px 6px;
  }
  .reader-navbar-user {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .reader-navbar-signout {
    flex-shrink: 0;
    padding: 4px 8px;
  }
}

/* Smallest phones (iPhone SE and narrower) still can't fit the header, and the
   wordmark is the one piece it can lose: the mark alone still reads as the
   home button. */
@media (max-width: 380px) {
  .reader-navbar-brand .brand-word {
    display: none;
  }
  .reader-navbar {
    gap: 2px;
  }
  .reader-navbar-right {
    gap: 6px;
  }
}

/* ─── Curation work page ─────────────────────────────────────────────────── */

/* Layout */
.curation-main {
  grid-template-columns: minmax(380px, 500px) minmax(0, 1fr);
}

.curation-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.curation-back-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.curation-page-title {
  margin: 0;
  font-size: 20px;
}

.curation-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Status tabs */
.curation-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
}

.curation-tab {
  padding: 8px 12px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.curation-tab-count {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--bg-strong, var(--gray-100));
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

/* Age filter */
.curation-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

.curation-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.curation-filter-select {
  padding: 2px 4px;
  font: inherit;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  cursor: pointer;
}

.curation-filter-select:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.curation-filter-number {
  width: 52px;
  padding: 2px 6px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.curation-filter-number:disabled {
  background: var(--bg);
  color: var(--muted);
}

.curation-filter-text--muted {
  color: var(--muted);
}

/* Bulk action bars */
.curation-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.curation-bulk-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
}

.curation-bulk-sep {
  color: var(--muted);
}

.curation-bulk-count {
  font-weight: 600;
}

.curation-bulk-confirm-text {
  font-weight: 600;
}

.curation-bulk-confirm-text--danger { color: var(--warn); }
.curation-bulk-confirm-text--teal   { color: var(--accent); }

.curation-bulk-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.curation-bulk-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.curation-bulk-btn--danger         { background: var(--warn); color: #fff; }
.curation-bulk-btn--teal           { background: var(--accent); color: #fff; }
.curation-bulk-btn--outline-danger { background: none; border: 1px solid var(--warn); color: var(--warn); }
.curation-bulk-btn--outline-teal   { background: none; border: 1px solid var(--accent); color: var(--accent); }

.curation-cancel-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.curation-clear-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

/* Article card */
.curation-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: default;
  background: var(--panel);
  transition: border-color 0.1s;
}

.curation-card.focused {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.curation-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.curation-card-domain {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
}

.curation-card-date {
  font-size: 12px;
  color: var(--muted);
}

.curation-card-ext-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
}

.curation-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.curation-card-title-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  text-align: left;
  outline: none;
}

.curation-card-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.curation-summary-toggle {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
}

.curation-note-wrap {
  margin-bottom: 8px;
}

.curation-note-textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  resize: vertical;
}

.curation-note-discard {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
}

.curation-note-add {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0 8px;
}

.curation-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.curation-action-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.curation-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.curation-action-key {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
}

.curation-tier-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.curation-tier-1 { background: var(--gray-100); color: var(--gray-500); }
.curation-tier-2 { background: var(--gray-200); color: var(--gray-600); }
.curation-tier-3 { background: var(--gray-200); color: var(--gray-700); }
.curation-tier-4 { background: var(--green-100); color: var(--green-700); }
.curation-tier-5 { background: var(--green-200); color: var(--green-800); }

.curation-score-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-left: -4px;
}

.curation-score-link:hover {
  color: var(--accent);
}

.curation-card-checkbox {
  cursor: pointer;
  flex-shrink: 0;
}

.curation-score-breakdown {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.curation-score-component {
  font-variant-numeric: tabular-nums;
}

.curation-score-sep {
  opacity: 0.4;
}

.curation-score-reasoning {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.4;
}

.curation-tab--active {
  font-weight: 700;
}

.curation-load-more {
  text-align: center;
  padding: 16px 0;
}

.curation-card-provenance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.curation-provenance-text {
  font-size: 11px;
  color: var(--muted);
}

.curation-provenance-agent {
  font-family: monospace;
}

.curation-history-chevron {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
}

.curation-history-chevron:hover {
  color: var(--accent);
}

.curation-history {
  margin-top: 6px;
}

.curation-history-loading {
  font-size: 12px;
  color: var(--muted);
}

.curation-history-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  color: var(--muted);
}

.curation-history-table th {
  text-align: left;
  padding: 2px 8px 4px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.curation-history-table td {
  padding: 3px 8px 3px 0;
  vertical-align: top;
}

.curation-history-when {
  white-space: nowrap;
}

.curation-history-agent {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-family: monospace;
}

.curation-history-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  padding: 0 2px;
}

.curation-history-link:hover {
  color: var(--accent);
}

/* Add article panel */
.curation-add-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.curation-add-form {
  display: flex;
  gap: 8px;
}

.curation-add-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.curation-add-submit {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.curation-add-submit:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.curation-add-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--warn);
}

.curation-add-result {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.curation-add-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.curation-add-exists-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #d97706;
  color: #fff;
  font-weight: 700;
}

.curation-add-result-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

.curation-add-done-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.curation-add-done-text {
  font-size: 13px;
  color: #16a34a;
  font-weight: 600;
}

.curation-add-another-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.curation-add-status-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.curation-add-status-label {
  font-size: 12px;
  color: var(--muted);
}

.curation-add-status-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.curation-add-status-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.curation-add-dismiss-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin-left: 4px;
}

/* Undo bar */
.curation-undo-bar {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
}

.curation-undo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.curation-undo-label {
  font-weight: 600;
  color: var(--muted);
}

.curation-undo-toggle {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
}

.curation-undo-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px solid var(--line);
}

.curation-undo-time {
  color: var(--muted);
  min-width: 70px;
}

.curation-undo-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curation-undo-btn {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 11px;
  cursor: pointer;
}

.curation-undo-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Empty / loading states */
.curation-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 48px 0;
  text-align: center;
}

.curation-clear-filter-btn {
  margin-top: 12px;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.curation-clear-filter-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.curation-loading {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

@media (max-width: 720px) {
  .auth-panel,
  .story-list-pane,
  .story-detail-pane {
    padding: 20px;
  }

  .pane-header h1,
  .story-detail h2,
  .auth-panel h1 {
    font-size: 1.65rem;
  }

  .channel-heading {
    flex-wrap: wrap;
  }
}

/* ── Search input ── */
.search-input-wrap {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 12px;
}

.search-submit-button {
  min-width: 8rem;
  padding: 0 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 0.75rem;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-submit-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.search-query-summary {
  margin: 8px 0 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.table-options-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.breakdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.column-legend summary {
  cursor: pointer;
  user-select: none;
}
.column-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 6px 0 2px;
}
.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  box-sizing: border-box;
}
.search-input::placeholder {
  color: var(--muted);
}
.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Article filter bar ── */
.article-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-bar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-preset-button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
  flex-shrink: 0;
}

.filter-preset-button:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filter-preset-button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filter-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.filter-sort-label {
  font-size: 0.83rem;
  color: var(--muted);
  white-space: nowrap;
}

.filter-sort-select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  cursor: pointer;
}

.filter-sort-select:focus,
.filter-row-select:focus,
.filter-row-value:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-dir-toggle {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease;
  white-space: nowrap;
}

.filter-dir-toggle:hover {
  background: var(--panel-strong);
}

.filter-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filter-row-select {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-row-value {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  min-width: 140px;
  flex: 1;
}

/* The date "within N days of" operator adds a second, small "± days" input. */
.filter-row-value.filter-row-within-days {
  min-width: 0;
  width: 72px;
  flex: 0 0 auto;
}

.filter-row-within-days-sep {
  color: var(--muted);
  flex-shrink: 0;
}

.filter-row-delete {
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
  margin-left: auto;
  transition: color 120ms ease, background 120ms ease;
}

.filter-row-delete:hover {
  color: var(--warn);
  background: var(--error-bg);
  border-color: var(--error);
}

.filter-bar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-add-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.filter-add-button:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.filter-clear-button {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.filter-clear-button:hover {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--error-bg);
}

/* Keyboard shortcuts overlay */
.shortcuts-overlay {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--gray-800);
  color: var(--gray-100);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  font-size: 13px;
  pointer-events: none;
  animation: shortcuts-fade-in 80ms ease;
}

@keyframes shortcuts-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shortcuts-overlay-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 6px;
}

.shortcuts-overlay-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--gray-200);
}

.shortcuts-overlay-row:last-child {
  margin-bottom: 0;
}

.shortcuts-overlay kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 5px;
  background: var(--gray-600);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.6;
}

/* ── Prompts page ─────────────────────────────────────────────────────────── */

.prompts-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.prompt-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  background: var(--gray-900);
}

.prompt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.prompt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prompt-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-right: 10px;
}

.prompt-card-key {
  font-size: 12px;
  color: var(--gray-400);
  background: var(--gray-800);
  padding: 1px 6px;
  border-radius: 4px;
}

.prompt-card-meta {
  flex-shrink: 0;
}

.prompt-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.prompt-badge-custom {
  background: var(--blue-900, #1e3a5f);
  color: var(--blue-300, #7ab8f5);
}

.prompt-badge-default {
  background: var(--gray-800);
  color: var(--gray-400);
}

.prompt-description {
  font-size: 13px;
  color: var(--gray-400);
  margin: 0 0 14px 0;
}

.prompt-field {
  margin-bottom: 14px;
}

.prompt-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.prompt-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.prompt-textarea:focus {
  outline: none;
  border-color: var(--gray-400);
}

.prompt-textarea-large {
  min-height: 200px;
}

.prompt-workbench-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.prompt-workbench-sidebar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.prompt-workbench-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.prompt-workbench-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt-workbench-sidebar-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.4;
}

.prompt-workbench-nav-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.prompt-workbench-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.prompt-workbench-nav-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink);
}

.prompt-workbench-nav-meta-dim {
  color: var(--gray-400);
}

.prompt-workbench-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.prompt-workbench-nav-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-workbench-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.prompt-workbench-archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.prompt-workbench-archive-btn:hover {
  background: var(--panel);
}

.prompt-workbench-model-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gray-800);
  color: var(--gray-200);
  font-size: 11px;
  font-family: monospace;
}

.prompt-workbench-editor-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px 14px;
  min-width: 0;
}

.prompt-workbench-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.prompt-workbench-editor-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt-workbench-editor-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: var(--ink);
}

.prompt-workbench-unsaved-badge {
  display: inline-flex;
  padding: 3px 9px;
  border: 1px solid #b45309;
  border-radius: 999px;
  background: rgba(241, 170, 126, 0.14);
  color: #f1aa7e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.prompt-workbench-promotion-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.prompt-workbench-promotion-summary > div:not(.prompt-workbench-promotion-arrow) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.prompt-workbench-promotion-summary span,
.prompt-workbench-promotion-summary small {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.prompt-workbench-promotion-summary strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.prompt-workbench-promotion-arrow {
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 700;
}

.prompt-workbench-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prompt-workbench-compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.prompt-workbench-compact-button:hover {
  background: var(--panel);
}

.prompt-workbench-compact-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.prompt-workbench-compact-button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #f5fbfa;
}

.prompt-workbench-compact-button-primary:hover {
  background: var(--accent-strong);
}

.prompt-workbench-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.prompt-workbench-editor-textarea {
  min-height: 340px;
}

.prompt-workbench-empty-state {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  color: var(--gray-400);
  font-size: 13px;
  background: var(--panel);
}

.prompt-workbench-empty-state-large {
  min-height: 240px;
  display: flex;
  align-items: center;
}

.prompt-workbench-archive-toggle {
  display: block;
  width: 100%;
  padding: 8px 2px 2px;
  background: transparent;
  border: none;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.prompt-workbench-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.prompt-workbench-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.prompt-workbench-collapse-chevron {
  display: inline-block;
  color: var(--gray-400);
  transition: transform 0.16s ease;
}

.prompt-workbench-collapsed-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.prompt-workbench-collapsed-card {
  min-width: 250px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.prompt-workbench-collapsed-card-meta {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--ink);
}

@media (max-width: 980px) {
  .prompt-workbench-layout {
    grid-template-columns: 1fr;
  }

  .prompt-workbench-nav-list {
    max-height: 320px;
  }

  .prompt-workbench-editor-header {
    flex-direction: column;
  }

  .prompt-workbench-editor-actions {
    justify-content: flex-start;
  }

  .prompt-workbench-section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.prompt-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.prompt-error {
  font-size: 13px;
  color: var(--red-400, #f87171);
  margin-right: auto;
}

.prompt-saved {
  font-size: 13px;
  color: var(--green-400, #4ade80);
  margin-right: auto;
}

.prompt-toast {
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  animation: prompt-toast-in 0.2s ease-out;
}

.prompt-toast-success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green-600, #16a34a);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.prompt-toast-error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--red-600, #dc2626);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

@keyframes prompt-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Feed elements list */
.feed-elements-list {
  display: flex;
  flex-direction: column;
}

.feed-element-row {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.feed-element-row:last-child {
  border-bottom: none;
}

.feed-element-title-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-element-title {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

a.feed-element-title:hover {
  text-decoration: underline;
}

.feed-element-domain {
  color: var(--muted);
  font-size: 0.85rem;
}

.feed-element-age {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.feed-element-summary {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  line-height: 1.4;
}

.feed-element-meta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.feed-element-feed-name {
  opacity: 0.7;
}

.feed-element-tier {
  opacity: 0.7;
}

.muted-count {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   List picker dropdown (StoryDetail)
   --------------------------------------------------------------------------- */

.list-picker-container {
  position: relative;
  display: inline-flex;
}

.list-picker {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 200px;
  max-width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin-top: 4px;
  overflow: hidden;
}

.list-picker-loading {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.list-picker-items {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.list-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--ink);
}
.list-picker-item:hover {
  background: var(--bg-strong);
}
.list-picker-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.list-picker-new {
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding: 6px 8px;
}
.list-picker-new input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.list-picker-new input:focus {
  border-color: var(--accent);
}
.list-picker-add-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.list-picker-add-btn:hover {
  background: var(--accent-strong);
}

/* ---------------------------------------------------------------------------
   Lists page
   --------------------------------------------------------------------------- */

.lists-page {
  display: flex;
  height: calc(100vh - 44px);
  overflow: hidden;
}

.lists-sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lists-sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 16px 8px;
  margin: 0;
  color: var(--ink);
}

.lists-empty {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.lists-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lists-list-item {
  display: flex;
  align-items: center;
  padding: 0 8px 0 0;
}

.lists-list-item.active {
  background: var(--bg-strong);
}

.lists-list-btn {
  flex: 1;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lists-list-btn:hover {
  color: var(--accent);
}

.lists-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 100ms;
}
.lists-list-item:hover .lists-item-actions {
  opacity: 1;
}

.lists-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}
.lists-action-btn:hover {
  color: var(--ink);
  background: var(--bg-strong);
}
.lists-action-delete:hover {
  color: var(--warn);
}

.lists-rename-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 4px 8px;
}
.lists-create-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.lists-rename-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.lists-rename-input:focus {
  border-color: var(--accent);
}
.lists-rename-save {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.lists-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.lists-empty-content {
  padding: 40px 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.lists-article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.lists-article-table th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lists-article-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.lists-article-table tr:hover td {
  background: var(--bg-strong);
}

.lists-article-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.lists-article-link:hover {
  color: var(--accent);
}

.lists-article-summary {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.lists-article-domain {
  font-size: 0.8rem;
  color: var(--muted);
}
.lists-article-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.lists-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.lists-toggle-scores {
  font-size: 0.78rem;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.lists-toggle-scores:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.lists-toggle-scores.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.score-selector {
  display: inline-flex;
  gap: 2px;
}
.score-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  line-height: 22px;
  text-align: center;
}
.score-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.score-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tier-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  min-width: 24px;
  text-align: center;
}
.tier-1 { background: #ef4444; }
.tier-2 { background: #f97316; }
.tier-3 { background: #eab308; }
.tier-4 { background: #22c55e; }
.tier-5 { background: #10b981; }

/* ── Admin home page ── */

.admin-index {
  max-width: 720px;
}

.admin-index-usage {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  margin: -8px 0 4px;
}

.admin-index-usage-users summary {
  cursor: pointer;
}

.admin-index-usage-users ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.admin-index-group {
  margin-top: 22px;
}

.admin-index-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.admin-index-rows {
  border-top: 1px solid var(--line);
}

.admin-index-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.admin-index-row:hover {
  background: var(--panel);
}

.admin-index-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.admin-index-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.admin-index-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .admin-index-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.settings-admin-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.settings-admin-link:hover {
  text-decoration: underline;
}

.model-variant-tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-family: monospace;
  font-size: 0.7rem;
  line-height: 1.2;
  cursor: pointer;
}

.model-variant-tag:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.model-variant-tag-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.model-variant-tag-label {
  font-family: inherit;
  opacity: 0.75;
}

@media (max-width: 560px) {
  .model-variant-tag-label {
    display: none;
  }
}

/* ── Search page pills & filters ── */
.search-pills-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.search-pill:hover {
  background: var(--panel-strong);
  border-color: #adb5bd;
}

.search-pill-overflow {
  color: var(--gray-500, var(--muted));
  border-style: dashed;
}

.search-options-pill {
  color: var(--gray-500, var(--muted));
}

.search-options-pill.open {
  background: var(--panel-strong);
  border-color: #adb5bd;
  color: var(--ink);
}

.search-options-modified-dot {
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.search-pill-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  margin-top: 4px;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
}

.search-clear-pill {
  color: var(--gray-500, var(--muted));
}

.search-clear-pill:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--panel-strong);
  cursor: pointer;
}

.search-clear-pill:disabled {
  color: var(--muted);
  opacity: 0.45;
  cursor: not-allowed;
}

.search-pill-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  color: #182027;
  cursor: pointer;
}

.search-pill-dropdown-item:hover {
  background: #f1f3f5;
}

/* ── Search controls row ── */
.search-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
}

.search-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  color: var(--gray-500, var(--muted));
  cursor: pointer;
  transition: all 0.15s;
}

.search-toggle-btn:hover {
  background: var(--panel-strong);
  color: var(--ink);
}

.search-toggle-btn.active {
  background: var(--panel-strong);
  border-color: #adb5bd;
  color: var(--ink);
}

.search-toggle-btn.modified {
  color: var(--accent, #2d4a6e);
  border-color: var(--accent, #2d4a6e);
}

.scoring-panel {
  display: grid;
  gap: 14px;
  margin: 8px 0 4px;
  padding: 14px 16px;
  background: var(--panel-strong);
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* ── Search status inline ── */
.search-options-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface, var(--panel-strong));
}

.search-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.search-toggle-row input {
  margin: 0;
}

/* Secondary explanation under a toggle. Only worth the space where the
   toggle's own label cannot say what the option costs. */
.search-toggle-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-muted, var(--ink));
  opacity: 0.75;
}

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

/* One row welded to the top of the results list: count + deepen on the left,
   save controls pushed right. Replaces the old floating status line + save bar. */
.search-results-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  font-size: 0.85rem;
}

.search-results-area {
  width: 100%;
}

.search-poll-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.search-poll-timeline svg {
  width: min(300px, 55vw);
  height: 48px;
  overflow: visible;
}

.search-poll-axis { stroke: var(--line); stroke-width: 1; }
.search-poll-axis-label { fill: var(--muted); font-size: 8px; }
.search-poll-negative { stroke: #8091a7; stroke-width: 2; }
.search-poll-positive { stroke: #17864b; stroke-width: 2; }
.search-poll-dot { fill: #8091a7; }
.search-poll-complete { fill: #17864b; stroke: #ffffff; stroke-width: 1.5; }

.search-timing-waterfall { flex-basis: 100%; max-width: 720px; }
.search-timing-waterfall.compact { display: contents; }
.search-timing-waterfall.compact .search-timing-details {
  flex: 0 0 100%;
  max-width: 720px;
}
.search-timing-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 2px 0;
}
.search-timing-chevron { display: inline-block; font-size: 1rem; margin-left: 5px; transition: transform 120ms ease; }
.search-timing-chevron.open { transform: rotate(90deg); }
.search-timing-details { margin-top: 4px; }
.search-timing-axis { display: flex; justify-content: space-between; margin-left: 146px; padding-right: 49px; }
/* The judges that ran, above the waterfall lanes. Wraps rather than
   truncates: a model id is the whole point of the line. */
.search-timing-judges { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 6px 146px; }
.search-timing-judges-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.search-timing-judges-cover { color: var(--muted); }
.search-timing-row { display: grid; grid-template-columns: 140px minmax(160px, 1fr) 44px; align-items: center; gap: 6px; min-height: 17px; }
.search-timing-label { position: relative; min-width: 0; cursor: help; outline: none; }
.search-timing-label-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; }
.search-timing-label::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + 6px);
  width: 280px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  white-space: normal;
  font-size: 0.82rem;
  line-height: 1.3;
}
.search-timing-label:hover::after,
.search-timing-label:focus-visible::after { display: block; }
.search-timing-track { height: 10px; position: relative; background: var(--panel-strong); overflow: hidden; }
.search-timing-bar { height: 100%; min-width: 2px; position: absolute; background: #5f6368; opacity: 0.76; }
.search-timing-bar.setup { background: #9c6ade; }
.search-timing-bar.retrieval { background: #4285f4; }
.search-timing-bar.rerank { background: #f9ab00; }
.search-timing-bar.judging { background: #34a853; }
.search-timing-bar.finalization { background: #ea4335; }
.search-timing-duration { text-align: right; }

@media (max-width: 640px) {
  .search-poll-timeline { align-items: flex-start; flex-direction: column; gap: 0; }
  .search-poll-timeline svg { width: 100%; }
}

.search-status-inline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85rem;
}

.search-status-inline-summary {
  display: inline-flex;
  margin-left: 16px;
}

.search-result-count {
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-variant-numeric: tabular-nums;
}

.search-result-label {
  color: var(--gray-500, var(--muted));
}

.search-deeper-inline {
  margin-left: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 120ms ease;
}

.search-deeper-inline:hover {
  text-decoration: underline;
}

.search-deeper-inline:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.search-active-filters {
  color: var(--gray-400, var(--muted));
  font-size: 0.8rem;
  margin-left: 4px;
}

/* ── Filter pills ── */
.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.filter-pills-label {
  font-size: 0.78rem;
  color: var(--gray-400, var(--muted));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
  white-space: nowrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  background: var(--panel-strong);
}

.filter-pill.excluded {
  background: rgba(227, 140, 148, 0.14);
  border-color: #f5c6cb;
  color: #e38c94;
  text-decoration: line-through;
  opacity: 0.7;
}

.filter-pill.excluded:hover {
  opacity: 1;
}

/* ── Reading time filter ── */
.reading-time-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reading-time-select {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--panel);
}

.reading-time-input {
  width: 56px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink);
  text-align: center;
}

.reading-time-unit {
  font-size: 0.8rem;
  color: var(--gray-500, var(--muted));
}

/* ── Right side of the results toolbar: saved-search access + save controls ── */
.search-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-toolbar-save {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Compact saved-searches control (shown once a search has run) */
.search-pills-compact {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-pill-dropdown-right {
  left: auto;
  right: 0;
}

.search-save-trigger {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--gray-500, var(--muted));
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.search-save-trigger:hover {
  color: var(--accent);
  border-color: var(--green-300);
  background: var(--panel-strong);
}

.search-toolbar-save .search-save-input {
  flex: none;
  width: 220px;
  padding: 5px 12px;
}

.search-toolbar-save .primary-button,
.search-toolbar-save .ghost-button {
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 0.84rem;
}

@media (max-width: 768px) {
  .search-toolbar-right {
    margin-left: 0;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .search-toolbar-save .search-save-input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

.search-save-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-save-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--panel);
}

/* ── Saved searches CRUD page ── */
.saved-searches-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  width: 100%;
  box-sizing: border-box;
}

.saved-searches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.saved-searches-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

.saved-searches-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-search-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  background: var(--panel);
  transition: box-shadow 0.15s;
}

.saved-search-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.saved-search-card-editing {
  border-color: var(--accent, #2d4a6e);
  box-shadow: 0 0 0 1px var(--accent, #2d4a6e);
}

.saved-search-card-display {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.saved-search-card-main {
  flex: 1;
  min-width: 0;
}

.saved-search-card-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent, #2d4a6e);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.saved-search-card-name:hover {
  text-decoration: underline;
}

.saved-search-card-description {
  font-size: 0.84rem;
  color: var(--gray-600, var(--muted));
  margin-top: 4px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-search-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--gray-400, var(--muted));
}

.saved-search-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.saved-search-delete-btn {
  color: #dc3545 !important;
}

.saved-search-delete-btn:hover {
  background: var(--error-bg) !important;
}

/* ── Saved search edit form ── */
.saved-search-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-search-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-search-edit-label {
  font-size: 0.78rem;
  color: var(--gray-500, var(--muted));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.saved-search-edit-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}

.saved-search-edit-textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  resize: vertical;
}

.saved-search-edit-row {
  display: flex;
  gap: 16px;
}

.saved-search-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.search-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.search-status-badge.status-finished {
  background: rgba(140, 228, 160, 0.14);
  color: #8ce4a0;
}

.search-status-badge.status-failed {
  background: rgba(236, 133, 132, 0.14);
  color: #ec8584;
}

.search-status-badge.status-processing {
  background: rgba(127, 175, 240, 0.14);
  color: #7faff0;
}

.search-prompt-editor {
  margin-top: 10px;
}

.search-prompt-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.search-editor-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.search-editor-save {
  border: 1px solid #0f766e;
  border-radius: 4px;
  padding: 5px 14px;
  background: #0f766e;
  color: #ffffff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.search-editor-save:hover:not(:disabled) {
  background: #0b5f59;
}

.search-editor-save:disabled {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  cursor: default;
}

.search-restore {
  color: #8a4b08;
}

.search-prompt-panel textarea,
.search-prompt-panel select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.search-prompt-panel .search-options-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}


/* ── Light-mode chips ──────────────────────────────────────────────
   The badge/pill vocabulary is authored dark-first above: a 14% tint of
   the label hue behind a lifted version of that same hue. These restore
   the original pastel-on-dark-text pairs for the light theme.
──────────────────────────────────────────────────────────────────── */
html.light .flash.error,
html.light .reader-status.error { background: #f8d8d2; color: #6f2016; }
html.light .toast-error { background: #f8d8d2; color: #6f2016; }
html.light .pill.stage-fetched { background: #e8f0fe; color: #1a56db; }
html.light .smart-feed-event-badge.is-in { background: #dcfce7; color: #166534; }
html.light .smart-feed-event-badge.is-out { background: #fee2e2; color: #991b1b; }
html.light .smart-feed-event-current { background: #dbeafe; color: #1d4ed8; }
html.light .feed-membership-indicator.in-feed { background: #dcfce7; color: #15803d; }
html.light .feed-membership-prior.prior-should { background: #dcfce7; color: #15803d; }
html.light .feed-membership-prior.prior-shouldnt { background: #fef2f2; color: #b91c1c; }
html.light .curation-data-pill-quality { background: #edf6ec; color: #2e6b39; }
html.light .curation-data-pill-topic { background: #fff1e7; color: #b25917; }
html.light .curation-data-pill-duplicate { background: #eef2ff; color: #4456c6; }
html.light .lifecycle-step.step-queued { background: #fef3c7; color: #92400e; }
html.light .score-1 { background: #fdd; color: #9b1c1c; }
html.light .score-2 { background: #fde6cc; color: #8a4b08; }
html.light .score-3 { background: #fef3c7; color: #78600d; }
html.light .score-4 { background: #d1fae5; color: #065f46; }
html.light .score-5 { background: #a7f3d0; color: #064e3b; }
html.light .search-type-badge.fast { background: #e5f3ec; color: #17633b; }
html.light .activity-badge--flag { background: #fef3c7; color: #92400e; }
html.light .activity-badge--expand { background: #fef3c7; color: #92400e; }
html.light .activity-badge--click_external { background: #dbeafe; color: #1e40af; }
html.light .activity-badge--return_to_feed { background: #e0f2fe; color: #0c4a6e; }
html.light .activity-badge--read { background: #d1fae5; color: #065f46; }
html.light .activity-badge--show_summary { background: #fef3c7; color: #92400e; }
html.light .activity-badge--expand_topic { background: #e0f2fe; color: #0c4a6e; }
html.light .score-breakdown-cluster-note { background: #fffbeb; color: #92400e; }
html.light .prompt-workbench-unsaved-badge { background: #fffbeb; color: #92400e; }
html.light .filter-pill.excluded { background: #f8d7da; color: #721c24; }
html.light .search-status-badge.status-finished { background: #e6f4ea; color: #1e7e34; }
html.light .search-status-badge.status-failed { background: #fce8e6; color: #c5221f; }
html.light .search-status-badge.status-processing { background: #e8f0fe; color: #1967d2; }

/* ---------------------------------------------------------------------------
   Search run audit (/search/<id>/audit, admin only)
   ---------------------------------------------------------------------------
   The table shades by row *state*, not by verdict. "Judged relevant but not
   shown" and "one cover of two said yes" are different states with different
   causes -- the first is the clustering/score cutoff, the second is the
   uncertain middle a reuse threshold change moves first -- so they never share
   a shade. Backgrounds are opaque tints, never alpha over the row, so the
   striping cannot make justification text unreadable. */

.fs-audit-description {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.fs-audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  margin-bottom: 14px;
}

.fs-audit-warning {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--error);
  background: #301817;
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.fs-audit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.fs-audit-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.fs-audit-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fs-audit-stat-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.fs-audit-table {
  font-size: 0.76rem;
  table-layout: auto;
}

.fs-audit-table td {
  vertical-align: top;
}

.fs-audit-domain,
.fs-audit-justification {
  font-size: 0.7rem;
  margin-top: 2px;
}

.fs-audit-donor {
  font-size: 0.72rem;
  margin-top: 2px;
}

/* Served to the reader. */
.fs-audit-row.fs-audit-shown {
  background: #102b1a;
}

/* Judged relevant, then dropped by the score cutoff or folded into another
   slot by the clustering pass -- a display decision, not a judge decision. */
.fs-audit-row.fs-audit-relevant-not-shown {
  background: #2b2412;
}

/* One positive of two covers: rejected from the default list, and its own
   state rather than a plain rejection. */
.fs-audit-row.fs-audit-split {
  background: #251a30;
}

/* Cut before judging, and candidates the run never got a verdict for. */
.fs-audit-row.fs-audit-cut {
  color: var(--muted);
}

.fs-audit-row.fs-audit-no-verdict {
  background: #301817;
}

html.light .fs-audit-warning {
  border-left-color: #d13212;
  background: #fff6f5;
  color: #7a1c0d;
}

html.light .fs-audit-row.fs-audit-shown {
  background: #eaf7ec;
}

html.light .fs-audit-row.fs-audit-relevant-not-shown {
  background: #fdf6e3;
}

html.light .fs-audit-row.fs-audit-split {
  background: #f4ecfb;
}

html.light .fs-audit-row.fs-audit-no-verdict {
  background: #fdecea;
}

.fs-audit-link {
  text-decoration: none;
}

/* ── Email digests ──────────────────────────────────────────────────────────
   Scoped to the two feed-management surfaces (My feeds, Email digests) rather
   than changed globally. The app-wide .primary-button/.ghost-button pill --
   999px radius, 12px 18px padding -- reads consumer-app; these two pages are
   dense management lists where a row of pills crowds itself. Restyling every
   button in the app is a bigger visual decision than this change should make
   on its own, so the compact shape stops at the page wrapper. */
.saved-searches-page .primary-button,
.saved-searches-page .secondary-button,
.saved-searches-page .ghost-button {
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 0.82rem;
  gap: 6px;
}

/* The lift-on-hover belongs to hero buttons; in a list it makes rows twitch. */
.saved-searches-page .primary-button:hover,
.saved-searches-page .secondary-button:hover,
.saved-searches-page .ghost-button:hover {
  transform: none;
  background: var(--panel-strong);
}

.saved-searches-page .primary-button:hover {
  background: var(--accent);
  filter: brightness(1.06);
}

.saved-searches-page .saved-searches-list {
  gap: 10px;
}

.saved-searches-page .saved-search-card {
  padding: 14px 16px;
}

.saved-searches-page .saved-search-card-meta {
  margin-top: 6px;
}

/* Six controls per row (Run, Feed URL, Subscribe, Stop, Edit, Delete) no
   longer fit beside the text: .saved-search-card-actions is flex-shrink: 0, so
   they were squeezing the name and description into a narrow column and
   wrapping "updates every 30 minutes" down five lines. Stack instead -- text
   full width, controls on their own row beneath -- and let the row wrap on
   narrow viewports. */
.saved-searches-page .saved-search-card-display {
  flex-direction: column;
  gap: 12px;
}

.saved-searches-page .saved-search-card-actions {
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.saved-searches-page .saved-search-edit-form {
  gap: 14px;
}

.saved-searches-page .saved-search-edit-actions {
  margin-top: 6px;
}

.digest-intro {
  margin: -6px 0 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-500, var(--muted));
  max-width: 62ch;
}

/* The subscription dropdown. Anchors its menu, so it is positioned even while
   the menu is closed. */
.digest-menu {
  position: relative;
  display: inline-flex;
}

/* Matches .search-pill rather than .ghost-button: this is a state control that
   should read as quieter than the actions beside it, and the My-feeds pill is
   the established shape for "opens a menu". */
.digest-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--gray-500, var(--muted));
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.digest-menu-trigger:hover:not(:disabled) {
  background: var(--panel-strong);
  border-color: #adb5bd;
  color: var(--ink);
}

.digest-menu-trigger:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Subscribed is a state worth seeing at a glance down a list of feeds. */
.digest-menu-trigger-on {
  color: var(--ink);
  border-color: var(--line-strong, #adb5bd);
  background: var(--panel-strong);
}

.digest-menu-beta {
  font-size: 0.78rem;
  line-height: 1;
}

/* .search-pill-dropdown hardcodes a white panel and near-black item text,
   which is invisible-on-invisible in the dark theme. Scoped to this menu
   rather than fixed globally: the search pills share that rule, and
   retheming them is a separate change from shipping this menu. */
.digest-menu .search-pill-dropdown {
  /* Wide enough that "Every 3 business hours" and its story count sit on one
     line each; below this the label wraps and the count wraps with it. */
  min-width: 252px;
  background: var(--panel);
  border-color: var(--line);
}

.digest-menu .search-pill-dropdown-item {
  color: var(--ink);
}

.digest-menu .search-pill-dropdown-item:hover {
  background: var(--panel-strong);
}

.digest-menu .search-pill-dropdown-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.digest-menu-item-note {
  font-size: 0.76rem;
  color: var(--gray-400, var(--muted));
  white-space: nowrap;
}

/* ── For You ──────────────────────────────────────────────────────────────
   The feed picker above the merged list. Collapsed by default: it is a
   setting, not the page.                                                   */
.for-you-picker {
  margin: 12px 0 4px;
}

.for-you-picker-summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  list-style: none;
}

.for-you-picker-summary::-webkit-details-marker {
  display: none;
}

.for-you-picker-summary::before {
  content: '▸';
  font-size: 10px;
  transition: transform 120ms cubic-bezier(.25, .46, .45, .94);
}

.for-you-picker[open] .for-you-picker-summary::before {
  transform: rotate(90deg);
}

.for-you-picker-summary:hover {
  color: var(--ink);
}

.for-you-picker-count {
  color: var(--muted);
  opacity: 0.75;
}

.for-you-picker-list {
  list-style: none;
  margin: 4px 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.for-you-picker-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.for-you-picker-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
}

.for-you-picker-name {
  font-weight: 500;
}

.for-you-picker-description {
  color: var(--muted);
  font-size: 12px;
  margin-left: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
