/* Burlington Pulse — brutalist headline feed.
   Deliberately NOT css/style.css: this page is a full-screen replica of the
   Brutalist Report's look (black/white, mono labels, dense lists, one green
   accent for LOCAL), so it carries its own tokens and nothing else. */

:root[data-theme="dark"] {
  --bg: #000;
  --fg: #fff;
  --dim: #9b9b9b;
  --faint: #6a6a6a;
  --line: #232323;
  --chipbg: #161616;
  --chipline: #383838;
  --accent: #30d158;
  --accent-dim: #1d7c36;
  /* one restrained hue per topic — chips and section names only, so the
     page stays black-and-white where it counts. Local owns green. */
  --c-local: #30d158;
  --c-news: #e3b341;
  --c-tech: #58b7e0;
  --c-business: #c9955a;
  --c-science: #a58ae8;
  --c-culture: #e07ab8;
  --c-politics: #e0645c;
  --c-sports: #ef9448;
  --c-gaming: #7d8de8;
  --c-reddit: #ff4500;   /* reddit's own orangered — the tab Stephen wants red */
  --c-newsletters: #45c4b0;
  --c-youtube: #ff5b5b;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fff;
  --fg: #111;
  --dim: #636363;
  --faint: #9a9a9a;
  --line: #e4e4e4;
  --chipbg: #f3f3f3;
  --chipline: #d4d4d4;
  --accent: #1e7d36;
  --accent-dim: #67a97b;
  --c-local: #1e7d36;
  --c-news: #8a6206;
  --c-tech: #136a92;
  --c-business: #8a5426;
  --c-science: #5b3fc0;
  --c-culture: #a83579;
  --c-politics: #b0342c;
  --c-sports: #a85a10;
  --c-gaming: #4053b8;
  --c-reddit: #cc3700;
  --c-newsletters: #12756a;
  --c-youtube: #c00000;
  color-scheme: light;
}

.c-local { --tc: var(--c-local); }
.c-news { --tc: var(--c-news); }
.c-tech { --tc: var(--c-tech); }
.c-business { --tc: var(--c-business); }
.c-science { --tc: var(--c-science); }
.c-culture { --tc: var(--c-culture); }
.c-politics { --tc: var(--c-politics); }
.c-sports { --tc: var(--c-sports); }
.c-gaming { --tc: var(--c-gaming); }
.c-newsletters { --tc: var(--c-newsletters); }
.c-youtube { --tc: var(--c-youtube); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 15px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs: 17px;   /* headline size; the settings slider rewrites this */
}

