/* ─── Design tokens — dark (default) ───────────────── */
:root {
  --bg:          #0d0d10;
  --surface:     #141418;
  --surface-2:   #1c1c22;
  --surface-3:   #222229;
  --border:      rgba(255, 255, 255, 0.07);
  --border-2:    rgba(255, 255, 255, 0.12);
  --text:        #eeeef0;
  --text-2:      #8e8e9c;
  --text-3:      #55556a;
  --header-bg:   rgba(13, 13, 16, 0.88);
  --reader-text: #d4d4da;
  --accent:      #c96442;
  --accent-dim:  rgba(201, 100, 66, 0.14);
  --a1:          #4ecba8;
  --a2:          #9c8df5;
  --b1:          #e8964d;
  --a1-dim:      rgba(78, 203, 168, 0.13);
  --a2-dim:      rgba(156, 141, 245, 0.13);
  --b1-dim:      rgba(232, 150, 77, 0.13);
  --radius:      13px;
  --radius-sm:   8px;
}

/* ─── Light mode ────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f7f6f3;
  --surface:     #ffffff;
  --surface-2:   #f0ede8;
  --surface-3:   #e8e4de;
  --border:      rgba(0, 0, 0, 0.07);
  --border-2:    rgba(0, 0, 0, 0.12);
  --text:        #1a1a1c;
  --text-2:      #6b6b78;
  --text-3:      #a0a0ad;
  --header-bg:   rgba(247, 246, 243, 0.88);
  --reader-text: #2e2e32;
  --accent:      #c96442;
  --accent-dim:  rgba(201, 100, 66, 0.10);
  --a1:          #1f9e7d;
  --a2:          #6b58e0;
  --b1:          #c4710e;
  --a1-dim:      rgba(31, 158, 125, 0.10);
  --a2-dim:      rgba(107, 88, 224, 0.10);
  --b1-dim:      rgba(196, 113, 14, 0.10);
}

/* ─── System preference fallback ───────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          #f7f6f3;
    --surface:     #ffffff;
    --surface-2:   #f0ede8;
    --surface-3:   #e8e4de;
    --border:      rgba(0, 0, 0, 0.07);
    --border-2:    rgba(0, 0, 0, 0.12);
    --text:        #1a1a1c;
    --text-2:      #6b6b78;
    --text-3:      #a0a0ad;
    --header-bg:   rgba(247, 246, 243, 0.88);
    --reader-text: #2e2e32;
    --accent:      #c96442;
    --accent-dim:  rgba(201, 100, 66, 0.10);
    --a1:          #1f9e7d;
    --a2:          #6b58e0;
    --b1:          #c4710e;
    --a1-dim:      rgba(31, 158, 125, 0.10);
    --a2-dim:      rgba(107, 88, 224, 0.10);
    --b1-dim:      rgba(196, 113, 14, 0.10);
  }
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ─── App main content wrapper ─────────────────────── */
.app-main {
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

/* ─── Site header ───────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 2rem;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 641px) {
  .with-sidebar .site-header .logo {
    margin-left: calc(-200px - 1rem);
  }
}

.logo,
.lp-nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.logo {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.logo-mark-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark {
  width: 48px;
  height: 48px;
  display: block;
}

.header-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.6rem;
  flex-shrink: 0;
}
.header-streak-flame {
  font-size: 0.9rem;
}

.daily-goal {
  flex: 1;
  max-width: 360px;
  margin: 0 1rem;
}
.daily-goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.26rem;
  gap: 0.4rem;
}
.daily-goal-label {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.daily-goal-value {
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 600;
}
.daily-goal-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.daily-goal-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58d0ff 0%, #f59e0b 100%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover,
.icon-btn[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }

/* ─── Read progress bar ─────────────────────────────── */
#read-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.15s linear;
  pointer-events: none;
  opacity: 0;
}
#read-progress-bar.visible { opacity: 1; }

/* ─── Sidebar settings button ───────────────────────── */
.sidebar-settings-btn {
  margin-top: auto;
}

.settings-email {
  font-size: 0.83rem;
  color: var(--text-2);
  padding: 0.6rem 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  gap: 0.75rem;
}
.settings-row:hover { background: var(--surface-3); }

.settings-row:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-row-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.settings-subtext {
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
}

