
:root {
  --bg: #ffffff;
  --surface-tint: #f8fafc;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-link: #1d4ed8;
  --hairline: #e2e8f0;
  --border: #cbd5e1;

  /* D-002 soft pastel controls with high-contrast dark ink */
  --pastel-blue: #dbeafe;
  --pastel-blue-hover: #bfdbfe;
  --pastel-blue-border: #93c5fd;
  --pastel-blue-ink: #1e3a8a;

  --pastel-warm: #fef3c7;
  --pastel-warm-hover: #fde68a;
  --pastel-warm-border: #fcd34d;
  --pastel-warm-ink: #78350f;

  --pastel-mint: #dcfce7;
  --pastel-mint-hover: #bbf7d0;
  --pastel-mint-border: #86efac;
  --pastel-mint-ink: #14532d;

  --pastel-lavender: #ede9fe;
  --pastel-lavender-border: #c4b5fd;
  --pastel-lavender-ink: #4c1d95;

  --pastel-neutral: #f1f5f9;
  --pastel-neutral-hover: #e2e8f0;
  --pastel-neutral-border: #cbd5e1;
  --pastel-neutral-ink: #1e293b;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

* { box-sizing: border-box; }
::selection { background: #dbeafe; color: #1e3a8a; }

html, body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  caret-color: #1e3a8a;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink-link);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

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

/* ── Topbar (subtle & light) ────────────────────────────────── */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 30;
  transition: background 180ms ease, border-color 180ms ease;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: background 140ms ease, color 140ms ease;
}
.nav-link:hover { background: rgba(241, 245, 249, 0.85); color: var(--ink); text-decoration: none; }
.nav-link.active {
  background: var(--pastel-blue);
  color: var(--pastel-blue-ink);
  font-weight: 600;
}

/* Profile avatar dropdown menu (replaces separate Sign out button) */
.profile-menu-wrap { position: relative; }
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem;
  border-radius: 999px;
  border: 1.5px solid rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: border-color 140ms ease, transform 90ms ease;
}
.profile-trigger:hover { border-color: #93c5fd; transform: translateY(-1px); }
.profile-trigger:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: 0 14px 32px -12px rgba(15, 23, 42, 0.2);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.profile-header {
  padding: 0.45rem 0.6rem 0.55rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 0.2rem;
}
.profile-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); display: block; }
.profile-email { font-size: 0.78rem; color: var(--ink-secondary); display: block; overflow: hidden; text-overflow: ellipsis; }
.profile-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.profile-item:hover { background: var(--pastel-neutral); text-decoration: none; }

/* Below-the-fold Home Category Leaderboard */
.leaderboard-section {
  background: #ffffff;
  border-top: 1px solid var(--hairline);
  padding: 3.25rem 1.5rem 3.5rem;
}
.leaderboard-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 3rem;
  margin-top: 1.75rem;
}
@media (max-width: 780px) {
  .leaderboard-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}
.lb-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 0.35rem;
}
.lb-col-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.lb-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.45rem;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  border-radius: 8px;
  transition: background 120ms ease;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--surface-tint); }
.lb-rank {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #94a3b8;
  width: 20px;
  flex-shrink: 0;
  line-height: 1.3;
}
.lb-topic {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.38;
  flex: 1;
}
.lb-source {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  margin-top: 0.15rem;
  display: block;
}

/* Interactive Story Gallery Carousel (big wider right column) */
.gallery-stage {
  position: relative;
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  border-radius: 12px;
  overflow: hidden;
}
.gallery-stage img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.gallery-stage svg {
  max-width: 100%;
  max-height: 360px;
  padding: 0.75rem;
  display: block;
}
.gallery-caption {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2vw, 1.55rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0.7rem 0 0.6rem 0;
}
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.gallery-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}
.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}
.gallery-dot.active {
  background: #1e3a8a;
  transform: scale(1.25);
}