::selection { background: var(--accent); color: #000; }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* display:flex on these would otherwise defeat the [hidden] attribute */
[hidden] { display: none !important; }

/* ---------- masthead ---------- */

.mast {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 0;
}

.mast-row {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mast-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mast-icons { display: flex; gap: 4px; }

/* READ | WATCH — the two ways to take the wire */
.modes {
  display: flex;
  border: 1px solid var(--chipline);
  border-radius: 4px;
  overflow: hidden;
  margin-left: auto;
  margin-right: 8px;
  flex: none;
}
.mode {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 6px 10px;
  color: var(--dim);
  text-decoration: none;
}
.mode + .mode { border-left: 1px solid var(--chipline); }
.mode.on { background: var(--fg); color: var(--bg); }
a.mode:hover { color: #fc560a; }

.ic {
  font-size: 17px;
  line-height: 1;
  color: var(--dim);
  padding: 7px 8px;
  border-radius: 4px;
}
.ic:hover { color: var(--fg); background: var(--chipbg); }

.mast-tag {
  max-width: 1240px;
  margin: 2px auto 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}

.mast-sub { padding-bottom: 10px; }

.mast-count {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;   /* let the flex row squeeze this, never the view toggle */
  flex: 1;
}
.mast-count strong { color: var(--fg); font-weight: 600; }

.viewtog {
  display: flex;
  border: 1px solid var(--chipline);
  border-radius: 4px;
  overflow: hidden;
  flex: none;
}
.vt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 10px;
  color: var(--dim);
}
.vt + .vt { border-left: 1px solid var(--chipline); }
.vt[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* the Live board is a page, not a view — an anchor dressed as a toggle.
   Brand orange: the board is the Brief's own broadcast. */
.vt-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #fc560a;
}
.vt-live i {
  width: 6px; height: 6px;
  background: currentColor;
  animation: vt-blink 1.6s steps(2, start) infinite;
}
@keyframes vt-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .vt-live i { animation: none; } }

/* ---------- search ---------- */

.search-row {
  max-width: 1240px;
  margin: 0 auto 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
#search-input {
  flex: 1;
  background: var(--chipbg);
  border: 1px solid var(--chipline);
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
  padding: 9px 12px;
}
#search-input::placeholder { color: var(--faint); letter-spacing: .12em; }

/* ---------- tab rows ---------- */

.tabs, .srcbar {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}
.tabs::-webkit-scrollbar, .srcbar::-webkit-scrollbar { display: none; }

.tab, .srcchip {
  flex: none;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
  white-space: nowrap;
  border-radius: 3px;
}
.tab {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  color: var(--dim);
}
.tab[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.tab.t-local[aria-pressed="false"] { color: var(--accent); }
.tab.t-reddit[aria-pressed="false"] { color: var(--c-reddit); }

.srcchip {
  font-size: 10px;
  padding: 4px 8px;
  color: var(--faint);
}
.srcchip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.srcchip.s-local[aria-pressed="false"] { color: var(--accent-dim); }

/* ---------- feed view ---------- */

.body-wrap { padding: 0 16px 48px; }

/* the last-visit boundary in the feed */
.since {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.since::before, .since::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--accent-dim);
}
.since span { flex: none; }

/* the catch-up strip: what arrived since your last visit, and the finite
   batch it opens — clearing it is the point */
.catchline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 14px auto 4px;
  padding: 9px 12px;
  border: 1px solid var(--chipline);
  border-left: 3px solid var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.catchline strong { color: var(--fg); }
.catchline .act { flex: none; }
.catchline .catchgo { color: var(--accent); border-color: var(--accent-dim); }

.caughtup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 22px auto 8px;
  padding: 16px 12px;
  border: 1px dashed var(--accent-dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--accent);
}

/* dealt on the Live board already — marked, not dimmed like read */
.fi.live-seen .fi-meta::after {
  content: "seen on Live";
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}

/* the previous TOP edition folds away under the current one */
.prev-top { max-width: 680px; margin: 26px auto 0; }
.prev-top summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--dim);
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.prev-top summary:hover { color: var(--fg); }

.feed { max-width: 680px; margin: 0 auto; }

.fi { padding: 11px 0 12px; border-bottom: 1px solid var(--line); }

.fi-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.chip {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--chipbg);
  border: 1px solid var(--chipline);
  border-radius: 3px;
  padding: 2px 6px 3px;
  color: var(--dim);
  white-space: nowrap;
}
.chip:hover { color: var(--fg); border-color: var(--dim); }
.chip[class*=" c-"] {
  color: var(--tc, var(--dim));
  border-color: color-mix(in srgb, var(--tc, var(--chipline)) 42%, var(--chipbg));
}
.chip[class*=" c-"]:hover { color: var(--fg); border-color: var(--tc, var(--dim)); }

.age {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--faint);
  white-space: nowrap;
}

.play {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .08em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 2px 7px 3px;
  margin-left: auto;
}
.play:hover { background: var(--chipbg); }

.fi-t {
  display: block;
  font-size: var(--fs);
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -0.011em;
  text-decoration: none;
}
.fi-t:hover { text-decoration: underline; text-underline-offset: 3px; }
.fi.read .fi-t { color: var(--faint); font-weight: 500; }

/* optional thumbnails (settings toggle, feed view only) — grayscale keeps
   the page brutalist; color arrives on hover as a little reward */
.fi.has-thumb {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 12px;
  align-items: center;
}
.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.05);
  background: var(--chipbg);
}
.fi.has-thumb:hover .thumb { filter: none; }
.fi.read .thumb { opacity: .45; }

/* email-only newsletter items: honest, unlinked, marked with ✉ */
.nolink { cursor: default; }
.nolink:hover { text-decoration: none; }
.nolink::after {
  content: " ✉";
  color: var(--faint);
  font-size: .72em;
}

/* discussion-thread suffixes ([r/tech], [hn·214]) */
.disc {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
}
.disc:hover { color: var(--accent); }
.src-sec .disc { margin-left: 6px; }
.fi-disc { margin-top: 3px; }