.settings-row-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-row-danger .settings-row-label,
.settings-row-danger { color: var(--text); }
.settings-row-danger:hover { color: #f87171; background: rgba(248,113,113,0.08); }

.settings-level-row {
  cursor: default;
  pointer-events: none;
}
.settings-level-row .settings-row-label { pointer-events: none; }

.level-picker {
  display: flex;
  gap: 0.3rem;
  pointer-events: all;
  flex-shrink: 0;
}
.level-pick-btn {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: none;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 34px;
  min-width: 38px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.level-pick-btn:hover { color: var(--text); border-color: var(--text-2); }
.level-pick-btn.active {
  background: #7c6af7;
  border-color: #7c6af7;
  color: #fff;
}

/* Toggle switch */
.toggle-switch {
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch.is-on {
  background: #7c6af7;
  border-color: #7c6af7;
}
.toggle-switch.is-on::after {
  transform: translateX(16px);
  background: #fff;
}

/* Show sun in dark mode, moon in light mode */
:root:not([data-theme="light"]) .icon-moon,
[data-theme="light"] .icon-sun { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .icon-moon { display: block; }
}

/* ─── Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.855rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1;
}

.btn-primary:hover   { opacity: 0.85; transform: translateY(-1px); }
.btn-primary:active  { transform: none; opacity: 0.75; }
.btn-primary:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary.btn-full { width: 100%; justify-content: center; padding: 0.7rem 1rem; }
.btn-primary:focus { outline: none; }
.btn-primary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent); }

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.92rem;
  border: 1px solid rgba(255, 216, 120, 0.8);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ffcc66 0%, #f59e0b 100%);
  color: #3f2a00;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  line-height: 1.15;
  max-width: min(46vw, 420px);
  text-align: center;
  white-space: normal;
}
.btn-upgrade:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.36);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.855rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.38rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.back-btn:hover { color: var(--text); background: var(--surface-2); }

/* ─── Views ─────────────────────────────────────────── */
.view          { animation: fadeUp 0.22s ease both; }
.view-hidden   { display: none !important; }

/* ─── Feed ──────────────────────────────────────────── */
#feed-view {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.8rem 2rem 6rem;
}

/* The top padding above was sized for My Articles' hero heading — Explore
   has no heading there, so the same gap reads as empty space above the
   topic filters. Tighten it only when Explore is the visible panel. */
#feed-view:has(#explore-panel:not(.feed-panel-hidden)) {
  padding-top: 1.5rem;
}

.feed-hero {
  margin-bottom: 2.2rem;
}

.feed-hero h1 {
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.55rem;
}

.feed-hero p {
  color: var(--text-2);
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}
.level-pill.a1 { background: var(--a1-dim); color: var(--a1); }
.level-pill.a2 { background: var(--a2-dim); color: var(--a2); }
.level-pill.b1 { background: var(--b1-dim); color: var(--b1); }

/* Grid — individual cards with gaps */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ─── Article card ──────────────────────────────────── */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.3rem;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s, transform 0.14s;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 200px;
  position: relative;
}
.article-card:hover {
  background: var(--surface-2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.article-card.recommended-first-read {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 18px 40px rgba(201, 100, 66, 0.14);
}
.first-read-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: rgba(201, 100, 66, 0.12);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.24rem 0.55rem;
}
.first-read-badge::before {
  content: '★';
  font-size: 0.68rem;
}

/* ─── Card action button (remove / add) ─────────────── */
.card-action-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: background 0.14s, color 0.14s;
  background: var(--surface-2);
  color: var(--text-3);
  z-index: 1;
  flex-shrink: 0;
}
.card-action-btn:hover { background: var(--border); color: var(--text); }
.card-remove-btn:hover { background: #fee2e2; color: #dc2626; }
.card-add-btn { background: var(--surface-2); color: var(--text-3); }
.card-add-btn:hover { background: #fce7f3; color: #e11d48; }
.card-add-btn.saved { background: #fce7f3; color: #e11d48; pointer-events: none; }
.card-add-btn.saved .heart-path { fill: currentColor; }

/* Reserve space so title doesn't slide under the action button */
.article-card.has-action .card-title { padding-right: 1.8rem; }

.card-badges {
  display: flex;
  gap: 0.35rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.48rem;
  border-radius: 100px;
}
.badge.a1 { background: var(--a1-dim); color: var(--a1); }
.badge.a2 { background: var(--a2-dim); color: var(--a2); }
.badge.b1 { background: var(--b1-dim); color: var(--b1); }

.card-title {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-snippet {
  font-size: 0.845rem;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.card-date   { font-size: 0.77rem; color: var(--text-3); }
.card-source {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.card-arrow {
  font-size: 0.82rem;
  color: var(--accent);
  transition: transform 0.14s, color 0.14s;
}
.article-card:hover .card-arrow { transform: translateX(3px); color: var(--accent); }

/* ─── Empty & loading states ────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  background: var(--surface);
  text-align: center;
  padding: 5rem 2rem;
}

.empty-icon { font-size: 2.2rem; margin-bottom: 1rem; opacity: 0.35; }

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.empty-state p {
  color: var(--text-2);
  font-size: 0.875rem;
  max-width: 38ch;
  margin: 0 auto 0.75rem;
  line-height: 1.6;
}
.empty-heart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.12rem;
  margin: 0 0.18rem;
  color: #e11d48;
}
.empty-state #empty-add-btn {
  margin-top: 0.35rem;
}

/* ─── For You: new-since-visit banner & soft checkpoint ───────────── */
.feed-new-since-banner {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

.feed-checkpoint {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-align: center;
}

.feed-checkpoint-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.feed-checkpoint-sub {
  font-size: 0.845rem;
  color: var(--text-2);
  line-height: 1.5;
}

.skeleton-card {
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
}

.skel {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-right: 1.8rem;
  max-width: calc(100% - 1.8rem);
}
.skel-xs  { height: 13px; }
.skel-sm  { height: 14px; }
.skel-lg  { height: 16px; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Reader header ─────────────────────────────────── */
.reader-header {
  position: sticky;
  top: 54px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 54px;
  padding: 0 1.25rem;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.level-tabs {
  display: flex;
  flex: 1;
  gap: 0.25rem;
  padding: 0.22rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.level-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
  padding: 0.5rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
  line-height: 1;
  white-space: nowrap;
}
.level-tab:hover { color: var(--text); }
.level-tab.active {
  background: #7c6af7;
  color: #fff;
  box-shadow: 0 1px 6px rgba(124,106,247,0.4);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-a1 { background: var(--a1); }
.dot-a2 { background: var(--a2); }
.dot-b1 { background: var(--b1); }
.level-tab.active .dot { background: rgba(255,255,255,0.7); }

.source-link {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.14s;
  flex-shrink: 0;
}
.source-link:hover { color: var(--text); }

/* ─── Reader body ───────────────────────────────────── */
.reader-container {
  max-width: 672px;
  margin: 0 auto;
  padding: 3.2rem 2rem 7rem;
}

.reader-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.reader-wordcount {
  font-size: 0.78rem;
  color: var(--text-3);
}

.reader-level-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0;
}
.reader-level-label.a1 { color: var(--a1); }
.reader-level-label.a2 { color: var(--a2); }
.reader-level-label.b1 { color: var(--b1); }

.reader-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.65rem, 3.5vw, 2.3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 2rem;
}

.reader-body {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.82;
  color: var(--reader-text);
}
.reader-body p + p { margin-top: 1.25em; }
.article-source-credit {
  margin-top: 2.5em;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 1.25em;
}

/* ─── Next article recommendation ─────────────────────── */
.next-article-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.article-complete-stat {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.article-complete-trial-progress {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.article-complete-install-nudge {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.9rem;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.article-complete-install-nudge:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.next-article-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.next-article-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover, var(--surface));
}
.next-article-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
.next-article-headline {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-1);
  margin: 0 0 0.55rem;
}
.next-article-snippet {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 0.55rem;
}
.next-article-source {
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
}

.reader-word {
  cursor: pointer;
  border-radius: 0.3rem;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.reader-word:hover {
  background: var(--accent-dim);
  color: var(--text);
}
.reader-word:focus-visible {
  outline: 2px solid rgba(124, 106, 247, 0.7);
  outline-offset: 1px;
}

/* ─── Dictionary popup ───────────────────────────────── */
.dict-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dict-popup-overlay.modal-hidden { display: none; }

.dict-popup {
  width: min(100%, 34rem);
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
  padding: 0.95rem 0.95rem 1rem;
}

.dict-popup-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.dict-popup-word {
  font-size: 1.08rem;
  color: var(--text);
  letter-spacing: -0.01em;
  word-break: break-word;
}

.dict-popup-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 9px;
  color: var(--text-2);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}
.dict-popup-close:hover {
  color: var(--text);
  background: var(--surface-3);
}

.dict-popup-pos {
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.dict-popup-status {
  color: var(--text-2);
  font-size: 0.88rem;
  min-height: 1.4em;
  margin-bottom: 0.2rem;
}

.dict-popup-definition {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.52;
}

.dict-popup-example {
  margin-top: 0.55rem;
  color: var(--reader-text);
  font-size: 0.92rem;
  line-height: 1.5;
  font-style: italic;
}

@media (min-width: 768px) {
  .dict-popup-overlay {
    align-items: center;
    padding: 1.25rem;
  }
}

/* ─── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.14s ease;
}
.modal-overlay.modal-hidden { display: none; }

.settings-view {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  overflow-y: auto;
  background: var(--bg);
  padding: 2rem 1rem calc(56px + env(safe-area-inset-bottom) + 1.5rem);
}

.settings-page-card {
  max-width: 880px;
  margin: 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.with-sidebar .settings-view {
  left: 200px;
}

.settings-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.3rem 0.55rem 0.75rem 0.85rem;
}

.settings-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.settings-page-subtitle {
  margin-top: 0.15rem;
  font-size: 0.84rem;
  color: var(--text-2);
}

.settings-page-close {
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}
.settings-page-close:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--text-3);
}

.settings-view .settings-page-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.settings-view .settings-email {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.75rem;
}

.settings-view .settings-divider {
  display: none;
}

.settings-view .settings-row,
.settings-view .settings-push-cap-row,
.settings-view #billing-row {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.7rem;
}

.settings-view .settings-row:hover {
  background: var(--surface-3);
}

.settings-view .settings-topics-row {
  padding: 0.95rem;
}

.modal {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  animation: slideUp 0.18s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.55rem 0.3rem 0.85rem;
  min-height: 44px;
}

.modal-head h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* ─── Modal pickers (mode / language) ──────────────── */
.modal-picker {
  display: flex;
  gap: 0.3rem;
  pointer-events: all;
}

.modal-pick-opt { margin: 0; }

.modal-pick-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modal-pick-opt span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: none;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 34px;
  min-width: 38px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.modal-pick-opt:hover span { color: var(--text); border-color: var(--text-2); }

.modal-pick-opt input:checked + span {
  background: #7c6af7;
  border-color: #7c6af7;
  color: #fff;
}

/* ─── Modal input + submit areas ────────────────────── */
.modal-input-area {
  padding: 0.6rem 0.85rem 0.5rem;
}

.modal-submit-row {
  padding: 0.35rem 0.85rem 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  line-height: 0;
  transition: color 0.14s, background 0.14s;
}
.modal-close-btn:hover { color: var(--text); background: var(--surface-2); }

/* ─── Form ──────────────────────────────────────────── */
.toggle-row {
  display: inline-flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.18rem;
  margin-bottom: 1.1rem;
}

.toggle-option { margin: 0; }

.toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option span {
  display: inline-block;
  padding: 0.36rem 0.82rem;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  user-select: none;
}
.toggle-option input:checked + span {
  background: var(--surface-2);
  color: var(--text);
}


input[type="url"],
textarea {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.93rem;
  padding: 0.72rem 0.95rem;
  outline: none;
  transition: border-color 0.14s;
  margin-bottom: 0;
  display: block;
}
textarea { margin-bottom: 0; }
input[type="url"]:focus,
textarea:focus { border-color: rgba(201, 100, 66, 0.55); }

textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.55;
}

.modal-status {
  font-size: 0.835rem;
  color: var(--text-2);
  text-align: center;
  padding: 0.4rem 0.85rem 0.25rem;
  min-height: 1.2em;
  line-height: 1.5;
}
.modal-status.error { color: #f08080; }

/* ─── Field hint (paywall link) ─────────────────────── */
.field-hint {
  font-size: 0.8rem;
  color: var(--text-2);
  margin: 0.45rem 0 0;
}
.hint-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-2);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.hint-link:hover { color: var(--text); }

/* ─── Progress steps ────────────────────────────────── */
.modal-progress {
  margin-top: 0.75rem;
  padding: 0 0.85rem;
}
.modal-progress.hidden { display: none; }

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-2);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.progress-step.active .step-dot {
  background: #e8622a;
  border-color: #e8622a;
  box-shadow: 0 0 0 4px rgba(232, 98, 42, 0.3), 0 0 12px rgba(232, 98, 42, 0.4);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.progress-step.done .step-dot {
  background: #7c6af7;
  border-color: #7c6af7;
  box-shadow: 0 0 6px rgba(124, 106, 247, 0.4);
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.3s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.progress-step.active .step-label { color: #e8622a; }
.progress-step.done  .step-label  { color: #7c6af7; }

.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--border-2);
  min-width: 40px;
  max-width: 80px;
  margin-bottom: 1.2rem;
  transition: background 0.4s;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.progress-connector.done { background: #7c6af7; }
.progress-connector.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #e8622a, #7c6af7, transparent);
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232,98,42,0.3), 0 0 12px rgba(232,98,42,0.4); }
  50%       { box-shadow: 0 0 0 7px rgba(232,98,42,0.15), 0 0 18px rgba(232,98,42,0.25); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Landing page ──────────────────────────────────── */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: fadeUp 0.28s ease both;
  overflow-x: hidden;
}

/* Nav */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 2rem;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.lp-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}

.lp-nav-logo-mark {
  width: 50px;
  height: 50px;
  display: block;
  flex-shrink: 0;
  transform: translateY(1px);
}

.lp-nav-logo > span {
  display: block;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}
.lp-nav .btn-sm {
  min-height: 36px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

/* ── Nav links + dropdown ─────────────────────────────────────────── */
.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-2);
}

.lp-nav-link,
.lp-nav-dropdown-toggle,
.lp-nav-dropdown-item {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  line-height: 1.3;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.lp-nav :is(.lp-nav-link, .lp-nav-dropdown-item):any-link { color: inherit; }
.lp-nav :is(.lp-nav-link, .lp-nav-dropdown-item):visited { color: inherit; }
.lp-nav-link,
.lp-nav-dropdown-toggle {
  padding: 0.35rem 0.65rem;
}

.lp-nav-dropdown-item {
  display: flex;
  width: 100%;
  padding: 0.45rem 0.75rem;
}

.lp-nav-link:hover,
.lp-nav-link:focus-visible,
.lp-nav-dropdown-toggle:hover,
.lp-nav-dropdown-toggle:focus-visible,
.lp-nav-dropdown-item:hover,
.lp-nav-dropdown-item:focus-visible {
  color: var(--text);
  background: var(--surface-2, rgba(255,255,255,0.06));
}

.lp-nav-chevron {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.15rem;
}

.lp-nav-dropdown {
  position: relative;
}

/* Transparent bridge fills the gap so hover isn't lost moving to the menu */
.lp-nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 10px;
}

.lp-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 130px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  transform: translateX(-50%) translateY(-4px);
  z-index: 200;
}

.lp-nav-dropdown:hover .lp-nav-dropdown-menu,
.lp-nav-dropdown:focus-within .lp-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.lp-nav-link.active,
.lp-nav-link[aria-current="page"] {
  color: var(--text);
}

.lp-nav-dropdown-item.active,
.lp-nav-dropdown-item[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 600px) {
  .lp-nav-links { display: none; }
}

/* Hero */
.lp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 5rem;
  overflow: hidden;
}

.lp-hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at 50% 30%, rgba(201, 100, 66, 0.13) 0%, transparent 65%);
  pointer-events: none;
}

.lp-hero-inner {
  position: relative;
  max-width: 700px;
  width: 100%;
}

.lp-level-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.lp-headline {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1rem;
}

.lp-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.lp-br { display: none; }

/* Signup form */
.lp-signup {
  max-width: 460px;
  margin: 2rem auto 0;
}

.lp-form-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

#login-btn {
  justify-content: center;
}

.lp-google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  color: #1f1f1f;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.lp-google-btn:hover:not(:disabled),
.lp-google-btn:focus-visible:not(:disabled) {
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}
.lp-google-btn:focus-visible {
  outline: 3px solid rgba(201, 100, 66, 0.28);
  outline-offset: 2px;
}
.lp-google-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}
.lp-google-icon {
  flex: 0 0 auto;
}
.lp-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.8rem 0;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lp-auth-divider::before,
.lp-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.lp-auth-divider span {
  white-space: nowrap;
}

.lp-email-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.95rem;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.lp-email-input:focus {
  border-color: rgba(201, 100, 66, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.1);
}
.lp-email-input::placeholder { color: var(--text-3); }

.lp-form-note {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-3);
}