/* Below-the-fold footer (holds Search, Archive, Agent API, Docs) */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--hairline);
  padding: 1.5rem 1.5rem 2.25rem;
}
.site-footer-inner {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* ── Full-bleed Home Mode. The bar stays fixed; its colour comes from the lead image. ─ */
body.home-stage {
  background-color: #ffffff;
}
body.home-stage .topbar {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}
body.home-stage .topbar.topbar-tinted {
  background: var(--topbar-bg, #ffffff);
  color: var(--topbar-ink, var(--ink));
  border-bottom: none;
  box-shadow: none;
}
/* Soft handoff into the lead image. Same RGB as the bar, alpha only, so the
   fade does not pick up a grey fringe. About 36px, inside the 24–48px range. */
body.home-stage .topbar.topbar-tinted::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 36px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgb(from var(--topbar-bg) r g b / 1),
    rgb(from var(--topbar-bg) r g b / 0)
  );
}
.topbar.topbar-tinted[data-logo="light"] .brand img {
  filter: brightness(0) invert(1);
}
.topbar.topbar-tinted[data-logo="dark"] .brand img {
  filter: brightness(0);
}
.topbar.topbar-tinted .profile-trigger {
  border-color: color-mix(in srgb, var(--topbar-ink, #0f172a) 42%, transparent);
  background: rgba(255, 255, 255, 0.92);
}
.topbar.topbar-tinted .profile-dropdown {
  background: #ffffff;
  color: var(--ink);
}
.topbar.topbar-tinted .profile-dropdown .profile-name { color: var(--ink); }
.topbar.topbar-tinted .profile-dropdown .profile-email { color: var(--ink-secondary); }
body.home-stage .topbar-inner {
  max-width: none;
  padding: 0.45rem 1.5rem;
}
body.home-stage .wrap {
  max-width: none;
  padding: 0;
}

.backdrop-canvas {
  position: relative;
  min-height: calc(100vh - 66px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.5rem 5.5rem;
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  transition: min-height 380ms cubic-bezier(0.16, 1, 0.3, 1), padding 380ms cubic-bezier(0.16, 1, 0.3, 1), background-image 320ms ease;
}
.backdrop-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.16) 44%,
    rgba(255, 255, 255, 0.42) 100%
  );
  pointer-events: none;
}
.backdrop-canvas.compact {
  min-height: 0;
  background-image: none;
  background-color: #ffffff;
  padding: 1.5rem 1.5rem 0;
  align-items: stretch;
  justify-content: flex-start;
}
.backdrop-canvas.compact::before { display: none; }

/* Continuous Lead-Image Editorial Header Banner on Results */
.backdrop-canvas.compact.has-banner {
  min-height: 210px;
  padding: 4.5rem 1.5rem 1.75rem;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--hairline);
  background-size: cover;
  background-position: center 35%;
}
.backdrop-canvas.compact.has-banner::before {
  display: block;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.36) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.84) 100%
  );
}
.backdrop-canvas.compact.has-banner .hero-shell.compact {
  border-bottom: none;
  padding-bottom: 0;
  max-width: 920px;
}
.backdrop-canvas.compact.has-banner .search-bar-wrap {
  box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.22);
}
.banner-controls {
  position: absolute;
  right: 1.25rem;
  bottom: 0.65rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 0.3rem;
}
.backdrop-canvas.compact.has-banner .banner-controls { display: inline-flex; }

.backdrop-footer {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  z-index: 2;
}
.backdrop-canvas.compact .backdrop-footer { display: none; }

.backdrop-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.44rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.85);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, transform 90ms ease;
}
.backdrop-caption:hover { background: #ffffff; transform: translateY(-1px); }

.backdrop-shuffle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.85);
  color: var(--ink);
  cursor: pointer;
  transition: background 140ms ease, transform 90ms ease;
}
.backdrop-shuffle:hover { background: #ffffff; transform: rotate(24deg); }

.results-container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem;
}