/* single-source header */
.solo-head {
  max-width: 680px;
  margin: 18px auto 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.solo-name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0;
}
.solo-head .mlink { margin-left: auto; }

.mlink {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
}
.mlink:hover { color: var(--fg); }

/* ---------- by-source view ---------- */

.grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 40px;
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px) { .grid { grid-template-columns: 1fr; gap: 0; } }

.src-sec { padding: 16px 0 6px; border-bottom: 1px solid var(--line); overflow: hidden; }

.src-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
}
.src-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
}
.src-name[class*=" c-"] { color: var(--tc, var(--fg)); }
.src-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.src-out {
  font-size: 11px;
  color: var(--faint);
  text-decoration: none;
}
.src-out:hover { color: var(--fg); }
.src-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.src-sec ul { list-style: none; margin: 0; padding: 0; }
.src-sec li { padding: 9px 0; border-top: 1px solid var(--line); }
.src-sec li:first-child { border-top: 0; }

.si-t {
  font-size: calc(var(--fs) - 1px);
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}
.si-t:hover { text-decoration: underline; text-underline-offset: 3px; }
li.read .si-t { color: var(--faint); font-weight: 400; }
.src-sec .age { margin-left: 6px; }
.src-sec .play { margin-left: 6px; }

/* ---------- shared bits ---------- */

.empty {
  max-width: 680px;
  margin: 48px auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
}

.more {
  display: block;
  max-width: 680px;
  width: 100%;
  margin: 22px auto 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  padding: 12px;
  border: 1px solid var(--chipline);
  border-radius: 4px;
  color: var(--dim);
}
.more:hover { color: var(--fg); border-color: var(--dim); }

.fresh {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 70px;   /* clears the podcast player bar when it's open */
  z-index: 40;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}

/* ---------- player ---------- */

.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.player-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#player-audio { height: 32px; flex: 2; min-width: 0; max-width: 480px; }

/* ---------- settings drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0,0,0,.55);
}

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: min(370px, 94vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 14px 18px 40px;
  overflow-y: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.drawer-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.set-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 26px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.set-note {
  font-size: 12px;
  color: var(--faint);
  margin: 8px 0 0;
  line-height: 1.4;
}

.pillrow { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--chipline);
  border-radius: 3px;
  color: var(--dim);
}
.pill[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill-end { margin-left: auto; font-weight: 400; }

.setrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}
.setrow small { display: block; color: var(--faint); font-size: 11px; margin-top: 3px; max-width: 190px; }

.fsrow { display: flex; align-items: center; gap: 12px; }
#fs-range { flex: 1; accent-color: var(--accent); }
.fs-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  min-width: 2ch;
  text-align: right;
}

.srctog {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.srctog .nm {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.srctog.off .nm { color: var(--faint); text-decoration: line-through; }
.srctog .eye { font-size: 13px; color: var(--dim); }
.srctog.off .eye { color: var(--faint); }
.srctog-group {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 16px 0 2px;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 26px 16px 40px;
  text-align: center;
}
.foot p { margin: 0 0 10px; }
.foot-creed {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
}
.foot-news {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.foot-news:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-meta { font-size: 11px; color: var(--faint); }
.foot-meta a { color: var(--dim); }

/* ---------- V2.2: focus mode ---------- */

.intent {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-politics);
  border: 1px solid var(--c-politics);
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
}
.intent:hover { background: color-mix(in srgb, var(--c-politics) 14%, var(--bg)); }
.intent[aria-pressed="true"] {
  color: #fff;
  background: var(--c-politics);
  border-color: var(--c-politics);
  position: relative;
  overflow: hidden;
}
.intent[aria-pressed="true"] .int-full,
.intent[aria-pressed="true"] .int-min { position: relative; z-index: 1; }
/* the mode is alive: two soft waves slosh through the pill like water */
.intent[aria-pressed="true"]::before,
.intent[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: -60%; bottom: -60%; left: -60%; right: -60%;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 30% 60%, rgba(255,255,255,.34), transparent 72%),
    radial-gradient(closest-side at 70% 35%, rgba(255,255,255,.20), transparent 70%);
  animation: focus-water 2.6s ease-in-out infinite alternate;
}
.intent[aria-pressed="true"]::after {
  background:
    radial-gradient(closest-side at 55% 75%, rgba(0,0,0,.16), transparent 70%),
    radial-gradient(closest-side at 20% 30%, rgba(255,255,255,.16), transparent 65%);
  animation-duration: 3.9s;
  animation-direction: alternate-reverse;
}
@keyframes focus-water {
  from { transform: translateX(-14%) translateY(-4%); }
  to { transform: translateX(14%) translateY(4%); }
}

