/* ============================================================
   RSS 3-panel layout — reuses design tokens from styles.css
   ============================================================ */

/* override app background for the 3-panel reader.
   Height inherited from body's flex column (styles.css) — banners above
   shrink this region instead of pushing it past 100vh. Fallback 100vh
   for browsers that load this file standalone (login.html, etc.). */
.app.rss { display: flex; height: 100vh; min-height: 0; overflow: hidden; }
body > .app.rss { height: auto; }

/* ===== SIDEBAR overrides ===== */
.sidebar.rss-side {
  width: 260px;
  padding-bottom: 8px;
  background: var(--sidebar);
  /* Flex column so the .rss-feeds list (flex:1) can absorb remaining height
     and engage its own overflow-y: auto when there are many folders/feeds. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Glossy translucent button (same family as .pill/.send-btn) */
.rss-filter-row {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}
.rss-filter-btn {
  position: relative;
  flex: 1;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.25));
  border: 1px solid var(--border);
  color: var(--fg-75);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -1px 0 rgba(27,27,27,.04),
    0 1px 2px rgba(27,27,27,.04);
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.rss-filter-btn:hover {
  color: var(--fg);
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.35));
}
.rss-filter-btn.is-on {
  color: var(--fg);
  border-color: rgba(var(--primary-rgb), .22);
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.2)),
    linear-gradient(180deg, rgba(var(--primary-rgb), .14), rgba(var(--primary-rgb), .08));
  background-blend-mode: normal;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -1px 0 rgba(var(--primary-rgb), .08),
    0 1px 2px rgba(var(--primary-rgb), .08);
}
html.dark .rss-filter-btn.is-on {
  color: var(--fg);
  border-color: rgba(var(--primary-rgb), .35);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    linear-gradient(180deg, rgba(var(--primary-rgb), .28), rgba(var(--primary-rgb), .14));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -1px 0 rgba(0,0,0,.3),
    0 1px 2px rgba(0,0,0,.25);
}
html.dark .rss-filter-btn {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.3),
    0 1px 2px rgba(0,0,0,.3);
}
html.dark .rss-filter-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
}
.rss-filter-btn .fb-ico { flex-shrink: 0; }
.rss-filter-btn .badge { display: none !important; }
.rss-filter-btn .badge.is-hidden {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--fg-12);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  color: var(--fg-75);
}
.rss-filter-btn.is-on .badge { background: rgba(var(--primary-rgb), .18); color: var(--fg); }
html.dark .rss-filter-btn.is-on .badge { background: rgba(var(--primary-rgb), .3); color: var(--fg); }

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

/* Icon-only variant sitting inline with the filter pills */
.rss-filter-row .rss-refresh-icon {
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
  margin: 0;
  gap: 0;
}

.rss-refresh {
  margin: 0 12px 14px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.25));
  color: var(--fg-75);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -1px 0 rgba(27,27,27,.04),
    0 1px 2px rgba(27,27,27,.04);
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.rss-refresh:hover { color: var(--fg); background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.35)); }
html.dark .rss-refresh {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.3),
    0 1px 2px rgba(0,0,0,.3);
}
html.dark .rss-refresh:hover { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); }
.rss-refresh .spin { display: inline-grid; place-items: center; }
.rss-refresh.is-spinning .spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AI usage panel — refresh button in the period/currency header row */
.usage-refresh { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.usage-refresh .usage-refresh-icon { transform-origin: 50% 50%; transition: transform .15s; }
.usage-refresh:hover:not([disabled]) .usage-refresh-icon { transform: rotate(-30deg); }
.usage-refresh.is-spinning .usage-refresh-icon {
  animation: spin 0.9s linear infinite;
  transform-origin: 50% 50%;
}
.usage-refresh[disabled] { opacity: .7; cursor: progress; }

.rss-feeds-top { padding: 4px 8px 2px; }
.feed-all .favicon-all {
  background: linear-gradient(180deg, rgba(var(--primary-rgb),.22), rgba(var(--primary-rgb),.10));
  color: var(--primary);
}
.rss-feeds-top .feed-item.feed-all {
  min-height: 34px;
  padding: 8px 10px 8px 10px;
  gap: 8px;
}
.rss-feeds {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
  /* Plain BLOCK column (mirrors .articles), NOT flex. A flex-column made each
     .feed-group a flex item whose main size resolves from flex-basis/content,
     so animating a row's `height` to collapse it (gregSidebarCollapse) didn't
     drive its laid-out height — leaving rows only faded. As a block container,
     feeds AND folders collapse via normal block reflow exactly like the
     article list: the rows below glide up onto the shrinking row. Inter-group
     spacing comes from .feed-group { margin-top } (the old flex gap:1px is
     dropped — a negligible 1px). */
  display: block;
}

.feed-group {
  margin-top: 4px;
}
.feed-group:first-child { margin-top: 0; }
.feed-group-head {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 18px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 10px;
  min-height: 32px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-75);
  cursor: pointer;
  border-radius: 6px;
  transition: color .15s var(--ease), background .15s var(--ease);
  user-select: none;
}
.feed-group-head:hover { color: var(--fg-75); background: var(--nav-hover); }
.feed-group-head.is-active {
  color: var(--fg);
  background: transparent;
}
.feed-group-head.is-active::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(224px 220px at 0% 50%, rgba(var(--primary-rgb), 0.15) 50%, rgba(var(--primary-rgb), 0.02) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.5),
    inset 0 0 8px 0 rgba(var(--primary-rgb), 0.24);
  z-index: -1;
  opacity: 0;
}
.feed-group-head.is-active .group-count { color: var(--primary); }
.feed-group-head .chev {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 4px;
}
.feed-group-head .chev:hover { background: var(--fg-12); }
.feed-group-head .chev svg { transition: transform .2s var(--ease); }
.feed-group.is-collapsed .feed-group-head .chev svg { transform: rotate(-90deg); }
.feed-group.is-collapsed .feed-group-body { display: none; }
.feed-loose { padding-top: 4px; padding-bottom: 4px; }
.feed-group-head .group-count {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.feed-group-head .chev {
  display: inline-grid;
  place-items: center;
  transition: transform .2s var(--ease);
}

.feed-item {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 18px 1fr 32px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 28px;
  padding: 4px 10px 4px 24px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-family: inherit;
  color: var(--fg-75);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  transition: color .3s var(--ease);
}
/* When a feed row has a handle (2-line layout), give rows breathing room */
.feed-item:has(.feed-handle) {
  min-height: 44px;
  margin-top: 2px;
  margin-bottom: 2px;
}
.feed-item::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--nav-hover);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
  pointer-events: none;
  z-index: -1;
}
.feed-item:hover { color: var(--fg); }
.feed-item:hover::after { opacity: 1; }

.feed-item.is-active {
  color: var(--fg);
}
.feed-item.is-active::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(224px 220px at 0% 50%, rgba(var(--primary-rgb), 0.15) 50%, rgba(var(--primary-rgb), 0.02) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.5),
    inset 0 0 8px 0 rgba(var(--primary-rgb), 0.24);
  z-index: -1;
  opacity: 0;
}
/* Hide per-item active backgrounds when the sliding pill is active */
.sidebar.rss-side.has-pill .feed-item.is-active::before,
.sidebar.rss-side.has-pill .feed-group-head.is-active::before {
  opacity: 0;
}

/* Shared sliding pill — sweeps between active rows in the sidebar */
.sidebar.rss-side { position: relative; }
.nav-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  border-radius: 8px;
  z-index: 0;
  opacity: 0;
  background-image: radial-gradient(224px 220px at 0% 50%, rgba(var(--primary-rgb), 0.28) 50%, rgba(var(--primary-rgb), 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.7),
    inset 0 0 12px 0 rgba(var(--primary-rgb), 0.35);
  /* Animate only transform (and opacity) — width/height changes snap so
     scroll/resize handlers don't trigger layout per frame. The pill is
     still resized via JS, but instantly; the smooth slide is preserved
     by the transform. */
  transition:
    transform .38s cubic-bezier(.34, 1.25, .64, 1),
    opacity   .22s var(--ease);
  will-change: transform;
}
.nav-pill.is-ready { opacity: 1; }

/* Filter-row pill (unread / starred / all) — rounded rect */
.filter-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  border-radius: 999px;
  z-index: 0;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb), .32), rgba(var(--primary-rgb), .22));
  border: 1px solid rgba(var(--primary-rgb), .5);
  box-sizing: border-box;
  box-shadow: inset 0 0 12px 0 rgba(var(--primary-rgb), .25);
  /* Animate only transform (and opacity) — width/height changes snap so
     scroll/resize handlers don't trigger layout per frame. The pill is
     still resized via JS, but instantly; the smooth slide is preserved
     by the transform. */
  transition:
    transform .38s cubic-bezier(.34, 1.25, .64, 1),
    opacity   .22s var(--ease);
  will-change: transform;
}
.filter-pill.is-ready { opacity: 1; }
html.dark .filter-pill {
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb), .45), rgba(var(--primary-rgb), .28));
  border-color: rgba(var(--primary-rgb), .65);
  box-shadow: inset 0 0 12px 0 rgba(var(--primary-rgb), .4);
}
/* Suppress the filter button's own active background when the pill is active */
.sidebar.rss-side.has-pill .rss-filter-btn.is-on {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.favicon {
  width: 18px; height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.feed-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-unread {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-50);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.feed-item.is-active .feed-unread { color: var(--primary); }

/* Broken-feed warning: small red dot in the top-right of the favicon. The
   class lands on the .feed-item; the dot is an absolutely-positioned ::after
   on the .favicon child. error_count >= 3 sets is-broken — the count resets
   on the next successful fetch so the dot self-clears. */
.feed-item.is-broken .favicon { position: relative; }
.feed-item.is-broken .favicon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5484d;
  border: 2px solid var(--sidebar);
  pointer-events: none;
}
/* Settings → Articles : prominent broken-state styling. The Settings list
   is the user's "control panel" for feeds, so the warning must be
   immediately legible — a subtle row tint + a clear inline error line. */
.feed-trow.is-feed.is-broken {
  background: linear-gradient(90deg, rgba(229, 72, 77, 0.10), rgba(229, 72, 77, 0.02));
  box-shadow: inset 3px 0 0 #e5484d;
}
.feed-trow .feed-error {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(229, 72, 77, 0.15);
  color: #c0382e;
  font-size: 11px;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-trow .feed-error::before {
  content: "⚠";
  font-weight: 700;
}
/* Folder row with at least one broken child feed: small red pill counting
   the broken feeds, positioned next to the folder name. When the folder is
   collapsed, this is the only signal — children rows are hidden, so the
   user needs to know the folder hides a dead feed before expanding it. */
.folder-broken-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  margin-right: 4px;
  font: 700 11px/1.3 ui-sans-serif;
  color: #c0382e;
  background: rgba(229, 72, 77, 0.15);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.feed-source > .folder-broken-pill { margin-left: auto; }
/* When the folder pill is also rendered (count of feeds), the broken pill
   sits to its left — push only the broken pill to the right edge so they
   sit as a pair, broken first then count. */
.feed-source > .folder-broken-pill + .feed-folder-pill { margin-left: 0; }
.feed-trow .feed-check {
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  transition: color .15s ease, background .15s ease;
}
.feed-trow .feed-check:hover {
  color: var(--fg);
  background: var(--fg-04);
}
.feed-trow .feed-check.is-spinning {
  animation: greg-pulse 1s ease-in-out infinite;
  color: var(--primary);
}
@keyframes greg-pulse {
  0%, 100% { opacity: .35; transform: scale(.92); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

/* ===== MAIN 2-panel area ===== */
.main.rss {
  flex: 1;
  padding: 8px 8px 8px 8px;
  min-width: 0;
  display: flex;
  gap: 0;
}

.rss-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.panel-list {
  /* Keep both panels visible regardless of viewport width and stored --list-w.
     Reader floor = 400px, +8px for the resizer = 408px reserved on the right.
     List floor = 320px so very narrow desktop viewports still degrade gracefully
     (mobile.css takes over at <=720px). Same values are mirrored in the JS dragger. */
  width: clamp(320px, var(--list-w, 60%), max(320px, 100% - 408px));
  flex-shrink: 0;
  position: relative;
}
.panel-reader {
  flex: 1;
  min-width: 0;
}

/* ===== Refresh status pill (bottom of article list) ===== */
.refresh-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px -8px rgba(0,0,0,.25), 0 2px 6px -2px rgba(0,0,0,.15);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  z-index: 30;
  pointer-events: auto;
  animation: refreshStatusIn .22s var(--ease) both;
}
.refresh-status[hidden] { display: none; }
@keyframes refreshStatusIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.refresh-status .rs-spin {
  display: inline-flex;
  color: var(--primary);
  animation: rsSpin 1s linear infinite;
}
@keyframes rsSpin { to { transform: rotate(360deg); } }
.refresh-status .rs-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.refresh-status .rs-text > [data-i18n] {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.refresh-status .rs-count {
  flex-shrink: 0;
  color: var(--fg-50);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.refresh-status .rs-count:empty { display: none; }
.refresh-status .rs-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--fg-50);
  cursor: pointer;
  margin-left: 2px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.refresh-status .rs-cancel:hover {
  background: var(--fg-08);
  color: var(--fg);
}

/* ===== Resize handles ===== */
.resizer {
  flex: 0 0 8px;
  width: 8px;
  cursor: col-resize;
  position: relative;
  z-index: 10;
  user-select: none;
}
.resizer::before {
  content: "";
  position: absolute;
  inset: 30% 3px;
  border-radius: 2px;
  background: transparent;
  transition: background .18s var(--ease);
}
.resizer:hover::before,
.resizer.is-dragging::before { background: var(--primary-50); }
body.is-resizing { cursor: col-resize; }
body.is-resizing * { user-select: none !important; }

/* Panel width readouts shown during splitter drag */
.panel-reader { position: relative; }

.panel-size-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s var(--ease);
  z-index: 50;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.panel-size-readout .psr-num {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}
.panel-size-readout .psr-unit {
  font-size: 14px;
  font-weight: 500;
  opacity: .65;
  margin-top: 6px;
  letter-spacing: .08em;
}

body.is-resizing .panel-size-readout { opacity: 1; }
body.is-resizing .panel-list > :not(.panel-size-readout),
body.is-resizing .panel-reader > :not(.panel-size-readout) {
  opacity: .35;
  transition: opacity .15s var(--ease);
}

/* tighter sidebar header for rss reader */
.sidebar.rss-side .sidebar-head {
  /* Right padding centers the 28px avatar over the 34px refresh button below
     (12px row padding + (34-28)/2 = 15px). */
  padding: 12px 15px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.brand-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font: 700 10.5px/1 ui-sans-serif, system-ui;
  letter-spacing: -.01em;
  display: grid; place-items: center;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--bg);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  flex-shrink: 0;
}
.brand-avatar:hover { transform: scale(1.06); }
.brand-avatar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.brand-avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in oklab, var(--primary) 40%, transparent); }

.user-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 10px;
  z-index: 60;
  width: 240px;
  max-width: calc(100% - 20px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.3), 0 4px 12px -4px rgba(0,0,0,.12);
  padding: 6px;
  animation: umFadeIn .15s var(--ease);
}
.user-menu[hidden] { display: none; }
@keyframes umFadeIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
/* The user-info row doubles as the Settings entry point, so it's a button.
   Reset native button styling and keep the original look. */
