:root {
  --ink: #0A1020;          /* app chrome */
  --ink-2: #131B30;
  --line: rgba(233, 237, 247, 0.12);
  --paper: #EEF1F7;        /* primary text */
  --muted: rgba(238, 241, 247, 0.66);
  --pulse: #FFD23F;        /* coverage / signal */
  --pulse-ink: #1A1400;

  /* Story colourways (cover-style fields when a story has no photo) */
  --c0: #1B3A9E; --c1: #6E1B2A; --c2: #0F4A3C;
  --c3: #3B2150; --c4: #7A4E0C; --c5: #22344A;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-lg: 22px;
  --radius-sm: 10px;
  --topbar: 60px;
  --tabs: 38px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --chrome: calc(var(--safe-t) + var(--topbar) + var(--tabs));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--pulse); outline-offset: 3px; border-radius: 6px; }

/* ---------- Layout ---------- */
.app {
  position: fixed; inset: 0; /* fills the whole screen, including under the status bar and home bar */
  display: grid;
  grid-template-columns: 1fr minmax(0, 460px) 1fr;
  gap: 40px;
  overflow: hidden;
}
.stage { position: relative; height: 100%; min-width: 0; }
.side { padding: 36px 0; max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
.side-left { justify-self: end; width: min(320px, 100%); display: flex; flex-direction: column; gap: 22px; }
.side-right { justify-self: start; width: min(340px, 100%); }

@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { display: none; }
}
@media (min-width: 1081px) {
  .stage { padding: 18px 0; }
  .feed { border-radius: var(--radius-lg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line); }
  .topbar { top: 18px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .brand-sm { display: none; }
  .counter { bottom: 44px; right: 26px; }
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 900; font-size: 34px; letter-spacing: 0.01em;
  text-decoration: none; line-height: 1;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--pulse);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18);
  transform: rotate(-8deg);
}
.brand-sm { font-size: 24px; gap: 8px; }
.brand-sm .brand-mark { width: 16px; height: 16px; border-radius: 4px; }

.side-lede { font-size: 19px; line-height: 1.4; margin: 0; color: var(--paper); max-width: 30ch; }
.how { margin: 0; display: grid; gap: 14px; }
.how div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
.how dt { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--pulse); line-height: 1.2; }
.how dd { margin: 0; color: var(--muted); font-size: 14.5px; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13px; }
kbd {
  font-family: var(--ui); font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  padding: 1px 6px; margin-right: 3px; color: var(--paper);
}
.side-foot { color: var(--muted); font-size: 12.5px; margin: auto 0 0; }
.side-title { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 4px 0 16px; line-height: 1.1; }
.side-title span { color: var(--pulse); }
.side-right .side-foot { margin-top: 16px; }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  height: calc(var(--topbar) + var(--safe-t));
  display: flex; align-items: center; gap: 8px;
  padding: var(--safe-t) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  background: rgba(6, 10, 22, 0.5);
}
.feed-pill {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 4px; padding: 7px 10px 7px 14px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 700; font-size: 15px; flex: 0 1 auto; min-width: 0;
}
.feed-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-pill svg { width: 18px; height: 18px; flex: none; }
.range {
  display: inline-flex; flex: none; margin-left: auto; padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.range button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.range button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--pulse); color: var(--pulse-ink);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
