/* ============================================================
   INDIC LEAGUE NEWS — Design tokens + global styles
   Tokens follow plan.md §4 with mockup palette overrides.
   ============================================================ */

:root {
  /* Brand */
  --coral:        #FF6B5A;
  --coral-deep:   #E85440;
  --coral-soft:   rgba(255, 107, 90, 0.10);
  --coral-glow:   rgba(255, 107, 90, 0.25);
  --gold:         #E8A020;

  /* Spectrum (quiz result only) */
  --spectrum-left:   #4a7cc7;
  --spectrum-center: #9b6db5;
  --spectrum-right:  #f27c27;

  /* Light theme */
  --bg:           #F7EFE8;
  --bg-2:         #EDE7DD;
  --bg-card:      #FFDCD2;        /* peach card backing from mockup */
  --surface:      #FEFEFE;
  --surface-2:    rgba(254, 254, 254, 0.82);
  --text-1:       #1B1B1B;
  --text-2:       #6E6E6E;
  --text-3:       #A09890;
  --border:       rgba(27, 27, 27, 0.08);
  --border-strong:rgba(27, 27, 27, 0.14);

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-serif:   "Lora", Georgia, serif;
  --font-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;

  /* Shadows — directional, top-left light */
  --shadow-card:
    0 0 0 1px var(--border),
    0 2px 4px rgba(0,0,0,0.04),
    0 10px 30px rgba(0,0,0,0.08),
    0 30px 60px rgba(0,0,0,0.06);
  --shadow-fab:
    0 1px 3px rgba(0,0,0,0.06),
    0 6px 20px rgba(0,0,0,0.08);
  --shadow-fab-hover:
    0 4px 16px rgba(0,0,0,0.14),
    0 12px 40px rgba(0,0,0,0.12);

  /* Layout */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Status colors */
  --success: #1E8A5F;
  --danger:  #C03B2D;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:           #13110f;
  --bg-2:         #1d1a17;
  --bg-card:      #2a2320;
  --surface:      #201d1a;
  --surface-2:    rgba(32, 29, 26, 0.88);
  --text-1:       #f2ede8;
  --text-2:       #a09891;
  --text-3:       #5d564f;
  --border:       rgba(242, 237, 232, 0.08);
  --border-strong:rgba(242, 237, 232, 0.14);
  --coral-soft:   rgba(255, 107, 90, 0.16);

  --shadow-card:
    0 0 0 1px var(--border),
    0 2px 6px rgba(0,0,0,0.20),
    0 12px 32px rgba(0,0,0,0.34),
    0 30px 60px rgba(0,0,0,0.26);
  --shadow-fab:
    0 1px 3px rgba(0,0,0,0.30),
    0 6px 20px rgba(0,0,0,0.38);

  color-scheme: dark;
}

/* ============================================================
   Reset + base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  /* prevent rubber-band scroll, allow scrollable areas to opt in */
  touch-action: pan-x pan-y;
}

#root {
  height: 100%;
  width: 100%;
  position: relative;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { cursor: not-allowed; }

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

a { color: var(--coral); text-decoration: none; }

img { display: block; max-width: 100%; }

/* Hide scrollbars on horizontal chip rows */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ============================================================
   Pre-React boot splash (HTML in #root)
   ============================================================ */

.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 9999;
  gap: 18px;
}
.boot-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 80px;
  letter-spacing: -2px;
  color: var(--text-1);
  display: flex; align-items: flex-end;
  line-height: 0.9;
}
.boot-i { position: relative; }
.boot-dot {
  position: absolute;
  top: -6px; left: 50%;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--coral);
  transform: translate(-50%, 0);
  box-shadow: 0 0 24px var(--coral-glow);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  50%      { transform: translate(-50%, 0) scale(1.3); opacity: 0.7; }
}
.boot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--text-1);
}
.boot-name span { color: var(--coral); }

/* ============================================================
   App shell
   ============================================================ */

.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text-1);
  overflow: hidden;
}

/* Mobile viewport: phone-shaped frame on desktop, edge-to-edge on phones */
.shell {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .app {
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
    padding: 28px;
    overflow-y: auto;
  }
  .shell {
    width: min(440px, 100%);
    height: 820px;
    max-height: 820px;
    flex: 0 0 auto;
    border-radius: 44px;
    overflow: hidden;
    box-shadow:
      0 0 0 10px #1B1B1B,
      0 0 0 12px rgba(255,255,255,0.05),
      0 30px 80px rgba(0,0,0,0.32),
      0 80px 200px rgba(0,0,0,0.18);
  }
  .shell::before {
    /* iPhone-style notch / dynamic island */
    content: '';
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    width: 110px; height: 32px;
    background: #1B1B1B;
    border-radius: 18px;
    z-index: 100;
    pointer-events: none;
  }
}

