/* Public magazine layout. Mobile-first responsive design.
   Colors strictly from themes.css tokens:
   --bg, --surface, --ink, --muted, --line, --accent, --accent-ink, --alert, --alert-ink */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: var(--fs, 18px)/1.68 var(--body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; transition: color .18s ease; }
img { max-width: 100%; height: auto; display: block; filter: brightness(var(--img-dim, 1)); }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

/* Accessible skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--radius);
  font: 700 14px var(--ui);
  z-index: 500;
  box-shadow: var(--shadow);
}
.skip:focus { left: 16px; }

/* Focus styles */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Page containers */
main, .news, .footer-inner, .footer-bottom, .top-in, .chips-wrap {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left));
}
main {
  flex: 1;
  padding-block: 20px 24px;
}

/* Top Reading Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width .08s ease-out;
}

/* Breaking news bar */
.brk {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
  font: 600 13px var(--ui);
  padding: 8px max(16px, env(safe-area-inset-left));
  overflow: hidden;
  white-space: nowrap;
}
.brk b {
  background: var(--alert);
  color: var(--alert-ink);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.brk a {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bg);
}
.brk a:hover { text-decoration: underline; }
.brk .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--alert);
  flex: none;
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .brk .dot { animation: none; } }

/* Sticky Header & Masthead */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.mark {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font: 800 24px/1 var(--display);
  box-shadow: 0 4px 12px -2px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.brand:hover .mark { transform: scale(1.05); }
.brand-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-t b {
  font: 800 19px/1.15 var(--display);
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-t small {
  font: 600 11px var(--ui);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Header Right Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.nav-staff,
.nav-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 13px var(--ui);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
  line-height: normal;
  vertical-align: middle;
  transition: all .2s ease;
}
.nav-guide-btn {
  color: var(--ink);
}
.nav-staff:hover,
.nav-guide-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}
.nav-staff svg { flex: none; }

/* Unify theme switcher button inside top-actions to match exact nav button height and pill geometry */
.top-actions #theme-slot {
  display: inline-flex;
  align-items: center;
}
.top-actions #theme-slot .tp {
  display: inline-flex;
  align-items: center;
}
.top-actions #theme-slot .tp-btn {
  height: 38px;
  min-height: 38px;
  min-width: 42px;
  padding: 0 12px;
  font: 700 15px Georgia, serif;
  border-radius: 999px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .brand { gap: 8px; min-width: 0; }
  .mark { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; flex-shrink: 0; }
  .brand-t { min-width: 0; }
  .brand-t b { font-size: clamp(15px, 3.5vw, 18px); }
  .brand-t small { display: none; }
  .top-actions { gap: 6px; flex-shrink: 0; }
  .nav-staff span,
  .nav-guide-btn span { display: none; }
  .nav-staff,
  .nav-guide-btn {
    padding: 0 10px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    justify-content: center;
    flex-shrink: 0;
  }
}
@media (max-width: 600px) {
  .nav-staff-secondary { display: none !important; }
}

/* Category Chips Bar */
.chips-wrap {
  position: relative;
  overflow: hidden;
}
.chips-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 8px 12px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  font: 600 13.5px var(--ui);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.chip.active, .chip[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Kickers & Section Headers */
.k {
  font: 700 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  display: inline-block;
}
.sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 38px 0 16px;
}
.sec-h h2 {
  font: 800 22px/1.2 var(--display);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-h h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
}
.sec-h a.view-all {
  font: 600 13.5px var(--ui);
  color: var(--accent);
  text-underline-offset: 3px;
}
.sec-h a.view-all:hover { text-decoration: underline; }

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.btn {
  font: 700 15px/1 var(--ui);
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 24px;
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  text-decoration: none;
  box-sizing: border-box;
  vertical-align: middle;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

/* ================= Hero Cover Story ================= */
.hero {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-img {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}
.hero-img img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top;
  transition: transform .4s ease;
}
.hero:hover .hero-img img { transform: scale(1.03); }
.hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 6px;
}
.hero-body h2 {
  font: 800 clamp(1.8rem, 6.5vw, 3rem)/1.08 var(--display);
  letter-spacing: -.03em;
  margin: 10px 0 12px;
}
.hero-body h2 a:hover { color: var(--accent); }
.dek {
  font: 400 clamp(1.05rem, 2.5vw, 1.25rem)/1.55 var(--body);
  color: var(--muted);
  margin: 0 0 20px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 14px var(--ui);
  color: var(--muted);
  margin-bottom: 20px;
}
@media (min-width: 840px) {
  .hero {
    grid-template-columns: 5.5fr 6.5fr;
    gap: 36px;
    padding: 24px;
    align-items: center;
  }
  .hero-img img { aspect-ratio: 5/4.5; }
}