/* ── Buttons (D-002 & D-004) ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.08rem;
  border-radius: 11px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--pastel-neutral-border);
  background: var(--pastel-neutral);
  color: var(--pastel-neutral-ink);
  transition: background 140ms ease, border-color 140ms ease, transform 90ms ease;
  text-decoration: none;
}
.btn:hover { background: var(--pastel-neutral-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.btn:disabled { opacity: 0.52; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--pastel-blue);
  border-color: var(--pastel-blue-border);
  color: var(--pastel-blue-ink);
}
.btn-primary:hover { background: var(--pastel-blue-hover); }

.btn-warm {
  background: var(--pastel-warm);
  border-color: var(--pastel-warm-border);
  color: var(--pastel-warm-ink);
}
.btn-warm:hover { background: var(--pastel-warm-hover); }

.btn-mint {
  background: var(--pastel-mint);
  border-color: var(--pastel-mint-border);
  color: var(--pastel-mint-ink);
}
.btn-mint:hover { background: var(--pastel-mint-hover); }

.btn-sm { padding: 0.4rem 0.78rem; font-size: 0.84rem; border-radius: 9px; }

.pill-group { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  border: 1px solid var(--pastel-neutral-border);
  background: var(--pastel-neutral);
  color: var(--pastel-neutral-ink);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.pill-btn:hover { background: var(--pastel-neutral-hover); }
.pill-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.pill-btn.selected {
  background: var(--pastel-warm);
  border-color: var(--pastel-warm-border);
  color: var(--pastel-warm-ink);
}

/* ── Main container ─────────────────────────────────────────── */
.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ── Home Search Hero ───────────────────────────────────────── */
.hero-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}
.hero-shell.compact {
  max-width: 1020px;
  margin: 0 auto;
  text-align: left;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--hairline);
}
.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.9rem 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 1.15rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.hero-shell.compact .hero-intro { display: none; }

/* Luminous translucent homepage search bar with generous vertical breathing room */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.92rem 0.9rem 0.92rem 1.4rem;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  box-shadow: 0 18px 46px -18px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.hero-shell.compact .search-bar-wrap {
  padding: 0.55rem 0.6rem 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(203, 213, 225, 0.95);
  border-radius: 16px;
  box-shadow: none;
}
.search-bar-wrap:focus-within {
  background: rgba(255, 255, 255, 0.9);
  border-color: #60a5fa;
  box-shadow: 0 20px 48px -16px rgba(30, 58, 138, 0.24), 0 0 0 3px #dbeafe;
}
.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--ink);
  padding: 0.45rem 0.2rem;
}
.hero-shell.compact .search-input { font-size: 1rem; padding: 0.4rem 0.2rem; }
.search-input::placeholder { color: #334155; }

.search-bar-wrap .btn-primary {
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font-size: 0.92rem;
}
.hero-shell.compact .search-bar-wrap .btn-primary {
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}
.hero-shell.compact .next-topic-btn { display: none; }
.next-topic-btn {
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Subtle inline Window selector inside search bar */
.window-picker {
  position: relative;
  flex-shrink: 0;
}
.window-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.window-trigger:hover { background: var(--pastel-neutral); color: var(--ink); }
.window-trigger:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.window-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 120px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.3rem;
  box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.18);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.window-opt {
  text-align: left;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}
.window-opt:hover { background: var(--pastel-neutral); }
.window-opt.selected {
  background: var(--pastel-warm);
  color: var(--pastel-warm-ink);
  font-weight: 700;
}

.src-favicon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
  /* Uniform Tesseract inner-cube blue (#2563eb) tint */
  filter: grayscale(100%) sepia(100%) hue-rotate(196deg) saturate(420%) brightness(0.76) contrast(1.15);
  opacity: 0.9;
  transition: opacity 120ms ease;
}
.src-favicon-sm {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
  filter: grayscale(100%) sepia(100%) hue-rotate(196deg) saturate(420%) brightness(0.76) contrast(1.15);
  opacity: 0.92;
  transition: opacity 120ms ease;
}
.voice-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.voice-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--hairline);
  background: var(--pastel-blue);
}
.voice-avatar-mono {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--pastel-blue);
  color: var(--pastel-blue-ink);
  border: 1px solid var(--pastel-blue-border);
}
.voice-plat-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  object-fit: contain;
}
.lb-row-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid var(--hairline);
}
.lb-row-wrap .lb-row {
  border-bottom: none;
  flex: 1;
}
.lb-ext-link {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 0.24rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}
.lb-ext-link:hover {
  background: var(--pastel-blue);
  color: var(--pastel-blue-ink);
  border-color: var(--pastel-blue-border);
  text-decoration: none;
}
.icon-circle-btn {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.source-chip:hover .src-favicon,
.rail-source-item:hover .src-favicon,
.rail-filter-pill:hover .src-favicon-sm,
.rail-filter-pill.selected .src-favicon-sm,
.pulse-pill:hover .src-favicon-sm {
  opacity: 1;
}

/* Logged-in visual style picker inside avatar dropdown */
.theme-section {
  padding: 0.4rem 0.55rem 0.5rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 0.2rem;
}
.theme-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  display: block;
  margin-bottom: 0.35rem;
}
.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}
.theme-opt {
  padding: 0.36rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface-tint);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}