.um-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s var(--ease);
}
.um-head:hover { background: var(--fg-06); }
.um-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.um-head .avatar.lg {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font: 700 13px/1 ui-sans-serif, system-ui;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.um-head .um-head-text { flex: 1; min-width: 0; }
.um-head strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-head .muted.xs { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-head-chev { color: var(--fg-50); flex-shrink: 0; opacity: .8; transition: opacity .15s; }
.um-head:hover .um-head-chev { opacity: 1; }
.um-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.um-item:hover { background: var(--fg-06); }
.um-item > span { flex: 1; }
.um-item svg { color: var(--fg-50); flex-shrink: 0; }
.um-item.danger { color: #e5484d; }
.um-item.danger svg { color: #e5484d; }
.um-sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--border);
}

/* Theme switcher inside the user menu */
.um-theme {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 4px;
}
.um-theme-label {
  flex: 1;
  font-size: 12.5px;
  color: var(--fg);
}
.um-theme-seg {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: var(--fg-06);
  border-radius: 8px;
}
.um-theme-btn {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--fg-50);
  cursor: pointer;
  transition: color var(--dur-med) var(--ease);
}
.um-theme-btn:hover { color: var(--fg-75); }
.um-theme-btn.is-on { color: var(--primary); }
.um-theme-thumb {
  position: absolute;
  z-index: 0;
  top: 2px;
  left: 2px;
  width: 30px;
  height: 24px;
  border-radius: 6px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--border);
  transition: transform var(--dur-med) var(--ease-spring);
  pointer-events: none;
}
.um-theme-seg[data-theme-val="light"]  .um-theme-thumb { transform: translateX(0); }
.um-theme-seg[data-theme-val="dark"]   .um-theme-thumb { transform: translateX(30px); }
.um-theme-seg[data-theme-val="system"] .um-theme-thumb { transform: translateX(60px); }
html.dark .um-theme-thumb {
  background: var(--fg-12);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), inset 0 0 0 1px var(--border);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 49px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  box-sizing: border-box;
}
.panel-head .ph-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-head .ph-sub {
  font-size: 12px;
  color: var(--fg-50);
  font-weight: 500;
}
.panel-head .ph-favicon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.panel-head .ph-favicon[hidden] { display: none; }

/* AI-generated topic tags shown in the reader header when the
   "Auto-tagging" use case is enabled in Settings → AI → Use cases.
   `.reader-tag-bar` is the standalone strip between the panel header and
   the article body; the older `.reader-tags` selector stays for any leftover
   inline placement. Both render the same chip style via `.reader-tag`. */
.reader-tags,
.reader-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reader-tags { margin-top: 6px; }
.reader-tag-bar {
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  align-items: center;
  flex-wrap: nowrap;
}
.reader-tag-bar .reader-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.reader-tag-bar .reader-tag-regen {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  margin-left: 6px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  opacity: .65;
  flex-shrink: 0;
}
.reader-tag-bar .reader-tag-regen:hover { background: var(--fg-08); color: var(--fg); opacity: 1; }
.reader-tag-bar .reader-tag-regen[disabled] { cursor: default; opacity: .35; }
.reader-tag-bar .reader-tag-regen[disabled] svg { animation: spin 1s linear infinite; }
.reader-tags[hidden],
.reader-tag-bar[hidden] { display: none; }
.reader-tag {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--primary) 22%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.45;
  white-space: nowrap;
  cursor: default;
  transition: background .12s, border-color .12s;
}
.reader-tag:hover {
  background: color-mix(in oklch, var(--primary) 18%, transparent);
  border-color: color-mix(in oklch, var(--primary) 36%, transparent);
}

/* ===== ARTICLE LIST ===== */
.articles {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-med) var(--ease);
  transform-origin: center top;
}
.articles.is-swapping {
  /* Opacity-only: a scope/filter/tab swap dissolves cleanly with NO vertical
     movement (the translateY used to amplify the perceived "sursaut"). */
  opacity: 0;
}
/* Stagger-in for list items whenever a new tab renders */
.articles > * {
  animation: organic-rise var(--dur-slow) var(--ease-spring) both;
}
.articles > *:nth-child(1)  { animation-delay: 0ms; }
.articles > *:nth-child(2)  { animation-delay: 22ms; }
.articles > *:nth-child(3)  { animation-delay: 44ms; }
.articles > *:nth-child(4)  { animation-delay: 66ms; }
.articles > *:nth-child(5)  { animation-delay: 88ms; }
.articles > *:nth-child(6)  { animation-delay: 110ms; }
.articles > *:nth-child(7)  { animation-delay: 128ms; }
.articles > *:nth-child(8)  { animation-delay: 144ms; }
.articles > *:nth-child(9)  { animation-delay: 158ms; }
.articles > *:nth-child(10) { animation-delay: 170ms; }
.articles > *:nth-child(n+11) { animation-delay: 180ms; }
.articles.is-swapping > * { animation: none; }

/* Opacity-only fade for rows appearing after a list swap / initial paint.
   No translateY: vertical row movement on a full swap read as a jolt. The
   refresh path's new-row slide-in uses gregArticleSlideIn (keeps its
   translateY) so the liked "new article slides in" motion is unaffected. */
@keyframes organic-rise {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== Search row ===== */
.search-row {
  position: relative;
  padding: 0 12px;
  height: 49px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.search-row .search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-row .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-50);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.search-row input[type="search"] {
  width: 100%;
  height: 32px;
  padding: 0 30px 0 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.25));
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(27,27,27,.04);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.search-row input[type="search"]::-webkit-search-cancel-button,
.search-row input[type="search"]::-webkit-search-decoration,
.search-row input[type="search"]::-webkit-search-results-button,
.search-row input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-row input::placeholder { color: var(--fg-50); }
.search-row input:focus {
  border-color: rgba(var(--primary-rgb), .4);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14), inset 0 1px 0 rgba(255,255,255,.7);
  background: var(--card);
}
html.dark .search-row input[type="search"] {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.3);
}
html.dark .search-row input:focus {
  background: rgba(255,255,255,.04);
  border-color: rgba(var(--primary-rgb), .5);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .22), inset 0 1px 0 rgba(255,255,255,.08);
}
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--fg-50);
  background: var(--fg-08);
  border: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.search-clear:hover { color: var(--fg); background: var(--fg-12); }
.search-clear[hidden] { display: none; }
.mark-all-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg-75);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-med) var(--ease-spring);
}
.mark-all-btn:hover {
  color: var(--primary);
  background: var(--primary-12);
  border-color: rgba(var(--primary-rgb), .25);
}
html.dark .mark-all-btn {
  background: var(--card);
}
html.dark .mark-all-btn:hover {
  color: var(--primary);
  background: var(--primary-12);
}

/* Reader-header read/unread toggle: plain ghost .icon-btn (blends with its
   toolbar neighbors — no circle/border), checkmark icon shared with the
   article-list "mark all read" control. Unread -> checkmark flipped
   horizontally (action: mark read); .is-read = already read -> normal
   checkmark (action: mark unread). */
.mark-read-btn svg { transition: transform var(--dur-fast) var(--ease); transform: scaleX(-1); }
.mark-read-btn.is-read svg { transform: none; }

/* Generic icon button — used in reader header (Star, Open original), feed-row actions, etc.
   Ghost-style with theme-aware hover. */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--fg-75);
  font-family: inherit;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-med) var(--ease-spring);
}
.icon-btn:hover {
  color: var(--fg);
  background: var(--fg-08);
}
.icon-btn:active {
  transform: scale(.94);
}
.icon-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.icon-btn:disabled:hover {
  color: var(--fg-75);
  background: transparent;
}
.icon-btn:disabled:active {
  transform: none;
}
.icon-btn.is-on {
  color: var(--primary);
  background: var(--primary-12);
}

/* ===== Single-line article row ===== */
.articles { padding: 2px 6px 12px; }