.login-status {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-top: 0.6rem;
  min-height: 1.2em;
  line-height: 1.5;
  text-align: center;
}
.login-status.success { color: var(--a1); }
.login-status.error   { color: #f08080; }

/* "Check your inbox" success state — replaces form content */
.login-sub {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Demo cards */
.lp-demo {
  padding: 4rem 2rem 5rem;
}

.lp-demo-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.lp-demo-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 1060px;
  margin: 0 auto;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lp-demo-card {
  background: var(--surface);
  padding: 1.5rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: background 0.14s;
}

.lp-demo-card-featured {
  background: var(--surface-2);
}

.lp-demo-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lp-demo-level {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lp-demo-level.a1 { color: var(--a1); }
.lp-demo-level.a2 { color: var(--a2); }
.lp-demo-level.b1 { color: var(--b1); }

.lp-demo-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text);
}

.lp-demo-body {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  flex: 1;
}

.lp-demo-words {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: auto;
}


.lp-demo-rich .topic-snippets-grid {
  max-width: 980px;
  margin: 0 auto;
}

/* How it works */
.lp-steps {
  padding: 0 2rem 5rem;
}

.lp-steps-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.lp-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 0 1.5rem;
}

.lp-step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.lp-step-text h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.lp-step-text p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

.lp-step-connector {
  width: 60px;
  height: 1.5px;
  background: var(--border-2);
  flex-shrink: 0;
  margin-top: 22px; /* vertically align with circle center */
}


/* Benefits */
.lp-benefits {
  padding: 4rem 2rem 3rem;
}

.lp-benefits-inner {
  max-width: 980px;
  margin: 0 auto;
}

.lp-benefits-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.lp-benefits-title {
  margin-top: 0.35rem;
  text-align: center;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  color: var(--text);
}

.lp-benefits-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.lp-benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}

.lp-benefit-card h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.45rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.45rem;
  line-height: 1.35;
  min-width: 0;
}

.lp-benefit-icon {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-dim);
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.lp-benefit-icon svg {
  display: block;
  width: 0.92rem;
  height: 0.92rem;
  overflow: visible;
}

.lp-benefit-card p {
  font-size: 0.86rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* Pricing */
.lp-pricing {
  padding: 0 2rem 4rem;
}

.lp-pricing-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.lp-pricing-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.lp-pricing-title {
  margin-top: 0.35rem;
  text-align: center;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  color: var(--text);
}

.lp-pricing-cards {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.lp-price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
}

.lp-price-card-pro {
  border-color: rgba(124, 106, 247, 0.48);
  background: linear-gradient(180deg, rgba(124, 106, 247, 0.12) 0%, var(--surface) 100%);
}

.lp-price-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lp-price-tier {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
}

.lp-price-value {
  margin-top: 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
}

.lp-price-value span {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-3);
}

.lp-price-list {
  margin-top: 0.9rem;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.lp-price-list li {
  position: relative;
  padding-left: 1rem;
}

.lp-price-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Footer */
.lp-footer {
  padding: 2.5rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.lp-footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
}

.lp-footer-brand {
  padding-top: 0.1rem;
}

.lp-footer-logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-3);
}

.lp-footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.lp-footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lp-footer-col-heading {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin: 0 0 0.2rem;
}

.lp-footer-copy {
  max-width: 860px;
  margin: 2rem auto 0;
  font-size: 0.75rem;
  color: var(--text-3);
  opacity: 0.6;
}

/* Landing responsive */
@media (max-width: 800px) {
  .lp-demo-cards { grid-template-columns: 1fr; }
  .lp-demo-card-featured { background: var(--surface); }
  .lp-benefits-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .lp-footer {
    padding: 2rem 1rem 1.25rem;
  }
  .lp-footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .lp-footer-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .lp-footer-copy {
    margin-top: 1.5rem;
  }

  .lp-hero { padding: 4rem 1.25rem 3.5rem; }
  .lp-demo { padding: 1.4rem 1.25rem 3.5rem; }
  .lp-steps { padding: 0 1.25rem 3.5rem; }
  .lp-benefits { padding: 1rem 1.25rem 2.5rem; }
  .lp-pricing { padding: 0 1.25rem 3rem; }
  .lp-pricing-inner { padding: 1.2rem; }
  .lp-pricing-cards { grid-template-columns: 1fr; }
  .lp-steps-inner { flex-direction: column; align-items: center; gap: 2rem; }
  .lp-step-connector { width: 1.5px; height: 24px; margin-top: 0; }
  .lp-form-row { flex-direction: column; }
  .lp-email-input { text-align: center; }
  .lp-nav { padding: 0 0.75rem; }
  .lp-nav-logo { gap: 0.16rem; }
  .lp-headline { font-size: 2.6rem; }
  .lp-hero { padding: 3.5rem 1.25rem 3rem; }
  .lp-hero-demo { margin-top: 2rem; }
  .lp-hero-demo-top { flex-wrap: wrap; gap: 0.5rem; justify-content: flex-start; }
  .lp-hero-levels { justify-content: center; }
  .lp-hero-topics { justify-content: flex-start; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .lp-inversion { padding: 3.5rem 1.25rem; }
  .lp-inversion-quote { font-size: 1.2rem; }
  .lp-inversion-punch { font-size: 1.5rem; }
  .lp-benefits-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .lp-benefit-card { padding: 1rem; }
  .lp-benefit-card h3 {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .lp-benefit-icon { margin-bottom: 0.05rem; }
  .lp-price-journey { padding: 1.4rem; }
}

/* ─── Hero label ─────────────────────────────────────── */
.lp-hero-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

/* Larger headline for the shorter new copy */
.lp-headline {
  font-size: clamp(3rem, 7vw, 5rem);
}

/* Tighter sub spacing so demo card sits close */
.lp-sub {
  margin-bottom: 0;
}

/* ─── Hero interactive demo ──────────────────────────── */
.lp-hero-demo {
  width: 100%;
  margin: 2rem auto 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.16), 0 1px 0 var(--border-2);
  text-align: left;
}

.lp-hero-demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  gap: 0.75rem;
}