.theme-opt:hover { background: var(--pastel-neutral-hover); }
.theme-opt.selected {
  background: var(--pastel-blue);
  border-color: var(--pastel-blue-border);
  color: var(--pastel-blue-ink);
}

/* Espresso & Clean-White homepage modes */
.backdrop-canvas.theme-espresso,
.backdrop-canvas.theme-clean {
  background-image: none !important;
  background-color: #ffffff;
}
.backdrop-canvas.theme-espresso::before,
.backdrop-canvas.theme-clean::before { display: none; }
.espresso-home-art {
  width: 220px;
  height: 180px;
  object-fit: contain;
  margin: 0 auto 1.5rem;
  display: block;
}
.backdrop-canvas.compact .espresso-home-art { display: none !important; }

.controls-bar {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.hero-shell:not(.compact) .controls-bar { display: none; }

/* Explore strip under home hero */
.explore-section {
  max-width: 820px;
  margin: 2.75rem auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.explore-tile {
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-tint);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 140ms ease, border-color 140ms ease, transform 90ms ease;
}
.explore-tile:hover {
  background: var(--pastel-blue);
  border-color: var(--pastel-blue-border);
  transform: translateY(-1px);
}
.explore-tile-title { font-weight: 600; font-size: 0.96rem; display: block; color: var(--ink); }
.explore-tile-meta { font-size: 0.8rem; color: var(--ink-secondary); margin-top: 0.25rem; display: block; }

/* ── Editorial Results Surface ──────────────────────────────── */
.status-banner {
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.94rem;
}

/* ── Full-Width Editorial Header + 72/28 Editorial Peek Carousel + Balanced Two-Column Deep Dive ── */
.results-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
}

.editorial-page-stack {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.peek-hero-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 1.05rem 1.15rem 1rem;
}

.peek-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 0.55rem;
  align-items: stretch;
}
.peek-track:has(.peek-next-stage.hidden) {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 900px) {
  .peek-track { grid-template-columns: minmax(0, 1fr); }
  .peek-next-stage { display: none !important; }
}

.peek-main-wrap {
  position: relative;
  min-width: 0;
}

.peek-main-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 540px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}
.peek-main-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.peek-edge-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0 2px 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.peek-edge-prev { left: 12px; }
.peek-edge-next { right: 12px; }
.peek-edge-btn:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}
.peek-edge-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.peek-next-stage {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  cursor: pointer;
  padding: 0;
  text-align: left;
  display: block;
  transition: transform 160ms ease, border-color 160ms ease;
}
.peek-next-stage:hover {
  border-color: var(--pastel-blue-border);
  transform: translateX(-2px);
}
.peek-next-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
  opacity: 0.84;
  transition: opacity 160ms ease, transform 240ms ease;
}
.peek-next-stage:hover img {
  opacity: 1;
  transform: scale(1.03);
}
.peek-next-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.48) 100%);
  pointer-events: none;
}

.peek-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
}

.editorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(340px, 0.82fr);
  gap: 2.5rem;
  align-items: start;
}
.editorial-layout.no-rail {
  grid-template-columns: minmax(0, 740px);
}
@media (max-width: 980px) {
  .editorial-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }
}

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

.editorial-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.story-feed-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}
.story-card-fig {
  margin: 0;
}
.story-card-img-wrap {
  min-height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.story-card-img-wrap svg {
  max-width: 100%;
  max-height: 320px;
  padding: 0.75rem;
  display: block;
}
.story-card-cap {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.36;
  color: var(--ink);
  margin-top: 0.6rem;
}

.article-header {
  margin-bottom: 1.5rem;
}
.brief-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0 0 0.85rem 0;
  color: var(--ink);
  text-wrap: balance;
}
.byline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.favicon-stack {
  display: inline-flex;
  align-items: center;
}
.favicon-stack-link {
  display: inline-flex;
  align-items: center;
  margin-left: -4px;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 140ms ease, z-index 0s;
  position: relative;
}
.favicon-stack-link:first-child { margin-left: 0; }
.favicon-stack-link:hover { transform: translateY(-1px) scale(1.08); z-index: 2; }
.favicon-stack img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ffffff;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px var(--hairline);
  margin-left: -4px;
  object-fit: contain;
  filter: grayscale(100%) sepia(100%) hue-rotate(196deg) saturate(420%) brightness(0.76) contrast(1.15);
  opacity: 0.92;
}
.favicon-stack-link img { margin-left: 0; }
.favicon-stack > img:first-child { margin-left: 0; }
.favicon-stack-link:hover img { opacity: 1; }