.article-item:focus,
.article-item:focus-visible { outline: none; }
.article-item {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 5px 10px;
  border-radius: 8px;
  transition: color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
  background: transparent;
  border: 0;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
/* Slide-in for rows inserted by gregMergeArticles() — used during the
   refresh-all live-merge so new items glide in instead of the whole list
   rebuilding. Transform-only (composited on GPU) + opacity. Rows take
   their final height immediately so the push-down of existing rows
   happens in a single reflow on insertion rather than animating
   max-height frame by frame — which used to cause visible saccades and
   forced followListPillDuringMerge() to chase a moving offsetTop with a
   rAF loop. animation-fill-mode: backwards applies the 0% values BEFORE
   the animation starts, preventing a brief paint at the natural state. */
@keyframes gregArticleSlideIn {
  0%   { opacity: 0; transform: translate3d(0, -10px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.article-item.is-entering {
  animation: gregArticleSlideIn .32s cubic-bezier(.22, 1, .36, 1);
  animation-fill-mode: backwards;
  will-change: transform, opacity;
}
/* Read rows leaving the list COLLAPSE in place: opacity + height + vertical
   padding shrink to 0 together so the rows below glide up tracking the shrink
   and never overlap the fading text (no pinning/absolute → no superposition).
   height/padding are set inline by scheduleRowExit (real measured start value,
   then 0); overflow:hidden clips content as it collapses. A transition (not a
   @keyframes) is used so the start value is the row's actual height. */
@keyframes gregArticleCollapse {
  0%   { opacity: 1; height: var(--row-h, auto); padding-top: var(--row-pt, 0); padding-bottom: var(--row-pb, 0); }
  100% { opacity: 0; height: 0; padding-top: 0; padding-bottom: 0; }
}
.article-item.is-leaving {
  overflow: hidden;
  pointer-events: none;
  /* Keyframe (not transition) so it overrides the inherited
     `.articles > * { animation: organic-rise ... both }` cleanly — its `both`
     fill would otherwise pin opacity:1. --row-h/--row-pt/--row-pb are the
     row's real measured box, set inline by scheduleRowExit. */
  animation: gregArticleCollapse .26s cubic-bezier(.4, 0, 1, 1) forwards;
  /* Gentle cascade so a multi-row purge reads as a wave, not lockstep.
     --exit-index is set per-row in scheduleRowExit (capped at 8). */
  animation-delay: calc(var(--exit-index, 0) * 20ms);
  will-change: height, opacity;
}
/* Sidebar feeds/folders newly appearing during a refresh slide in with
   the same feel. Horizontal nudge (-6px X) differentiates from the
   article rows (-10px Y) at a glance. */
@keyframes gregSidebarSlideIn {
  0%   { opacity: 0; transform: translate3d(-6px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.feed-item.is-entering,
.feed-group-head.is-entering {
  animation: gregSidebarSlideIn .32s cubic-bezier(.22, 1, .36, 1);
  animation-fill-mode: backwards;
  will-change: transform, opacity;
}
/* Sidebar feeds/folders leaving (both the removal-only fast path AND the mixed
   add/remove reconcile) COLLAPSE in place, exactly like article rows
   (gregArticleCollapse): opacity + height + vertical padding + top margin
   shrink to 0 together so survivors glide up tracking the shrink and never
   overlap the fading row (no pinning/fixed/clone → no superposition).
   --row-h/--row-mt/--row-pt/--row-pb are the row's real measured box, set
   inline by collapseOut. Works because .rss-feeds is a block container (see
   above) — the same reflow the article list relies on. A whole dead folder
   collapses as .feed-group (head + its feeds together).
   min-height is animated INSIDE the keyframe (not just the static rule below)
   on purpose: .feed-item carries a density min-height (24/36/44px) from a
   higher-specificity rule (html[data-density=...] .feed-item) that would clamp
   the height collapse and leave the row only fading. Animation declarations
   win over static rules regardless of specificity, so driving min-height -> 0
   here is what lets the feed row actually shrink (folders have no such floor,
   which is why they collapsed already). */
@keyframes gregSidebarCollapse {
  0%   { opacity: 1; height: var(--row-h, auto); min-height: 0; margin-top: var(--row-mt, 0); padding-top: var(--row-pt, 0); padding-bottom: var(--row-pb, 0); }
  100% { opacity: 0; height: 0; min-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; }
}
.feed-item.is-leaving,
.feed-group.is-leaving {
  overflow: hidden;
  min-height: 0;
  pointer-events: none;
  animation: gregSidebarCollapse .26s cubic-bezier(.4, 0, 1, 1) forwards;
  animation-delay: calc(var(--exit-index, 0) * 20ms);
  will-change: height, opacity;
}
/* Directional whole-list slide on a filter switch (Unread/Starred/All). The
   live #feedsList holds the freshly rendered target filter and slides in from
   the bound edge; a fixed-position .feeds-slide-ghost (cloned old content, on
   document.body) slides out the opposite edge. PURE positional slide (no
   opacity fade): old and new occupy adjacent halves of the column and never
   overlap, so a single hard slide reads as ONE direct motion — a cross-fade
   over overlapping feeds (e.g. Unread feeds are a subset of All) looked like a
   dissolve/double-step on a 2-tab jump. Transform-only (GPU), driven by
   gregSlideSidebar. forward (advancing) = new from the right; back = from the
   left. Easing matches gregSidebarSlideIn. */
@keyframes gregFeedsInFromRight { from { transform: translateX(100%);  } to { transform: translateX(0); } }
@keyframes gregFeedsInFromLeft  { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes gregFeedsOutToLeft   { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes gregFeedsOutToRight  { from { transform: translateX(0); } to { transform: translateX(100%);  } }
#feedsList.feeds-in-from-right { animation: gregFeedsInFromRight .34s cubic-bezier(.22, 1, .36, 1); }
#feedsList.feeds-in-from-left  { animation: gregFeedsInFromLeft  .34s cubic-bezier(.22, 1, .36, 1); }
/* Clip the sliding feed list to the column on the STATIC parent — clipping on
   #feedsList itself fails because its own transform moves the clip region with
   the content (it would bleed over the article panel). */
.sidebar.rss-side.is-feeds-sliding { overflow: hidden; }
.feeds-slide-inner { will-change: transform; }
.feeds-slide-inner.feeds-out-to-left  { animation: gregFeedsOutToLeft  .34s cubic-bezier(.22, 1, .36, 1) forwards; }
.feeds-slide-inner.feeds-out-to-right { animation: gregFeedsOutToRight .34s cubic-bezier(.22, 1, .36, 1) forwards; }
/* Honour the OS "reduce motion" setting: kill the list enter/exit/stagger
   motion entirely. scheduleRowExit also removes departing rows instantly in
   this mode (the JS reads the same media query) so nothing lingers. */
@media (prefers-reduced-motion: reduce) {
  .articles > * { animation: none; }
  .article-item.is-entering,
  .feed-item.is-entering,
  .feed-group-head.is-entering { animation: none; }
  .article-item.is-leaving,
  .feed-item.is-leaving,
  .feed-group.is-leaving { animation: none; transition: none; }
  .articles.is-swapping { opacity: 1; transform: none; }
  /* Filter-switch slide: instant swap (gregSlideSidebar also skips the ghost). */
  #feedsList.feeds-in-from-right,
  #feedsList.feeds-in-from-left,
  .feeds-slide-inner.feeds-out-to-left,
  .feeds-slide-inner.feeds-out-to-right { animation: none; }
}
/* Mini spinner used inside .reader-empty when a refresh is in flight for
   a cold scope (no cached articles for this feed/folder yet). Pure
   transform rotation — no layout cost. */
@keyframes gregEmptySpin {
  to { transform: rotate(360deg); }
}
.reader-empty-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: gregEmptySpin .9s linear infinite;
  will-change: transform;
}
/* Deferred fade-in for the "refreshing scope" placeholder. animation-fill-mode:
   both holds opacity 0 during the 250ms delay, then fades to opacity 1 over
   200ms. Fast fetches that complete in <250ms replace the wrap before the
   user ever sees the placeholder. */
@keyframes gregDeferredFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.reader-empty.is-deferred {
  animation: gregDeferredFadeIn .2s ease 0.25s both;
  will-change: opacity;
}
/* Dim the article list while a cold-scope fetch is in flight. The
   previous scope's rows stay visible (avoids the "empty article screen"
   perception) but get a subtle fade so the user reads it as a loading
   state. gregMergeArticles drops the class as soon as the new rows
   arrive (full opacity is restored just before the slide-in plays). */
.articles.is-loading {
  opacity: .45;
  transition: opacity .18s ease;
}
.articles { transition: opacity .18s ease; }
/* Hide the unread dot — the user prefers no dot accent on each row.
   Selection highlight alone communicates state. */
.article-item .ai-unread { display: none; }
.article-item::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--nav-hover);
  opacity: 0;
  transition: opacity .2s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.article-item:hover::after { opacity: 1; }

.article-item.is-active {
  background: transparent;
}
.article-item.is-active::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(280px 260px at 0% 50%, rgba(var(--primary-rgb), 0.28) 50%, rgba(var(--primary-rgb), 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.7),
    inset 0 0 12px 0 rgba(var(--primary-rgb), 0.35);
  z-index: -1;
  pointer-events: none;
}
/* Hide per-item active background when the shared sliding pill is active */
.articles.has-pill .article-item.is-active::before { opacity: 0; }

/* Shared sliding pill — sweeps between the selected article rows */
.articles { position: relative; }
.list-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  border-radius: 8px;
  z-index: 0;
  opacity: 0;
  background-image: radial-gradient(280px 260px at 0% 50%,
    rgba(var(--primary-rgb), 0.28) 50%,
    rgba(var(--primary-rgb), 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.7),
    inset 0 0 12px 0 rgba(var(--primary-rgb), 0.35);
  transform: translate3d(0, 0, 0);
  /* See .nav-pill: width/height snap, only transform animates. */
  transition:
    transform .42s cubic-bezier(.22, 1, .36, 1),
    opacity   .22s var(--ease);
  will-change: transform;
}
.list-pill.is-ready { opacity: 1; }
/* Snappy transition while the user is navigating with arrow keys (single
   press OR held key auto-repeat). At ~30 events/sec on auto-repeat, anything
   longer than ~40ms means the pill is always animating toward a target that
   already changed — visible lag behind the .is-read flip. Linear curve keeps
   each frame's distance proportional; .04s is barely-visible smoothing.
   The class is set by the bridge's arrow handler and removed 220ms after
   keystrokes stop so the cinematic ease returns for subsequent clicks. */
.list-pill.is-fast {
  transition:
    transform .04s linear,
    opacity   .22s var(--ease);
}
/* Don't apply the list rise animation to the pill element itself */
.articles > .list-pill { animation: none; }

.article-item.is-read .ai-title { color: var(--fg-50); font-weight: 500; }
.article-item.is-read .ai-unread { opacity: 0; }

.ai-unread {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity .2s;
}
.ai-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ai-date {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-50);
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== DENSITY =====
   Scales article rows + sidebar feed rows + reader spacing.
   Default values above match cozy. */
html[data-density="compact"] .article-item     { padding: 2px 10px; gap: 8px; }
html[data-density="compact"] .article-item .ai-title { font-size: 12.5px; line-height: 1.25; }
html[data-density="compact"] .article-item .ai-date  { font-size: 10.5px; }
html[data-density="compact"] .article-item .favicon  { width: 16px; height: 16px; font-size: 10px; }
html[data-density="compact"] .articles { padding: 0 6px 8px; }
html[data-density="compact"] .feed-item { min-height: 24px; padding: 2px 10px 2px 24px; font-size: 12.5px; }
html[data-density="compact"] .feed-item:has(.feed-handle) { min-height: 36px; }
html[data-density="compact"] .reader-body { padding: 20px 40px 40px; }

html[data-density="comfy"] .article-item       { padding: 10px 12px; gap: 12px; }
html[data-density="comfy"] .article-item .ai-title { font-size: 13.5px; line-height: 1.45; }
html[data-density="comfy"] .article-item .ai-date  { font-size: 11.5px; }
html[data-density="comfy"] .article-item .favicon  { width: 22px; height: 22px; }
html[data-density="comfy"] .articles { padding: 6px 6px 16px; }
html[data-density="comfy"] .feed-item { min-height: 36px; padding: 8px 10px 8px 24px; }
html[data-density="comfy"] .feed-item:has(.feed-handle) { min-height: 52px; }
html[data-density="comfy"] .reader-body { padding: 40px 56px 64px; }

/* ===== TEXT SIZE =====
   Scales article rows, sidebar feeds, reader body type, and reader title.
   Reader chrome (sub, meta strong, h3) and translate/AI banner body scale
   alongside the article body so the reader feels coherent at every step. */
html[data-text-size="sm"] .article-item .ai-title { font-size: 11px; line-height: 1.25; }
html[data-text-size="sm"] .article-item .ai-date  { font-size: 9.5px; }
html[data-text-size="sm"] .feed-item              { font-size: 11px; }
html[data-text-size="sm"] .reader-content         { font-size: 14px; line-height: 1.6; }
html[data-text-size="sm"] .reader-content h3      { font-size: 18px; }
html[data-text-size="sm"] .reader-title           { font-size: 30px; }
html[data-text-size="sm"] .reader-sub             { font-size: 14.5px; }
html[data-text-size="sm"] .reader-meta strong     { font-size: 12px; }
html[data-text-size="sm"] .reader-banner .rb-body { font-size: 12.5px; }

html[data-text-size="lg"] .article-item .ai-title { font-size: 15.5px; line-height: 1.45; }
html[data-text-size="lg"] .article-item .ai-date  { font-size: 13px; }
html[data-text-size="lg"] .feed-item              { font-size: 15.5px; }
html[data-text-size="lg"] .reader-content         { font-size: 17px; line-height: 1.7; }
html[data-text-size="lg"] .reader-content h3      { font-size: 22px; }
html[data-text-size="lg"] .reader-title           { font-size: 38px; }
html[data-text-size="lg"] .reader-sub             { font-size: 17.5px; }
html[data-text-size="lg"] .reader-meta strong     { font-size: 14px; }
html[data-text-size="lg"] .reader-banner .rb-body { font-size: 14.5px; }

/* ===== READER ===== */
.reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px 56px;
}
/* Discreet floating "back to top" button, anchored bottom-right of .panel-reader.
   Hidden by default; bridge.js toggles .is-visible once the reader is scrolled. */
.reader-to-top {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px -8px rgba(0,0,0,.25), 0 2px 6px -2px rgba(0,0,0,.15);
  color: var(--fg-75);
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease),
              transform var(--dur-med) var(--ease-spring),
              color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.reader-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.reader-to-top:hover { color: var(--fg); background: color-mix(in oklab, var(--bg) 94%, transparent); }
.reader-to-top:active { transform: scale(.92); }
.reader-inner {
  max-width: 680px;
  margin: 0 auto;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-50);
  margin-bottom: 12px;
}
.reader-meta .favicon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }

/* Neutral favicon treatment — unified monochrome look matches the minimal theme.
   Overrides inline background/color set in the FEEDS data so the sidebar
   reads as a calm list rather than a grid of brand chips. */
.rss-side .favicon:not(.favicon-all),
.article-item .favicon,
.panel-list .favicon {
  background: var(--fg-08) !important;
  color: var(--fg-75) !important;
}
.rss-side .feed-item.is-active .favicon:not(.favicon-all),
.article-item.is-active .favicon {
  background: var(--fg-12) !important;
  color: var(--fg) !important;
}
.reader-meta strong { color: var(--fg); font-weight: 700; font-size: 13px; }

.reader-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg);
}
.reader-sub {
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--fg-75);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.reader-hero {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 14px;
  margin: 8px 0 24px;
  background-image:
    repeating-linear-gradient(45deg, rgba(var(--primary-rgb),.06) 0 12px, rgba(var(--primary-rgb),.02) 12px 24px),
    linear-gradient(180deg, rgba(var(--primary-rgb),.08), rgba(var(--primary-rgb),.02));
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
  color: var(--fg-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-content {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
}
.reader-content p { margin: 0 0 16px; }
.reader-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 12px;
}
.reader-content blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--primary);
  color: var(--fg-75);
  font-style: italic;
}
.reader-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--primary-rgb), .3);
}
.reader-content a:hover { border-bottom-color: var(--primary); }
.reader-content ul { padding-left: 20px; margin: 0 0 16px; }
.reader-content li { margin-bottom: 4px; }

/* Video / audio embeds (YouTube, Vimeo, Twitch, SoundCloud, …) reinjected
   by the server after extraction stripped them. The wrapper enforces a
   responsive 16:9 box so the iframe scales to the column width. */
.reader-content figure.video-embed {
  position: relative;
  width: 100%;
  margin: 20px 0;
  aspect-ratio: 16 / 9;
  background: var(--fg-04);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.reader-content figure.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Social-media cards — static rendering of oEmbed blockquotes from X,
   Instagram, Bluesky, TikTok, Facebook. We don't iframe the platform widget
   endpoints because most of them ship empty HTML shells that fetch+render
   via JS, which silently fails on HTTP origins, with third-party cookies
   blocked, or with strict tracking protection on. Static cards always
   render, add no third-party surface, and load instantly — the "View on
   PLATFORM" link lets readers open the rich post in the app for media. */
.reader-content figure.social-card {
  margin: 20px 0;
  padding: 16px 18px;
  max-width: 550px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--fg-04);
}
.reader-content .social-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1;
}
.reader-content .social-card-brand {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
}
/* Per-platform brand accents. The brand colour is set on .social-card-brand
   only; the rest of the card uses the neutral reader theme so the panel
   stays calm even with several embeds. */