.lp-hero-topics {
  display: flex;
  gap: 0.15rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.lp-hero-topics::-webkit-scrollbar { display: none; }

.lp-hero-topic {
  padding: 0.28rem 0.65rem;
  border-radius: 100px;
  font-size: 0.77rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
  font-family: inherit;
}
.lp-hero-topic:hover { color: var(--text); background: var(--surface-3); }
.lp-hero-topic.active { color: var(--accent); background: var(--accent-dim); }

.lp-hero-lang-row {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.lp-hero-lang-row::-webkit-scrollbar { display: none; }

.lp-hero-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  flex-shrink: 0;
}
.lp-hero-lang-flag {
  display: block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.lp-hero-lang:hover { color: var(--text); background: var(--surface-3); }
.lp-hero-lang.active {
  background: var(--accent);
  color: #fff;
}

.lp-hero-levels {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.lp-hero-level {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1.5px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.1s;
  font-family: inherit;
}
.lp-hero-level:hover { color: var(--text); border-color: var(--text-3); }
.lp-hero-level.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lp-hero-article-area {
  padding: 1.25rem 1.5rem 0.5rem;
  min-height: 160px;
  max-height: 260px;
  overflow: hidden;
  transition: opacity 0.15s ease;
  mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
}

.lp-hero-article-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 0.85rem;
}

.lp-hero-article-para {
  font-size: 0.875rem;
  line-height: 1.72;
  color: var(--text-2);
  margin: 0 0 0.7rem;
}

.lp-hero-read-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, opacity 0.15s;
  font-family: inherit;
}
.lp-hero-read-btn:hover { background: var(--surface-2); }

/* ─── Skeleton loader ────────────────────────────────── */
.lp-hero-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.5rem;
}

.lp-skel-title,
.lp-skel-line {
  border-radius: 5px;
  background: var(--surface-2);
  animation: lp-skel-pulse 1.6s ease-in-out infinite;
}

.lp-skel-title { height: 1.3rem; width: 80%; }
.lp-skel-line  { height: 0.82rem; width: 100%; }
.lp-skel-line--short { width: 55%; }
.lp-skel-line--mid   { width: 78%; }

@keyframes lp-skel-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ─── Inversion section ──────────────────────────────── */
.lp-inversion {
  padding: 5.5rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lp-inversion-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.lp-inversion-quote {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.25rem, 2.8vw, 1.9rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 0.6rem;
}

.lp-inversion-punch {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}

/* ─── Demo section header ────────────────────────────── */
.lp-demo-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lp-demo-sublabel {
  font-size: 0.85rem;
  color: var(--text-3);
  margin: 0.3rem 0 0;
}

/* ─── Benefits grid — 2 columns ─────────────────────── */
.lp-benefits-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ─── Pricing journey card ───────────────────────────── */
.lp-price-journey {
  max-width: 480px;
  margin: 1.8rem auto 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 1.8rem 2rem;
}

.lp-price-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.lp-price-step-marker {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.lp-price-step-line {
  width: 1.5px;
  height: 2rem;
  background: var(--border-2);
  margin-left: 4.75px;
}

.lp-price-step-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lp-price-step-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  margin: 0;
}

.lp-price-step-small {
  font-size: 0.82rem;
  color: var(--text-3);
}

.lp-price-intro-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lp-price-save-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  background: rgba(80, 200, 120, 0.14);
  color: #5bc87a;
}

.lp-pricing-cta {
  max-width: 480px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

/* ─── Billing row (settings dropdown) ──────────────── */
.settings-billing-row {
  cursor: default;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.billing-action-btn {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.14s;
  flex-shrink: 0;
}
.billing-action-btn:hover { opacity: 0.82; }
.billing-action-btn.billing-btn-manage {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.billing-action-btn.billing-btn-manage:hover { color: var(--text); }

/* Usage bar inside settings row */
.billing-usage-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.billing-usage-bar-bg {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.billing-usage-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.billing-usage-bar-fill.full { background: #f87171; }
.billing-usage-text {
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ─── Paywall modal ─────────────────────────────────── */
.paywall-modal {
  text-align: center;
  padding: 2rem 1.75rem 1.5rem;
}

.paywall-brand-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.9rem;
  display: block;
}

.post-purchase-modal {
  text-align: center;
  padding: 2.1rem 1.75rem 1.65rem;
  max-width: 430px;
}

.post-purchase-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--a1);
  background: var(--a1-dim);
  border: 1px solid color-mix(in srgb, var(--a1) 35%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.post-purchase-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.post-purchase-message {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 auto 1.1rem;
}

.post-purchase-checklist {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
  padding: 0;
  text-align: left;
}
.post-purchase-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.62rem 0.72rem;
}
.post-purchase-checklist li::before {
  content: '✓';
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.05rem;
  border-radius: 999px;
  background: rgba(80, 200, 120, 0.16);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
}

.post-purchase-cta {
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
}

.paywall-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.paywall-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.4rem;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.paywall-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
  margin: 0 auto 1.6rem;
  max-width: 280px;
}

.paywall-perks li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text);
}

.paywall-perks svg { color: var(--a1); flex-shrink: 0; }

.paywall-plan-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0 auto 0.75rem;
  max-width: 380px;
}

.paywall-plan-btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--panel) 100%);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.8rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
  min-height: 168px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.11);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.paywall-plan-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--a1) 45%, var(--border));
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.paywall-plan-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--a1) 75%, white);
  outline-offset: 2px;
}

.paywall-plan-badge-row {
  display: flex;
  align-items: center;
  min-height: 1.25rem;
}
.paywall-plan-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}
.paywall-plan-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
}

.paywall-plan-price {
  display: flex;
  flex-direction: column;
  gap: 0.09rem;
  margin-top: 0.05rem;
}
.paywall-plan-price strong {
  font-size: 1.26rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.paywall-plan-price em {
  font-size: 0.76rem;
  color: var(--text-2);
  font-style: normal;
}

.paywall-plan-sub {
  font-size: 0.77rem;
  color: var(--text-3);
  margin-top: auto;
}
.paywall-plan-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 8px 22px rgba(0,0,0,0.17);
}

.paywall-plan-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 0.95rem;
}

.paywall-cta {
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.paywall-error {
  font-size: 0.82rem;
  color: #f08080;
  min-height: 1em;
  margin-bottom: 0.25rem;
}

/* ─── Toast notification ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #2a2a35;
  color: #e8e8f0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
  max-width: min(90vw, 360px);
  text-align: center;
  z-index: 9999;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.toast-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.5rem);
}

/* ─── Offline indicator (in header) ───────────────────────────────── */
.offline-indicator {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0b429;
  transition: opacity 0.2s;
}
.offline-indicator.offline-indicator-hidden {
  opacity: 0;
  pointer-events: none;
}

.paywall-dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.14s;
}
.paywall-dismiss:hover { color: var(--text-2); }

@media (max-width: 520px) {
  .paywall-plan-toggle {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
  .paywall-plan-btn {
    min-height: 0;
  }
}

/* ─── Utilities ─────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Animations ────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Progress cards ─────────────────────────────────── */
.progress-view {
  padding: 2rem 1.5rem 3rem;
}
.progress-view-inner {
  max-width: 760px;
  margin: 0 auto;
}
.progress-page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1.6rem;
  text-align: center;
  letter-spacing: -0.01em;
}
.progress-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-align: center;
}
.progress-sub {
  margin: 0.5rem 0 1.4rem;
  text-align: center;
  color: var(--text-2);
}
.progress-section {
  margin: 0 auto 1.2rem;
  max-width: 720px;
}
.progress-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.progress-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.progress-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}
.progress-stat-label {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-3);
}
.progress-stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.progress-stat-icon {
  display: block;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.progress-stat-card--words {
  border-color: var(--a1-dim);
  background: var(--a1-dim);
}
.progress-stat-card--words .progress-stat-icon { color: var(--a1); }
.progress-stat-card--articles {
  border-color: var(--a2-dim);
  background: var(--a2-dim);
}
.progress-stat-card--articles .progress-stat-icon { color: var(--a2); }
.progress-stat-card--streak .progress-stat-icon { color: var(--b1); }
.progress-stat-card.streak-active {
  border-color: rgba(201, 100, 66, 0.35);
  background: var(--accent-dim);
}
.progress-stat-card.streak-active .progress-stat-icon {
  color: var(--accent);
}
.progress-stat-card.streak-active .progress-stat-value {
  color: var(--accent);
}
.progress-daily-goal {
  margin-top: 0.9rem;
}
.mine-top-actions {
  width: 100%;
  margin: 0 0 1rem;
  display: flex;
  justify-content: flex-end;
}
.mine-top-actions .btn-primary,
.empty-state #empty-add-btn {
  min-height: 40px;
  padding: 0.68rem 1rem;
}
.more-menu {
  position: fixed;
  right: 0.75rem;
  bottom: calc(56px + env(safe-area-inset-bottom) + 0.5rem);
  min-width: 180px;
  z-index: 140;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  padding: 0.35rem;
}
.more-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  color: var(--text);
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.more-menu-item:hover {
  background: var(--surface-2);
}
.more-menu-icon {
  color: currentColor;
  flex-shrink: 0;
}
.more-menu-item:hover .more-menu-icon {
  color: var(--text);
}
@media (min-width: 641px) {
  .more-menu {
    top: 118px;
    bottom: auto;
    right: 0.85rem;
  }
}
@media (max-width: 900px) {
  .daily-goal {
    max-width: 240px;
  }
}
@media (max-width: 760px) {
  .daily-goal {
    display: none;
  }
  .progress-cards {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
}

/* ─── PWA install banner ────────────────────────────── */
.pwa-install-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 700px;
  margin: -1rem auto 1.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.9rem;
  color: var(--text-2);
  animation: fadeUp 0.4s ease both;
}
@media (max-width: 640px) {
  .pwa-install-banner:not([hidden]) { display: flex; }
}
.pwa-install-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem 0.3rem;
  cursor: pointer;
  transition: color 0.15s;
}
.pwa-install-dismiss:hover { color: var(--text-2); }