/* The ONE tinted lead callout on the reading spine: TL;DR */
.tldr-box {
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 2.25rem;
}
.tldr-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  max-width: 66ch;
}
.tldr-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.99rem;
  line-height: 1.56;
  color: #1e293b;
}
.tldr-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1e3a8a;
  margin-top: 0.58rem;
  flex-shrink: 0;
}
.tldr-lead {
  font-weight: 700;
  color: var(--ink);
}

/* Stacked editorial reading sections */
.digest-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.digest-sec {
  padding: 1.5rem 0;
  border-top: 1px solid var(--hairline);
}
.digest-sec:first-child { padding-top: 0; border-top: none; }
.digest-sec-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}
.digest-sec-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pastel-blue);
  color: var(--pastel-blue-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.digest-sec-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.32rem;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--ink);
}
.digest-sec-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  max-width: 66ch;
}
.digest-sec-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.96rem;
  line-height: 1.58;
  color: #334155;
}
.digest-sec-bullets li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #94a3b8;
  margin-top: 0.6rem;
  flex-shrink: 0;
}

/* Editorial pull quotes */
.quotes-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}
.quote-block {
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
}
.quote-text {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.48;
  color: var(--ink);
  margin: 0 0 0.55rem 0;
}
.quote-cite {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Right Rail Panels (consistent calm framing) */
.rail-card {
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1rem 1.05rem;
}
.rail-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lead-visual-canvas {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}
.lead-visual-canvas img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  object-fit: cover;
}
.lead-visual-canvas svg {
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  padding: 0.65rem;
  display: block;
}
.lead-visual-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.attention-svg { width: 100%; height: 48px; display: block; margin-top: 0.55rem; }

/* Compact Rail Source Feed */
.rail-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 0.7rem 0 0.55rem;
}
.rail-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-tint);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.rail-filter-pill:hover { background: var(--pastel-neutral-hover); color: var(--ink); }
.rail-filter-pill.selected {
  background: var(--pastel-blue);
  border-color: var(--pastel-blue-border);
  color: var(--pastel-blue-ink);
}