/* four arrows that pulse toward the button whenever Focus is off */
.focus-wrap { position: relative; display: inline-flex; margin: 8px 10px; }
.fpulse {
  position: absolute;
  font-size: 16px;
  line-height: 1;
  color: var(--c-politics);
  pointer-events: none;
  animation: fpulse 1.1s ease-in-out infinite alternate;
}
.fp-l { left: -24px; top: 50%; margin-top: -8px; }
.fp-r { right: -24px; top: 50%; margin-top: -8px; }
.fp-t { top: -21px; left: 50%; margin-left: -6px; }
.fp-b { bottom: -21px; left: 50%; margin-left: -6px; }
@keyframes fpulse {
  from { opacity: .25; transform: none; }
  to { opacity: 1; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .fpulse { animation: none; opacity: .7; }
  .intent[aria-pressed="true"]::before,
  .intent[aria-pressed="true"]::after { animation: none; }
}
.focus-wrap.seen .fpulse { display: none; }

/* while focus mode is on, already-passed headlines still visible this
   session are dimmed — they disappear on the next visit */
.fi.passed { opacity: .45; }

/* ---------- V2.2: chip-row scroll cues ---------- */

.srow { position: relative; max-width: 1240px; margin: 0 auto; }
body.src-hidden .srow-src { display: none; }
.srow-more, .srow-less {
  position: absolute;
  top: 0;
  bottom: 4px;
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--dim);
  cursor: pointer;
}
.srow-more {
  right: 0;
  padding: 0 2px 0 26px;
  background: linear-gradient(to right, transparent, var(--bg) 65%);
}
.srow-less {
  left: 0;
  padding: 0 26px 0 2px;
  background: linear-gradient(to left, transparent, var(--bg) 65%);
}
.srow-more:hover, .srow-less:hover { color: var(--fg); }
.srow-bar {
  height: 2px;
  margin-bottom: 3px;
  background: var(--chipbg);
  border-radius: 2px;
  overflow: hidden;
}
.srow-bar i {
  display: block;
  height: 100%;
  background: var(--chipline);
  border-radius: 2px;
}
.tabs-client { border-top: 0; padding-top: 2px; }

/* ---------- V2.2: refresh + hint card ---------- */

.ic.spin { animation: icspin .8s linear infinite; }
@keyframes icspin { to { transform: rotate(360deg); } }

.hintcard {
  max-width: 680px;
  margin: 14px auto 4px;
  padding: 12px 34px 12px 14px;
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.8;
  position: relative;
}
.hintcard b { color: var(--accent); }
@media (hover: none) {
  .hint-desk { display: none; }
}

/* ---------- V2.1: swipe gestures + hover actions ---------- */

.fi, .src-sec li[data-k] {
  position: relative;
  touch-action: pan-y;   /* horizontal drags belong to the swipe layer */
}
.swiping { transition: none; user-select: none; -webkit-user-select: none; }
.settling { transition: transform .18s ease; }
.fi::before, .fi::after,
.src-sec li[data-k]::before, .src-sec li[data-k]::after {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
}
.fi::before, .src-sec li[data-k]::before { content: "+ SAVE"; left: 8px; color: var(--accent); }
.fi::after, .src-sec li[data-k]::after { content: "DIG IN ↓"; right: 8px; color: var(--c-science); }
.sw-r::before { opacity: 1 !important; }
.sw-l::after { opacity: 1 !important; }

/* hover actions are a desktop affordance — phones swipe instead. display:none
   (not opacity) so there is never an invisible tap target over the row. */
.fi-acts { display: none; }
@media (hover: hover) and (pointer: fine) {
  .fi-acts { display: flex; gap: 6px; margin-left: auto; opacity: 0; pointer-events: none; }
  .fi:hover .fi-acts { opacity: 1; pointer-events: auto; }
  .fi-meta .fi-acts + .play, .fi-meta .fi-acts ~ .play { margin-left: 0; }
}
.act {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  padding: 2px 8px;
  border: 1px solid var(--chipline);
  border-radius: 3px;
  color: var(--dim);
  background: var(--bg);
}
.act:hover { color: var(--fg); border-color: var(--dim); }