/* ─── TTS listen button (reader header) ────────────── */
.tts-listen-btn[hidden] { display: none; }
.tts-listen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tts-listen-btn:hover { color: var(--text); background: var(--surface-2); }
.tts-listen-btn:disabled { opacity: 0.5; cursor: default; }
.tts-listen-btn[data-state="playing"],
.tts-listen-btn[data-state="paused"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tts-icon-spinner { display: none; animation: tts-spin 0.8s linear infinite; }
.tts-listen-btn[data-state="loading"] .tts-icon-headphone { display: none; }
.tts-listen-btn[data-state="loading"] .tts-icon-spinner  { display: block; }

@keyframes tts-spin { to { transform: rotate(360deg); } }

/* ─── TTS player bar (fixed bottom) ────────────────── */
.tts-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideBarUp 0.2s ease both;
}
.tts-bar-hidden { display: none !important; }

@keyframes slideBarUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.tts-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.tts-play-btn:hover  { opacity: 0.85; transform: scale(1.05); }
.tts-play-btn:active { transform: scale(0.95); }

/* Show pause icon by default (playing); show play icon when paused */
.tts-icon-pause { display: block; }
.tts-icon-play  { display: none; }
.tts-bar[data-paused="true"] .tts-icon-pause { display: none; }
.tts-bar[data-paused="true"] .tts-icon-play  { display: block; }

.tts-track {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tts-progress-bg {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.tts-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s linear;
  pointer-events: none;
}

.tts-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tts-speed-group {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.tts-speed-btn {
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  background: none;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 28px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tts-speed-btn:hover { color: var(--text); border-color: var(--text-3); }
.tts-speed-btn.tts-speed-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 580px) {
  .tts-bar { padding: 0.65rem 1rem; gap: 0.65rem; }
  .tts-speed-group { display: none; }
  .source-link { display: none; }
}

/* ─── Sidebar (desktop) ─────────────────────────────── */
.app-sidebar {
  position: fixed;
  top: 54px;
  left: 0;
  bottom: 0;
  width: 200px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 50;
  padding: 1rem 0.6rem;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar-nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.sidebar-nav-item.active svg {
  color: #7c6af7;
}

/* Shift app content to account for sidebar on desktop */
.with-sidebar .app-main {
  margin-left: 200px;
}

/* ─── Mobile bottom nav ─────────────────────────────── */
.mobile-nav {
  display: none; /* shown only on mobile via media query */
  flex-direction: row;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 120;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
  height: 56px;
  border: none;
  background: none;
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.14s;
}
.mobile-nav-item.active {
  color: #7c6af7;
}
.mobile-nav-item svg {
  flex-shrink: 0;
}

/* Dark-mode contrast tuneups */
:root:not([data-theme="light"]) .sidebar-nav-item:not(.active),
:root:not([data-theme="light"]) .mobile-nav-item:not(.active) {
  color: var(--text);
}

:root:not([data-theme="light"]) .app-sidebar,
:root:not([data-theme="light"]) .mobile-nav,
:root:not([data-theme="light"]) .site-header {
  border-color: rgba(255, 255, 255, 0.16);
}

:root:not([data-theme="light"]) .article-card {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

:root:not([data-theme="light"]) .card-action-btn {
  color: #b8b8c8;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

:root:not([data-theme="light"]) .progress-section-title,
:root:not([data-theme="light"]) .progress-stat-label {
  color: #acacbc;
}

/* ─── Feed panels ───────────────────────────────────── */
.feed-panel-hidden { display: none !important; }

/* ─── Explore header ────────────────────────────────── */
.explore-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.explore-desc {
  font-size: 0.845rem;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0;
}

.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.topic-pill {
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.topic-pill:focus {
  outline: none;
  box-shadow: none;
}

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

.topic-pill:hover {
  border-color: var(--text-2);
  color: var(--text);
}

.topic-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Explore interest (subtopic) pills ─────────────────────────────── */
.interest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.4rem 0 0.1rem;
  animation: interestFadeIn 0.18s ease;
}
.interest-filters[hidden] { display: none; }

@keyframes interestFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.interest-pill {
  font-size: 0.74rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.interest-pill:focus { outline: none; box-shadow: none; }
.interest-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.interest-pill:hover { border-color: var(--text-2); color: var(--text); }
.interest-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.explore-lang-row {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.explore-lang-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: none;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 34px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.explore-lang-btn:hover { color: var(--text); border-color: var(--text-2); }
.explore-lang-btn.active {
  background: #7c6af7;
  border-color: #7c6af7;
  color: #fff;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 960px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Hide sidebar on mobile, show bottom nav instead */
@media (max-width: 640px) {
  .app-sidebar { display: none !important; }
  .with-sidebar .app-main {
    margin-left: 0;
  }
  .with-sidebar .settings-view {
    left: 0;
  }
  .mobile-nav { display: flex; }
  /* Add bottom padding so content clears the mobile nav */
  #feed-view { padding-bottom: calc(56px + env(safe-area-inset-bottom) + 1rem); }
  #article-view { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  #progress-view { padding-bottom: calc(56px + env(safe-area-inset-bottom) + 1rem); }
  /* TTS bar sits above mobile nav */
  .tts-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
}

@media (max-width: 580px) {
  .article-grid { grid-template-columns: 1fr; }
  #feed-view { padding: 2rem 1rem calc(56px + env(safe-area-inset-bottom) + 1rem); }
  #progress-view { padding: 2rem 1rem calc(56px + env(safe-area-inset-bottom) + 1rem); }
  .site-header { padding: 0 1rem; }
  .daily-goal { max-width: 220px; margin: 0 0.6rem; }
  .btn-upgrade { max-width: 38vw; padding: 0.44rem 0.72rem; font-size: 0.72rem; }
  .header-streak { padding: 0.26rem 0.5rem; font-size: 0.75rem; }
  .reader-header { padding: 0 1rem; gap: 0.6rem; }
  .reader-container { padding: 2rem 1.25rem 5rem; }
  .source-link { display: none; }
  .reader-title { font-size: 1.55rem; }
  .mine-top-actions { justify-content: stretch; }
  .mine-top-actions .btn-primary { width: 100%; justify-content: center; }
  .explore-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ─── Onboarding overlays ───────────────────────────────────────────── */
.lang-onboarding {
  position: fixed;
  inset: 0;
  z-index: 300;
  background:
    radial-gradient(circle at top left, rgba(80, 200, 120, 0.14), transparent 34rem),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lang-onboarding.view-hidden { display: none; }
.lang-onboarding-inner {
  width: min(100%, 500px);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}
.onboarding-brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  margin: 0 auto 0.85rem;
}
.onboarding-kicker,
.onboarding-progress span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-onboarding-title {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.55rem;
  color: var(--text);
}
.lang-onboarding-sub {
  color: var(--text-2);
  margin: 0 auto 1.6rem;
  max-width: 38ch;
  font-size: 0.95rem;
  line-height: 1.6;
}
.onboarding-progress {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
  text-align: left;
}
.onboarding-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.onboarding-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #76df9d);
}
.onboarding-trial-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: -0.35rem auto 1.3rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(80, 200, 120, 0.24);
  border-radius: 999px;
  background: rgba(80, 200, 120, 0.09);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 650;
}
.onboarding-trial-note::before {
  content: '✓';
  color: var(--accent);
  font-weight: 850;
}

.onboarding-benefits {
  list-style: none;
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  text-align: center;
  max-width: 300px;
  margin: 0 auto 1.7rem;
  color: var(--text-2);
  font-size: 0.92rem;
}
.onboarding-benefits li {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.onboarding-benefits li::before {
  content: '✓';
  position: static;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(80, 200, 120, 0.16);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}
.onboarding-primary {
  min-width: 170px;
  justify-content: center;
  text-align: center;
}
.lang-onboarding-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.lang-onboarding-btn {
  flex: 1;
  max-width: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.45rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
}
.lang-onboarding-btn:hover,
.lang-onboarding-btn:focus-visible {
  border-color: var(--accent);
  background: var(--card-bg-hover, var(--card-bg));
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}
.lang-flag {
  font-size: 2.5rem;
  line-height: 1;
}
.lang-name {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
@media (max-width: 420px) {
  .lang-onboarding { padding: 1rem; }
  .lang-onboarding-inner { padding: 1.35rem; }
  .lang-onboarding-btns { flex-direction: column; align-items: center; }
  .lang-onboarding-btn { max-width: 260px; width: 100%; flex-direction: row; justify-content: center; padding: 1.1rem 1.25rem; gap: 1rem; }
  .lang-flag { font-size: 2rem; }
}

/* ─── Level onboarding overlay ────────────────────────────────────────── */
.level-onboarding-inner { width: min(100%, 540px); }
.level-onboarding-btns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.level-onboarding-btn {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  padding: 1rem 0.7rem;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s, transform 0.12s, background 0.12s, box-shadow 0.12s;
}
.level-onboarding-btn span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 0.2rem;
}
.level-onboarding-btn:hover,
.level-onboarding-btn:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}
@media (max-width: 520px) {
  .level-onboarding-btns { grid-template-columns: 1fr; }
}

/* ─── Topic onboarding overlay ─────────────────────────────────────────── */
.topic-onboarding-inner { width: min(100%, 590px); }

.topic-onboarding-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.topic-onboarding-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--card-bg);
  color: var(--text-2);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.12s;
}
.topic-onboarding-pill:hover,
.topic-onboarding-pill:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}
.topic-onboarding-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.topic-onboarding-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.topic-onboarding-surprise {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-2));
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, var(--card-bg));
  font-weight: 750;
}
.topic-onboarding-surprise span {
  display: inline-flex;
  margin-left: 0.35rem;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topic-onboarding-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.topic-onboarding-confirm {
  min-width: 160px;
  justify-content: center;
  text-align: center;
}
.complete-onboarding-inner { width: min(100%, 500px); }

/* ─── Post-onboarding screens ──────────────────────────────────────────── */
.install-onboarding-inner,
.notify-onboarding-inner,
.email-onboarding-inner { width: min(100%, 480px); }

.onboarding-skip-link {
  display: block;
  width: fit-content;
  margin: 0.85rem auto 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  text-align: center;
  transition: color 0.15s;
}
.onboarding-skip-link:hover { color: var(--text-2); }
.onboarding-skip-link:focus { outline: none; }
.onboarding-skip-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.onboarding-other-lang-form {
  margin: 0.6rem auto 0;
  max-width: 320px;
}
.onboarding-other-lang-label {
  display: block;
  color: var(--text-3);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}
.onboarding-other-lang-row {
  display: flex;
  gap: 0.5rem;
}
.onboarding-other-lang-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.88rem;
}
.onboarding-other-lang-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.onboarding-other-lang-submit {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s;
}
.onboarding-other-lang-submit:hover { opacity: 0.8; }
.onboarding-other-lang-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.onboarding-other-lang-thanks {
  margin: 0.6rem auto 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
}

.onboarding-level-demo {
  margin: 0 auto 1.3rem;
  max-width: 340px;
}
.onboarding-level-demo-tabs {
  justify-content: center;
  margin: 0 auto 0.7rem;
  max-width: 240px;
}
.onboarding-level-demo-text {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: left;
  min-height: 3.2em;
}

.onboarding-headline-preview {
  display: block;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-3);
  text-align: left;
}
.onboarding-headline-preview-label {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.onboarding-headline-preview-text {
  display: block;
  color: var(--text);
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.4;
  min-height: 2.7em;
}

.onboarding-demo-loading {
  color: var(--text-3) !important;
  font-weight: 500 !important;
  font-style: italic;
}

/* Install: iOS steps */
.install-ios-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}
.install-ios-steps li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}
.install-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-share-icon {
  display: inline-block;
  vertical-align: -3px;
  margin: 0 1px;
  color: var(--accent);
}