.rail-source-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.62rem 0;
  border-top: 1px solid var(--hairline);
}
.rail-source-item:first-child { border-top: none; }
.rail-source-body { min-width: 0; flex: 1; }
.rail-source-meta {
  font-size: 0.75rem;
  color: var(--ink-secondary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-source-link {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
}
.rail-source-link:hover { color: var(--ink-link); }

.history-details summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-details summary::-webkit-details-marker { display: none; }
.history-details[open] summary { margin-bottom: 0.5rem; }

/* Icon-only larger source badge (D-005: no redundant text beside recognizable favicons!) */
.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
a.source-chip:hover {
  border-color: var(--pastel-blue-border);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
  cursor: pointer;
}
.rail-source-fav-link {
  display: inline-flex;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 6px;
}

/* Clickable rabbit-hole inline links & section theme headings */
.topic-inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #60a5fa;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease, background 120ms ease;
  border-radius: 3px;
}
.topic-inline-link:hover {
  color: #1e3a8a;
  background: #dbeafe;
  text-decoration-style: solid;
  text-decoration-color: #1e3a8a;
}
.theme-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #93c5fd;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
.theme-link:hover {
  color: #1e3a8a;
  text-decoration-style: solid;
  text-decoration-color: #1e3a8a;
}

/* Live Progress Loader with Elapsed Timer */
.loader-header-card {
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.75rem;
}
.loader-progress-track {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 0.7rem 0 0.85rem;
}
.loader-progress-fill {
  height: 100%;
  width: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #1e3a8a);
  transition: width 350ms cubic-bezier(0.16, 1, 0.3, 1);
}
.loader-timer {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e3a8a;
  background: var(--pastel-blue);
  border: 1px solid var(--pastel-blue-border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.lang-select {
  width: 100%;
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Designed Shimmer Loading Skeleton */
.loading-shell { padding: 0.25rem 0 2rem; }
.loading-sources {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.65rem;
}
.pulse-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  animation: gentlePulse 1.5s ease-in-out infinite;
}
.pulse-pill:nth-child(2) { animation-delay: 140ms; }
.pulse-pill:nth-child(3) { animation-delay: 280ms; }
.pulse-pill:nth-child(4) { animation-delay: 420ms; }
.pulse-pill:nth-child(5) { animation-delay: 560ms; }
.pulse-pill:nth-child(6) { animation-delay: 700ms; }
.pulse-pill.done {
  animation: none;
  background: var(--pastel-mint);
  border-color: var(--pastel-mint-border);
}
.pulse-pill.done .src-favicon-sm { opacity: 1; }
@keyframes gentlePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.skel {
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.section-block {
  margin-bottom: 2.5rem;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

/* Visual stage (F13 Espresso) */
.visual-stage {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #ffffff;
  padding: 1.25rem 1.4rem;
}
.visual-canvas {
  margin-top: 1rem;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  border-radius: 10px;
  padding: 1.25rem;
}
.visual-canvas svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Editorial Themes grid (hairline separation, zero nested cards) */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem 2.25rem;
}
.theme-item {
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}
.theme-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}
.theme-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.theme-icon.momentum { background: var(--pastel-blue); color: var(--pastel-blue-ink); }
.theme-icon.build    { background: var(--pastel-mint); color: var(--pastel-mint-ink); }
.theme-icon.signal   { background: var(--pastel-warm); color: var(--pastel-warm-ink); }
.theme-icon.debate   { background: #fce7f3; color: #831843; }
.theme-icon.shift    { background: var(--pastel-lavender); color: var(--pastel-lavender-ink); }

.theme-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: var(--ink);
}
.theme-summary {
  margin: 0 0 0.55rem 0;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  max-width: 58ch;
}

/* Pull quotes */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}
.quote-block {
  margin: 0;
  padding: 1.05rem 1.15rem;
  border-radius: 12px;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
}
.quote-text {
  font-family: var(--font-display);
  font-size: 1.06rem;
  line-height: 1.48;
  color: var(--ink);
  margin: 0 0 0.65rem 0;
}
.quote-cite {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Creators strip */
.creators-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 0.75rem;
}
.creator-tile {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #ffffff;
}

/* Evidence stream */
.evidence-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hairline);
}
.evidence-item:last-child { border-bottom: none; }

/* Badges & chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 600;
  background: var(--pastel-neutral);
  color: var(--pastel-neutral-ink);
  border: 1px solid var(--hairline);
}
.badge-blue { background: var(--pastel-blue); color: var(--pastel-blue-ink); border-color: var(--pastel-blue-border); }
.badge-mint { background: var(--pastel-mint); color: var(--pastel-mint-ink); border-color: var(--pastel-mint-border); }
.badge-warm { background: var(--pastel-warm); color: var(--pastel-warm-ink); border-color: var(--pastel-warm-border); }

.surface-panel {
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.25rem;
}

.muted { color: var(--ink-secondary); font-size: 0.9rem; }
.row { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.hidden { display: none !important; }
.secret-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.secret-input-wrap > input {
  width: 100%;
  padding-right: 2.25rem;
}
.secret-reveal-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.14s ease, background 0.14s ease;
}
.secret-reveal-btn:hover,
.secret-reveal-btn:focus-visible {
  color: #334155;
  background: #f1f5f9;
}
.secret-reveal-btn[aria-pressed="true"] {
  color: #1e3a8a;
  background: #eff6ff;
}

pre, code {
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
code { padding: 0.12rem 0.38rem; }
pre { padding: 0.95rem 1.1rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--hairline); font-size: 0.9rem; }
th { color: var(--ink-secondary); font-weight: 600; background: var(--surface-tint); }

@media (max-width: 640px) {
  .topbar-inner { padding: 0.75rem 1rem; }
  .wrap { padding: 1.4rem 1rem 3.5rem; }
  .hero-shell { margin-top: 1.5rem; }
  .search-bar-wrap { padding: 0.4rem 0.45rem 0.4rem 0.8rem; }
}