.reader-content figure.social-x        .social-card-brand { background: var(--fg);    color: var(--bg); }
.reader-content figure.social-instagram .social-card-brand { background: #d62976; color: #fff; }
.reader-content figure.social-bluesky   .social-card-brand { background: #0085ff; color: #fff; }
.reader-content figure.social-tiktok    .social-card-brand { background: #000;    color: #fff; }
.reader-content figure.social-facebook  .social-card-brand { background: #1877f2; color: #fff; }
.reader-content .social-card-author {
  color: var(--fg);
  font-weight: 600;
}
.reader-content .social-card-date {
  color: var(--fg-50);
  margin-left: auto;
}
.reader-content .social-card-body {
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 10px;
  word-wrap: break-word;
}
.reader-content .social-card-body a { border-bottom: 1px solid rgba(var(--primary-rgb), .3); }
/* Media row — populated by the backend's social-card enrichment pass when a
   public API exposed the post's photos / videos (currently X via syndication).
   Single item: full card width. Multiple photos: 2-col responsive grid. */
.reader-content .social-card-media {
  margin: 4px 0 12px;
  border-radius: 10px;
  overflow: hidden;
}
.reader-content .social-card-media img,
.reader-content .social-card-media video {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: var(--fg-08);
}
.reader-content .social-card-media-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.reader-content .social-card-media-multi img,
.reader-content .social-card-media-multi video {
  max-height: 260px;
  aspect-ratio: 1 / 1;
}
.reader-content a.social-card-link {
  display: inline-block;
  font-size: 12px;
  color: var(--fg-50);
  text-decoration: none;
  border-bottom: 0;
}
.reader-content a.social-card-link:hover { color: var(--primary); }
/* Fallback for any iframe that slips through without our wrapper. */
.reader-content iframe { max-width: 100%; }

.reader-actions {
  display: flex;
  gap: 6px;
}
.reader-actions .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.reader-actions .icon-btn.is-on {
  color: var(--primary);
  background: var(--primary-12);
}
.reader-actions .icon-btn.is-loading {
  color: var(--primary);
}
.reader-actions .icon-btn.is-loading svg { animation: ai-spin 1s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
/* Tiny green dot in the top-right corner of an action button when a cached
   AI result (summary or translation) is available for the current article. */
.reader-actions .icon-btn { position: relative; }
.reader-actions .icon-btn.has-cache::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2bbf6b;
  opacity: .85;
  pointer-events: none;
}
/* While the reader shows a bulk AI digest, hide article-only actions
   (summarize, translate, star, open-original). The digest IS the AI output,
   so re-summarizing / starring / opening don't apply here. */
.panel-reader.is-bulk-summary .reader-actions { display: none; }
.panel-reader.is-bulk-summary .ph-title h2 { color: var(--primary); }
/* Header chrome for the bulk-summary view: meta line + regen/close buttons,
   sitting on the right of the reader panel header. Replaces the in-body slim
   header so we don't repeat "AI summary / 2 articles · Drone" twice. */
.bulk-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.bulk-header-actions .bulk-sum-meta {
  max-width: 360px;
  font-size: 11.5px;
  color: var(--fg-50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 6px;
}

/* AI summary + translation banners (in reader) */
.reader-banner {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 18px 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb), .22);
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(var(--primary-rgb), .14), rgba(var(--primary-rgb), .03) 70%),
    var(--card);
  box-shadow: 0 1px 0 rgba(var(--primary-rgb), .08), 0 8px 24px -16px rgba(var(--primary-rgb), .35);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  animation: banner-in 280ms cubic-bezier(.22,.61,.36,1);
}
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reader-banner .rb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}
.reader-banner .rb-head .rb-ico {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
}
.reader-banner .rb-head .rb-meta {
  margin-left: auto;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-50);
}
.reader-banner .rb-close {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-left: 6px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
}
.reader-banner .rb-close:hover { background: var(--fg-08); color: var(--fg); }
.reader-banner .rb-regen {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-left: 4px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  opacity: .65;
}
.reader-banner .rb-regen:hover { background: var(--fg-08); color: var(--fg); opacity: 1; }
.reader-banner .rb-regen + .rb-close { margin-left: 2px; }
.reader-banner .rb-body { color: var(--fg); line-height: 1.55; font-size: 13.5px; }
.reader-banner .rb-body p { margin: 0 0 10px; }
.reader-banner .rb-body p:last-child { margin-bottom: 0; }
.reader-banner .rb-md h4,
.reader-banner .rb-md h5,
.reader-banner .rb-md h6 {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--fg-70, var(--fg));
}
.reader-banner .rb-md h4:first-child,
.reader-banner .rb-md h5:first-child,
.reader-banner .rb-md h6:first-child { margin-top: 0; }
.reader-banner .rb-md ul,
.reader-banner .rb-md ol { margin: 4px 0 12px; padding-left: 20px; }
.reader-banner .rb-md ul:last-child,
.reader-banner .rb-md ol:last-child { margin-bottom: 0; }
.reader-banner .rb-md li { margin: 2px 0; }
.reader-banner .rb-md strong { color: var(--fg); font-weight: 700; }
.reader-banner .rb-md em { color: var(--fg-90, var(--fg)); }
.reader-banner .rb-md code {
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--fg-06);
  padding: 1px 5px;
  border-radius: 4px;
}
.reader-banner.is-loading .rb-body {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-50); font-style: italic;
}
.reader-banner .rb-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(var(--primary-rgb), .2);
  border-top-color: var(--primary);
  animation: ai-spin .8s linear infinite;
}
.reader-banner.is-error {
  border-color: rgba(220, 70, 70, .35);
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(220, 70, 70, .10), rgba(220, 70, 70, .02) 70%),
    var(--card);
}
.reader-banner.is-error .rb-head { color: #c0382e; }

/* Browser-style translation notice bar (Chrome-like) */
.translate-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -12px -12px 22px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 6px 18px -10px rgba(0,0,0,.18);
  font-size: 13px;
  color: var(--fg);
  animation: banner-in 220ms cubic-bezier(.22,.61,.36,1);
}
.translate-bar .tb-ico {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(var(--primary-rgb), .14);
  color: var(--primary);
  flex: 0 0 auto;
}
.translate-bar .tb-text { flex: 1; min-width: 0; color: var(--fg); }
.translate-bar .tb-text b { font-weight: 600; }
.translate-bar .tb-text .tb-meta { color: var(--fg-50); margin-left: 6px; font-size: 12px; }
.translate-bar .tb-link {
  background: transparent; border: 0; padding: 4px 8px;
  border-radius: 6px;
  color: var(--primary); font-weight: 600; font-size: 13px;
  cursor: pointer;
}
.translate-bar .tb-link:hover { background: rgba(var(--primary-rgb), .10); }
.translate-bar .tb-close {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: transparent; border: 0;
  color: var(--fg-50); cursor: pointer;
}
.translate-bar .tb-close:hover { background: var(--fg-08); color: var(--fg); }
.translate-bar .tb-regen {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: transparent; border: 0;
  color: var(--fg-50); cursor: pointer;
  opacity: .8;
  transition: opacity .15s, background .15s, color .15s;
}
.translate-bar .tb-regen:hover { background: var(--fg-08); color: var(--fg); opacity: 1; }
.translate-bar.is-loading .tb-text { color: var(--fg-50); font-style: italic; }
.translate-bar .tb-spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(var(--primary-rgb), .2);
  border-top-color: var(--primary);
  animation: ai-spin .8s linear infinite;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -2px;
}

.reader-empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--fg-50);
  font-size: 13px;
}
/* Same mask-driven tinting as .brand-mark / .about-mark — see styles.css.
   logo.png is reused as the mask source; --primary fills the silhouette. */
.reader-empty-logo {
  display: inline-block;
  width: 56px;
  height: 56px;
  background-color: var(--primary);
  -webkit-mask: url(/icons/logo.png) center / contain no-repeat;
  mask: url(/icons/logo.png) center / contain no-repeat;
}
.reader-empty-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.reader-empty-inner svg { color: var(--fg-25); }
.reader-empty-inner strong {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* "or" divider in empty state */
.reader-empty-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: 220px;
  margin: 18px auto 4px;
  color: var(--fg-50);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}
.reader-empty-divider::before,
.reader-empty-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}
/* AI summarize button — clearly the secondary path, not a primary CTA */
.reader-empty-ai {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font: 600 13px/1 inherit;
  font-family: inherit;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
/* Tiny green dot when a cached digest exists for the current scope. */
.reader-empty-ai.has-cache::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2bbf6b;
  opacity: .85;
  pointer-events: none;
}
.reader-empty-ai:hover {
  background: var(--fg-04);
  border-color: var(--fg-25);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -6px rgba(var(--primary-rgb),.4);
}
.reader-empty-ai:active { transform: translateY(0); }
.reader-empty-ai:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.reader-empty-ai .reai-ico {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.18), rgba(var(--primary-rgb),.06));
  color: var(--primary);
}
.reader-empty-ai .reai-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb),.12);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.reader-empty-helper {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--fg-50);
  max-width: 320px;
  line-height: 1.5;
}
.reader-empty-helper strong { color: var(--fg-75); font-weight: 600; font-family: inherit; font-size: inherit; }

/* Bulk AI summary view (replaces reader-empty when triggered) */
.reader-bulk-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.bulk-sum {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.bulk-sum-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--primary-rgb),.06) 0%, transparent 100%);
}
/* Compact variant: just a meta line + actions, no eyebrow / title / sub.
   The reader-panel header above already names the digest + scope. */
.bulk-sum-head--slim {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 10px 18px;
  background: transparent;
}
.bulk-sum-meta {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  color: var(--fg-50);
  letter-spacing: .005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bulk-sum-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
}
.bulk-sum-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--fg);
  line-height: 1.3;
  text-wrap: balance;
}
.bulk-sum-title em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}
.bulk-sum-sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--fg-50);
}
.bulk-sum-close {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  display: grid; place-items: center;
  align-self: start;
}
.bulk-sum-close:hover { background: var(--fg-08); color: var(--fg); }
.bulk-sum-regen {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  display: grid; place-items: center;
  align-self: start;
  margin-right: 2px;
  opacity: .8;
  transition: opacity .15s, background .15s, color .15s;
}
.bulk-sum-regen:hover { background: var(--fg-08); color: var(--fg); opacity: 1; }
.bulk-sum-body {
  flex: 1;
  overflow: auto;
  padding: 18px 28px 32px;
}
.bulk-sum-body .bulk-sum-h {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--fg);
  margin: 22px 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.bulk-sum-body .bulk-sum-h:first-child { margin-top: 4px; }
.bulk-sum-body p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-75);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.bulk-sum-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulk-sum-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-75);
}
.bulk-sum-list li::before {
  content: "";
  position: absolute;
  left: 6px; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .7;
}
.bulk-sum-list li strong { color: var(--fg); font-weight: 600; }
/* Loading skeleton */
.bulk-sum-skel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}
.bulk-skel-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--fg-08) 0%, var(--fg-04) 50%, var(--fg-08) 100%);
  background-size: 220% 100%;
  animation: bulkSkelShimmer 1.4s ease-in-out infinite;
}
.bulk-skel-line.w-60 { width: 60%; }
.bulk-skel-line.w-75 { width: 75%; }
.bulk-skel-line.w-80 { width: 80%; }
.bulk-skel-line.w-90 { width: 90%; }
.bulk-skel-line.w-95 { width: 95%; }
.bulk-skel-line.w-100 { width: 100%; }
@keyframes bulkSkelShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
/* Bulk summary — Phase 1 progress cards (one per article). State machine:
   pending → active → done | fallback. Reuses the user-selected accent for
   active pulse + done check (CSS vars updated by applyAccent). The list
   itself doesn't scroll — its parent .bulk-sum-body already handles overflow
   so the list grows to fill the panel and only that single scroll bar shows.
   Dimensions mirror .article-item (padding 5px 10px) so a row in the reader
   looks roughly the same height as a row in the article list while a bulk
   summary is in flight. */
.bulk-progress-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}
.bulk-progress-card {
  display: grid;
  grid-template-columns: 16px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
  opacity: .55;
}
.bulk-progress-card[data-state="active"] {
  background: var(--primary-12);
  border-color: var(--primary-25);
  opacity: 1;
  animation: bulkCardPulse 1.4s ease-in-out infinite;
}
.bulk-progress-card[data-state="done"],
.bulk-progress-card[data-state="fallback"] { opacity: 1; }
.bulk-progress-card .favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}
.bulk-progress-card .title {
  font: 500 13px/1.35 inherit;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bulk-progress-card .state-ico {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  position: relative;
}
.bulk-progress-card[data-state="pending"] .state-ico::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--fg-25);
  border-radius: 50%;
}
.bulk-progress-card[data-state="active"] .state-ico::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--primary-25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: bulkCardSpin .8s linear infinite;
}
.bulk-progress-card[data-state="done"] .state-ico::before {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 1.6px solid var(--primary);
  border-bottom: 1.6px solid var(--primary);
  transform: rotate(-45deg) translate(1px, -1px);
}
.bulk-progress-card[data-state="fallback"] .state-ico::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--fg-50);
  border-radius: 50%;
  background: radial-gradient(circle, var(--fg-25) 30%, transparent 32%);
}
@keyframes bulkCardSpin { to { transform: rotate(360deg); } }
@keyframes bulkCardPulse {
  0%, 100% { background: var(--primary-12); }
  50%      { background: var(--primary-25); }
}
/* Bulk summary — inline confirmation rendered in the reader panel when the
   visible-article count is above BULK_CONFIRM_THRESHOLD. Visually mirrors
   the Phase 2 indicator (centred, accent halo) so the user reads the whole
   flow as one cohesive sequence: confirm → cards → synthesis → result.
   Layout: icon → title → stats pills → intro → cost warning → actions. */
.bulk-confirm {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px 36px;
  text-align: center;
  min-height: 320px;
}
.bulk-confirm-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-12);
  color: var(--primary);
  display: grid;
  place-items: center;
  box-shadow: 0 0 28px var(--primary-25);
  margin-bottom: 2px;
}
.bulk-confirm-ico svg { width: 32px; height: 32px; }
.bulk-confirm-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.014em;
  color: var(--fg);
  line-height: 1.25;
  text-wrap: balance;
  margin: 2px 0 6px;
}
.bulk-confirm-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 440px;
}
.bulk-confirm-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 12px;
  background: var(--fg-04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--fg-50);
  white-space: nowrap;
}
.bulk-confirm-stat strong {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bulk-confirm-intro {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-60);
  max-width: 440px;
}
/* Cost callout — amber, same level token as the broadcast warning banner.
   Reads as "this is more expensive than you might expect" without crossing
   into red/danger territory (the action isn't dangerous, just costly). */
.bulk-confirm-warn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 10px;
  color: #b76e00;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  max-width: 440px;
  text-align: left;
}
body.dark .bulk-confirm-warn { color: #f59e0b; }
/* Danger variant — activated when articles.length > 100. The cost grows
   non-linearly with chunked synthesis (intermediate digests + final), so
   we cross from amber "expensive" into red "really expensive" once the
   user moves past 2 chunks. Mirrors the broadcast banner's critical
   level tokens. */
.bulk-confirm-warn.is-danger {
  background: rgba(229, 72, 77, .12);
  border-color: rgba(229, 72, 77, .4);
  color: #b3261e;
}
body.dark .bulk-confirm-warn.is-danger { color: #ff6b6b; }
.bulk-confirm-warn svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}
.bulk-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.bulk-confirm-actions .btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  min-width: 110px;
}
/* Bulk summary — Phase 2 (synthesis call in flight). Replaces the cards
   with a centred animated indicator so the user knows we're past the
   per-article step and the final digest is being composed. */
.bulk-phase2 {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px;
  text-align: center;
  min-height: 240px;
}
.bulk-phase2-anim {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}
.bulk-phase2-anim::before,
.bulk-phase2-anim::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: bulkPhase2Ring 1.8s cubic-bezier(.16, .84, .44, 1) infinite;
}
.bulk-phase2-anim::after { animation-delay: -.9s; }
.bulk-phase2-anim span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 18px var(--primary-50);
  animation: bulkPhase2Dot 1.4s ease-in-out infinite;
}
@keyframes bulkPhase2Ring {
  0%   { transform: scale(.25); opacity: 0; }
  30%  { opacity: .55; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes bulkPhase2Dot {
  0%, 100% { transform: scale(1);   opacity: .85; }
  50%      { transform: scale(1.35); opacity: 1; }
}
.bulk-phase2-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--fg);
  line-height: 1.3;
}
.bulk-phase2-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-50);
  max-width: 360px;
}
.bulk-sum-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--fg-04);
}
.bulk-sum-error strong { color: var(--fg); font-size: 13px; font-family: inherit; font-weight: 600; }
.bulk-sum-error span { color: var(--fg-50); font-size: 12.5px; line-height: 1.5; }
.reai-retry {
  font: 600 12px/1 inherit;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  margin-top: 4px;
}
.reai-retry:hover { background: var(--fg-04); }

/* toast on refresh */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--fg);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
  z-index: 80;
  box-shadow: 0 8px 28px -8px rgba(0,0,0,.35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Social / Images / Videos / Audio / Mixed CSS removed in RSS-only build. */
/* ===== WHAT'S NEW MODAL ===== */
.whatsnew-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 50px;
  animation: settingsFadeIn .18s var(--ease);
}
.whatsnew-overlay[hidden] { display: none; }
.whatsnew-modal {
  width: min(720px, calc(100vw - 100px));
  max-height: calc(100vh - 100px);
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: settingsScaleIn .22s var(--ease);
}
.whatsnew-head {
  position: relative;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--fg-04) 0%, var(--bg) 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.whatsnew-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.whatsnew-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .2);
}
.whatsnew-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--fg);
}
.whatsnew-sub {
  font-size: 12px;
  color: var(--fg-50);
  margin: 4px 0 0;
}
.whatsnew-close {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  display: grid; place-items: center;
  align-self: start;
}
.whatsnew-close:hover { background: var(--fg-08); color: var(--fg); }
.whatsnew-body {
  overflow: auto;
  padding: 8px 22px 22px;
}
.wn-entry {
  position: relative;
  padding: 22px 0 4px 24px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}