/* Notify: bell icon */
.notify-onboarding-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(80, 200, 120, 0.12);
  border: 1.5px solid rgba(80, 200, 120, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent);
}

/* ─── Settings topics section ──────────────────────────────────────────── */
.settings-topics-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
}
.settings-topics-label { margin-bottom: 0; }

.settings-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.settings-topic-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-2);
  background: var(--card-bg);
  color: var(--text-2);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.settings-topic-pill:hover { border-color: var(--accent); color: var(--text); }
.settings-topic-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Settings subtopic chip rows ───────────────────────────────────────── */
.settings-subtopics-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.settings-subtopic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0 0;
}

.settings-subtopic-chip {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.settings-subtopic-chip:hover { border-color: var(--accent); color: var(--text); }
.settings-subtopic-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Topics panel empty state ─────────────────────────────────────────── */
.topics-empty {
  padding: 3rem 1.5rem;
  text-align: center;
}
.topics-empty.hidden { display: none; }
.topics-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.topics-empty-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.topics-empty-settings-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

/* ─── Push cap picker (max notifications per day) ───────────────────────── */
.settings-push-cap-row {
  cursor: default;
  pointer-events: none;
}
.settings-push-cap-row .settings-row-label { pointer-events: none; }

.push-cap-picker {
  display: flex;
  gap: 0.3rem;
  pointer-events: all;
}
.push-cap-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: none;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 34px;
  min-width: 34px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.push-cap-btn:hover { color: var(--text); border-color: var(--text-2); }
.push-cap-btn.active {
  background: #7c6af7;
  border-color: #7c6af7;
  color: #fff;
}

/* ─── Topic tag on article cards ───────────────────────────────────────── */
.card-topic-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-right: auto;
}

/* ─── Inline settings link (used in empty states) ──────────────────────── */
.inline-settings-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────── */
/* ─── Blog pages (server-rendered) ─────────────────────── */
/* ─────────────────────────────────────────────────────── */

/* footer links */
.lp-footer-link {
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.lp-footer-link:hover { color: var(--text-2); }

/* ─── Layout ─────────────────────────────────────────── */
.blog-main {
  min-height: calc(100vh - 60px);
  padding: 3rem 1.25rem 5rem;
}

.blog-container {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.blog-container--narrow {
  max-width: 740px;
}

/* ─── Listing header ─────────────────────────────────── */
.blog-listing-header {
  margin-bottom: 2.5rem;
}

.blog-listing-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.blog-listing-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 520px;
}

/* ─── Post grid ──────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ─── Post card ──────────────────────────────────────── */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.blog-card:hover {
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  gap: 0.75rem;
}

.blog-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.blog-card-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}
.blog-card:hover .blog-card-title { color: var(--accent); }

.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ─── Tag pill ───────────────────────────────────────── */
.blog-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s;
}
a.blog-tag:hover { background: var(--accent); color: #fff; }

/* ─── Empty state ────────────────────────────────────── */
.blog-empty {
  color: var(--text-3);
  font-size: 0.95rem;
  padding: 2rem 0;
}

/* ─── Breadcrumb ─────────────────────────────────────── */
.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 2rem;
}

.blog-breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
}
.blog-breadcrumb-link:hover { text-decoration: underline; }

.blog-breadcrumb-sep {
  color: var(--text-3);
}

.blog-breadcrumb-current {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60ch;
}

/* ─── Blog article ───────────────────────────────────── */
.blog-article {
  width: 100%;
}

.blog-post-header {
  margin-bottom: 2rem;
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.blog-post-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.blog-post-meta {
  font-size: 0.84rem;
  color: var(--text-3);
  margin: 0;
}

.blog-post-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}

/* ─── Post content (extends .reader-body) ────────────── */
.blog-post-content {
  margin-top: 0.25rem;
}

.blog-post-content h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.25rem 0 0.75rem;
  line-height: 1.3;
}

.blog-post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.5rem;
}

.blog-post-content p {
  margin-top: 1.25em;
}

.blog-post-content p:first-child {
  margin-top: 0;
}

.blog-post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-post-content a:hover { opacity: 0.8; }

.blog-post-content ul,
.blog-post-content ol {
  padding-left: 1.6rem;
  margin-top: 1em;
  margin-bottom: 1em;
}

.blog-post-content li {
  margin-bottom: 0.4em;
  line-height: 1.7;
  color: var(--reader-text);
}

.blog-post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.1rem;
  margin: 1.5rem 0;
  color: var(--text-2);
  font-style: italic;
}

.blog-post-content code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.blog-post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ─── Blog table of contents ─────────────────────────── */
.blog-toc {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.blog-toc-title {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-toc-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.4rem;
}

.blog-toc-list li {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.4;
}

.blog-toc-link {
  color: var(--accent);
  text-decoration: none;
}
.blog-toc-link:hover { text-decoration: underline; }

/* ─── Related articles ───────────────────────────────── */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-articles-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.related-articles-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.related-articles-link {
  font-size: 0.84rem;
  color: var(--accent);
  text-decoration: none;
}
.related-articles-link:hover { text-decoration: underline; }

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.related-article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.related-article-link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.related-article-meta {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-3);
}

.related-article-title {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.35;
}

.related-article-link:hover .related-article-title {
  color: var(--accent);
}

.related-article-excerpt {
  margin: 0;
  color: var(--text-2);
  font-size: 0.83rem;
  line-height: 1.5;
}

/* ─── Blog custom components ─────────────────────────── */