/* long-press = mute, so the OS link callout has to stand down on touch */
@media (hover: none) {
  .fi, .fi *, .src-sec li[data-k], .src-sec li[data-k] * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.unsave {
  font-size: 11px;
  color: var(--faint);
  padding: 2px 6px;
  margin-left: auto;
}
.unsave:hover { color: var(--c-politics); }

.pop {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--accent);
  white-space: nowrap;
}

.tab.t-top[aria-pressed="false"] { color: var(--c-news); }
.tab.t-youtube[aria-pressed="false"] { color: var(--c-youtube); }
/* deep dives share the DIG IN purple — the swipe and its payoff match */
.tab.t-dives[aria-pressed="false"] { color: var(--c-science); }
.dive-dek { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--dim); }

/* ---------- V2.1: confirm dialog + toast ---------- */

.confirm {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  width: min(340px, 92vw);
  background: var(--bg);
  border: 1px solid var(--chipline);
  border-radius: 6px;
  padding: 20px 20px 16px;
}
.confirm-title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.confirm-body {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
}
.confirm-btns { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-go { background: var(--fg); color: var(--bg); border-color: var(--fg); }
#confirm-scrim { z-index: 55; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 70px;
  z-index: 40;
  pointer-events: none;   /* headlines behind it stay tappable/swipeable… */
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 92vw;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
#toast-undo {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  pointer-events: auto;   /* …but UNDO itself still works */
  padding: 4px 2px;
}

/* ---------- V2.1: rail + nudge ---------- */

.rail {
  max-width: 680px;
  margin: 10px auto 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail a { color: var(--accent); text-decoration: none; }
.rail a:hover { text-decoration: underline; text-underline-offset: 3px; }

.nudge {
  max-width: 680px;
  margin: 18px auto;
  padding: 14px 16px;
  border: 1px solid var(--chipline);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.7;
  position: relative;
}
.nudge a { color: var(--accent); text-decoration: none; }
.nudge a:hover { text-decoration: underline; text-underline-offset: 3px; }
.nudge-x {
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--faint);
  font-size: 12px;
  padding: 4px;
}
.nudge-x:hover { color: var(--fg); }

@media (max-width: 640px) {
  .mast { padding: 10px 12px 0; }
  .mast-title { font-size: 20px; }
  .body-wrap { padding: 0 12px 48px; }
  .mast-tag { display: none; }
  #player-audio { flex: 3; }
  /* stack the count line and the view toggle — side by side they fight
     for width and the toggle loses off the right edge */
  .mast-sub { flex-wrap: wrap; }
  .mast-count { flex-basis: 100%; }
  .int-full { display: none; }
  .int-min { display: inline; }
}

@media (prefers-reduced-motion: no-preference) {
  .drawer { transition: transform .18s ease; }
}

/* ---------- V2.2: the video shelves ---------- */

.ytbar {
  max-width: 1240px;
  margin: 16px auto 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ytsorts { display: flex; gap: 6px; flex-wrap: wrap; }

.vsec { max-width: 1240px; margin: 0 auto; }
.vsec-head {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 26px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.vshuffle { font-weight: 400; }

.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px 14px;
}
.vcard {
  position: relative;
  touch-action: pan-y;
  min-width: 0;
}
.vcard.read { opacity: .55; }
.vthumb {
  position: relative;
  display: block;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--chipbg);
  aspect-ratio: 16 / 9;
}
.vthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.05);
}
.vcard:hover .vthumb img { filter: none; }
.vdur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.vtitle {
  display: block;
  margin-top: 7px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vtitle:hover { text-decoration: underline; text-underline-offset: 3px; }
.vmeta {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* swipe labels on cards */
.vcard::before, .vcard::after {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  position: absolute;
  top: 30%;
  opacity: 0;
  pointer-events: none;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 2;
}
.vcard::before { content: "+ SAVE"; left: 6px; color: var(--accent); }
.vcard::after { content: "DIG IN ↓"; right: 6px; color: var(--c-science); }
@media (hover: none) {
  .vcard, .vcard * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}