.wn-entry:first-child { padding-top: 18px; }
.wn-entry:last-child { padding-bottom: 14px; }
.wn-entry::before {
  content: "";
  position: absolute;
  left: -5px; top: 26px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--fg-50);
}
.wn-entry.is-latest::before {
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb),.25), 0 0 0 4px rgba(var(--primary-rgb),.08);
}
.wn-entry-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.wn-version {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fg);
}
.wn-date {
  font-size: 11.5px;
  color: var(--fg-50);
  font-variant-numeric: tabular-nums;
}
.wn-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--fg-08);
  color: var(--fg-75);
}
.wn-tag.is-new      { background: rgba(var(--primary-rgb), .14); color: var(--primary); }
.wn-tag.is-fix      { background: rgba(34,197,94,.14);  color: rgb(22,163,74); }
.wn-tag.is-improved { background: rgba(245,158,11,.14); color: rgb(180,120,16); }
html.dark .wn-tag.is-fix      { color: rgb(74,222,128); }
html.dark .wn-tag.is-improved { color: rgb(252,211,77); }
.wn-headline {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--fg);
  margin: 0 0 8px;
  line-height: 1.4;
}
.wn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wn-list li {
  position: relative;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-75);
}
.wn-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--fg-50);
}
.wn-list li strong {
  color: var(--fg);
  font-weight: 600;
}
/* Changelog category sections (modal + About). One label pill per category
   (Added / Fixed / Changed…) above its bullet list. */
.cl-section { margin-bottom: 12px; }
.cl-section:last-child { margin-bottom: 0; }
.cl-cat {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: var(--fg-08);
  color: var(--fg-75);
}
.cl-cat.is-new      { background: rgba(var(--primary-rgb), .14); color: var(--primary); }
.cl-cat.is-fix      { background: rgba(34,197,94,.14);  color: rgb(22,163,74); }
.cl-cat.is-improved { background: rgba(245,158,11,.14); color: rgb(180,120,16); }
.cl-cat.is-neutral  { background: var(--fg-08); color: var(--fg-75); }
html.dark .cl-cat.is-fix      { color: rgb(74,222,128); }
html.dark .cl-cat.is-improved { color: rgb(252,211,77); }
.whatsnew-foot {
  border-top: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--fg-04);
}
.whatsnew-foot a {
  color: var(--fg-75);
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.whatsnew-foot a:hover { color: var(--fg); }
.whatsnew-foot .wn-foot-actions { display: flex; gap: 8px; }
.whatsnew-foot button {
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.whatsnew-foot button:hover { background: var(--fg-04); }
.whatsnew-foot button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.whatsnew-foot button.primary:hover { filter: brightness(1.06); }
/* Tiny "new" indicator dot on the user-menu item until viewed */
.um-item.has-update { position: relative; }
.um-item.has-update::after {
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.2);
}

/* ===== SETTINGS MODAL ===== */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 50px;
  animation: settingsFadeIn .18s var(--ease);
}
.settings-overlay[hidden] { display: none; }
@keyframes settingsFadeIn { from { opacity: 0 } to { opacity: 1 } }
.settings-modal {
  position: relative;
  width: min(1280px, calc(100vw - 200px));
  height: calc(100vh - 200px);
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 32px 80px -20px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: settingsScaleIn .22s var(--ease);
}
@keyframes settingsScaleIn { from { opacity:0; transform: translateY(8px) scale(.98) } to { opacity:1; transform:none } }

.settings-nav {
  background: var(--fg-04);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.settings-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px 18px;
}
.settings-nav-title { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.settings-close {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--fg-50);
  cursor: pointer;
  display: grid; place-items: center;
}
.settings-close:hover { background: var(--fg-08); color: var(--fg); }
.settings-close-modal {
  position: absolute;
  top: 12px;
  /* Bump right offset so the button clears the right pane's scrollbar
     (which sits flush with the modal edge). */
  right: 24px;
  z-index: 10;
  width: 32px; height: 32px;
}
.settings-nav-search {
  position: relative;
  margin: 0 10px 8px;
}
.settings-nav-search svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--fg-50);
}
.settings-nav-search input {
  width: 100%;
  height: 28px;
  padding: 0 26px 0 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
  color: var(--fg);
  font-family: inherit;
}
.settings-nav-search input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.settings-nav-search-clear {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-50);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.settings-nav-search-clear:hover { background: var(--fg-08); color: var(--fg); }
.settings-nav-search.has-value .settings-nav-search-clear { display: flex; }
.settings-nav-list {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
}
.settings-nav-list .snav-item-bottom { margin-top: auto; }
.snav-pill {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
  border-radius: 8px;
  z-index: 0;
  opacity: 0;
  background-image: radial-gradient(224px 220px at 0% 50%, rgba(var(--primary-rgb), 0.28) 50%, rgba(var(--primary-rgb), 0.08) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.7),
    inset 0 0 12px 0 rgba(var(--primary-rgb), 0.35);
  /* Animate only transform (and opacity) — width/height changes snap so
     scroll/resize handlers don't trigger layout per frame. The pill is
     still resized via JS, but instantly; the smooth slide is preserved
     by the transform. */
  transition:
    transform .38s cubic-bezier(.34, 1.25, .64, 1),
    opacity   .22s var(--ease);
  will-change: transform;
}
.snav-pill.is-ready { opacity: 1; }
.settings-nav-list.has-pill .snav-item.is-on::before { opacity: 0; }
.snav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-50);
  padding: 12px 10px 6px;
}
.snav-item {
  position: relative;
  isolation: isolate;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--fg-75);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: color .3s var(--ease);
}
.snav-item::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--nav-hover);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
  pointer-events: none;
  z-index: -1;
}
.snav-item:hover { color: var(--fg); }
.snav-item:hover::after { opacity: 1; }
.snav-item.is-on { color: var(--fg); }
.snav-item.is-on::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(224px 220px at 0% 50%, rgba(var(--primary-rgb), 0.15) 50%, rgba(var(--primary-rgb), 0.02) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--primary-rgb), 0.5),
    inset 0 0 8px 0 rgba(var(--primary-rgb), 0.24);
  z-index: -1;
}
.snav-item.is-on .snav-ico { color: var(--primary); }
.snav-item.is-on .snav-badge { color: var(--primary); }
.snav-ico { color: var(--fg-50); display: inline-flex; width: 14px; height: 14px; transition: color .3s var(--ease); }
.snav-item > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snav-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-50);
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding: 0;
  background: none;
  transition: color .3s var(--ease);
}
.snav-badge.dot {
  width: 7px; height: 7px; padding: 0;
  background: var(--primary);
  border-radius: 999px;
  display: inline-block;
}

.settings-content {
  overflow: auto;
  padding: 28px 40px 48px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--bg);
  /* The pane fills the right column so the scrollbar sits flush with the
     modal's right edge. Visual width of cards is constrained per-child via
     `.settings-content > *` below, which keeps the readable column width. */
  align-items: center;
}
.settings-content > * { max-width: 880px; width: 100%; }
.settings-head { margin-bottom: 4px; }
.settings-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
.settings-head p { margin: 0; color: var(--fg-50); font-size: 13px; }
.set-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.set-card.danger { border-color: color-mix(in oklab, var(--primary) 30%, var(--border)); }
.set-card.is-search-hit {
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent);
  animation: setCardPulse .9s ease-out 1;
}
.set-card.is-search-hidden { display: none !important; }
.snav-item.hide,
.snav-group-title.hide { display: none !important; }
@keyframes setCardPulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in oklab, var(--primary) 35%, transparent); }
  60%  { box-shadow: 0 0 0 8px color-mix(in oklab, var(--primary) 0%, transparent); }
  100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent); }
}
.snav-empty {
  margin: 6px 12px;
  padding: 14px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--fg-50);
  font-size: 12px;
  text-align: center;
  line-height: 1.45;
}
.snav-empty strong { color: var(--fg); font-weight: 600; }
.set-card .card-h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }
.set-card .card-p { margin: -4px 0 6px; font-size: 12px; }
.set-card-title { font-size: 13.5px; font-weight: 700; margin: 0; letter-spacing: -.005em; }

/* About section */
.about-brand { display: flex; align-items: center; gap: 12px; }
.about-mark {
  width: 48px; height: 48px;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  /* Same mask-driven tinting as .brand-mark (sidebar) — see styles.css.
     mask-size: contain scales the silhouette to whatever dimensions a
     scoped override (e.g. .set-card-about .about-mark at 128px) applies. */
  background-color: var(--primary);
  -webkit-mask: url(/icons/logo.png) center / contain no-repeat;
  mask: url(/icons/logo.png) center / contain no-repeat;
}
.about-mark img { display: none; }
.about-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.about-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.about-tag  { font-size: 12px; color: var(--fg-50); }
.about-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-50); line-height: 1.5; }
.about-meta { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.about-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px;
}
.about-link {
  text-decoration: none;
  color: var(--fg);
  transition: border-color .15s, background .15s;
}
.about-link:hover {
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  background: color-mix(in oklab, var(--primary) 6%, transparent);
}
.about-link-label { display: inline-flex; align-items: center; gap: 8px; }
.about-link-url { color: var(--fg-50); font-size: 12px; }

/* About panel — frameless hero, anchored in the top third of the pane.
   Scoped to .set-card-about so the rest of Settings keeps its left-aligned
   reading rhythm. The outer card frame (border/background) is dropped and the
   block is pushed down by a clamped top margin (≈ top quarter of viewport) so
   the logo lands in the first third rather than mid-pane. `margin-bottom:auto`
   absorbs the remaining space, keeping tall content scroll-safe. */
.set-card.set-card-about {
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 20px 24px 16px;
  border: none;
  background: transparent;
  /* Tightened top offset (was clamp(24px, 8vh, 96px)) so the embedded
     changelog panel below has room without scrolling the whole pane. */
  margin-top: clamp(8px, 2.5vh, 28px);
  margin-bottom: auto;
}
/* DB status row — colored dot + label. Stays in line with the version row. */
.set-card-about .about-db-state {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.set-card-about .about-db-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-25);
  box-shadow: 0 0 0 2px transparent;
  transition: background .15s, box-shadow .2s;
}
.set-card-about .about-db-state.is-checking .about-db-dot {
  animation: aboutDbPulse 1.2s ease-in-out infinite;
}
.set-card-about .about-db-state.is-ok .about-db-dot {
  background: #2ea44f;
  box-shadow: 0 0 0 3px rgba(46, 164, 79, .18);
}
.set-card-about .about-db-state.is-down .about-db-dot {
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .18);
}
.set-card-about .about-db-state.is-down .about-db-label { color: #e5484d; font-weight: 600; }
@keyframes aboutDbPulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}
.set-card-about .about-brand {
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.set-card-about .about-mark {
  width: 104px;
  height: 104px;
}
.set-card-about .about-text {
  align-items: center;
  gap: 4px;
}
.set-card-about .about-name { font-size: 23px; letter-spacing: -.015em; }
.set-card-about .about-tag  { font-size: 13px; }
.set-card-about .about-desc {
  max-width: 460px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}
.set-card-about .about-meta {
  width: 100%;
  max-width: 360px;
  margin-top: 6px;
}
/* About changelog block — the full release notes embedded inline, in a
   bordered scrollable panel below the app info (left-aligned reading
   rhythm inside the otherwise centered About hero). */
.about-changelog {
  width: 100%;
  max-width: 800px;
  margin-top: 14px;
  text-align: left;
}
.about-cl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.about-cl-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-50);
}
/* The embedded scroll window. Fixed-ish height with internal scroll so the
   notes don't push the whole settings pane around. */
.about-cl-scroll {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  max-height: clamp(200px, 40vh, 440px);
  overflow-y: auto;
  background: color-mix(in oklab, var(--fg-08) 40%, transparent);
}
/* Timeline rail (continuous left line + dot per release), mirroring the
   What's new modal's .wn-entry. */
.about-cl-entry {
  position: relative;
  padding: 22px 0 4px 24px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}
.about-cl-entry:first-child { padding-top: 6px; }
.about-cl-entry:last-child { padding-bottom: 4px; }
.about-cl-entry::before {
  content: "";
  position: absolute;
  left: -5px; top: 26px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--fg-50);
}
.about-cl-entry:first-child::before { top: 10px; }
.about-cl-entry.is-latest::before {
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb),.25), 0 0 0 4px rgba(var(--primary-rgb),.08);
}
.about-cl-release {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.about-cl-section { margin-bottom: 12px; }
.about-cl-section:last-child { margin-bottom: 0; }
.about-cl-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-cl-list li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-75);
}
.about-cl-list li::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--fg-50);
}
.about-cl-list li strong { color: var(--fg); font-weight: 600; }

/* Refresh settings — radio mode rows */
.rfr-modes { display: flex; flex-direction: column; gap: 8px; }
.rfr-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.rfr-row:hover { border-color: var(--fg-25); }
.rfr-row.is-on { border-color: var(--primary); background: rgba(var(--primary-rgb), .06); }
.rfr-row input[type=radio] { margin-top: 3px; accent-color: var(--primary); }
.rfr-row-body { flex: 1; }
.rfr-row-body strong { display: block; font-size: 13.5px; }
.rfr-row-body p { margin: 2px 0 0; }
.rfr-num { display: flex; gap: 8px; align-items: center; }
.rfr-num input[type=number] {
  width: 80px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit;
}
.rfr-num select {
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit;
}
.rfr-inline { margin-top: 10px; display: none; }
.rfr-row.is-on .rfr-inline { display: block; }
.rfr-inline .field { max-width: 260px; }

/* Refresh — daily time picker (visually aligned with .rfr-num) */
.rfr-num#rfrTimePicker { flex-wrap: wrap; row-gap: 10px; }
.rfr-num#rfrTimePicker input[type=number] { width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.rfr-num-sep {
  font-size: 16px; font-weight: 600; color: var(--fg-50);
  padding: 0 2px;
}
.rfr-time-presets {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-left: 6px;
}
.rfr-time-preset {
  appearance: none; border: 1px solid var(--border); background: transparent;
  color: var(--fg-75); cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
}
.rfr-time-preset:hover { border-color: var(--fg-25); color: var(--fg); }
.rfr-time-preset.is-on {
  border-color: var(--primary); color: var(--primary);
  background: rgba(var(--primary-rgb), .08);
}
.rfr-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.rfr-kind {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 13px;
}
.rfr-kind input { accent-color: var(--primary); }
.rfr-kind:has(input:checked) { border-color: var(--primary); background: rgba(var(--primary-rgb), .06); }