@media (max-width: 520px) {
  .brand-sm { font-size: 0; gap: 0; }
  .topbar { gap: 4px; padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
  .feed-pill { margin-left: 6px; }
}
@media (max-width: 360px) { #listBtn { display: none; } .range button { padding: 5px 8px; } }

/* ---------- Feed ---------- */
.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: var(--ink-2);
  position: relative;
}
.feed::-webkit-scrollbar { display: none; }
.feed:focus { outline: none; }

.card {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  isolation: isolate;
  background: var(--field, var(--c5));
}
/* Photo cards: the photo sits in the middle of the card, with a soft blurred copy behind everything */
.card-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.card-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(34px) saturate(1.3) brightness(0.42); transform: scale(1.25); }
.card.has-photo { background: #0c1122; }

.card-body {
  position: absolute; left: 0; right: 64px; bottom: 0; top: calc(var(--chrome) + 10px);
  padding: 0 18px calc(24px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px;
  overflow: hidden;
}
.card-top { flex: none; display: flex; flex-direction: column; gap: 12px; }
.card-media {
  flex: 1 1 auto; min-height: 0; position: relative;
  border-radius: 18px; overflow: hidden;
}
.card.has-photo .card-media { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card.no-media .card-media { display: none; }
.card-foot { flex: none; display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
/* Cover-style cards: giant outlined rank numeral fills the picture area */
.card-numeral {
  position: absolute; left: -0.04em; bottom: -0.1em;
  font-family: var(--display); font-weight: 900;
  font-size: min(64vw, 300px); line-height: 0.8; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, 0.16);
  user-select: none; pointer-events: none;
}

/* Summary */
.summary-box { display: flex; flex-direction: column; gap: 7px; }
.summary-box .summary {
  margin: 0; font-size: 16px; line-height: 1.5; color: rgba(238, 241, 247, 0.9); max-width: 62ch;
  display: -webkit-box; -webkit-line-clamp: var(--lines, 7); -webkit-box-orient: vertical; overflow: hidden;
}
.summary-src { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.summary-box[data-state="loading"] .summary { opacity: 0.75; }
.summary-box[data-state="loading"]:has(.sk-line) { gap: 9px; padding-top: 2px; }
.sk-line { display: block; height: 13px; border-radius: 7px; background: rgba(255, 255, 255, 0.12); position: relative; overflow: hidden; }
.sk-line.short { width: 60%; }
.sk-line::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%); animation: shimmer 1.3s infinite; }
.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 7px; overflow: hidden; }
.tag { flex: none; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08);
  border-radius: 999px; padding: 5px 9px 5px 11px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tag svg { width: 14px; height: 14px; opacity: 0.7; }
.tag:hover { background: rgba(255, 255, 255, 0.16); }
.rankline { display: flex; align-items: center; gap: 12px; }
.rank {
  font-family: var(--display); font-weight: 900; font-size: 30px; line-height: 1;
  color: var(--pulse);
}
.rank small { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.pulse { flex: 1; max-width: 160px; }
.pulse-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.pulse-bar i { display: block; height: 100%; width: var(--p); background: var(--pulse); border-radius: 3px; }
.pulse-label { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 500; }

.headline {
  font-family: var(--display); font-weight: 800;
  font-size: 44px; line-height: 0.98; letter-spacing: -0.005em;
  margin: 0; text-wrap: balance;
  overflow-wrap: anywhere;
}
.headline a { text-decoration: none; }
.headline.len-m { font-size: 38px; }
.headline.len-l { font-size: 32px; line-height: 1.02; }
.headline.len-xl { font-size: 27px; line-height: 1.05; }
@media (max-height: 640px) {
  .headline { font-size: 34px; } .headline.len-m { font-size: 30px; }
  .headline.len-l { font-size: 26px; } .headline.len-xl { font-size: 23px; }
}
.summary {
  margin: 0; color: rgba(238, 241, 247, 0.84); font-size: 15.5px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 60ch;
}
.byline { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.byline strong { color: var(--paper); font-weight: 600; }
.fav {
  width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, 0.9);
  display: grid; place-items: center; overflow: hidden; flex: none;
  font-size: 11px; font-weight: 700; color: var(--ink);
}
.fav img { width: 16px; height: 16px; }
.outlets { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; color: var(--paper); font-size: 14px; font-weight: 600; text-align: left; }
.stack { display: inline-flex; }
.stack .fav { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--field, var(--ink)); margin-left: -8px; }
.card.has-photo .stack .fav { border-color: #10131c; }
.stack .fav:first-child { margin-left: 0; }

.read {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  align-self: flex-start;
  padding: 13px 20px; border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 15.5px; text-decoration: none;
  transition: transform 0.12s ease;
}
.read:active { transform: scale(0.97); }
.read svg { width: 18px; height: 18px; }

/* TikTok-style action rail */
.actions {
  position: absolute; right: 8px; bottom: calc(30px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.act {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0; font-size: 11.5px; font-weight: 600; color: var(--paper);
}
.act span.circle {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, transform 0.15s ease;
}
.act:active span.circle { transform: scale(0.92); }
.act[aria-pressed="true"] span.circle { background: var(--pulse); color: var(--pulse-ink); }
.act[aria-pressed="true"] svg { fill: currentColor; }

/* Double-tap burst */
.burst {
  position: absolute; left: 50%; top: 42%; z-index: 4; pointer-events: none;
  width: 110px; height: 110px; margin: -55px 0 0 -55px; color: var(--pulse);
  animation: burst 0.7s ease-out forwards;
}
.burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
@keyframes burst {
  0% { transform: scale(0.3); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}

/* End card */
.card-end { display: grid; place-items: center; text-align: center; padding: 24px; background: var(--ink-2); }
.card-end h2 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; margin: 0 0 10px; }
.card-end p { color: var(--muted); margin: 0 auto 20px; max-width: 30ch; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ghost {
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line); background: none;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.card-end .read { align-self: auto; }

/* Loading + states */
.state { height: 100%; display: grid; place-items: center; text-align: center; padding: 30px; }
.state h2 { font-family: var(--display); font-size: 34px; font-weight: 800; margin: 0 0 8px; line-height: 1.05; }
.state p { color: var(--muted); margin: 0 auto 18px; max-width: 32ch; }
.skeleton { height: 100%; position: relative; background: var(--c5); overflow: hidden; }
.skeleton .sk { position: absolute; left: 18px; right: 80px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.counter {
  position: absolute; z-index: 4; right: 14px; bottom: calc(6px + var(--safe-b));
  font-size: 11.5px; font-weight: 600; color: var(--muted); pointer-events: none;
}
.swipe-hint {
  position: absolute; z-index: 6; left: 50%; top: 38%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--paper); color: var(--ink); font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: nudge 1.4s ease-in-out infinite;
}
.swipe-hint svg { width: 18px; height: 18px; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }

/* ---------- Ranked rail / lists ---------- */
.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail li button, .rail li a.row {
  width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start;
  text-align: left; border: 0; background: none; padding: 10px 10px; border-radius: var(--radius-sm);
  text-decoration: none;
}
.rail li button:hover, .rail li a.row:hover { background: rgba(255, 255, 255, 0.06); }
.rail li.active button { background: rgba(255, 210, 63, 0.12); }
.rail .n { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1; color: var(--muted); }
.rail li.active .n { color: var(--pulse); }
.rail .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: block; }
.rail .m { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.rail .mini { width: 44px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; flex: none; }
.rail .mini i { display: block; height: 100%; width: var(--p); background: var(--pulse); }
.rail-sheet { padding-bottom: 20px; }
.row-actions { display: flex; gap: 6px; }

/* ---------- Sheets ---------- */
.sheet {
  width: min(560px, 100vw); max-width: 100vw; max-height: 86dvh;
  margin: auto auto 0; padding: 0 18px 18px;
  border: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #121A2E; color: var(--paper);
  overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
@media (min-width: 700px) { .sheet { margin: auto; border-radius: var(--radius-lg); max-height: 80dvh; } }
.sheet::backdrop { background: rgba(3, 6, 14, 0.62); backdrop-filter: blur(3px); }
.sheet[open] { animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  position: sticky; top: 0; z-index: 1; background: #121A2E;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 12px;
}
.sheet-head h2 { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 0; line-height: 1.05; }
.sheet h3 { font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 20px 0 10px; }
.sheet-sub { color: var(--muted); margin: -4px 0 12px; font-size: 14.5px; }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--pulse); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--paper); font: inherit; font-size: 15px; padding: 6px 0; outline: none; }
.search input::placeholder { color: rgba(238, 241, 247, 0.45); }
.search button { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--pulse); color: var(--pulse-ink); font-weight: 700; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  padding: 8px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
}
.chip:hover { background: rgba(255, 255, 255, 0.1); }
.chip[aria-current="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 700; }

.coverage { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.coverage a {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 13px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); text-decoration: none;
}
.coverage a:hover { background: rgba(255, 255, 255, 0.1); }
.coverage .fav { width: 26px; height: 26px; border-radius: 7px; }
.coverage .src { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.coverage .ht { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; margin-top: 2px; }

.empty { color: var(--muted); padding: 20px 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(var(--chrome) + 14px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14.5px;
  padding: 10px 16px; border-radius: 999px; transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .feed { scroll-behavior: auto; }
}

/* ---------- Flags: new / read / topic ---------- */
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 8px; border-radius: 6px;
}
.flag svg { width: 13px; height: 13px; stroke-width: 3; }
.flag-new { background: var(--pulse); color: var(--pulse-ink); }
.flag-read { background: rgba(255, 255, 255, 0.16); color: var(--paper); }
.flag-topic { background: none; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--paper); font-weight: 600; }
.card.is-read .headline, .card.is-read .summary { opacity: 0.6; }
.card.is-read .read { background: rgba(255, 255, 255, 0.16); color: var(--paper); }
.rail li.read .t { color: var(--muted); font-weight: 500; }
.rail li.new .n::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pulse); margin-left: 3px; vertical-align: top; }

/* ---------- Listen player ---------- */
.icon-btn[aria-pressed="true"] { background: var(--pulse); color: var(--pulse-ink); }
.player {
  position: absolute; z-index: 6; left: 10px; right: 10px; top: var(--chrome);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 8px; border-radius: 18px;
  background: rgba(14, 20, 38, 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pl-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; }
.pl-btn:hover { background: rgba(255, 255, 255, 0.1); }
.pl-btn svg { width: 20px; height: 20px; }
.pl-main { width: 44px; height: 44px; background: var(--pulse); color: var(--pulse-ink); }
.pl-main:hover { background: var(--pulse); filter: brightness(1.05); }
.player.buffering .pl-main { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }
.pl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-status { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-top: 4px; }
.pl-bar i { display: block; height: 100%; width: 0; background: var(--pulse); transition: width 0.4s ease; }
.pl-voice select {
  appearance: none; -webkit-appearance: none; max-width: 86px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: var(--paper);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 999px; text-overflow: ellipsis;
}
.pl-voice select option { color: #111; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 400px) { .pl-voice select { max-width: 64px; padding: 7px 8px; } #plClose { width: 32px; } }
body.listening .card-body { top: calc(var(--chrome) + 84px); }

/* ---------- My Mix ---------- */
#mixWrap { margin-bottom: 14px; }
.mix-card {
  display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left;
  padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
}
.mix-card h3 { margin: 0; color: var(--paper); font-size: 16px; }
.mix-head { display: flex; align-items: center; justify-content: space-between; }
.mix-list { margin: 0; color: var(--muted); font-size: 14.5px; }
.mix-card .read { align-self: flex-start; }
.mix-card .read[aria-current="true"] { background: var(--pulse); color: var(--pulse-ink); }
.mix-card .read:disabled { opacity: 0.45; cursor: not-allowed; }
.mix-new { border-style: dashed; cursor: pointer; }
.mix-new strong { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1; }
.mix-new span { color: var(--muted); font-size: 14px; }
.mix-new:hover { background: rgba(255, 255, 255, 0.08); }
.mix-card.editing { border-color: var(--pulse); background: rgba(255, 210, 63, 0.06); }
.mix-help { margin: 0; color: var(--muted); font-size: 14px; }
.mix-empty { color: var(--muted); font-size: 14px; font-style: italic; }
.mix-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.link { border: 0; background: none; color: var(--pulse); font-weight: 700; font-size: 14px; padding: 4px; }
.chip-on { background: var(--pulse); color: var(--pulse-ink); border-color: var(--pulse); font-weight: 700; }
.chip-on span { margin-left: 6px; font-weight: 800; }
.chip-on:hover { background: var(--pulse); filter: brightness(1.05); }
.sheet.editing #recentWrap h3::after { content: " (tap to add)"; font-weight: 500; }

.mix-dock { position: sticky; bottom: -18px; margin: 18px -18px -18px; padding: 12px 18px 18px; background: #121A2E; border-top: 1px solid var(--line); }
.mix-dock .mix-card { border: 0; background: none; padding: 0; }
@media (max-width: 440px) {
  .topbar { gap: 0; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  .feed-pill { min-width: 78px; margin-right: 4px; }
  .range button { padding: 5px 9px; }
}

/* ---------- Popular / Latest / New tabs ---------- */
.topbar { background: linear-gradient(to bottom, rgba(6, 10, 22, 0.78), rgba(6, 10, 22, 0.55)); }
.tabs {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(var(--safe-t) + var(--topbar));
  height: var(--tabs); display: flex; justify-content: center; align-items: flex-start; gap: 22px;
  background: linear-gradient(to bottom, rgba(6, 10, 22, 0.55), rgba(6, 10, 22, 0));
}
.tabs button {
  position: relative; border: 0; background: none; padding: 4px 2px 9px;
  font-size: 16px; font-weight: 700; color: rgba(238, 241, 247, 0.6);
  display: inline-flex; align-items: center; gap: 6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.tabs button[aria-selected="true"] { color: var(--paper); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px;
  border-radius: 2px; background: var(--paper);
}
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--pulse); color: var(--pulse-ink); font-size: 12px; font-weight: 800; text-shadow: none;
}
.rank small { white-space: nowrap; }

/* ---------- New stories banner ---------- */
.new-banner {
  position: absolute; z-index: 7; left: 50%; top: calc(var(--chrome) + 8px);
  transform: translate(-50%, -10px); opacity: 0; transition: 0.22s ease;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  max-width: calc(100% - 24px);
  border: 0; border-radius: 999px; padding: 10px 8px 10px 14px;
  background: var(--pulse); color: var(--pulse-ink); font-size: 14.5px; font-weight: 700;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.new-banner.show { transform: translate(-50%, 0); opacity: 1; }
.new-banner #newBannerText { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .new-banner { font-size: 13.5px; gap: 8px; } }
.nb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pulse-ink); flex: none; animation: breathe 1.4s ease-in-out infinite; }
.nb-cta { background: var(--pulse-ink); color: var(--pulse); padding: 6px 11px; border-radius: 999px; font-size: 13px; flex: none; }
body.listening .new-banner { display: none; }

@media (min-width: 1081px) { .player { top: calc(var(--chrome) + 18px); } .tabs { top: calc(var(--topbar) + 18px); } .new-banner { top: calc(var(--chrome) + 26px); } }

/* ---------- Pull to refresh ---------- */
.feed { will-change: transform; }
.ptr {
  position: absolute; z-index: 6; left: 50%; top: calc(var(--chrome) + 6px);
  transform: translate(-50%, -20px);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); pointer-events: none;
}
.ptr-icon, .ptr-spin { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pulse); color: var(--pulse-ink); flex: none; }
.ptr-icon svg { width: 16px; height: 16px; stroke-width: 2.6; }
.ptr-icon { transition: transform 0.12s linear; }
.ptr.armed .ptr-icon { background: var(--pulse-ink); color: var(--pulse); }
.ptr-spin { display: none; background: none; border: 3px solid rgba(10, 16, 32, 0.15); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
.ptr.loading { transform: translate(-50%, 0); opacity: 1; transition: transform 0.2s ease; }
.ptr.loading .ptr-icon { display: none; }
.ptr.loading .ptr-spin { display: grid; }
@keyframes spin { to { transform: rotate(360deg); } }
body.listening .ptr { top: calc(var(--chrome) + 84px); }

/* ---------- About ---------- */
.picker-foot { margin: 22px 0 4px; text-align: center; }
.about-body p { color: var(--muted); margin: 0 0 6px; font-size: 14.5px; }
.about-body .about-lede { color: var(--paper); font-size: 17px; margin-bottom: 18px; }
.about-body .how { margin-bottom: 18px; }
.about-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px; border-radius: 16px; background: rgba(255, 210, 63, 0.08); border: 1px solid rgba(255, 210, 63, 0.3);
}
.about-row div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.about-row span { color: var(--muted); }
.about-row .read { flex: none; }
.link-quiet { color: var(--muted); padding: 0; font-weight: 600; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Headline sizes for the new top-aligned layout */
.headline { font-size: 40px; }
.headline.len-m { font-size: 35px; }
.headline.len-l { font-size: 31px; }
.headline.len-xl { font-size: 27px; }
@media (max-height: 700px) {
  .headline { font-size: 33px; } .headline.len-m { font-size: 30px; }
  .headline.len-l { font-size: 27px; } .headline.len-xl { font-size: 24px; }
  .summary-box .summary { font-size: 15px; }
  .card-foot { gap: 10px; }
}
.card.is-read .headline, .card.is-read .summary-box { opacity: 0.6; }

/* ---------- Timeline ---------- */
#timeline .sheet-sub { font-weight: 600; color: var(--paper); }
.tl-summary { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.tl { list-style: none; margin: 0; padding: 0 0 18px; position: relative; }
.tl::before { content: ""; position: absolute; left: 73px; top: 36px; bottom: 30px; width: 2px; background: rgba(255, 255, 255, 0.12); border-radius: 1px; }
.tl-day { font-family: var(--display); font-weight: 800; font-size: 20px; margin: 16px 0 6px; color: var(--paper); position: relative; background: #121A2E; padding: 2px 0; }
.tl-day:first-child { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: 60px 1fr; gap: 26px; position: relative; padding: 6px 0; }
.tl-item::before { content: ""; position: absolute; left: 69px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #121A2E; border: 2px solid rgba(255, 255, 255, 0.45); }
.tl-item.is-latest::before { background: var(--pulse); border-color: var(--pulse); box-shadow: 0 0 0 5px rgba(255, 210, 63, 0.18); }
.tl-time { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 9px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-item a { display: flex; flex-direction: column; gap: 5px; padding: 8px 12px; margin-left: -12px; border-radius: 12px; text-decoration: none; }
.tl-item a:hover { background: rgba(255, 255, 255, 0.06); }
.tl-h { font-size: 15.5px; font-weight: 600; line-height: 1.32; }
.tl-src { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tl-src .fav { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.tl-src .fav img { width: 13px; height: 13px; }
.tl-mark { align-self: flex-start; font-size: 11.5px; font-weight: 800; padding: 3px 7px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); }
.tl-mark.tl-latest { background: var(--pulse); color: var(--pulse-ink); }
.tl-empty { padding: 20px 0 28px; color: var(--muted); }
.tl-empty p { margin: 0 0 14px; max-width: 40ch; }
.tl-loading { display: grid; gap: 18px; padding: 6px 0 24px; }
.tl-sk { display: grid; grid-template-columns: 60px 1fr; gap: 26px; }
.tl-sk span { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.1); }
.tl-sk span + span { height: 38px; }

/* ---------- First-open setup ---------- */
.welcome {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--ink); color: var(--paper);
  display: none; flex-direction: column;
}
.welcome[open] { display: flex; animation: fadeIn 0.3s ease; }
.welcome::backdrop { background: var(--ink); }
.wl-panel { flex: 1; overflow-y: auto; padding: calc(22px + var(--safe-t)) 22px 20px; width: 100%; max-width: 560px; margin: 0 auto; }
.wl-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.wl-top .brand { font-size: 30px; }
.wl-intro { font-size: 19px; line-height: 1.4; margin: 0 0 30px; max-width: 30ch; }
.wl-step { font-size: 13px; font-weight: 700; color: var(--pulse); margin: 0 0 6px; }
.wl-title { font-family: var(--display); font-weight: 800; font-size: 42px; line-height: 1; margin: 0 0 10px; text-wrap: balance; }
.wl-sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.wl-chips .chip { font-size: 15.5px; padding: 10px 15px; }
.wl-foot {
  flex: none; display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 14px 22px calc(18px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--ink);
}
.wl-dots { display: flex; gap: 6px; margin-right: auto; }
.wl-dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); transition: width 0.2s ease; }
.wl-dots i.on { width: 22px; background: var(--pulse); }
.wl-foot .read:disabled { opacity: 0.4; cursor: not-allowed; }
.about-setup { margin: 16px 0 4px; }

.wl-title:focus { outline: none; }

/* ---------- App mode (added to the home screen) ---------- */
html, body { overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button, a, .chip, .tag, .act { touch-action: manipulation; }
button, .act, .chip, .tag, .tabs, .topbar, .actions, .rank, .pulse, .counter, .flags { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-touch-callout: none; -webkit-user-drag: none; }
/* Sheets clear the home bar */
.sheet { padding-bottom: calc(18px + var(--safe-b)); }
/* In the installed app the status bar sits on top of the page, so give it a solid backing */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .topbar { background: rgba(6, 10, 22, 0.82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
  .tabs { background: linear-gradient(to bottom, rgba(6, 10, 22, 0.82), rgba(6, 10, 22, 0)); }
  .brand-sm { font-size: 0; gap: 0; }
}
body.standalone .topbar { background: rgba(6, 10, 22, 0.82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
body.standalone .tabs { background: linear-gradient(to bottom, rgba(6, 10, 22, 0.82), rgba(6, 10, 22, 0)); }