/* Stat callout: row of metric cards */
.stat-callout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.stat-callout .stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-callout .stat .number {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-callout .stat .label {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* Level example: bordered box with A1/A2/B1 rows */
.level-example {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 2.5rem 0;
}
.level-example .level-header {
  background: var(--surface-2);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.level-example .level-header a,
.level-example .level-header .btn-link {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.level-example .level-body {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.level-example .level-body:last-child {
  border-bottom: none;
}
.level-example .level-body .headline {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.level-example .level-body .body-text {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* Topic cluster: labelled pill link group */
.topic-cluster {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}
.topic-cluster h4 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 1rem;
}
.topic-cluster .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topic-cluster .pill {
  display: inline-block;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s;
}
.topic-cluster .pill:hover {
  background: var(--accent-dim);
}

/* CTA inline: filled box with button */
.cta-inline {
  background: var(--accent);
  border-radius: var(--radius-sm);
  padding: 2rem 2.25rem;
  margin: 3rem 0;
}
.cta-inline h4 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.5rem;
}
.cta-inline p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.cta-inline .btn {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
}
.cta-inline .btn:hover {
  opacity: 0.9;
}
.cta-inline a:not(.btn) {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

/* ─── Back-to-blog link ──────────────────────────────── */
.blog-post-footer-nav {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.15s;
}
.blog-back-link:hover { gap: 0.2rem; }

/* ─── 404 page ───────────────────────────────────────── */
.blog-not-found {
  text-align: center;
  padding: 5rem 0;
}

.blog-not-found-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.blog-not-found-sub {
  color: var(--text-2);
  margin-bottom: 2rem;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .blog-main { padding: 2rem 1.25rem 4rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-post-title { font-size: 1.7rem; }
  .blog-breadcrumb-current { max-width: 30ch; }
}

/* ─────────────────────────────────────────────────────── */
/* ─── Language pages (/spanish, /french) ───────────────── */
/* ─────────────────────────────────────────────────────── */

/* Section wrapper */
.lang-section {
  padding: 4rem 2rem;
}
.lang-freshness {
  padding: 0.9rem 2rem 0;
}
.lang-freshness-inner .topic-stats-bar {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lang-freshness-inner .topic-stats-inner {
  justify-content: center;
  text-align: center;
}
.lang-section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lang-section-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.lang-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.lang-heading {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.75rem;
  line-height: 1.2;
}

.lang-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.lang-toc-link {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.82rem;
}
.lang-toc-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.lang-intent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.lang-intent-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
}
.lang-intent-title {
  font-size: 0.98rem;
  margin-bottom: 0.65rem;
}
.lang-intent-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-2);
  line-height: 1.6;
  font-size: 0.86rem;
}
.lang-intent-list li {
  margin-bottom: 0.55rem;
}
.lang-intent-list li strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.lang-intent-list li span {
  display: block;
}
.lang-answer-copy {
  color: var(--text-2);
  line-height: 1.65;
  font-size: 0.9rem;
  margin: 0 0 0.85rem;
}
.lang-answer-link {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}
.lang-answer-link:hover { text-decoration: underline; }

.lang-fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.lang-fit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.lang-fit-title {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}
.lang-fit-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* About section */
.lang-about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}
.lang-about-body p {
  font-size: 0.97rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-top: 1em;
}
.lang-about-body p:first-child { margin-top: 0; }
.lang-about-body em { color: var(--text); font-style: normal; font-weight: 500; }

.lang-facts-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  position: sticky;
  top: 70px;
}
.lang-facts-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}
.lang-fact {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.lang-fact:last-child { border-bottom: none; }
.lang-fact-label { color: var(--text-2); }
.lang-fact-value { color: var(--text); font-weight: 500; text-align: right; }

/* Level guide */
.lang-level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.lang-level-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.lang-level-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.lang-level-card--soon {
  opacity: 0.55;
}

.lang-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}
.lang-level-badge--a1 { background: var(--a1-dim); color: var(--a1); }
.lang-level-badge--a2 { background: var(--a2-dim); color: var(--a2); }
.lang-level-badge--b1 { background: var(--b1-dim); color: var(--b1); }
.lang-level-badge--b2 { background: rgba(78,142,240,0.13); color: #4e8ef0; }
[data-theme="light"] .lang-level-badge--b2 { background: rgba(29,95,204,0.10); color: #1d5fcc; }

.lang-level-soon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 0.2em 0.5em;
  border-radius: 4px;
}
.lang-level-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.lang-level-vocab {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}
.lang-level-meta {
  list-style: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.lang-level-cta {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.5rem;
  font-weight: 500;
}
.lang-level-card--link:hover .lang-level-cta { text-decoration: underline; }

/* Topics */
.lang-topics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.lang-topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem 1rem;
}
.lang-topic-emoji { font-size: 1.65rem; line-height: 1; }
.lang-topic-label { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.lang-topic-desc  { font-size: 0.7rem; color: var(--text-3); line-height: 1.3; }
.lang-topics-intro { font-size: 0.9rem; color: var(--text-2); margin-bottom: 1.5rem; max-width: 600px; }
.lang-topics-note { font-size: 0.82rem; color: var(--text-3); }

/* Clickable topic tiles */
a.lang-topic--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.lang-topic--link:hover {
  border-color: var(--accent, #c96442);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
a.lang-topic--link:hover .lang-topic-label { color: var(--accent, #c96442); }

/* Why reading section */
.lang-why-body {
  max-width: 720px;
}
.lang-why-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}
.lang-why-body p:last-child { margin-bottom: 0; }
.lang-why-body em { color: var(--text); font-style: italic; }

/* FAQ */
.lang-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lang-faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.lang-faq-item:first-child { border-top: 1px solid var(--border); }
.lang-faq-q {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.lang-faq-a {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.7;
}
.lang-faq-a em { color: var(--text); font-style: italic; }

/* Bottom CTA */
.lang-cta {
  padding: 5rem 2rem;
  text-align: center;
  background: #141414;
  border-top: none;
}
.lang-cta-inner {
  max-width: 480px;
  margin: 0 auto;
}
.lang-cta-heading {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}
.lang-cta-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}
.lang-signup-status { font-size: 0.85rem; min-height: 1.2em; }

/* Real article cards */
.lang-articles-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.lang-article-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
}
.lang-article-head {
  margin-bottom: 0.75rem;
}
.lang-article-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.35;
}
.lang-article-body {
  font-size: 0.97rem;
}
.lang-article-body p + p { margin-top: 1em; }
.lang-article-source {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-3);
}
.lang-article-source a {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lang-article-source a:hover { color: var(--text-2); }

/* Article section intro + per-card meta */
.lang-artintro {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 680px;
}
.lang-sources-intro {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 640px;
}
.inline-art-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-3);
}
.inline-art-meta-level { font-weight: 600; color: var(--text-2); }
.inline-art-meta-sep { padding: 0 0.1rem; }
.inline-art-meta-source a {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inline-art-meta-source a:hover { color: var(--text-2); }

/* Responsive */
@media (max-width: 900px) {
  .lang-level-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-intent-grid { grid-template-columns: 1fr; }
  .lang-fit-grid { grid-template-columns: 1fr; }
  .lang-about-grid { grid-template-columns: 1fr; }
  .lang-facts-card { position: static; }
  .lang-topics-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 700px) {
  .lang-topics-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .lang-section { padding: 3rem 1.25rem; }
  .lang-freshness { padding: 0.7rem 1.25rem 0; }
  .lang-level-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .lang-topics-grid { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .lang-topic { padding: 1rem 0.5rem 0.85rem; }
  .lang-topic-emoji { font-size: 1.4rem; }
  .lang-cta { padding: 3.5rem 1.25rem; }
}
@media (max-width: 400px) {
  .lang-topics-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Blog prose (About page) ─────────────────────────────────────── */
.blog-prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--text-1);
}
.blog-prose p { margin-bottom: 1.1rem; line-height: 1.75; }
.blog-prose ul { padding-left: 1.4rem; margin-bottom: 1.1rem; }
.blog-prose li { margin-bottom: 0.5rem; line-height: 1.7; }
.blog-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── FAQ page ────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 2rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  color: var(--text-1);
  gap: 1rem;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item[open] .faq-question::after { content: '−'; }
.faq-answer {
  padding: 0 1.4rem 1.1rem;
  color: var(--text-2);
  line-height: 1.7;
  font-size: 0.96rem;
}
.faq-answer p { margin: 0; }
.faq-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-2);
}
.faq-cta a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ─── Contact form ───────────────────────────────────────────────────────────── */
.contact-faq-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text-2);
}
.contact-faq-banner a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contact-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.contact-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.contact-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}
.contact-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.contact-input:focus {
  border-color: rgba(201, 100, 66, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.12);
}
.contact-textarea {
  min-height: 150px;
  resize: vertical;
}
.contact-form-actions { margin-top: 0.5rem; }
.contact-status {
  font-size: 0.9rem;
  min-height: 1.4em;
  margin-top: 0.25rem;
}
.contact-status--ok    { color: #4caf7d; }
.contact-status--error { color: #e05252; }

/* ─── Topic page: stats bar ─────────────────────────── */
.topic-stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
}
.topic-stats-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.topic-stat {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
}
.topic-stat-sep {
  color: var(--text-3);
  font-size: 0.75rem;
  user-select: none;
}

/* ─── Topic page: related-topics chip rail ──────────── */
.topic-chips-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45em 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.topic-chip:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--text);
}

/* ─── Topic page: level progression rail ────────────── */
.lang-level-progression-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
}
.lang-level-progression-step {
  flex: 1 1 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 120px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
a.lang-level-progression-step:hover { border-color: var(--border-2); }
.lang-level-progression-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  color: var(--text-3);
  font-size: 1.2rem;
  flex-shrink: 0;
  align-self: center;
}

/* ─── Topic page: related blog post cards ───────────── */
.blog-preview-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.blog-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.blog-preview-date {
  font-size: 0.75rem;
  color: var(--text-3);
  margin: 0;
}
.blog-preview-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}
.blog-preview-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}

/* ─── Responsive — topic page components ────────────── */
@media (max-width: 640px) {
  .topic-stats-bar { padding: 0.5rem 1rem; }
  .lang-level-progression-arrow { display: none; }
  .lang-level-progression-grid { flex-direction: column; gap: 0.5rem; }
  .lang-level-progression-step { flex: none; width: 100%; }
}

/* ─── Topic snippet cards ────────────────────────────── */
.topic-snippets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.topic-snippet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}
.topic-snippet-card:hover { border-color: var(--border-2); }
.topic-snippet-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.topic-snippet-levels { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.topic-snippet-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}
.topic-snippet-preview {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}
.topic-snippet-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5em 1.1em;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.topic-snippet-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ─── Article drawer ─────────────────────────────────── */
.topic-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.topic-drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.topic-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92vh;
  background: var(--bg);
  border-top: 1px solid var(--border-2);
  border-radius: 16px 16px 0 0;
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0, 0, 1);
}
.topic-drawer.open { transform: translateY(0); }
body.drawer-open { overflow: hidden; }