/* Storage — segmented retention picker */
.seg-row {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 4px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
}
.seg-opt {
  appearance: none; border: 0; background: transparent;
  color: var(--fg-75); cursor: pointer;
  padding: 7px 14px; border-radius: 7px;
  font: inherit; font-size: 13px; font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
}
.seg-opt:hover { color: var(--fg); background: var(--fg-05); }
.seg-opt.is-on {
  background: var(--primary); color: var(--primary-on, #fff);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
/* Storage — usage table */
.usage-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-tbl td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.usage-tbl td:nth-child(2) { color: var(--fg-50); font-variant-numeric: tabular-nums; }
.usage-tbl td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.usage-tbl tr.usage-total td { border-bottom: 0; padding-top: 12px; }
/* Per-kind group header (Articles / Videos). The label is a single colspan
   cell, so override the right-align that .usage-tbl td:last-child would force. */
.usage-tbl tr.usage-group td {
  padding: 12px 0 4px;
  border-bottom: 0;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-50);
}
.usage-tbl tr.usage-group:first-child td { padding-top: 2px; }

/* Reader view — embedded "original page" frame */
.reader-original { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.reader-orig-actions {
  display: flex; justify-content: flex-end;
  padding: 0 0 10px;
}
.reader-original .ro-spacer { flex: 1; }
.reader-original .ro-open {
  font-size: 12px; color: var(--primary); text-decoration: none;
}
.reader-original .ro-open:hover { text-decoration: underline; }
/* Tiny "Re-extract" button above the extracted article body. */
.reader-fulltext-actions {
  display: flex; justify-content: flex-end; padding: 0 0 8px;
}
.reader-fulltext-refresh {
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-50); cursor: pointer;
  font: inherit; font-size: 12px;
  padding: 4px 10px; border-radius: 6px;
}
.reader-fulltext-refresh:hover { color: var(--fg); border-color: var(--fg-25); background: var(--fg-04); }

/* RSS body shares the typography rules of the extracted-article view —
   keep images contained, tables tidy, code legible. */
.reader-rss-body img,
.reader-rss-body picture { max-width: 100%; height: auto; border-radius: 6px; }
.reader-rss-body figure { margin: 16px 0; }
.reader-rss-body figcaption { color: var(--fg-50); font-size: 12.5px; margin-top: 6px; text-align: center; }
.reader-rss-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.reader-rss-body th, .reader-rss-body td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.reader-rss-body pre { overflow-x: auto; padding: 10px; background: var(--fg-04); border-radius: 6px; }
.reader-rss-body code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.reader-rss-body blockquote { border-left: 3px solid var(--primary); padding-left: 12px; color: var(--fg-75); margin: 14px 0; }

/* Loading state for the server-side full-article extraction. */
.reader-fulltext-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 60px 0;
}
/* Extracted full-article HTML uses the same body typography as the RSS view.
   Constrain images so wide hero photos fit the column without overflow. */
.reader-fulltext img,
.reader-fulltext picture { max-width: 100%; height: auto; border-radius: 6px; }
.reader-fulltext figure { margin: 16px 0; }
.reader-fulltext figcaption { color: var(--fg-50); font-size: 12.5px; margin-top: 6px; text-align: center; }
.reader-fulltext table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.reader-fulltext th, .reader-fulltext td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.reader-fulltext pre { overflow-x: auto; padding: 10px; background: var(--fg-04); border-radius: 6px; }
.reader-fulltext code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.ro-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--fg-05); border-bottom: 1px solid var(--border);
}
.ro-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fg-25);
}
.ro-url {
  margin-left: 8px;
  font-size: 11.5px; color: var(--fg-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ro-page { padding: 28px 32px 36px; }
.ro-page-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.ro-page-head p { margin: 0; color: var(--fg-50); font-size: 14px; }
.ro-page-hero {
  margin: 18px 0;
  height: 180px; border-radius: 8px;
  background: linear-gradient(135deg, var(--fg-05), var(--fg-10));
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-50); font-size: 13px; letter-spacing: .04em;
}
.ro-page-body p { font-size: 14.5px; line-height: 1.65; margin: 0 0 12px; }
.ro-page-foot { margin-top: 18px; }

/* Reader view — option tiles (focused mockup of the reader pane only) */
.rv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.rv-tile {
  padding: 0; background: transparent;
  border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; overflow: hidden; text-align: left;
  color: var(--fg); font: inherit;
  transition: border-color var(--dur-fast) var(--ease);
}
.rv-tile:hover { border-color: var(--fg-25); }
.rv-tile.is-on { border-color: var(--primary); }
.rv-preview {
  display: block;
  height: 170px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.rv-mock {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  gap: 5px;
  box-sizing: border-box;
}
/* RSS pane: clean, light, just text */
.rv-mock-rss { background: var(--bg); }
.rv-rss-meta {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 4px;
}
.rv-rss-fav {
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--primary); opacity: .85;
}
.rv-rss-metaline {
  height: 3px; width: 38%; border-radius: 2px;
  background: var(--fg-25);
}
.rv-rss-h {
  height: 8px; width: 80%; border-radius: 2px;
  background: var(--fg-50);
  margin-bottom: 1px;
}
.rv-rss-sub {
  height: 4px; width: 55%; border-radius: 2px;
  background: var(--fg-25);
  margin-bottom: 6px;
}
.rv-rss-line { height: 3px; border-radius: 2px; background: var(--fg-12); }
.rv-rss-line.w95 { width: 95%; }
.rv-rss-line.w92 { width: 92%; }
.rv-rss-line.w90 { width: 90%; }
.rv-rss-line.w85 { width: 85%; }
.rv-rss-line.w80 { width: 80%; }
.rv-rss-line.w70 { width: 70%; }
/* Original publisher page: nav + hero + body + thumbs */
.rv-mock-orig {
  background: var(--bg);
  padding: 0;
  gap: 0;
}
.rv-orig-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--fg-04);
}
.rv-orig-logo {
  width: 28px; height: 8px; border-radius: 2px;
  background: var(--fg-50);
}
.rv-orig-navlinks { display: flex; gap: 6px; }
.rv-orig-navlinks span {
  width: 14px; height: 4px; border-radius: 2px;
  background: var(--fg-25);
}
.rv-mock-orig .rv-orig-h {
  height: 7px; width: 78%; border-radius: 2px;
  background: var(--fg-50);
  margin: 11px 12px 4px;
}
.rv-orig-byline {
  height: 3px; width: 36%; border-radius: 2px;
  background: var(--fg-25);
  margin: 0 12px 7px;
}
.rv-mock-orig .rv-orig-hero {
  height: 50px;
  margin: 0 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, var(--fg-12)), var(--fg-25));
  position: relative;
  overflow: hidden;
}
.rv-orig-hero-shape {
  position: absolute;
  right: -8px; bottom: -10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
}
.rv-mock-orig .rv-orig-line {
  height: 3px; border-radius: 2px;
  background: var(--fg-12);
  margin: 4px 12px 0;
}
.rv-mock-orig .rv-orig-line.w92 { width: calc(100% - 24px); max-width: 92%; }
.rv-mock-orig .rv-orig-line.w88 { width: 88%; }
.rv-mock-orig .rv-orig-line.w70 { width: 70%; }
.rv-orig-thumbs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  margin: 7px 12px 0;
}
.rv-orig-thumb {
  height: 22px; border-radius: 3px;
  background: linear-gradient(135deg, var(--fg-12), var(--fg-25));
}
/* Tile footer: radio + label */
.rv-tile-foot {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
}
.rv-radio {
  flex-shrink: 0;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--fg-25);
  margin-top: 2px;
  display: grid; place-items: center;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.rv-tile.is-on .rv-radio { border-color: var(--primary); }
.rv-tile.is-on .rv-radio::after {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}
.rv-tile-foot strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.rv-tile-foot .muted {
  display: block;
  margin-top: 2px;
}

/* Language picker (Settings → Language & region) — drop list */
.lang-select-wrap {
  position: relative;
  display: block;
  margin-top: 4px;
}
.lang-select {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-family: inherit; color: var(--fg); text-align: left;
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.lang-select:hover { background: var(--fg-3); }
.lang-select[aria-expanded="true"] {
  border-color: color-mix(in oklab, var(--primary) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 16%, transparent);
}
.lang-flag-emoji {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.lang-select-label, .lang-opt-label {
  display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0;
}
.lang-select-label strong, .lang-opt-label strong { font-size: 13.5px; font-weight: 600; }
.lang-chevron {
  color: var(--fg-50);
  flex-shrink: 0;
  transition: transform .15s var(--ease);
}
.lang-select[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  display: none;
  z-index: 50;
  animation: langMenuIn .12s ease-out;
}
body.dark .lang-menu {
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
}
.lang-menu.is-open { display: block; }
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.lang-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background .12s var(--ease);
}
.lang-opt:hover, .lang-opt:focus-visible { background: var(--fg-3); }
.lang-opt.is-on {
  background: color-mix(in oklab, var(--primary) 8%, var(--bg));
  color: var(--fg);
}
.lang-check {
  color: var(--primary);
  opacity: 0; transform: scale(.85);
  flex-shrink: 0;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.lang-opt.is-on .lang-check { opacity: 1; transform: scale(1); }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-50); }
.field > span:first-child { font-weight: 600; letter-spacing: -.005em; }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}
.field-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.field-pw { position: relative; }
.field-pw input { padding-right: 34px; }
.field-pw .ico-reveal {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; width: 26px; height: 26px;
  color: var(--fg-50); cursor: pointer; border-radius: 4px;
}
.field-pw .ico-reveal:hover { background: var(--fg-06); color: var(--fg); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: background .12s var(--ease);
}
.btn:hover { background: var(--fg-06); }
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { background: #e5484d; color: #fff; border-color: transparent; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.row-between:first-of-type { border-top: 0; padding-top: 2px; }
.row-between strong { font-size: 13px; font-weight: 600; }
.row-between p { margin: 2px 0 0; font-size: 12px; }
.row-between.danger strong { color: #e5484d; }
.row-actions { display: flex; gap: 6px; align-items: center; }

/* Profile */
.prof-row { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: start; }
.prof-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.prof-avatar .avatar-edit {
  position: absolute; inset: auto 0 0 0;
  padding: 6px 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
}
.prof-card { position: relative; }
.prof-toggle-btn { position: absolute; top: 16px; right: 16px; }
.prof-fields { display: flex; flex-direction: column; gap: 6px; }
.prof-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  min-width: 0;
}
.prof-field-row + .prof-field-row { border-top: 1px solid var(--border-soft); }
.prof-field-row strong {
  flex: 0 0 110px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}
.prof-field-row .prof-value-show,
.prof-field-row .prof-value-edit {
  margin: 0;
  flex: 1;
  min-width: 0;
  max-width: 360px;
  height: 32px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}
.prof-field-row .prof-value-show {
  padding: 0 10px;
  line-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-field-row .prof-value-edit {
  padding: 0 10px;
  line-height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
}
.prof-field-row .prof-value-edit:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}
.prof-card.is-editing .prof-field-row .prof-value-show { display: none; }

/* Segmented control */
.seg { display: inline-flex; padding: 2px; background: var(--fg-06); border-radius: 8px; gap: 2px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--fg-50);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.seg-btn.is-on { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Swatches */
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;
  transition: transform .12s var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--c); }

/* Toggle */
.tgl { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.tgl-track {
  width: 32px; height: 18px;
  background: var(--fg-25);
  border-radius: 999px;
  position: relative;
  transition: background .15s var(--ease);
}
.tgl-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .18s var(--ease);
}
.tgl input:checked + .tgl-track { background: var(--primary); }
.tgl input:checked + .tgl-track .tgl-thumb { transform: translateX(14px); }
.tgl-label { font-size: 12px; color: var(--fg-50); font-weight: 600; }

/* Keyboard table */
.kb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kb-table td { padding: 8px 0; border-top: 1px solid var(--border); }
.kb-table tr:first-child td { border-top: 0; }
.kb-table td:last-child { text-align: right; }
kbd {
  display: inline-block;
  padding: 2px 7px;
  margin-left: 4px;
  background: var(--fg-06);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg);
}