/* Status bar (visible in framed mode) */
.statusbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px 6px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  height: 50px;
  flex-shrink: 0;
}
.statusbar-icons {
  display: flex; align-items: center; gap: 6px;
}
@media (min-width: 720px) {
  .statusbar { display: flex; }
}

/* Screen container — every route mounts here */
.screen {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Top nav (in-app, persistent on tab screens) */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}
.topnav-side {
  display: flex; align-items: center; gap: 10px;
  min-width: 44px;
}
.topnav-side button {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  transition: background 120ms;
}
.topnav-side button:hover { background: var(--bg-2); }

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2.2px;
  color: var(--text-1);
  display: flex;
  gap: 6px;
}
.brand-wordmark span { color: var(--coral); }

.topnav::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--coral) 30%, var(--coral) 70%, transparent);
  opacity: 0.6;
}

/* ============================================================
   Card stack — the hero swipeable feed
   ============================================================ */

.stage {
  flex: 1;
  position: relative;
  padding: 20px 18px 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.cardstack {
  flex: 1;
  position: relative;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.card.peach { background: var(--bg-card); }

.card-ghost {
  pointer-events: none;
}

.card-hero {
  position: relative;
  width: 100%;
  flex: 0 1 320px;
  min-height: 150px;
  overflow: hidden;
}
.card-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}
.card-hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.32) 100%);
  pointer-events: none;
}

.card-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 5px;
  z-index: 2;
}
.card-time {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 5px;
  z-index: 2;
}

.card-body {
  padding: 16px 20px 16px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-category {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--coral);
  text-transform: uppercase;
}
.card-political {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--text-3);
  text-transform: uppercase;
}

.card-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 5.4vw, 26px);
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
  color: var(--text-1);
  text-wrap: pretty;
}
.card-headline em {
  color: var(--coral);
  font-style: italic;
  font-family: var(--font-display);
}

.card-summary {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 1;
  min-height: 0;
}

.card-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.byline-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--coral-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--coral);
  flex-shrink: 0;
  overflow: hidden;
}
.byline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-2);
}

.card-progress {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  align-items: center;
}
.card-progress-dots {
  display: flex; gap: 4px;
}
.card-progress-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
}
.card-progress-dot.active {
  background: var(--coral);
  width: 18px;
}

/* FAB row beneath the stack */
.fab-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 12px 0 6px;
  flex-shrink: 0;
}
.fab {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  box-shadow: var(--shadow-fab);
  border: 1px solid var(--border);
  transition: transform 180ms cubic-bezier(0.175,0.885,0.32,1.275),
              box-shadow 180ms;
}
.fab:hover { box-shadow: var(--shadow-fab-hover); }
.fab:active { transform: scale(0.92); }
.fab.fab-primary {
  width: 54px; height: 54px;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 20px var(--coral-glow), 0 2px 6px rgba(0,0,0,0.1);
}
.fab.fab-primary:hover {
  box-shadow: 0 10px 30px var(--coral-glow), 0 4px 12px rgba(0,0,0,0.14);
}
.fab.fab-liked {
  color: var(--coral);
}
.fab.fab-popped {
  animation: fab-pop 280ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes fab-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.swipe-hint {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 0 2px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

/* Swipe overlay (NEXT / PREVIOUS feedback during drag) */
.swipe-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 120ms;
}
.swipe-overlay-pill {
  width: 110px; height: 110px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
}
.swipe-overlay.next .swipe-overlay-pill { background: var(--coral); }
.swipe-overlay.prev .swipe-overlay-pill { background: #1E8A5F; }

/* ============================================================
   Bottom navigation dock
   ============================================================ */

.dock {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--surface-2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + var(--safe-bottom));
  gap: 4px;
  flex-shrink: 0;
}
.dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.4px;
  transition: color 120ms;
}
.dock-item.active { color: var(--coral); }
.dock-item span { font-size: 11px; }

/* ============================================================
   Onboarding screens
   ============================================================ */

.onboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 28px;
  overflow-y: auto;
}
.onboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.steps {
  display: flex;
  gap: 6px;
  align-items: center;
}
.step-dot {
  width: 26px; height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 160ms;
}
.step-dot.active { background: var(--coral); }
.onboard-skip {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  padding: 8px;
}
.onboard-skip:hover { color: var(--coral); }

.onboard-eyebrow {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  color: var(--coral);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 28px 0 12px;
}
.onboard-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.6px;
  color: var(--text-1);
  margin: 0 0 14px;
  text-wrap: balance;
}
.onboard-heading em {
  color: var(--coral);
  font-style: italic;
  position: relative;
}
.onboard-heading em::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  bottom: 2px;
  height: 4px;
  background: var(--coral-soft);
  border-radius: 999px;
  z-index: -1;
}
.onboard-sub {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 30ch;
  text-wrap: pretty;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.topic-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-2);
  position: relative;
  transition: transform 180ms, border-color 140ms, color 140ms, background 140ms;
}
.topic-pill .topic-icon {
  color: var(--text-2);
  transition: color 140ms;
}
.topic-pill:nth-child(3n) { border-radius: 20px 6px 20px 6px; }
.topic-pill:nth-child(3n+1) { border-radius: 6px 20px 6px 20px; }
.topic-pill:nth-child(3n+2) { border-radius: 14px; }

.topic-pill.selected {
  background: var(--text-1);
  border-color: var(--text-1);
  color: var(--bg);
  transform: translateY(-1px);
}
.topic-pill.selected .topic-icon { color: var(--coral); }
.topic-pill .check {
  position: absolute;
  top: 7px; right: 8px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms, transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.topic-pill.selected .check { opacity: 1; transform: scale(1); }

.onboard-hint {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-3);
  margin: 18px 0 0;
}

.onboard-actions {
  margin-top: auto;
  padding-top: 24px;
}

/* CTA button */
.btn {
  width: 100%;
  height: 54px;
  background: var(--coral);
  color: #fff;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 140ms, transform 140ms, box-shadow 200ms;
  box-shadow: 0 4px 14px var(--coral-glow);
}
.btn:hover:not(:disabled) {
  box-shadow: 0 8px 24px var(--coral-glow);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled {
  opacity: 0.32;
  box-shadow: none;
  cursor: not-allowed;
}
.btn.btn-secondary {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn.btn-secondary:hover {
  background: var(--bg-2);
  box-shadow: none;
}
.btn.btn-ghost {
  background: transparent;
  color: var(--text-2);
  height: 44px;
  box-shadow: none;
}

/* Political pills (Step 2) */
.political-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.political-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-1);
  transition: background 140ms, border-color 140ms, transform 140ms;
}
.political-pill .pol-pos {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--text-3);
}
.political-pill.selected {
  background: var(--text-1);
  border-color: var(--text-1);
  color: var(--bg);
}
.political-pill.selected .pol-pos { color: var(--coral); }

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 14px;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2px;
}
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ============================================================
   Quiz screens
   ============================================================ */

.quiz-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 22px 28px;
  overflow-y: auto;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
}
.quiz-top button {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
}
.quiz-counter {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}
.quiz-progress {
  height: 4px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--coral);
  border-radius: 999px;
  transition: width 320ms cubic-bezier(0.34, 1.42, 0.64, 1);
}
.quiz-question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 6.5vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.4px;
  color: var(--text-1);
  margin: 0 0 26px;
  text-wrap: balance;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-1);
  text-align: left;
  transition: background 140ms, border-color 140ms, transform 140ms;
}
.quiz-option:hover { background: var(--bg-2); }
.quiz-option:active { transform: scale(0.99); }
.quiz-option.picked {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.quiz-back-link {
  margin-top: 22px;
  align-self: center;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.quiz-back-link:hover { color: var(--coral); }

/* Quiz result */
.quiz-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 28px;
  text-align: center;
  overflow-y: auto;
}
.quiz-result-confetti {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 16px;
}
.quiz-result-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: var(--text-1);
}
.quiz-result-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 38px;
  color: var(--coral);
  margin: 4px 0 28px;
}
.spectrum-bar {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--spectrum-left) 0%,
    var(--spectrum-center) 50%,
    var(--spectrum-right) 100%);
  margin: 0 0 8px;
}
.spectrum-marker {
  position: absolute;
  top: 50%;
  width: 24px; height: 24px;
  background: #fff;
  border: 3px solid var(--text-1);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
  transition: left 600ms cubic-bezier(0.34, 1.42, 0.64, 1);
}
.spectrum-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.quiz-result-body {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-2);
  margin: 0 auto 30px;
  max-width: 30ch;
  line-height: 1.55;
}