.topic-drawer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topic-drawer-tabs { display: flex; gap: 0.35rem; flex: 1; }
.topic-drawer-tab {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  border-radius: 6px;
  padding: 0.35em 0.9em;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.topic-drawer-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.topic-drawer-tab.disabled,
.topic-drawer-tab:disabled {
  opacity: 0.3;
  cursor: default;
}
.topic-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15em 0.3em;
  border-radius: 4px;
  flex-shrink: 0;
  font-family: inherit;
}
.topic-drawer-close:hover { color: var(--text); }
.topic-drawer-body {
  overflow-y: auto;
  padding: 1.5rem 1.5rem 3rem;
  flex: 1;
  min-height: 0;
  max-width: 680px;
}
.topic-drawer-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.topic-drawer-wordcount {
  margin: -0.6rem 0 1.25rem !important;
  font-size: 0.8rem !important;
  color: var(--text-3) !important;
}
.topic-drawer-body p {
  font-size: 0.97rem;
  line-height: 1.75;
  color: var(--reader-text);
  margin: 0 0 1em;
}
.topic-drawer-source {
  margin-top: 2rem !important;
  font-size: 0.8rem !important;
  color: var(--text-3) !important;
}
.topic-drawer-source a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 768px) {
  .topic-drawer {
    left: auto;
    max-width: 600px;
    width: 100%;
    max-height: 100vh;
    top: 0;
    bottom: 0;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--border-2);
    transform: translateX(100%);
  }
  .topic-drawer.open { transform: translateX(0); }
  .topic-drawer-body { padding: 2rem 2rem 4rem; }
}

/* ─── Inline article cards (language hub) ────────────── */
.inline-art-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 720px;
}
.inline-art-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
}
.inline-art-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.inline-art-tabs { display: flex; gap: 0.3rem; }
.inline-art-tab {
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.inline-art-tab:hover:not(.active) { background: var(--border); color: var(--text); }
.inline-art-tab.active {
  background: var(--accent, #c96442);
  border-color: var(--accent, #c96442);
  color: #fff;
}
.inline-art-wordcount {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}
.inline-art-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 1rem;
}
.inline-art-body { font-size: 0.97rem; }
.inline-art-source {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-3);
}
.inline-art-source a {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inline-art-source a:hover { color: var(--text-2); }
@media (max-width: 640px) {
  .inline-art-card { padding: 1.35rem 1.25rem; }
}
.feature-read-more { color: var(--accent); font-weight: 600; text-decoration: none; }
.feature-read-more:hover { text-decoration: underline; }
.feature-related-list { list-style: none; display: grid; gap: 0.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; }
.feature-related-link { display:block; padding:0.75rem 0.9rem; border:1px solid var(--border); border-radius:10px; text-decoration:none; color:var(--text); background:var(--surface); }
.feature-related-link:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px){ .feature-related-list{ grid-template-columns:1fr; } }

/* ─── Comparison pages ───────────────────────────────── */
.compare-page {
  background: var(--bg);
  color: var(--text);
}

.compare-container {
  max-width: 1040px;
  margin: 0 auto;
}

.compare-hero {
  padding: 4rem 2rem 2.5rem;
}

.compare-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1.25rem;
  align-items: end;
}

.compare-verdict {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding: 1.25rem;
}

.compare-verdict-label {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare-verdict p:last-child {
  margin: 0;
  color: var(--text-2);
  line-height: 1.65;
}

.compare-section {
  padding: 2.5rem 2rem;
}

.compare-section-muted {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.compare-criteria {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 1.4rem;
}

.compare-criteria span {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--text-2);
  background: var(--surface);
  font-size: 0.82rem;
}

.compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.compare-table th,
.compare-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.compare-table thead th {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 0.88rem;
}

.compare-table tbody th {
  width: 20%;
  color: var(--text);
  font-size: 0.9rem;
}

.compare-table td {
  color: var(--text-2);
  font-size: 0.88rem;
}

.compare-table tr:last-child th,
.compare-table tr:last-child td {
  border-bottom: 0;
}

.compare-fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.compare-fit-grid h2 {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 1rem;
}

.compare-fit-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-2);
  line-height: 1.65;
  font-size: 0.9rem;
}

.compare-copy {
  max-width: 780px;
}

.compare-copy h2 {
  margin-top: 1.75rem;
}

.compare-copy h2:first-child {
  margin-top: 0;
}

@media (max-width: 760px) {
  .compare-hero,
  .compare-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .compare-hero-grid,
  .compare-fit-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Feature SEO pages ───────────────────────────────────────────────────── */
.feature-hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
}
.feature-pill-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  padding: 0.48rem 0.78rem;
  font-size: 0.86rem;
  text-decoration: none;
}
.feature-pill-link:hover {
  border-color: var(--accent);
  color: var(--text);
}
.feature-answer {
  max-width: 860px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124,106,247,0.12), rgba(232,98,42,0.08));
  padding: 1.35rem;
}
.feature-answer p {
  color: var(--text-2);
  line-height: 1.75;
  font-size: 1.03rem;
  margin: 0 0 1rem;
}
.feature-answer-cta,
.feature-read-more {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.feature-answer-cta:hover,
.feature-read-more:hover { text-decoration: underline; }
.feature-faq-list {
  display: grid;
  gap: 0.85rem;
  max-width: 900px;
}
.feature-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1rem 1.1rem;
}
.feature-faq-item summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}
.feature-faq-item p {
  color: var(--text-2);
  line-height: 1.7;
  margin: 0.7rem 0 0;
}
.feature-table-wrap { overflow-x: auto; }
.feature-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
}
.feature-table th,
.feature-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1rem;
  text-align: left;
  color: var(--text-2);
  vertical-align: top;
}
.feature-table th {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.feature-table tr:last-child td { border-bottom: 0; }
.feature-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.feature-read-more { font-size: 0.8rem; }
.lp-cta {
  margin: 0 auto 3rem;
  max-width: 980px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(232,98,42,0.18), transparent 34%), linear-gradient(135deg, rgba(124,106,247,0.16), rgba(255,255,255,0.04));
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.lp-cta h2 {
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  margin: 0 0 0.8rem;
}
.lp-cta p {
  color: var(--text-2);
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto 1.35rem;
}
.lp-cta .btn-primary { display: inline-flex; }
@media (max-width: 760px) {
  .lp-cta { margin-left: 1rem; margin-right: 1rem; }
}

/* ─── Signup modal ───────────────────────────────────────────────────────────── */

.signup-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.18s ease;
}
.signup-modal-hidden { display: none !important; }

.signup-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}
.signup-modal-logo-mark {
  width: 22px;
  height: 22px;
}
.signup-modal-logo-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.signup-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.04);
  width: 100%;
  max-width: 760px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  animation: modalSlideUp 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.signup-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.14s, background 0.14s;
}
.signup-modal-close:hover { color: var(--text); background: var(--surface-2); }

.signup-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.signup-modal-context {
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius) 0 0 var(--radius);
}

.signup-modal-headline {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 1.4rem;
}

.signup-modal-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.signup-modal-bullet {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.55;
  padding-left: 1.35rem;
  position: relative;
}
.signup-modal-bullet::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  top: 0.05em;
}

.signup-modal-form-wrap {
  padding: 2.5rem 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.signup-modal-email-row {
  margin-bottom: 0.6rem;
}
.signup-modal-email-row .lp-email-input {
  width: 100%;
}

.signup-modal-submit {
  width: 100%;
  justify-content: center;
  padding: 0.72rem 1rem;
  font-size: 0.95rem;
}

/* Flatten Google button inside modal — shadow looks out of place */
.signup-modal-form-wrap .lp-google-btn {
  box-shadow: none;
  border: 1px solid var(--border-2);
}
.signup-modal-form-wrap .lp-google-btn:hover:not(:disabled),
.signup-modal-form-wrap .lp-google-btn:focus-visible:not(:disabled) {
  box-shadow: none;
  transform: none;
  border-color: var(--border-2);
}

.signup-modal-legal {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
}

.signup-modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text);
}
.signup-modal-success-icon { font-size: 2rem; }
.signup-modal-success strong { font-size: 1.05rem; }

/* Mobile: stack vertically */
@media (max-width: 600px) {
  .signup-modal-body { grid-template-columns: 1fr; }
  .signup-modal-context {
    padding: 2rem 1.5rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .signup-modal-form-wrap { padding: 1.5rem 1.5rem 2rem; }
  .signup-modal-panel { max-width: 100%; }
}

/* ─── Blog filters ───────────────────────────────────────────────────────────── */

.blog-filters {
  margin-bottom: 2.5rem;
}

.blog-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.blog-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
  white-space: nowrap;
}
.blog-filter-chip:hover {
  color: var(--text);
  border-color: var(--text-3);
  background: var(--surface-2);
}
.blog-filter-chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.blog-filter-chip--active:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  opacity: 0.9;
}

.blog-cluster-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-3);
}
.blog-cluster-nav-label {
  white-space: nowrap;
}
.blog-cluster-link {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border-2);
  transition: color 0.14s, border-color 0.14s;
}
.blog-cluster-link:hover {
  color: var(--text);
  border-color: var(--text-2);
}

.blog-filter-empty {
  color: var(--text-2);
  font-size: 0.95rem;
  padding: 2rem 0;
  text-align: center;
}

/* ─── Blog cluster (topic) page ──────────────────────────────────────────────── */

.blog-cluster-count {
  margin-top: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-3);
}

.blog-cluster-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.blog-cluster-related-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}
.blog-cluster-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.blog-cluster-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.14s, background 0.14s;
}
.blog-cluster-related-card:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}
.blog-cluster-related-card strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.blog-cluster-related-card span {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.4;
}