/* Billing */
.plan-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 8%, var(--bg)), var(--bg));
}
.plan-tag { display: inline-block; padding: 2px 8px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; }
.plan-card h3 { margin: 6px 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.plan-actions { display: flex; gap: 6px; }
.plan-feat { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--fg-50); }
.plan-feat li { margin: 2px 0; }
.pay { display: flex; align-items: center; gap: 10px; }
.card-logo { font: 800 11px ui-monospace; letter-spacing: .1em; padding: 5px 10px; background: #1a1f71; color: #fff; border-radius: 4px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inv-table td { padding: 8px 0; border-top: 1px solid var(--border); }
.inv-table tr:first-child td { border-top: 0; }
.inv-table a { color: var(--primary); text-decoration: none; }

/* Feed manager */
.feed-mgr { display: flex; flex-direction: column; gap: 12px; }
.folder-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-50);
  cursor: pointer;
  font-family: inherit;
}
.folder-chip:hover { background: var(--fg-06); color: var(--fg); }
.folder-chip.is-on { background: var(--fg); color: var(--bg); border-color: transparent; }
.folder-chip span { opacity: .7; font-weight: 500; }
.folder-chip.add-chip { color: var(--primary); border-style: dashed; }
.feed-folder-block { display: flex; flex-direction: column; gap: 0; }
.feed-folder-foot { display: flex; margin-top: -1px; }
.feed-opml {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.feed-opml-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed-opml-text strong { font-size: 13px; font-weight: 600; }
.feed-opml-text .muted.xs { font-size: 11.5px; line-height: 1.4; }
.feed-opml-actions { display: flex; gap: 8px; flex-shrink: 0; }
.feed-opml-actions .btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  min-width: 88px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.feed-opml-actions .btn svg { width: 18px; height: 18px; flex: none; display: block; margin: 0 auto; }

/* Dedicated OPML settings section — two-card layout */
.opml-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.opml-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  /* 1fr top row absorbs the slack so the CTA pins to the card bottom. */
  grid-template-rows: 1fr auto;
  column-gap: 14px;
  row-gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.opml-card:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  box-shadow: 0 4px 14px -8px rgba(0,0,0,.18);
}
.opml-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  grid-row: 1;
}
.opml-card[data-kind="export"] .opml-card-icon {
  background: var(--fg-06);
  color: var(--fg);
}
.opml-card-body { min-width: 0; grid-row: 1; }
.opml-card-body h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.005em;
}
.opml-card-body p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--fg-70);
  line-height: 1.5;
  text-wrap: pretty;
}
.opml-card-hint {
  display: inline-block;
  font-size: 11px;
  color: var(--fg-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .01em;
}
.opml-card-cta {
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
  height: 36px;
  font-weight: 600;
}

/* Profile → Backup : two-card layout (export / import account JSON) */
.backup-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.backup-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  /* 1fr top row absorbs the slack from unequal description lengths so the
     CTA pins to the card bottom — both buttons line up. */
  grid-template-rows: 1fr auto;
  column-gap: 12px;
  row-gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.backup-card:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  box-shadow: 0 4px 12px -8px rgba(0,0,0,.18);
}
.backup-card-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  grid-row: 1;
}
.backup-card[data-kind="import"] .backup-card-icon {
  background: var(--fg-06);
  color: var(--fg);
}
.backup-card-body { min-width: 0; grid-row: 1; }
.backup-card-body h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.005em;
}
.backup-card-body p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--fg-70);
  line-height: 1.45;
  text-wrap: pretty;
}
.backup-card-hint {
  display: inline-block;
  font-size: 10.5px;
  color: var(--fg-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .01em;
}
.backup-card-cta {
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
  height: 36px;
  min-width: 0;
  font-weight: 600;
}

/* Profile → harmonized button sizing (right-aligned row actions + password footer). */
/* Floors short labels ("Activer", "Supprimer", "Annuler") at 160px so they line up */
/* with longer ones ("Demander l'export", "Mettre à jour") which sit at the same min. */
[data-section="profile"] .set-card .row-between > .btn,
[data-section="profile"] .set-card .field-foot > .btn {
  min-width: 160px;
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* OPML import dialog */
.opml-back {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: grid; place-items: center;
  animation: opml-fade .15s var(--ease) both;
}
@keyframes opml-fade { from { opacity: 0; } to { opacity: 1; } }
.opml-dlg {
  width: min(560px, 92vw);
  max-height: 80vh;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: opml-pop .18s var(--ease) both;
}
@keyframes opml-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.opml-dlg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.opml-dlg-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.opml-dlg-close {
  appearance: none; border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: var(--fg-50);
  cursor: pointer; width: 28px; height: 28px; border-radius: 6px;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.opml-dlg-close:hover { background: var(--fg-06); color: var(--fg); }
.opml-dlg-body {
  flex: 1; min-height: 0;
  padding: 18px;
  overflow-y: auto;
}
.opml-dlg-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--fg-04);
}
.opml-stage { display: flex; flex-direction: column; gap: 12px; }
.opml-stage-parsing { align-items: center; padding: 24px 0; gap: 14px; }
.opml-stage-parsing p { margin: 0; color: var(--fg-50); font-size: 13px; }
.opml-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--fg-12);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.opml-stage-error p { margin: 0; color: #e5484d; font-size: 13.5px; padding: 16px 0; }
.opml-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.opml-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 12px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 10px;
  text-align: center;
}
.opml-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.opml-stat-lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-60);
  text-transform: lowercase;
  letter-spacing: .01em;
}
.opml-progress-text { font-size: 12px; font-weight: 600; color: var(--fg-50); font-variant-numeric: tabular-nums; }
.opml-progress-current { font-size: 14.5px; font-weight: 600; min-height: 22px; }
.opml-bar {
  height: 8px;
  background: var(--fg-08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.opml-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .15s var(--ease);
}
.opml-done-head {
  font-size: 14px; font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
}
.opml-done-head.is-ok {
  background: color-mix(in srgb, #16a34a 10%, transparent);
  border: 1px solid color-mix(in srgb, #16a34a 25%, transparent);
  color: #15803d;
}
.opml-done-head.is-warn {
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
  color: #b45309;
}
html[data-theme="dark"] .opml-done-head.is-ok { color: #4ade80; }
html[data-theme="dark"] .opml-done-head.is-warn { color: #fbbf24; }
.opml-skipped { display: flex; flex-direction: column; gap: 6px; }
.opml-skipped-h { font-size: 12px; font-weight: 600; color: var(--fg-50); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0; }
.opml-skipped ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.opml-skipped li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px;
  background: var(--fg-04);
  border-radius: 6px;
  font-size: 12.5px;
  min-width: 0;
}
.opml-skipped li strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.feed-folder-block .feed-tree { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.feed-folder-block .add-chip {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  flex: 1 1 auto;
  width: auto;
  justify-content: center;
  padding: 12px 14px;
  font-size: 13px;
}
.feed-folder-block .sort-chip {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 10px;
  border-left: none;
  flex: 0 0 auto;
  justify-content: center;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg-75);
}
.feed-folder-block .add-chip + .sort-chip { margin-left: -1px; }
.feed-folder-block .add-chip:has(+ .sort-chip) { border-bottom-right-radius: 0; }
.add-feed { display: flex; gap: 8px; }
.add-feed input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
}
.add-feed input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
/* Target-folder picker in the add-row: fixed width so only the input flexes,
   matches the input chrome. */
.add-feed-folder {
  flex: 0 0 auto;
  max-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
.add-feed-folder:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.pill {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--fg-06);
  color: var(--fg-50);
  letter-spacing: .02em;
}
.pill.muted { background: var(--fg-04); }

/* ---- Articles tab: feed table layout ---- */
.feed-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.feed-trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 6px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s var(--ease);
  position: relative;
}
.feed-trow > .feed-tcell { min-width: 0; }
.feed-trow:first-of-type { border-top: 0; }
.feed-trow:hover,
.feed-trow:focus-visible { background: var(--fg-04); outline: none; }
.feed-trow.is-paused .feed-source-text strong,
.feed-trow.is-paused .feed-fav { opacity: .55; }

.feed-source { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.feed-source > .feed-folder-pill { margin-left: auto; flex-shrink: 0; }
.feed-fav {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  font: 700 12px/1 ui-monospace;
}
.feed-fav img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  background: #fff;
}
.feed-fav .feed-fav-fallback {
  position: relative; z-index: 0;
}
.feed-fav img + .feed-fav-fallback { display: none; }

/* Platform picker grid (used in "Add account" modal). */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.platform-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.platform-tile:hover { background: var(--fg-04); }
.platform-tile.is-on {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.platform-tile .feed-fav { width: 24px; height: 24px; font-size: 11px; flex-shrink: 0; }
.platform-tile .feed-fav-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.platform-tile .pt-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-source-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-source-text strong {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.feed-url {
  font: 11.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg-50);
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.feed-folder-pill {
  display: inline-flex;
  padding: 3px 9px;
  font: 600 11px/1.3 ui-sans-serif;
  color: var(--fg-70, var(--fg));
  background: var(--fg-06);
  border-radius: 999px;
  max-width: 100%;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.feed-tgl-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.feed-tgl-cell .tgl { padding: 0; }
/* When no .feed-check is present (folder rows, non-articles kinds), the
   toggle should still sit visually centered within the cell. */
.folder-trow .feed-tgl-cell { justify-content: center; }
/* Action cell: trash visible only on hover/focus, swap to confirm pair when active */
.feed-act-cell {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  position: relative;
}
.feed-trash,
.feed-confirm-yes,
.feed-confirm-no {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: 700 13px/1 system-ui;
  transition: opacity .12s, background .12s, color .12s, border-color .12s;
}
.feed-trash {
  color: var(--fg-50);
  opacity: 0;
  pointer-events: none;
}
.feed-trow:hover .feed-trash,
.feed-trow:focus-within .feed-trash { opacity: 1; pointer-events: auto; }
.feed-trash:hover {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .3);
}
.feed-confirm-yes,
.feed-confirm-no { display: none; }
.feed-confirm-yes { background: #ef4444; color: #fff; }
.feed-confirm-yes:hover { background: #dc2626; }
.feed-confirm-no { background: var(--fg-06); color: var(--fg); border-color: var(--border); }
.feed-confirm-no:hover { background: var(--fg-10); }
.feed-trow.is-confirming-remove .feed-trash { visibility: hidden; }
.feed-trow.is-confirming-remove .feed-confirm-yes,
.feed-trow.is-confirming-remove .feed-confirm-no { display: grid; opacity: 1; pointer-events: auto; }
/* ✕ (cancel) overlays the trash position so a quick double-click on the trash
   cancels immediately. ✓ (confirm) appears just to the left. */
.feed-trow.is-confirming-remove .feed-act-cell {
  position: relative;
}
.feed-trow.is-confirming-remove .feed-confirm-no {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px; height: 28px;
}
.feed-trow.is-confirming-remove .feed-confirm-yes {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
}
.feed-trow.is-confirming-remove { background: rgba(239, 68, 68, .06); }
/* Match AI provider double-confirm: hide secondary info, swap in a red prompt */
.feed-trow.is-confirming-remove .feed-url,
.feed-trow.is-confirming-remove .feed-folder-pill { display: none; }
.feed-trow.is-confirming-remove .feed-tgl-cell { visibility: hidden; }
.feed-trow.is-confirming-remove .feed-source-text strong::after {
  content: attr(data-confirm-label);
  display: block;
  font-size: 11.5px;
  color: #ef4444;
  font-weight: 600;
  margin-top: 2px;
}

/* ---- Feed tree (Articles): folder rows + nested feed rows ---- */
.feed-tree .feed-trow.is-folder {
  background: var(--fg-04);
  font-weight: 600;
}
.feed-tree .feed-trow.is-folder:hover,
.feed-tree .feed-trow.is-folder:focus-visible { background: var(--fg-06); }
.feed-tree .feed-trow.is-folder .feed-source-text strong { font-size: 13.5px; }
.feed-tree .feed-trow.is-feed { padding-left: 6px; }
.feed-tree .feed-trow.is-feed::before { display: none; }

/* Drag handle (visible on row hover/drag) — sits to the left of the favicon */
.feed-drag-handle {
  width: 14px; height: 18px;
  flex: 0 0 auto;
  cursor: grab;
  opacity: 0;
  transition: opacity .12s ease;
  background-image: radial-gradient(circle, var(--fg-40) 1px, transparent 1.4px);
  background-size: 4px 4px;
  background-position: 1px 2px;
  background-repeat: repeat;
  margin-right: -4px;
}
.feed-trow:hover .feed-drag-handle,
.feed-trow:focus-within .feed-drag-handle { opacity: 1; }
.feed-trow.is-dragging { opacity: .35; }
.feed-trow:active .feed-drag-handle { cursor: grabbing; }

/* Numbered prefix on folder headers — visualizes manual order.
   Absolutely positioned inside the row's left padding so it doesn't push
   the chevron; the chevron stays aligned with the favicons in feed rows. */
.feed-tree .feed-trow.is-folder { padding-left: 6px; position: relative; }
/* Hide the folder drag-handle visually but keep its space so the chevron
   sits at the same horizontal position as the favicons in the feed rows. */
.feed-trow.is-folder .folder-drag-handle { visibility: hidden; opacity: 0 !important; }

/* Drop indicators */
.feed-tree .feed-trow.is-drop-before { box-shadow: inset 0 2px 0 0 var(--primary); }
.feed-tree .feed-trow.is-drop-after  { box-shadow: inset 0 -2px 0 0 var(--primary); }
.feed-tree .feed-trow.is-folder.is-drop-into {
  background: color-mix(in srgb, var(--primary) 14%, var(--fg-04));
  outline: 1px dashed var(--primary);
  outline-offset: -3px;
}
.feed-chevron {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--fg-50);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  flex-shrink: 0;
  transition: transform .15s var(--ease), color .12s, background .12s;
}
.feed-chevron svg { width: 14px; height: 14px; }
.feed-chevron:hover { color: var(--fg); background: var(--fg-06); }
.feed-tree .feed-trow.is-folder.is-open .feed-chevron { transform: rotate(90deg); }
/* Hide nested feeds when their folder is collapsed */
.feed-tree .feed-trow.is-feed.is-collapsed { display: none; }

/* AI providers */
.provider-card .prov-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.provider-card .prov-title { flex: 1; min-width: 0; }

/* Collapsed state: hide body, swap description for summary (default model) */
.provider-card.is-collapsed .prov-body { display: none; }
.provider-card.is-collapsed { padding-bottom: 14px; }
.provider-card.is-collapsed .prov-head { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.provider-card .prov-sub { display: block; }
.provider-card .prov-summary { display: none; }
.provider-card.is-collapsed .prov-sub { display: none; }
.provider-card.is-collapsed .prov-summary { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg-70); }

/* Trash button — visible only on card hover, hidden when confirming or in default state */
.provider-card .prov-remove {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--fg-50);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, background .12s, color .12s, border-color .12s;
}
.provider-card:hover .prov-remove,
.provider-card:focus-within .prov-remove {
  opacity: 1;
  pointer-events: auto;
}
.provider-card .prov-remove:hover {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .3);
}

/* Confirm-delete buttons: hidden by default, shown when .is-confirming-remove */
.provider-card .prov-confirm-yes,
.provider-card .prov-confirm-no {
  width: 28px; height: 28px;
  display: none;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font: 700 14px/1 system-ui, -apple-system, sans-serif;
  padding: 0;
  transition: background .12s, border-color .12s;
}
.provider-card .prov-confirm-yes {
  background: #ef4444;
  color: #fff;
}
.provider-card .prov-confirm-no {
  background: var(--fg-06);
  color: var(--fg);
  border-color: var(--border);
}
.provider-card .prov-confirm-yes:hover { background: #dc2626; }
.provider-card .prov-confirm-no:hover { background: var(--fg-10); }

.provider-card.is-confirming-remove .prov-remove,
.provider-card.is-confirming-remove .prov-status {
  display: none;
}
.provider-card.is-confirming-remove .prov-confirm-yes,
.provider-card.is-confirming-remove .prov-confirm-no {
  display: grid;
}
/* When confirming, show a tiny label next to the ✓ to make intent crystal clear */
.provider-card.is-confirming-remove .prov-title::after {
  content: 'Remove this provider?';
  display: block;
  font-size: 11.5px;
  color: #ef4444;
  font-weight: 600;
  margin-top: 2px;
}
.provider-card.is-confirming-remove .prov-sub,
.provider-card.is-confirming-remove .prov-summary { display: none; }

/* Expand / collapse chevron */
.provider-card .prov-expand {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--fg-50);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s, transform .2s;
}
.provider-card .prov-expand:hover { background: var(--fg-06); color: var(--fg); }
.provider-card .prov-expand svg { transition: transform .2s; }
.provider-card:not(.is-collapsed) .prov-expand svg { transform: rotate(180deg); }
.prov-glyph {
  position: relative;
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; font: 800 16px/1 ui-monospace;
  overflow: hidden;
  flex-shrink: 0;
}
.prov-glyph .prov-glyph-fallback {
  display: grid; place-items: center;
  width: 100%; height: 100%;
}
.prov-glyph img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 6px;
  background: #fff;
  opacity: 0;
  transition: opacity .18s ease;
}
.prov-glyph.has-fav img { opacity: 1; }
/* When the favicon is showing, hide the colored fallback beneath so the logo
   reads cleanly on the white tile. Colored tile only shows while loading or on error. */
.prov-glyph.has-fav { background: #fff !important; }
.prov-glyph.has-fav .prov-glyph-fallback { visibility: hidden; }
/* Smaller variant for the add-provider dropdown */
.prov-select-glyph.prov-glyph img { padding: 4px; }
.prov-select-menu li .prov-select-glyph.prov-glyph img { padding: 3px; }
.prov-title strong { font-size: 14px; }
.prov-title p { margin: 2px 0 0; font-size: 12px; }
.prov-status {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fg-06);
  color: var(--fg-50);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.prov-status.is-on,
.prov-status.ok { background: #10b981; color: #fff; }
.prov-status.fail { background: #ef4444; color: #fff; }
.prov-status.testing { background: var(--fg-10); color: var(--fg); }

.provider-card .btn.ghost.xs { padding: 3px 8px; font-size: 11px; gap: 4px; }
.provider-card .btn.ghost.xs svg { width: 11px; height: 11px; }
/* Inline discover button next to model select */
.provider-card .prov-model-row { display: flex; align-items: stretch; gap: 6px; }
.provider-card .prov-model-row .prov-model {
  flex: 1; min-width: 0;
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--fg-04);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  outline: none;
}
.provider-card .prov-model:hover { border-color: var(--fg-20); }
.provider-card .prov-model.is-open { border-color: var(--primary); }
.provider-card .prov-model.is-disabled { cursor: default; opacity: .55; }
.provider-card .prov-model-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.provider-card .prov-model .prov-select-caret { color: var(--fg-50); transition: transform .15s; flex-shrink: 0; }
.provider-card .prov-model.is-open .prov-select-caret { transform: rotate(180deg); }
.prov-model-menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 10;
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--bg-raised, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  max-height: 280px;
  overflow-y: auto;
}
.prov-model-menu li {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prov-model-menu li:hover { background: var(--fg-06); }
.prov-model-menu li[hidden] { display: none; }
.prov-model-menu li[aria-selected="true"] { background: var(--fg-06); font-weight: 600; }
.provider-card .prov-discover.icon-only { padding: 0; width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; }
.provider-card .prov-discover.icon-only svg { width: 14px; height: 14px; }
/* Manual model-name input (custom / cerebras kinds). Sits under the
   dropdown row so the user can type a model the provider's /v1/models
   doesn't expose (Cerebras Dedicated, custom OpenAI-compatible proxies). */
.provider-card .prov-model-manual { margin-top: 6px; }
.provider-card .prov-manual-hint { margin-top: 4px; }
.provider-card .field-label-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%;
}
.provider-card .prov-key-link {
  color: var(--primary); text-decoration: none;
  font-size: 11px; opacity: .85;
  white-space: nowrap;
}
.provider-card .prov-key-link:hover { opacity: 1; text-decoration: underline; }
.provider-card .prov-head .prov-test-msg {
  flex: 0 1 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.provider-card .prov-test-msg:empty { display: none; }
.provider-card.is-collapsed .prov-test-msg { display: none; }
.provider-card .prov-test-msg.ok { color: #10b981; }
.provider-card .prov-test-msg.fail { color: #ef4444; }
.provider-card .field-foot { display: flex; align-items: center; gap: 10px; }

@keyframes provSpin { to { transform: rotate(360deg); } }
.provider-card .spin { display: inline-block; animation: provSpin .9s linear infinite; }

/* Add-provider — dashed full-width button, mirrors .folder-chip.add-chip */
.prov-add { position: relative; display: flex; flex-direction: column; gap: 8px; }
.prov-add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1.5px dashed var(--primary);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.prov-add-btn:hover { background: var(--primary-12); }
.prov-add-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.prov-add-btn[disabled] { opacity: .55; cursor: not-allowed; color: var(--fg-50); border-color: var(--border); }
.prov-add[aria-expanded="true"] .prov-add-btn,
.prov-add-btn[aria-expanded="true"] { background: var(--primary-12); }
/* When expanded under the dashed button, hide the prov-select header row
   (first-provider preview + caret) — the dashed button is the entry point.
   Only the search + list menu shows, anchored inline under the button. */
.prov-add .prov-select {
  padding: 0;
  border: 0;
  background: transparent;
  grid-template-columns: 1fr;
  cursor: default;
}
.prov-add .prov-select:hover { border-color: transparent; }
.prov-add .prov-select > :not(.prov-select-menu) { display: none; }
.prov-add .prov-select-menu {
  position: static;
  margin: 0;
  max-height: 360px;
}

.prov-select {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 20px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.prov-select:hover { border-color: var(--fg-20); }
.prov-select.is-open { border-color: var(--primary); }
.prov-select-glyph {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font: 800 15px/1 ui-monospace;
}
.prov-select-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prov-select-body strong { font-size: 13px; }
.prov-select-body .muted { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prov-select-caret { color: var(--fg-50); transition: transform .15s; }
.prov-select.is-open .prov-select-caret { transform: rotate(180deg); }
.prov-select-menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 10;
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--bg-raised, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  max-height: 320px;
  overflow-y: auto;
}
.prov-select-menu li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
}
.prov-select-menu li:hover { background: var(--fg-06); }
.prov-select-menu li[hidden] { display: none; }
.prov-select-menu li .prov-select-glyph { width: 28px; height: 28px; font-size: 13px; }
.prov-select-empty { padding: 10px; text-align: center; }
.prov-select-search {
  display: block !important;
  position: sticky;
  top: -4px;
  z-index: 1;
  margin: -4px -4px 4px;
  padding: 6px !important;
  background: var(--bg-raised, var(--bg));
  border-radius: 0 !important;
  cursor: default !important;
  border-bottom: 1px solid var(--border);
}
.prov-select-search:hover { background: var(--bg-raised, var(--bg)) !important; }
.prov-select-search .prov-search {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  font: inherit; font-size: 12.5px;
  background: var(--fg-04);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}
.prov-select-search .prov-search:focus { border-color: var(--primary); }

.uc-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.uc-row:nth-child(2) { border-top: 0; padding-top: 4px; }
.uc-row-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background .12s;
}
.uc-row-head:hover { background: var(--fg-04); }
.uc-row-head .tgl, .uc-row-head .uc-model, .uc-row-head .uc-provider { cursor: default; }
.uc-body strong { font-size: 13px; }
.uc-body p { margin: 2px 0 0; font-size: 11.5px; }
/* Native <select>s used inside the use-cases panel (legacy uc-model + lang
   picker). Custom uc-provider div is below. */
.uc-model, .uc-lang {
  font: inherit;
  font-size: 12px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--fg-04);
  color: var(--fg);
  min-width: 200px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px 14px;
  cursor: pointer;
}
.uc-model:hover, .uc-lang:hover { border-color: var(--fg-20); }
.uc-model:focus, .uc-lang:focus {
  outline: none;
  border-color: var(--primary);
}
.uc-model:disabled, .uc-lang:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.uc-model option, .uc-lang option {
  background: var(--bg);
  color: var(--fg);
}

/* Custom themed provider picker (matches .prov-model in the AI providers
   section). Replaces a native <select> so the open menu also follows the
   theme — native option dropdowns can't be styled cross-browser. */
.uc-provider {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  min-width: 240px;
  padding: 7px 10px;
  background: var(--fg-04);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  outline: none;
  user-select: none;
}
.uc-provider:hover { border-color: var(--fg-20); }
.uc-provider.is-open { border-color: var(--primary); }
.uc-provider.is-disabled { cursor: default; opacity: .55; }
.uc-provider-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uc-provider .prov-select-caret { color: var(--fg-50); transition: transform .15s; flex-shrink: 0; }
.uc-provider.is-open .prov-select-caret { transform: rotate(180deg); }
.uc-provider-menu {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 10;
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--bg-raised, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  max-height: 280px;
  overflow-y: auto;
}
.uc-provider-menu li {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--fg);
}
.uc-provider-menu li:hover { background: var(--fg-06); }
.uc-provider-menu li[aria-selected="true"] { background: var(--fg-06); font-weight: 600; }
.uc-provider-menu li { display: flex; align-items: center; gap: 8px; }
.uc-provider-menu li .uc-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.uc-glyph.prov-glyph,
.uc-provider .prov-glyph,
.uc-provider-menu .prov-glyph {
  width: 20px; height: 20px;
  border-radius: 4px;
  font-size: 10px;
}
.uc-glyph.prov-glyph img,
.uc-provider .prov-glyph img,
.uc-provider-menu .prov-glyph img { padding: 2px; }
.uc-glyph-placeholder {
  width: 20px; height: 20px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--fg-06);
  border: 1px dashed var(--fg-20);
}
.uc-expand {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-50);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s, transform .2s;
  flex-shrink: 0;
}
.uc-expand:hover { background: var(--fg-06); color: var(--fg); }
.uc-row.is-open .uc-expand svg { transform: rotate(180deg); }
.uc-edit {
  margin-top: 12px;
  padding: 12px;
  background: var(--fg-04);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.uc-edit[hidden] { display: none; }
.uc-edit .uc-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uc-edit textarea.uc-prompt,
.uc-edit textarea.uc-bulk-prompt {
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  /* Auto-grown by JS up to ~15 lines (≈ 16+30+15*1.5*12.5 = ~330px). Beyond
     that the textarea scrolls. Manual resize disabled — height tracks content. */
  resize: none;
  min-height: 64px;
  max-height: 330px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.uc-edit textarea.uc-prompt:focus,
.uc-edit textarea.uc-bulk-prompt:focus { outline: none; border-color: var(--primary); }
.uc-reset, .uc-bulk-reset { padding: 3px 8px; font-size: 11px; }
.uc-stat { text-align: right; }
.uc-stat strong { display: block; font-size: 14px; }

/* Usage */
.usage-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 4px; }
.usage-top h2 { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.usage-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fg-06); }
.usage-bar span { display: block; height: 100%; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 18px 22px; font-size: 12px; color: var(--fg-50); }
.usage-legend .uleg-item { display: inline-flex; align-items: center; gap: 8px; }
.usage-legend .uleg-text { display: inline-flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.usage-legend .uleg-name { color: var(--fg); font-weight: 600; }
.usage-legend .uleg-tokens { color: var(--fg-75); font-weight: 500; font-variant-numeric: tabular-nums; }
.usage-legend .uleg-cost { color: var(--fg-50); font-variant-numeric: tabular-nums; }
.usage-legend i { border-radius: 2px; display: inline-block; }

/* responsive */
@media (max-width: 1100px) {
  .reader-body { padding: 28px 32px 48px; }
}
@media (max-width: 900px) {
  .sidebar.rss-side { width: 240px; }
}

/* Broadcast banner — system-wide announcement injected by bridge.js or login.html.
   Three levels (info / warning / critical) borrow accent + danger CSS tokens already
   defined elsewhere, so the banner re-tints when the user changes accent.
   Sits as the first DOM child of <body>; height-collapses when hidden to avoid layout jank. */
.broadcast-banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  font-size: 13px; line-height: 1.45; color: var(--fg); background: var(--card);
  border-bottom: 1px solid var(--border); position: relative; z-index: 50; }
.broadcast-banner[data-level='info'] { background: var(--primary-12); color: var(--fg);
  border-bottom-color: var(--primary-25); }
.broadcast-banner[data-level='warning'] { background: rgba(245, 158, 11, .14); color: var(--fg);
  border-bottom-color: rgba(245, 158, 11, .35); }
.broadcast-banner[data-level='critical'] { background: rgba(229, 72, 77, .14); color: var(--fg);
  border-bottom-color: rgba(229, 72, 77, .35); }
.broadcast-banner .bb-text { flex: 1 1 auto; word-break: break-word; }
.broadcast-banner .bb-dismiss { flex: 0 0 auto; background: transparent; border: 0;
  color: var(--fg-75); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px;
  border-radius: 6px; transition: background .15s ease, color .15s ease; }
.broadcast-banner .bb-dismiss:hover { background: var(--fg-06); color: var(--fg); }
.broadcast-banner[hidden] { display: none; }

/* Level-specific glyph rendered with CSS mask-image so the shape comes from
   a single inline SVG per level, and the color flows from currentColor on
   the parent rule below. The icon span is empty markup-side — just a
   <span class="bb-icon" aria-hidden="true"></span> inserted before .bb-text. */
.broadcast-banner .bb-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--bb-icon, none) center/contain no-repeat;
          mask: var(--bb-icon, none) center/contain no-repeat;
}
.broadcast-banner[data-level='info'] .bb-icon {
  color: var(--primary);
  --bb-icon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}