/* ============================================================
   Splash screen (in-app, post-boot)
   ============================================================ */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px calc(36px + var(--safe-bottom));
  text-align: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 30%, var(--coral-soft) 0%, transparent 60%),
    var(--bg);
}
.splash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.splash-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(96px, 26vw, 140px);
  letter-spacing: -4px;
  color: var(--text-1);
  display: inline-flex; align-items: flex-end;
  line-height: 0.85;
  position: relative;
}
.splash-mark .dot {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 40px var(--coral-glow);
  top: -6px;
  left: 22%;
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.15); opacity: 0.8; }
}
.splash-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 3.5px;
  color: var(--text-1);
  margin-top: 8px;
}
.splash-name span { color: var(--coral); }
.splash-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-2);
  line-height: 1.4;
  margin-top: 14px;
}
.splash-tag::after {
  content: '';
  display: block;
  width: 52px;
  height: 2px;
  background: var(--coral);
  border-radius: 999px;
  margin: 14px auto 0;
}

.splash-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================
   Login (mock auth)
   ============================================================ */
.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 24px;
  overflow-y: auto;
}
.login-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -1.5px;
  position: relative;
  display: inline-block;
  margin: 32px 0 6px;
}
.login-mark .dot {
  position: absolute;
  top: 8px; left: 8px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--coral);
}
.login-name-row {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--text-1);
}
.login-name-row span { color: var(--coral); }

.login-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 7.5vw, 36px);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 36px 0 8px;
}
.login-heading em {
  font-style: italic;
  color: var(--coral);
}
.login-sub {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 32ch;
}
.input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text-1);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  margin-bottom: 10px;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.social-row {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.social-btn {
  flex: 1;
  height: 50px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  transition: background 140ms;
}
.social-btn:hover { background: var(--bg-2); }

.login-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.login-foot a { font-weight: 600; }

/* ============================================================
   Deep dive sheet
   ============================================================ */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.52);
  z-index: 50;
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92%;
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 51;
  transform: translateY(100%);
  transition: transform 440ms cubic-bezier(0.32, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.open {
  transform: translateY(0);
}
.sheet-handle {
  width: 36px; height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 12px auto 0;
  flex-shrink: 0;
}
.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px calc(80px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}
.sheet-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
}
.sheet-cat {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--coral);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sheet-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 6.5vw, 30px);
  letter-spacing: -0.6px;
  line-height: 1.12;
  margin: 0 0 12px;
}
.sheet-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.sheet-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sheet-meta-dot { width: 3px; height: 3px; border-radius: 999px; background: var(--text-3); }

.sheet hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0 18px;
}
.sheet-content p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-1);
  margin: 0 0 14px;
}
.our-take {
  background: var(--bg-2);
  border-left: 3px solid var(--coral);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 20px 0 16px;
}
.our-take-label {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--coral);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.our-take p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-1);
  margin: 0;
}

.sheet-source {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}
.sheet-source a { font-weight: 600; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -20px);
  padding: 10px 16px;
  background: var(--text-1);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 200ms, transform 280ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--text-2);
  font-family: var(--font-serif);
}
.empty h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--text-1);
  margin: 16px 0 6px;
}

/* ============================================================
   Desktop adaptations (per request: responsive)
   ============================================================ */
@media (min-width: 1024px) {
  .app {
    background: var(--bg);
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .shell {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .shell::before { display: none; }
  .statusbar { display: none; }

  /* Two-column dashboard layout when on feed screen */
  .desktop-layout .screen { flex-direction: row; }
  .desktop-layout .topnav {
    flex-direction: column;
    width: 260px;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 24px 18px;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
  }
  .desktop-layout .topnav::after { display: none; }
  .desktop-layout .topnav .brand-wordmark {
    font-size: 14px;
    align-self: flex-start;
  }
  .desktop-layout .dock {
    flex-direction: column;
    align-items: stretch;
    width: 240px;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 14px;
    gap: 4px;
    background: transparent;
    backdrop-filter: none;
  }
  .desktop-layout .dock-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
  }
  .desktop-layout .dock-item.active {
    background: var(--coral-soft);
  }
}