/* ================= Empty / Launch Manifesto State ================= */
.welcome-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 5vw, 44px);
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.welcome-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 999px;
  font: 700 11.5px var(--ui);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .welcome-badge {
    font-size: 10px;
    padding: 5px 12px;
    letter-spacing: .04em;
  }
}
.welcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s infinite ease-in-out;
}
.welcome-card h2 {
  font: 800 clamp(1.9rem, 6vw, 3.1rem)/1.1 var(--display);
  letter-spacing: -.025em;
  max-width: 22ch;
  margin: 0 auto 16px;
}
.welcome-lead {
  font: 400 clamp(1.05rem, 2.5vw, 1.25rem)/1.65 var(--body);
  color: var(--muted);
  max-width: 58ch;
  margin: 0 auto 24px;
}
.welcome-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* Dedicated Category / Section Empty State */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(32px, 5vw, 48px) 24px;
  margin: 20px 0 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.empty-state-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}
.empty-state h3 {
  font: 700 1.35rem var(--display);
  color: var(--ink);
  margin: 0;
}
.empty-state p {
  font: 15px/1.6 var(--ui);
  color: var(--muted);
  max-width: 48ch;
  margin: 0;
}
.empty-state .btn {
  margin-top: 8px;
}
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.welcome-col {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.welcome-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.welcome-col-header span.icon {
  font: 700 16px var(--display);
  color: var(--accent);
  line-height: 1;
  display: inline-flex;
  flex-shrink: 0;
}
.welcome-col-header h4 {
  font: 700 15.5px var(--ui);
  margin: 0;
  color: var(--ink);
}
.welcome-col p {
  font: 14px/1.5 var(--ui);
  color: var(--muted);
  margin: 0;
}
@media (min-width: 768px) {
  .welcome-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* ================= Issue Shelf ================= */
.shelf {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 18px;
  margin-inline: -16px;
  padding-inline: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shelf::-webkit-scrollbar { display: none; }
.cover {
  flex: 0 0 min(68%, 230px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .2s ease;
}
.cover:hover { transform: translateY(-3px); }
.cover .img {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  border: 1px solid var(--line);
}
.cover .img img {
  width: 100%;
  aspect-ratio: 5/6;
  object-fit: cover;
  object-position: top;
  transition: transform .4s ease;
}
.cover:hover .img img { transform: scale(1.04); }
.cover em {
  position: absolute;
  left: 10px;
  top: 10px;
  right: 10px;
  width: fit-content;
  max-width: calc(100% - 20px);
  font: 700 11px var(--ui);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover b {
  font: 700 16px/1.25 var(--display);
}
.cover small {
  font: 600 12.5px var(--ui);
  color: var(--muted);
}
@media (min-width: 820px) {
  .shelf { margin-inline: 0; padding-inline: 2px; }
  .cover { flex-basis: 220px; }
}

/* ================= Stories List & Columns ================= */
.cols {
  display: grid;
  gap: 24px;
}
@media (min-width: 920px) {
  .cols {
    grid-template-columns: 1fr 340px;
    gap: 48px;
  }
}
.grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 680px) and (max-width: 919px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Story Card */
.srow {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.srow-thumb {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.srow-thumb img, .srow .ph {
  width: 96px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top;
  transition: transform .3s ease;
}
.srow-thumb:hover img { transform: scale(1.05); }
.srow .ph {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
}
.srow-body { min-width: 0; }
.srow-cat {
  font: 700 11px var(--ui);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}
.srow h3 {
  font: 700 18px/1.25 var(--display);
  letter-spacing: -.015em;
  margin-bottom: 6px;
}
.srow h3 a:hover { color: var(--accent); }
.srow p {
  margin: 0 0 6px;
  color: var(--muted);
  font: 14px/1.45 var(--ui);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.srow-meta {
  font: 600 12px var(--ui);
  color: var(--muted);
}
@media (min-width: 540px) {
  .srow {
    grid-template-columns: 110px 1fr;
    gap: 18px;
  }
  .srow-thumb img, .srow .ph { width: 110px; }
}
@media (max-width: 420px) {
  .srow {
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 12px 0;
  }
  .srow-thumb img, .srow .ph { width: 80px; }
  .srow h3 { font-size: 16px; line-height: 1.25; margin-bottom: 4px; }
  .srow p { font-size: 13px; line-height: 1.4; }
}

/* Trending List in Sidebar */
.trend {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: t;
}
.trend li {
  counter-increment: t;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.trend li::before {
  content: counter(t, decimal-leading-zero);
  font: 800 24px/1 var(--display);
  color: var(--accent);
}
.trend a {
  font: 700 16px/1.35 var(--display);
  letter-spacing: -.01em;
}
.trend a:hover { color: var(--accent); }

/* Sidebar Callout Card */
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-top: 24px;
}
.sidebar-box h4 {
  font: 800 17px var(--display);
  margin-bottom: 8px;
}
.sidebar-box p {
  font: 14px/1.55 var(--ui);
  color: var(--muted);
  margin-bottom: 14px;
}

/* ================= Newsletter Band ================= */
.news {
  display: grid;
  gap: 20px;
  margin-block: 44px 16px;
  padding: clamp(24px, 5vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.news h2 {
  font: 800 clamp(1.6rem, 5vw, 2.2rem) var(--display);
  letter-spacing: -.025em;
  margin-bottom: 8px;
}
.news p {
  margin: 0;
  color: var(--muted);
  font: 15px/1.55 var(--ui);
}
.subscribe {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.subscribe input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font: 15px var(--ui);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 20px;
  min-height: 48px;
}
.subscribe input::placeholder { color: var(--muted); }
@media (max-width: 540px) {
  .news { padding: 22px 16px; margin-block: 28px 16px; gap: 16px; }
  .subscribe { flex-direction: column; width: 100%; }
  .subscribe input { width: 100%; flex: 1 1 auto; min-height: 48px; }
  .subscribe .btn { width: 100%; min-height: 48px; }
}
@media (min-width: 820px) {
  .news {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

/* ================= Footer ================= */
footer {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-block: 40px max(30px, env(safe-area-inset-bottom));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1.8fr 1fr 1fr 1.1fr;
    gap: 36px;
  }
}
.footer-bio p {
  color: var(--muted);
  font: 14px/1.6 var(--ui);
  max-width: 44ch;
  margin-top: 12px;
}
.footer-col h5 {
  font: 700 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink);
  margin-bottom: 14px;
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font: 600 14px var(--ui);
  color: var(--muted);
}
.footer-nav a:hover { color: var(--accent); }
.staff-link {
  color: var(--accent) !important;
  font-weight: 700;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font: 13px var(--ui);
  color: var(--muted);
}

/* ================= Sponsors & Ads ================= */
.ad {
  width: calc(100% - 32px);
  max-width: 1088px;
  margin: 18px auto;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  font: 14px var(--ui);
  box-sizing: border-box;
}
.ad a {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow-wrap: break-word;
  word-break: break-word;
}
.ad small {
  display: block;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ad strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: break-word;
}
.ad p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: break-word;
}
.ad a:hover strong { color: var(--accent); }
.ad-in_article { max-width: 100%; margin-block: 28px; width: 100%; }
.ad img {
  border-radius: 12px;
  margin-bottom: 10px;
  max-height: 180px;
  object-fit: cover;
  width: 100%;
}
.sponsored {
  font: 700 11px var(--ui);
  background: var(--alert);
  color: var(--alert-ink);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  vertical-align: middle;
}

/* ================= Article Reader ================= */
.story {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 10px;
}
.story-hero {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.story h1, .story h2.title {
  font: 800 clamp(2.1rem, 7vw, 3.4rem)/1.08 var(--display);
  letter-spacing: -.03em;
  margin: 12px 0 16px;
}
.byline {
  display: flex;
  gap: 14px;
  align-items: center;
  font: 14px/1.4 var(--ui);
  color: var(--muted);
  margin: 18px 0 28px;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}
.byline b { color: var(--ink); font-size: 15px; }
.byline a:hover b { color: var(--accent); }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-grid;
  place-items: center;
  font: 700 18px var(--ui);
  object-fit: cover;
  flex: none;
}
.avatar.lg {
  width: 88px;
  height: 88px;
  font-size: 30px;
}
.read-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 12px var(--ui);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

.read-aloud-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 12px var(--ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 6px;
  cursor: pointer;
  transition: all .2s ease;
  vertical-align: middle;
}
.read-aloud-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.read-aloud-pill-btn.is-playing {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.read-aloud-pill-btn.is-loading,
.speech-ctrl-btn.is-loading {
  opacity: 0.85;
  cursor: wait !important;
  pointer-events: none;
}
.read-aloud-pill-btn.is-loading .speech-spin-icon,
.speech-ctrl-btn.is-loading .speech-spin-icon {
  display: inline-block;
  animation: speechSpin 0.9s linear infinite;
}
@keyframes speechSpin {
  100% { transform: rotate(360deg); }
}
.read-aloud-pill-btn svg {
  flex-shrink: 0;
}

/* Floating Audio Player Dock */
.speech-player-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 6px 14px 6px 16px;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all .24s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.speech-player-dock.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.speech-player-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.speech-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.speech-wave-icon {
  font-size: 16px;
  animation: speechPulse 1.8s infinite ease-in-out;
}
@keyframes speechPulse {
  50% { transform: scale(1.15); opacity: .7; }
}
.speech-text-wrap {
  display: flex;
  flex-direction: column;
}
.speech-title {
  font: 700 12px var(--ui);
  color: var(--ink);
  line-height: 1.2;
}
.speech-status-text {
  font: 500 11px var(--ui);
  color: var(--muted);
  line-height: 1.2;
}
.speech-player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.speech-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 700 12px var(--ui);
  padding: 5px 12px;
  min-height: 32px;
  cursor: pointer;
  transition: all .15s ease;
}
.speech-ctrl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.speech-btn-play {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.speech-btn-play:hover {
  filter: brightness(1.08);
  color: var(--accent-ink);
}
.speech-btn-stop,
.speech-btn-nav {
  padding: 0;
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* Active reading paragraph highlight */
.speech-active-paragraph {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  transition: border-color .2s ease, padding .2s ease;
}

@media (max-width: 600px) {
  .speech-player-dock {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    border-radius: 16px;
    padding: 8px 12px;
  }
  .speech-player-inner {
    justify-content: space-between;
  }
  .speech-btn-label {
    display: none;
  }
}

.story .body {
  font: var(--fs, 18px)/1.85 var(--body);
}
.story .body p { margin: 0 0 1.3em; }
.story .body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.story .body h2, .story .body h3 {
  font-family: var(--display);
  margin: 1.8em 0 .6em;
  letter-spacing: -.02em;
}
.story .body h2 { font-size: 1.65em; }
.story .body h3 { font-size: 1.3em; }
.story .body blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.story .body figure { margin: 1.8em 0; }
.story .body figcaption {
  font: 13px var(--ui);
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}
.story .body img {
  border-radius: 16px;
  border: 1px solid var(--line);
}
.pull-quote {
  font: italic 700 1.45em/1.35 var(--display);
  border-left: 5px solid var(--accent);
  padding-left: 20px;
  margin: 1.8em 0;
  letter-spacing: -.01em;
}
.img-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  margin: 1.8em 0;
}
.img-grid img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
  .img-grid {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pull-quote {
    font-size: 1.25em;
    padding-left: 14px;
    margin: 1.4em 0;
  }
  .story .body blockquote {
    padding-left: 14px;
    margin: 1.3em 0;
  }
}

/* Rich-text: lists, figures, callouts, video embeds */
.story .body ol, .story .body ul {
  padding-left: 1.6em;
  margin: 0 0 1.3em;
}
.story .body ol { list-style-type: decimal; }
.story .body ul { list-style-type: disc; }
.story .body li { margin-bottom: 0.35em; }
.story .body li::marker { color: var(--accent); font-weight: 600; }

figure.article-figure {
  margin: 1.8em 0;
  text-align: center;
}
figure.article-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
}
figure.article-figure figcaption {
  font: 13px/1.4 var(--ui);
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

.callout {
  margin: 1.8em 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  font: 15px/1.65 var(--ui);
  color: var(--ink);
}
.callout-title {
  font: 700 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
  color: var(--accent);
}
.callout-info { border-left-color: var(--accent); }
.callout-note { border-left-color: var(--ink); }
.callout-warning { border-left-color: #d97706; }
.callout-tip { border-left-color: #059669; }
.callout-editorial { border-left-color: #7c3aed; }
.callout p:last-child { margin-bottom: 0; }

.video-embed {
  margin: 1.8em 0;
  width: 100%;
}
.video-embed-aspect {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.video-embed-aspect iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-embed figcaption {
  font: 13px var(--ui);
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}
.story .body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1.6em 0;
}
pre, code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .88em;
}
code { padding: 2px 6px; }
pre { padding: 16px; overflow: auto; -webkit-overflow-scrolling: touch; }
pre code { border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* Issue / Author / Column pages */
.issue-head {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.issue-head img {
  width: min(280px, 75%);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.issue-head h2 {
  font: 800 clamp(1.9rem, 7vw, 3rem) var(--display);
  letter-spacing: -.025em;
}
.foreword {
  color: var(--muted);
  font: italic 1.1em/1.6 var(--body);
  max-width: 64ch;
  margin: 8px 0 0;
}
@media (min-width: 760px) {
  .issue-head {
    grid-template-columns: 260px 1fr;
    column-gap: 40px;
    align-items: start;
  }
  .issue-head img { grid-row: 1 / span 4; width: 100%; }
}
.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: t;
}
.toc li {
  counter-increment: t;
  padding: 16px 0 16px 52px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.toc li::before {
  content: counter(t, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 16px;
  font: 800 22px var(--display);
  color: var(--accent);
}
.toc a { font: 700 18px var(--display); }
.toc a:hover { color: var(--accent); }
.toc span { display: block; color: var(--muted); font: 14px var(--ui); margin-top: 4px; }

.prof {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.prof h2 { font: 800 2.2rem var(--display); }

/* Onboarding Tour Modal & Stepper */
.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2147483010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tourFadeIn .2s ease;
}
@keyframes tourFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.tour-modal {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 100%;
  max-width: min(540px, calc(100vw - 32px));
  max-height: min(88dvh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  animation: tourSlideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tourSlideUp {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.tour-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 12px/1.2 var(--ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: calc(100% - 56px);
  box-sizing: border-box;
}
.tour-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1;
  transition: all .15s;
  box-sizing: border-box;
  flex-shrink: 0;
}
.tour-close:hover {
  color: var(--ink);
  background: var(--surface);
}
.tour-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.tour-title {
  font: 800 1.45rem var(--display);
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: var(--ink);
  overflow-wrap: break-word;
}
.tour-desc {
  font: 15px/1.6 var(--ui);
  color: var(--muted);
  margin: 0 0 14px;
  overflow-wrap: break-word;
}
.tour-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.tour-box-item {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
}
.tour-box-item b {
  color: var(--ink);
  font-weight: 600;
}
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  transition: all .2s ease;
}
.tour-dot.active {
  background: var(--accent);
  width: 22px;
}
.tour-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tour-btn {
  font: 600 13px/1 var(--ui);
  padding: 0 18px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  vertical-align: middle;
}
.tour-btn:hover {
  border-color: var(--accent);
}
.tour-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-weight: 700;
}
.tour-btn-primary:hover {
  opacity: .92;
}
@media (max-width: 500px) {
  .tour-modal { padding: 18px 16px; border-radius: 16px; max-height: calc(100dvh - 24px); }
  .tour-header { margin-bottom: 12px; }
  .tour-badge { font-size: 11px; padding: 6px 12px; }
  .tour-icon { width: 40px; height: 40px; font-size: 20px; margin-bottom: 10px; }
  .tour-title { font-size: 1.3rem; margin-bottom: 8px; }
  .tour-desc { font-size: 13.5px; line-height: 1.5; margin-bottom: 10px; }
  .tour-box { padding: 10px 12px; margin: 10px 0; gap: 8px; }
  .tour-box-item { font-size: 12.5px; line-height: 1.45; }
  .tour-footer { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 14px; }
  .tour-actions { justify-content: flex-end; }
}

/* ================= Cover-First Issue Reader ================= */
body.reader-mode {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
}

.reader-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-sizing: border-box;
}

.reader-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  transition: width 0.15s ease-out;
  pointer-events: none;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.hud-back {
  font: 600 13px var(--ui);
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background-color .15s;
}
.hud-back:hover {
  color: var(--ink);
  background: var(--bg);
}
.hud-back-arrow { font-size: 15px; font-weight: 700; }

.hud-center {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  justify-content: center;
  padding: 0 12px;
}

.hud-toc-pill {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  height: 32px;
  min-height: 32px;
  font: 600 12px var(--ui);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color .15s, color .15s;
}
.hud-toc-pill:hover { border-color: var(--accent); color: var(--accent); }
.hud-toc-badge {
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.hud-story-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.hud-counter {
  font: 700 11px var(--ui);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-title {
  font: 600 13px var(--ui);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hud-pill-btn {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  height: 32px;
  min-height: 32px;
  font: 600 12px var(--ui);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  transition: border-color .15s, color .15s;
}
.hud-pill-btn:hover { border-color: var(--accent); color: var(--accent); }

.hud-icon-btn {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  font: 600 14px var(--ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  transition: border-color .15s, color .15s;
}
.hud-icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Theme switcher sizing scoped inside reader HUD */
.reader-hud #theme-slot {
  display: inline-flex;
  align-items: center;
}
.reader-hud #theme-slot .tp {
  display: inline-flex;
  align-items: center;
}
.reader-hud #theme-slot .tp-btn {
  height: 32px;
  min-height: 32px;
  min-width: 34px;
  padding: 0 8px;
  font: 700 13px Georgia, serif;
  border-radius: 8px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-nav-cluster {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-nav-btn {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  font: 700 18px var(--ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  transition: border-color .15s, color .15s;
}
.hud-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hud-nav-btn:disabled { opacity: 0.35; cursor: default; }

/* Viewport and Layout Modes */
.reader-viewport {
  margin-top: 56px;
  outline: none;
  box-sizing: border-box;
  max-width: 100vw !important;
  width: 100vw !important;
  padding: 0 !important;
  margin-inline: 0 !important;
}

/* Flip / Carousel Layout */
.reader-viewport.layout-flip {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  width: 100vw;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.reader-viewport.layout-flip .reader-slide {
  flex: 0 0 100vw;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 32px 20px 100px;
}

/* Continuous Scroll Layout */
.reader-viewport.layout-continuous {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  width: 100vw;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: none;
  scroll-behavior: smooth;
  padding: 20px 0 80px;
}

.reader-viewport.layout-continuous .reader-slide {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  height: auto;
  min-height: auto;
  overflow: visible;
  padding: 40px 20px 64px;
  border-bottom: 2px dashed var(--line);
}
.reader-viewport.layout-continuous .reader-slide:last-child {
  border-bottom: none;
}
.reader-viewport.layout-continuous .story-slide-nav-bar {
  margin-top: 36px;
}

/* Cover Slide */
/* Cover Slide */
.cover-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  box-sizing: border-box;
  padding-bottom: 90px !important;
}

.cover-card {
  max-width: 900px;
  width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 36px;
  align-items: center;
  text-align: left;
  padding: 16px 0;
  box-sizing: border-box;
}

.cover-media {
  max-width: 340px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-full-img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  display: block;
}

.cover-text-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-badge-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.cover-edition-tag {
  font: 700 11px var(--ui);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.cover-runtime-tag {
  font: 600 12px var(--ui);
  color: var(--muted);
}

.cover-main-title {
  font: 800 clamp(2.2rem, 5vw, 3.2rem) var(--display);
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.08;
}

.cover-foreword-quote {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 4px 0 12px;
  max-width: 520px;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  text-align: left;
}

.cover-cta-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.cover-start-btn {
  min-height: 46px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 700;
}

.cover-toc-overview {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  width: 100%;
}
.cover-toc-label {
  font: 600 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.cover-toc-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.cover-toc-pills button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font: 500 12px var(--ui);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cover-toc-pills button:hover { border-color: var(--accent); color: var(--accent); }

/* Floating Reader Bottom Bar */
.reader-bottom-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  z-index: 100;
  transition: opacity 0.2s, transform 0.2s;
}
.bottom-bar-btn {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font: 600 12px var(--ui);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.bottom-bar-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.bottom-bar-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.bottom-bar-status {
  font: 600 12px var(--ui);
  color: var(--muted);
  white-space: nowrap;
  padding: 0 4px;
  min-width: 90px;
  text-align: center;
}

/* Story Slide */
.story-slide-measure {
  max-width: 720px;
  margin: 0 auto;
}

.story-slide-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.story-slide-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-canonical {
  font: 500 12px var(--ui);
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.reader-canonical:hover { color: var(--ink); border-color: var(--ink); }

.story-slide-title {
  font: 800 clamp(2rem, 5vw, 2.9rem) var(--display);
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 0 0 12px;
}

.story-slide-dek {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 18px;
}

.story-hero-wrapper {
  margin: 24px 0 32px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.story-hero-wrapper .story-hero {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

/* Classical Editorial Drop Cap */
.reader-mode .story-reader-body > p:first-of-type::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 0.82;
  margin: 0.08em 0.12em 0 0;
  font-family: var(--display);
  font-weight: 800;
  color: var(--accent);
}

.story-slide-nav-bar {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-slide-turners {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.story-turner-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start;
  padding: 12px 16px !important;
  text-align: left;
  height: auto !important;
  min-height: 56px !important;
  justify-content: center;
  border-radius: 8px;
  line-height: normal !important;
}
.story-turner-btn:last-child {
  align-items: flex-end;
  text-align: right;
}
.story-turner-btn .turner-dir {
  font: 700 11px var(--ui);
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .8;
  display: block;
  flex-shrink: 0;
  line-height: 1.2;
}
.story-turner-btn .turner-title {
  font: 600 13px/1.4 var(--ui);
  white-space: normal;
  margin-top: 4px;
  overflow: visible;
  max-width: 100%;
  height: auto !important;
  word-break: break-word;
  flex-shrink: 0;
}

.story-top-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: 600 12px var(--ui);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.story-top-btn:hover { color: var(--ink); border-color: var(--ink); }

.story-canonical-permalink {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 12px var(--ui);
  color: var(--muted);
  word-break: break-all;
}
.story-canonical-permalink a { color: var(--accent); }

/* Outro Slide */
.outro-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}
.outro-card {
  max-width: 560px;
  text-align: center;
  margin: 0 auto;
  padding: 40px 20px;
}
.outro-mark {
  width: 54px;
  height: 54px;
  font-size: 26px;
  margin: 0 auto 18px;
  border-radius: 14px;
}
.outro-heading {
  font: 800 clamp(1.8rem, 4.5vw, 2.5rem) var(--display);
  margin-bottom: 10px;
}
.outro-sub {
  font-size: 1.05rem;
  line-height: 1.6;
}
.outro-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.outro-dispatch-box {
  margin-top: 32px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}
.outro-dispatch-box b {
  font-size: 15px;
  color: var(--ink);
}
.outro-dispatch-box p {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 12px;
}

/* TOC Drawer Modal */
.reader-toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 110;
}
.reader-toc-backdrop[hidden] { display: none; }

.reader-toc-drawer {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 120;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.reader-toc-drawer[hidden] { display: none; }

.reader-toc-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reader-toc-title-group b {
  display: block;
  font: 700 16px var(--ui);
  color: var(--ink);
}
.reader-toc-sub {
  font: 500 12px var(--ui);
  color: var(--muted);
}
.reader-toc-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  transition: color .15s;
}
.reader-toc-close:hover { color: var(--ink); }

.reader-toc-list {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.toc-jump-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font: var(--ui);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.toc-jump-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.toc-jump-item.is-active {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.toc-jump-num {
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
  min-width: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toc-jump-item.is-active .toc-jump-num {
  color: var(--accent);
  border-color: var(--accent);
}
.toc-jump-info {
  flex: 1;
  min-width: 0;
}
.toc-jump-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.toc-jump-cat {
  font: 700 10px var(--ui);
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: .05em;
}
.toc-jump-time {
  font: 500 11px var(--ui);
  color: var(--muted);
}
.toc-jump-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--ink);
}
.toc-jump-dek {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.toc-jump-author {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  display: block;
}

.reader-toc-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.reader-keyboard-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 500 11px var(--ui);
  color: var(--muted);
  flex-wrap: wrap;
}
.reader-keyboard-hints kbd {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: inherit;
  font-size: 10px;
}

@media (max-width: 768px) {
  .hud-story-context { display: none; }
  .hud-back-title { display: none; }
  .cover-card {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .cover-media {
    max-width: 260px;
    margin: 0 auto;
  }
  .cover-badge-row, .cover-cta-wrap, .cover-toc-pills {
    justify-content: center;
  }
  .cover-foreword-quote {
    text-align: left;
    margin: 0 auto 12px;
  }
  .reader-bottom-bar {
    width: calc(100vw - 32px);
    justify-content: space-between;
    padding: 6px 10px;
    bottom: 12px;
  }
  .bottom-bar-status {
    min-width: auto;
    font-size: 11px;
  }
  .story-slide-turners {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .story-turner-btn { align-items: flex-start !important; text-align: left !important; }
}

/* ================= Search, Tags & Related Stories (P2-07) ================= */
.search-head {
  padding: 36px 0 24px;
  max-width: 680px;
}
.search-box-wrap {
  display: flex;
  gap: 10px;
  margin: 20px 0 14px;
}
.search-box-wrap input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s ease;
}
.search-box-wrap input[type="search"]:focus {
  border-color: var(--accent);
}
.search-box-wrap .btn {
  padding: 0 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-topic-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.search-results {
  margin-top: 24px;
}
.article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.related-section {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}


/* ================= Social Share Bar, Currency Switcher & Google Translate Overrides ================= */
body { top: 0 !important; }
.skiptranslate iframe, .goog-te-banner-frame, #goog-gt-tt { display: none !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }

/* Prevent Read Aloud dock from colliding with Cover-First Issue Reader bottom bar */
body.reader-mode .speech-player-dock {
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.share-label {
  font: 700 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 600 12.5px var(--ui);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, transform .15s, color .15s;
}
.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.share-btn-wa {
  border-color: rgba(22, 163, 74, 0.4);
}
.share-btn-wa:hover {
  border-color: #16a34a;
  color: #16a34a;
}

.currency-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 14px auto 0;
}
.currency-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font: 700 12px var(--ui);
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all .15s;
}
.currency-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}