.broadcast-banner[data-level='warning'] .bb-icon {
  color: #f59e0b;
  --bb-icon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}
.broadcast-banner[data-level='critical'] .bb-icon {
  color: #e5484d;
  --bb-icon: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

/* Admin-panel entry in the user menu. Only present in the DOM when the
   logged-in user has is_admin=true (bridge.js applyAdminEntryToMenu
   flips the [hidden] attribute). Visually mirrors .um-head's row rhythm.
   Lives outside the prototype "figé" surface — it is a new admin-only
   entry, not a mutation of the existing menu visuals. */
.um-admin {
  display: flex; align-items: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  margin-top: 6px; margin-bottom: 2px;
  background: var(--primary-12);
  border: 1px solid var(--primary-25);
  border-radius: 8px;
  color: var(--primary);
  font: 700 13px/1.2 var(--font-sans);
  letter-spacing: .005em;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.um-admin:hover {
  background: rgba(var(--primary-rgb), .22);
  border-color: var(--primary);
  box-shadow: 0 2px 10px -2px rgba(var(--primary-rgb), .35);
}
.um-admin:active { transform: translateY(1px); }
.um-admin:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.um-admin .um-admin-ico { color: var(--primary); flex-shrink: 0; }
.um-admin .um-admin-label { flex: 1 1 auto; }
/* Chevron at the end — hints that this action navigates somewhere
   else (vs. Settings which opens an in-app modal). Slides slightly on hover. */
.um-admin .um-admin-chev {
  color: var(--primary);
  opacity: .6;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.um-admin:hover .um-admin-chev { opacity: 1; transform: translateX(2px); }
.um-admin[hidden] { display: none; }

/* Account import progress — shown while the destructive replace is running.
   Reuses .opml-spinner for the spin glyph. */
.import-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 12px 24px;
  text-align: center;
}
.import-progress h2 { font-size: 17px; }
.import-progress .sub { color: var(--fg-50); font-size: 13.5px; max-width: 340px; }
.import-progress-done .import-progress-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, #22c55e 16%, transparent);
  color: #22c55e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: import-check-in .35s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes import-check-in {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
