/* Pure Living Course - Calm editorial reading app */
/* v3: Search, sources panel, templates, Start Here, mobile fixes. */

/* ── Design tokens ── */
:root {
  --bg: #FAFAF7;
  --bg-warm: #F5F3EE;
  --card: #FFFFFF;
  --card-elevated: #FFFFFF;
  --ink: #1C1C1E;
  --ink-secondary: #6B7280;
  --ink-tertiary: #9CA3AF;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --accent: #2D6A4F;
  --accent-light: #D4E7DC;
  --accent-bg: #F0F7F3;
  --accent-hover: #245840;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── App shell ── */
#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
  overflow-x: hidden;
}

/* ── Bottom navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-inner {
  display: flex;
  width: 100%;
  max-width: 480px;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  color: var(--ink-tertiary);
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active { color: var(--accent); }

.nav-tab svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-tab.active svg { stroke-width: 2.2; }

.nav-tab span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Page header ── */
.page-header {
  padding: calc(var(--safe-top) + 16px) 20px 8px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-header .subtitle {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.4;
  margin-top: 4px;
}

/* ── Section label ── */
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 20px 20px 10px;
}

/* ── Hero continue card ── */
.hero-card {
  margin: 12px 20px 0;
  padding: 24px;
  background: var(--accent);
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-card:active {
  transform: scale(0.98);
}

.hero-card .hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 10px;
}

.hero-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.hero-card .hero-meta {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 16px;
}

.hero-card .hero-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-card .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.2s;
}

.hero-card .dot.done { background: rgba(255, 255, 255, 0.7); }
.hero-card .dot.current { background: #fff; width: 10px; height: 10px; }

.hero-card .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.hero-card .hero-cta svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Empty / welcome state ── */
.welcome-card {
  margin: 12px 20px 0;
  padding: 32px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.welcome-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-card p {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.welcome-card .btn-primary {
  display: inline-flex;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
}

/* ── Search ── */
.search-wrap {
  padding: 4px 20px 12px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
}

.search-input-wrap svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--ink-tertiary);
}

.search-results {
  min-height: 100px;
}

/* ── Start Here path ── */
.start-here-section {
  margin: 0 20px 8px;
}

.start-here-desc {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.start-here-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}

.start-here-item:active { transform: scale(0.98); }

.start-here-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.start-here-number.done {
  background: var(--accent);
  color: #fff;
}

.start-here-number .sh-check svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-here-content {
  flex: 1;
  min-width: 0;
}

.start-here-content h4 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 2px;
}

.start-here-meta {
  font-size: 13px;
  color: var(--ink-tertiary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.start-here-item > svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── Latest saved insight preview ── */
.insight-preview {
  margin: 0 20px 8px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}

.insight-preview:active { transform: scale(0.98); }

.insight-preview .insight-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.insight-preview h4 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 6px;
}

.insight-preview .insight-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Horizontal lesson row ── */
.lesson-row {
  padding: 0 20px;
  margin-bottom: 8px;
}

.lesson-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lesson-row-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lesson-row-header .see-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.lesson-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.lesson-scroll::-webkit-scrollbar { display: none; }

/* ── Lesson card ── */
.lesson-card {
  flex-shrink: 0;
  width: 220px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  scroll-snap-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}

.lesson-card-image {
  height: 104px;
  margin-bottom: 14px;
  border-radius: calc(var(--radius-md) - 4px);
  background: linear-gradient(135deg, #EEF3ED, #DCD3C5);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.lesson-card:active {
  transform: scale(0.97);
}

.lesson-card .card-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.lesson-card h4 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-card .card-outcome {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-tertiary);
}

.lesson-card .card-meta .read-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-weight: 600;
}

.lesson-card .card-meta .read-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* Level badge */
.level-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.level-beginner {
  background: var(--accent-bg);
  color: var(--accent);
}

.level-intermediate {
  background: #FFF3E0;
  color: #E65100;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

/* Full-width lesson card for lists */
.lesson-card-full {
  margin: 0 20px 10px;
  padding: 12px 14px 12px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform 0.12s ease;
  overflow: hidden;
}

.lesson-card-full-image {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #EEF3ED, #DCD3C5);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.lesson-card-full:active { transform: scale(0.98); }

.lesson-card-full > svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.lesson-card-full .card-content { flex: 1; min-width: 0; }

.lesson-card-full h4 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  margin-bottom: 2px;
}

.lesson-card-full .card-outcome-full {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-card-full .card-meta {
  font-size: 13px;
  color: var(--ink-tertiary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lesson-card-full .card-meta .read-badge {
  color: var(--accent);
  font-weight: 600;
}

/* ── Utforska: category chips ── */
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 16px;
  -webkit-overflow-scrolling: touch;
}

.category-chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--ink-secondary);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}

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

/* ── Category card (full width, in Utforska) ── */
.category-section {
  margin-bottom: 24px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  margin-bottom: 12px;
}

.category-header .cat-icon,
.category-thumb {
  font-size: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EEF3ED, #DCD3C5);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.category-thumb span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(8px);
}

.category-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.category-header .cat-desc {
  display: none;
}

/* ── Lesson reader ── */
.lesson-view {
  padding-top: var(--safe-top);
}

.lesson-top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--border);
}

.lesson-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-toc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 6px 12px;
  background: var(--bg-warm);
  border-radius: 999px;
}

.btn-toc svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.lesson-breadcrumb {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-bottom: 6px;
}

.lesson-title-bar h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.lesson-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 12px;
  align-items: center;
}

.lesson-title-meta .source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-bg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.lesson-hero-image {
  height: 156px;
  margin: 0 0 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #EEF3ED, #DCD3C5);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

/* Dot progress */
.dot-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.dot-progress .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all 0.25s ease;
}

.dot-progress .dot.done { background: var(--accent); }
.dot-progress .dot.current { background: var(--accent); width: 12px; height: 12px; }

.dot-progress .dot-label {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-tertiary);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Section content ── */
.section-content {
  padding: 28px 24px 20px;
}

.section-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.section-body p {
  margin-bottom: 16px;
}

.section-body p:last-child { margin-bottom: 0; }

/* Example / anti-example boxes */
.example-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
}

.example-box .example-label {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.example-box p {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.anti-example-box {
  margin-top: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #D97706;
  background: #FFF8F0;
}

.anti-example-box .example-label {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #D97706;
  margin-bottom: 6px;
}

.anti-example-box p {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

/* Save section button */
.save-section-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 16px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.15s;
}

.save-section-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.save-section-btn.saved {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-light);
}

.save-section-btn.saved svg {
  fill: var(--accent);
}

/* Section navigation */
.section-nav {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
}

.section-nav .btn-secondary {
  flex: 1;
  padding: 14px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 15px;
  color: var(--ink-secondary);
  transition: background 0.15s;
}

.section-nav .btn-primary {
  flex: 1.2;
  padding: 14px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 15px;
  color: #fff;
  transition: background 0.15s;
}

.section-nav .btn-primary:active { background: var(--accent-hover); }

/* ── End-of-lesson content ── */
.lesson-end {
  padding: 0 24px 40px;
}

/* ── Sources panel ── */
.sources-panel {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sources-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-warm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sources-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sources-header-left svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sources-header-left span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.sources-count {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  flex-shrink: 0;
}

.sources-header > svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sources-panel.open .sources-header > svg {
  transform: rotate(180deg);
}

.sources-body {
  display: none;
  padding: 0;
  border-top: 1px solid var(--border);
}

.sources-panel.open .sources-body {
  display: block;
}

.source-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.source-item:last-child {
  border-bottom: none;
}

.source-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.source-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-warm);
  color: var(--ink-tertiary);
  flex-shrink: 0;
}

.source-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.source-creator {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-bottom: 4px;
}

.source-summary {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.source-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ── Template cards ── */
.templates-intro {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.templates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.template-card {
  padding: 16px;
  background: var(--bg-warm);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.template-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 6px;
}

.template-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

/* Video summary block */
.video-summary {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-warm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.video-summary-header svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-secondary);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.video-summary.open .video-summary-header svg {
  transform: rotate(90deg);
}

.video-summary-header .video-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.video-summary-header .video-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--accent-bg);
  border-radius: 999px;
  flex-shrink: 0;
}

.video-summary-body {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.video-summary.open .video-summary-body { display: block; }

.video-summary-body .video-creator {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-tertiary);
  margin-bottom: 8px;
}

.video-summary-body .video-takeaway {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.video-summary-body .video-timestamps {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* Practice prompt */
.practice-card {
  margin-top: 20px;
  padding: 20px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-md);
}

.practice-card .practice-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 8px;
}

.practice-card p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.practice-card .practice-optional {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-style: italic;
}

.practice-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--card);
  resize: vertical;
  min-height: 80px;
  outline: none;
  margin-bottom: 10px;
}

.practice-card textarea:focus { border-color: var(--accent); }

.practice-card .btn-save-note {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
}

/* Related lessons */
.related-section {
  margin-top: 28px;
}

.related-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.related-card {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.12s;
}

.related-card:active { transform: scale(0.98); }

.related-card h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.related-card .related-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.related-card svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── TOC Drawer ── */
.toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.toc-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.toc-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 0 0 var(--safe-bottom);
  transform: translateY(0);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.toc-overlay.hidden .toc-drawer {
  transform: translateY(100%);
}

.toc-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

.toc-handle span {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
}

.toc-title {
  padding: 4px 24px 16px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.toc-list {
  padding: 8px 0;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.toc-item:active { background: var(--bg-warm); }

.toc-item .toc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.toc-item .toc-dot.done { background: var(--accent); }
.toc-item .toc-dot.current { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.toc-item .toc-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-secondary);
  flex: 1;
}

.toc-item .toc-dot.done + .toc-text,
.toc-item .toc-dot.current + .toc-text {
  color: var(--ink);
  font-weight: 600;
}

/* ── Sparat tab ── */
.sparat-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sparat-tab {
  padding: 10px 16px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.sparat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Saved items */
.saved-item {
  margin: 0 20px 10px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.saved-item .saved-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.saved-item h4 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  flex: 1;
}

.saved-item .saved-item-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 4px;
}

.saved-item .saved-item-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-item .saved-note-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin-top: 8px;
}

.btn-remove {
  padding: 4px;
  color: var(--ink-tertiary);
  flex-shrink: 0;
}

.btn-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 32px;
  color: var(--ink-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--border-strong);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
}

/* ── Save lesson button (top bar) ── */
.btn-save-lesson {
  padding: 6px;
  color: var(--ink-secondary);
}

.btn-save-lesson svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-save-lesson.saved svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* ── Utility ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 20px;
}

/* ── Transitions ── */
.fade-in {
  animation: fadeIn 0.2s ease;
}

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

/* ── Desktop max-width ── */
@media (min-width: 520px) {
  body {
    background: #EEEEE9;
  }

  #app {
    background: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 480px;
    border-radius: 20px 20px 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .templates-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* ── Home redesign: clear first-use hierarchy ── */
.home-redesign {
  padding-bottom: 18px;
}

.home-top {
  padding: calc(var(--safe-top) + 22px) 20px 8px;
}

.home-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .02em;
  margin-bottom: 10px;
}

.home-top h1 {
  max-width: 420px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 780;
  margin-bottom: 12px;
}

.home-top p {
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.45;
  max-width: 410px;
}

.continue-card,
.home-primary-card {
  margin: 14px 20px 0;
  border-radius: 28px;
  border: 1px solid rgba(45, 106, 79, .14);
  box-shadow: 0 16px 42px rgba(37, 50, 42, .08);
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: #1F4E3B;
  color: #fff;
  cursor: pointer;
}

.continue-card h2 {
  font-size: 20px;
  line-height: 1.16;
  letter-spacing: -.02em;
  margin: 4px 0 6px;
}

.continue-card p {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.continue-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-weight: 750;
  font-size: 13px;
}

.continue-action svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.home-primary-card {
  padding: 22px;
  background: radial-gradient(circle at 20% 0%, rgba(212,231,220,.9), transparent 42%), #fff;
}

.primary-card-kicker,
.section-heading-row span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .075em;
}

.home-primary-card h2 {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.035em;
  margin: 9px 0 8px;
}

.home-primary-card p {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.start-progress-line {
  margin: 18px 0 16px;
}

.start-progress-line span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 650;
}

.start-progress-line div {
  height: 8px;
  border-radius: 999px;
  background: rgba(45,106,79,.11);
  overflow: hidden;
}

.start-progress-line b {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.home-actions {
  display: grid;
  gap: 10px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 760;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: rgba(45,106,79,.09);
  color: var(--accent);
}

.wide { width: 100%; }

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 24px 20px 10px;
}

.section-heading-row h3 {
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -.025em;
  margin-top: 6px;
}

.section-heading-row small {
  color: var(--ink-tertiary);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.text-link {
  color: var(--accent);
  font-weight: 750;
  font-size: 14px;
}

.start-here-section.compact {
  margin-top: 0;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 20px;
}

.mode-card {
  text-align: left;
  padding: 16px 17px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.mode-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.mode-card span {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.category-overview-list {
  display: grid;
  gap: 9px;
  margin: 0 20px;
}

.category-overview-item {
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  text-align: left;
}

.category-overview-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--accent-bg);
  font-size: 18px;
}

.category-overview-item strong,
.category-overview-item small {
  display: block;
}

.category-overview-item strong {
  font-size: 15px;
  line-height: 1.2;
}

.category-overview-item small {
  margin-top: 2px;
  color: var(--ink-tertiary);
  font-size: 13px;
}

.category-overview-item > svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 420px) {
  .home-actions { grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Visual identity polish: editorial Pure Living feel */
:root {
  --sand: #EFE7D8;
  --sage: #DDE9DE;
  --moss: #2D6A4F;
  --clay: #C9835D;
  --paper: #FFFDF8;
}

body {
  background:
    radial-gradient(circle at 18% -4%, rgba(221,233,222,.88), transparent 34%),
    radial-gradient(circle at 95% 18%, rgba(239,231,216,.9), transparent 34%),
    var(--bg);
}

.lesson-card,
.lesson-card-full,
.category-overview-item,
.mode-card,
.start-here-item {
  box-shadow: 0 10px 28px rgba(30, 41, 34, .045);
}

.lesson-card-image,
.lesson-card-full-image,
.category-thumb,
.lesson-hero-image {
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.78), transparent 22%),
    linear-gradient(135deg, #DFE9DC 0%, #EFE7D8 50%, #C9D7CB 100%);
}

.lesson-card-image::after,
.lesson-card-full-image::after,
.category-thumb::after,
.lesson-hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 36%, rgba(255,255,255,.28) 36% 37%, transparent 37% 100%),
    radial-gradient(circle at 82% 80%, rgba(45,106,79,.18), transparent 34%);
  pointer-events: none;
}

.theme-instagram-foundations .lesson-card-image,
.lesson-card-full.theme-instagram-foundations .lesson-card-full-image,
.category-overview-item.theme-instagram-foundations .category-overview-icon,
.category-thumb.theme-instagram-foundations,
.lesson-view.theme-instagram-foundations .lesson-hero-image {
  background-image: linear-gradient(135deg, #E5F0E7, #F8EFE2 55%, #D5E3D8);
}

.theme-production-systems .lesson-card-image,
.lesson-card-full.theme-production-systems .lesson-card-full-image,
.category-overview-item.theme-production-systems .category-overview-icon,
.category-thumb.theme-production-systems,
.lesson-view.theme-production-systems .lesson-hero-image {
  background-image: linear-gradient(135deg, #E7EBE0, #F5E4D7 54%, #CED8C9);
}

.theme-curation-and-claims .lesson-card-image,
.lesson-card-full.theme-curation-and-claims .lesson-card-full-image,
.category-overview-item.theme-curation-and-claims .category-overview-icon,
.category-thumb.theme-curation-and-claims,
.lesson-view.theme-curation-and-claims .lesson-hero-image {
  background-image: linear-gradient(135deg, #E8E7EF, #F4E7DD 54%, #D9D2C4);
}

.theme-growth-and-review .lesson-card-image,
.lesson-card-full.theme-growth-and-review .lesson-card-full-image,
.category-overview-item.theme-growth-and-review .category-overview-icon,
.category-thumb.theme-growth-and-review,
.lesson-view.theme-growth-and-review .lesson-hero-image {
  background-image: linear-gradient(135deg, #E2ECEF, #F2E9D8 54%, #CEDCD8);
}

.lesson-card h4,
.lesson-card-full h4,
.start-here-content h4,
.category-overview-item strong {
  letter-spacing: -.018em;
}

.lesson-card .card-category,
.card-category {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .045em;
  font-size: 11px;
}

/* Reader polish */
.lesson-top-bar {
  background:
    linear-gradient(180deg, rgba(255,253,248,.96), rgba(250,250,247,.92));
}

.lesson-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 7px;
}

.lesson-title-bar h1 {
  font-size: 23px;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.lesson-outcome {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
  margin: 8px 0 10px;
}

.lesson-title-meta {
  margin-bottom: 14px;
}

.dot-progress {
  padding: 0 0 14px;
}

.section-content {
  padding: 22px 18px 18px;
}

.section-card {
  padding: 24px 21px 20px;
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 18px 46px rgba(31, 45, 36, .07);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
  margin-bottom: 13px;
}

.section-content h2 {
  font-size: 28px;
  line-height: 1.09;
  letter-spacing: -.045em;
  margin-bottom: 18px;
}

.section-body {
  font-size: 18px;
  line-height: 1.72;
}

.section-body p:first-child::first-letter {
  font-size: 48px;
  line-height: .88;
  float: left;
  padding: 7px 8px 0 0;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
}

.example-box,
.anti-example-box {
  border-radius: 18px;
  border-left-width: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.045);
}

.save-section-btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  margin-top: 22px;
  background: #fff;
}

.section-hint {
  margin-top: 12px;
  color: var(--ink-tertiary);
  font-size: 12px;
  text-align: center;
}

.section-nav {
  position: sticky;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  z-index: 40;
  padding: 12px 18px 16px;
  background: linear-gradient(180deg, rgba(250,250,247,0), rgba(250,250,247,.96) 28%);
}

.section-nav .btn-primary,
.section-nav .btn-secondary {
  min-height: 52px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(31,45,36,.08);
}

.lesson-end {
  padding: 4px 18px 88px;
}

.sources-panel,
.video-summary,
.practice-card,
.related-card,
.template-card {
  background: rgba(255,255,255,.86);
  border-color: rgba(0,0,0,.065);
  box-shadow: 0 10px 28px rgba(31,45,36,.045);
}

.sources-header,
.video-summary-header {
  background: rgba(245,243,238,.78);
}

.learn-more-panel .sources-header-left span {
  color: var(--ink);
}

.source-link {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-bg);
}

@media (max-width: 390px) {
  .home-top h1 { font-size: 31px; }
  .section-content h2 { font-size: 25px; }
  .section-body { font-size: 17px; }
}


/* Reader focus mode */
body.reading-mode .bottom-nav {
  display: none;
}

body.reading-mode #app {
  padding-bottom: 0;
}

body.reading-mode .section-nav {
  bottom: 0;
}


/* Keep lesson text clearer than decorative drop caps */
.section-body p:first-child::first-letter {
  font-size: inherit;
  line-height: inherit;
  float: none;
  padding: 0;
  color: inherit;
}


/* Home v2: less generic, stronger editorial app feel */
.home-v2 {
  background:
    radial-gradient(circle at 90px 80px, rgba(45,106,79,.10), transparent 35%),
    linear-gradient(180deg, rgba(255,253,248,.94), rgba(250,250,247,0));
}

.home-top-v2 {
  padding: calc(var(--safe-top) + 24px) 20px 12px;
}

.home-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.home-brand-row span {
  font-size: 15px;
  font-weight: 820;
  letter-spacing: -.01em;
}

.home-brand-row small {
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.home-top-v2 h1 {
  max-width: 370px;
  font-size: 42px;
  line-height: .98;
  letter-spacing: -.06em;
  font-weight: 840;
  margin-bottom: 14px;
}

.home-top-v2 p {
  max-width: 360px;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.46;
}

.today-lesson-card {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 16px;
  margin: 14px 20px 0;
  padding: 14px;
  border-radius: 32px;
  background: #1F3128;
  color: #fff;
  box-shadow: 0 22px 60px rgba(31,49,40,.20);
  cursor: pointer;
}

.today-cover {
  min-height: 188px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,.62), transparent 18%),
    radial-gradient(circle at 78% 72%, rgba(255,207,42,.30), transparent 24%),
    linear-gradient(145deg, #B8CBB8, #EEE3C7 48%, #D5B78E);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.today-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(255,255,255,.30), transparent 35%),
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.22), transparent 20%);
}

.cover-mark {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255,253,248,.88);
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.today-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 2px 2px 0;
}

.today-kicker {
  color: rgba(255,255,255,.62);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.today-copy h2 {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.045em;
  margin-bottom: 9px;
}

.today-copy p {
  color: rgba(255,255,255,.72);
  font-size: 13px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.today-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.today-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 720;
}

.today-btn {
  margin-top: auto;
  width: 100%;
  min-height: 46px;
  background: #fff;
  color: #173324;
  box-shadow: none;
}

.today-plan-card {
  margin: 14px 20px 0;
  padding: 16px;
  border-radius: 26px;
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 14px 36px rgba(31,45,36,.055);
}

.today-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.today-plan-head span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.today-plan-head h3 {
  font-size: 19px;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.today-plan-head small {
  min-width: 44px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-align: center;
}

.today-plan-lesson {
  width: 100%;
  padding: 12px 13px;
  border-radius: 18px;
  background: var(--bg-warm);
  text-align: left;
  margin-bottom: 10px;
}

.today-plan-lesson strong,
.today-plan-lesson span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-plan-lesson strong {
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.today-plan-lesson span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.today-task-list {
  display: grid;
  gap: 8px;
}

.today-task {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 16px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.today-task-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(45,106,79,.08);
  border: 1px solid rgba(45,106,79,.14);
  color: var(--accent);
}

.today-task-check svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
}

.today-task strong,
.today-task small {
  display: block;
  min-width: 0;
}

.today-task strong {
  font-size: 14px;
  line-height: 1.18;
  margin-bottom: 2px;
}

.today-task small {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.today-task.done .today-task-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.today-task.done strong {
  color: var(--accent);
}

.home-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 20px 2px;
}

.quick-action {
  min-height: 92px;
  padding: 15px;
  text-align: left;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 10px 28px rgba(31,45,36,.045);
}

.quick-action strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.quick-action span {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.editorial-heading {
  padding-top: 26px;
}

.foundation-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 20px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.foundation-strip::-webkit-scrollbar { display: none; }

.foundation-pill {
  flex: 0 0 184px;
  min-height: 138px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 10px 28px rgba(31,45,36,.045);
  text-align: left;
  scroll-snap-align: start;
}

.foundation-pill > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
}

.foundation-pill > span svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}

.foundation-pill strong {
  display: block;
  font-size: 15px;
  line-height: 1.18;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.foundation-pill small {
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 650;
}

.category-overview-v2 .category-overview-item {
  grid-template-columns: 48px 1fr 20px;
  padding: 16px;
  border-radius: 24px;
}

.category-overview-v2 .category-overview-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
}

.category-overview-v2 .category-overview-item small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.34;
}

/* Explore v2: category menu first */
.explore-header-v2 {
  padding-bottom: 2px;
}

.explore-category-menu {
  padding-bottom: 12px;
}

.explore-category-card {
  display: grid;
  grid-template-columns: 132px 1fr 18px;
  gap: 14px;
  align-items: stretch;
  width: calc(100% - 40px);
  margin: 0 20px 12px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 34px rgba(31,45,36,.055);
  text-align: left;
}

.explore-category-art {
  min-height: 138px;
  display: grid;
  place-items: end start;
  border-radius: 22px;
  background:
    radial-gradient(circle at 72% 24%, rgba(255,255,255,.54), transparent 19%),
    linear-gradient(145deg, #D4E7DC, #EEE3C7 52%, #C5A47E);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  position: relative;
}

.explore-category-art span {
  z-index: 1;
  width: 34px;
  height: 34px;
  margin: 10px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,253,248,.78);
  backdrop-filter: blur(8px);
  font-size: 17px;
}

.explore-category-copy {
  min-width: 0;
  padding: 3px 0;
}

.explore-category-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 7px;
}

.explore-category-top strong {
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.explore-category-top small {
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.explore-category-copy p {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.explore-category-copy em {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.32;
  font-style: normal;
  font-weight: 680;
  margin-bottom: 9px;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.category-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.explore-category-card > svg {
  align-self: center;
  width: 18px;
  height: 18px;
  stroke: var(--ink-tertiary);
  fill: none;
  stroke-width: 2;
}

/* Generated image bindings: make real assets visible wherever app.js adds inline background-image. */
[style*="assets/images"] {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Local CSS cover art. No external image license needed. */
.theme-instagram-foundations .today-cover,
.theme-instagram-foundations .lesson-card-image,
.theme-instagram-foundations .lesson-card-full-image,
.theme-instagram-foundations .explore-category-art,
.theme-instagram-foundations.article-reader .article-cover {
  background:
    radial-gradient(circle at 22% 20%, rgba(255,255,255,.58), transparent 18%),
    radial-gradient(circle at 84% 74%, rgba(245,207,112,.34), transparent 24%),
    linear-gradient(145deg, #C8D8C3, #EFE2C5 50%, #B99B72);
}

.theme-production-systems .today-cover,
.theme-production-systems .lesson-card-image,
.theme-production-systems .lesson-card-full-image,
.theme-production-systems .explore-category-art,
.theme-production-systems.article-reader .article-cover {
  background:
    radial-gradient(circle at 76% 18%, rgba(255,255,255,.56), transparent 18%),
    radial-gradient(circle at 18% 78%, rgba(45,106,79,.22), transparent 24%),
    linear-gradient(145deg, #E8D8BE, #C9B18C 48%, #738A74);
}

.theme-curation-and-claims .today-cover,
.theme-curation-and-claims .lesson-card-image,
.theme-curation-and-claims .lesson-card-full-image,
.theme-curation-and-claims .explore-category-art,
.theme-curation-and-claims.article-reader .article-cover {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.56), transparent 18%),
    radial-gradient(circle at 76% 76%, rgba(183,129,92,.24), transparent 24%),
    linear-gradient(145deg, #D8D0BF, #B9C5AF 50%, #8C795F);
}

.theme-growth-and-review .today-cover,
.theme-growth-and-review .lesson-card-image,
.theme-growth-and-review .lesson-card-full-image,
.theme-growth-and-review .explore-category-art,
.theme-growth-and-review.article-reader .article-cover {
  background:
    radial-gradient(circle at 78% 24%, rgba(255,255,255,.52), transparent 18%),
    radial-gradient(circle at 20% 80%, rgba(245,207,112,.22), transparent 24%),
    linear-gradient(145deg, #AFC7BC, #E7DBC1 50%, #6F8A77);
}

@media (max-width: 390px) {
  .home-top-v2 h1 { font-size: 38px; }
  .today-lesson-card { grid-template-columns: 112px 1fr; }
  .today-cover { min-height: 172px; }
  .today-copy h2 { font-size: 22px; }
  .explore-category-card { grid-template-columns: 82px 1fr 16px; gap: 12px; }
  .explore-category-art { min-height: 104px; }
}


/* Article reader v2: X-style, minimal chrome */
body.reading-mode {
  background: #050505;
}

body.reading-mode #app {
  max-width: 480px;
  padding-bottom: 0;
  background: #050505;
}

.article-reader {
  min-height: 100dvh;
  background: #050505;
  color: #F7F7F2;
  padding-bottom: calc(92px + var(--safe-bottom));
}

.article-cover {
  height: min(43vh, 292px);
  min-height: 230px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,207,42,.58), rgba(45,106,79,.20)),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.34), transparent 20%),
    linear-gradient(135deg, #F3C736, #E4D9BC 42%, #829887);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.article-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0) 42%, rgba(0,0,0,.72)),
    radial-gradient(circle at 18% 28%, rgba(0,0,0,.12), transparent 18%);
}

.article-cover::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -34px;
  width: 142px;
  height: 142px;
  border: 2px solid rgba(0,0,0,.22);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.article-cover-actions {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  top: calc(var(--safe-top) + 14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-circle-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.46);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.article-circle-btn.saved {
  background: rgba(255,255,255,.92);
  color: #111;
}

.article-circle-btn svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-circle-btn.saved svg {
  fill: currentColor;
}

.article-cover-mark {
  position: absolute;
  z-index: 2;
  left: 24px;
  bottom: 22px;
  color: rgba(255,255,255,.84);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.article-main {
  padding: 24px 24px 12px;
  background: #050505;
}

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: rgba(255,255,255,.48);
  font-size: 13px;
  font-weight: 680;
}

.article-meta-row span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: rgba(255,255,255,.32);
}

.article-main h1 {
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.055em;
  font-weight: 850;
  color: #fff;
  margin: 0 0 16px;
}

.article-dek {
  color: rgba(255,255,255,.72);
  font-size: 18px;
  line-height: 1.48;
  margin-bottom: 22px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.article-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #F7F7F2;
  color: #173324;
  font-size: 13px;
  font-weight: 860;
}

.article-byline strong,
.article-byline span {
  display: block;
}

.article-byline strong {
  color: #fff;
  font-size: 15px;
  margin-bottom: 3px;
}

.article-byline span {
  color: rgba(255,255,255,.48);
  font-size: 13px;
}

.article-source-brief {
  margin: 0 0 30px;
  padding: 16px;
  border-radius: 22px;
  background: #F5F2EB;
  border: 1px solid rgba(20, 32, 25, .08);
  color: var(--text);
}

.article-source-brief span,
.article-source-brief strong {
  display: block;
}

.article-source-brief span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .10em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.article-source-brief strong {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 8px;
}

.article-source-brief p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-progress-line {
  height: 3px;
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 30px;
}

.article-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #F7F7F2;
}

.article-section {
  padding-bottom: 22px;
}

.article-section-label {
  color: rgba(255,255,255,.44);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

.article-section h2 {
  color: #fff;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -.035em;
  margin-bottom: 18px;
}

.article-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: rgba(255,255,255,.88);
  font-size: 20px;
  line-height: 1.62;
  letter-spacing: -.018em;
}

.article-text p {
  margin-bottom: 26px;
}

.article-text p:last-child {
  margin-bottom: 0;
}

.article-callout {
  margin: 28px 0 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}

.article-callout strong {
  display: block;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.article-callout p {
  color: rgba(255,255,255,.78);
  font-size: 16px;
  line-height: 1.5;
}

.article-callout.good {
  background: rgba(45,106,79,.28);
}

.article-callout.avoid {
  background: rgba(151,71,71,.22);
}

.article-save-insight {
  width: 100%;
  margin-top: 26px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 15px;
  font-weight: 740;
}

.article-save-insight.saved {
  background: #F7F7F2;
  color: #111;
}

.article-save-insight svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.article-save-insight.saved svg {
  fill: currentColor;
}

.article-extras {
  padding: 6px 0 24px;
}

.article-detail-block {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 18px 0;
}

.article-detail-block summary {
  color: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 760;
}

.article-detail-block summary::-webkit-details-marker {
  display: none;
}

.article-detail-block summary::after {
  content: "+";
  float: right;
  color: rgba(255,255,255,.48);
}

.article-detail-block[open] summary::after {
  content: "−";
}

.article-detail-block > p,
.article-source-item p,
.article-template p {
  color: rgba(255,255,255,.70);
  font-size: 15px;
  line-height: 1.55;
  margin-top: 10px;
}

.article-detail-block textarea {
  width: 100%;
  min-height: 110px;
  margin: 14px 0 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  resize: vertical;
}

.article-detail-block .btn-save-note {
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 760;
}

.article-source-item,
.article-template {
  margin-top: 16px;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
}

.article-source-item strong,
.article-template strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.article-source-item small {
  display: block;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  margin-top: 4px;
}

.article-source-item a {
  display: inline-flex;
  margin-top: 10px;
  color: #fff;
  font-weight: 740;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-related {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  color: #fff;
  text-align: left;
}

.article-related svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.article-bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, var(--safe-bottom));
  z-index: 80;
  width: min(432px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(22,22,22,.88);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.article-nav-link,
.article-nav-primary {
  min-height: 48px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 780;
}

.article-nav-link {
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.07);
}

.article-nav-primary {
  color: #111;
  background: #F7F7F2;
}

.article-reader .lesson-top-bar,
.article-reader .section-nav,
.article-reader .dot-progress,
.article-reader .section-content,
.article-reader .lesson-title-bar,
.article-reader .lesson-hero-image {
  display: none;
}

@media (max-width: 390px) {
  .article-main { padding-left: 22px; padding-right: 22px; }
  .article-main h1 { font-size: 31px; }
  .article-text { font-size: 19px; }
  .article-cover { min-height: 218px; }
}


/* Article reader nav fix: no floating bar over the text */
.article-reader {
  padding-bottom: calc(28px + var(--safe-bottom));
}

.article-bottom-nav {
  position: static;
  left: auto;
  transform: none;
  width: auto;
  margin: 8px 24px calc(28px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  border-radius: 0;
}

.article-nav-link,
.article-nav-primary {
  min-height: 54px;
}

.article-nav-link {
  background: rgba(255,255,255,.08);
}

.article-nav-primary {
  background: #F7F7F2;
}


/* Longform reader: scroll article, theme toggle */
body.reading-mode {
  background: #FAFAF7;
}

.longform-reader {
  padding-bottom: calc(32px + var(--safe-bottom));
}

.article-cover-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-theme-btn {
  min-width: 64px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.46);
  color: #fff;
  font-size: 14px;
  font-weight: 780;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reader-light.article-reader,
.reader-light .article-main {
  background: #FAFAF7;
  color: #171717;
}

.reader-light .article-cover::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,0) 45%, rgba(0,0,0,.42)),
    radial-gradient(circle at 18% 28%, rgba(0,0,0,.10), transparent 18%);
}

.reader-light .article-cover-mark {
  color: rgba(255,255,255,.88);
}

.reader-light .article-meta-row {
  color: rgba(23,23,23,.52);
}

.reader-light .article-meta-row span:not(:last-child)::after {
  color: rgba(23,23,23,.28);
}

.reader-light .article-main h1,
.reader-light .article-section h2,
.reader-light .article-byline strong,
.reader-light .article-detail-block summary,
.reader-light .article-callout strong,
.reader-light .article-source-item strong,
.reader-light .article-template strong,
.reader-light .article-related {
  color: #171717;
}

.reader-light .article-dek,
.reader-light .article-byline span,
.reader-light .article-detail-block > p,
.reader-light .article-source-item p,
.reader-light .article-template p {
  color: rgba(23,23,23,.64);
}

.reader-light .article-avatar {
  background: #173324;
  color: #fff;
}

.reader-light .article-section-label {
  color: rgba(23,23,23,.42);
}

.reader-light .article-text {
  color: rgba(23,23,23,.90);
}

.reader-light .article-section {
  border-bottom: 1px solid rgba(23,23,23,.08);
}

.reader-light .article-callout,
.reader-light .article-source-item,
.reader-light .article-template,
.reader-light .article-related,
.reader-light .article-detail-block textarea {
  background: rgba(255,255,255,.78);
  border-color: rgba(23,23,23,.08);
  color: #171717;
}

.reader-light .article-callout.good {
  background: rgba(45,106,79,.10);
}

.reader-light .article-callout.avoid {
  background: rgba(151,71,71,.09);
}

.reader-light .article-callout p {
  color: rgba(23,23,23,.70);
}

.reader-light .article-save-insight {
  background: rgba(23,23,23,.06);
  color: #171717;
}

.reader-light .article-save-insight.saved {
  background: #173324;
  color: #fff;
}

.reader-light .article-detail-block {
  border-top-color: rgba(23,23,23,.10);
}

.reader-light .article-detail-block summary::after {
  color: rgba(23,23,23,.42);
}

.reader-light .article-detail-block textarea {
  color: #171717;
}

.reader-light .article-detail-block .btn-save-note,
.reader-light .article-nav-primary {
  background: #173324;
  color: #fff;
}

.reader-light .article-nav-link {
  background: rgba(23,23,23,.06);
  color: rgba(23,23,23,.66);
}

.reader-light .article-source-item small {
  color: rgba(23,23,23,.45);
}

.reader-light .article-source-item a {
  color: #173324;
}

.reader-dark.article-reader,
.reader-dark .article-main {
  background: #050505;
  color: #F7F7F2;
}

.longform-reader .article-main {
  padding-bottom: 0;
}

.longform-reader .article-progress-line {
  display: none;
}

.longform-reader .article-section {
  padding: 34px 0 38px;
}

.longform-reader .article-section:first-of-type {
  padding-top: 4px;
}

.longform-reader .article-save-insight {
  margin-top: 22px;
  width: auto;
  padding: 0 18px;
  min-height: 46px;
  display: inline-flex;
}

.longform-done-nav {
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
}

.longform-done-nav span {
  min-height: 1px;
}


/* Saved library overview */
.sparat-overview-card {
  margin: 10px 20px 14px;
  padding: 16px;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 14px 36px rgba(31,45,36,.055);
}

.sparat-overview-card > div:first-child span,
.sparat-overview-card > div:first-child strong,
.sparat-overview-card > div:first-child small {
  display: block;
}

.sparat-overview-card > div:first-child span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.sparat-overview-card > div:first-child strong {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.sparat-overview-card > div:first-child small {
  margin-top: 6px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.sparat-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.sparat-overview-grid span {
  padding: 11px 8px;
  border-radius: 17px;
  background: var(--accent-bg);
  text-align: center;
}

.sparat-overview-grid strong,
.sparat-overview-grid small {
  display: block;
}

.sparat-overview-grid strong {
  font-size: 18px;
  line-height: 1;
}

.sparat-overview-grid small {
  margin-top: 4px;
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 680;
}

.sparat-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  font-size: 11px;
  font-weight: 800;
}

.sparat-tab.active span {
  background: rgba(255,255,255,.22);
}

.saved-item-hint {
  margin-top: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
}

/* Global dark and light theme */
.global-theme-toggle {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  right: max(14px, calc((100vw - 480px) / 2 + 14px));
  z-index: 160;
  min-width: 62px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: #172018;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 26px rgba(31,45,36,.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 760;
}

body.app-dark {
  --bg: #0B0C0B;
  --bg-warm: #121412;
  --card: #151715;
  --card-elevated: #1A1D1A;
  --ink: #F5F2EA;
  --ink-secondary: rgba(245,242,234,.66);
  --ink-tertiary: rgba(245,242,234,.42);
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.14);
  --accent: #A8D5BA;
  --accent-bg: rgba(168,213,186,.13);
  background: #0B0C0B;
}

body.app-dark .global-theme-toggle {
  background: rgba(22,24,22,.86);
  color: #F7F4EC;
  border-color: rgba(255,255,255,.12);
}

body.app-dark #app,
body.app-dark .home-v2,
body.app-dark .explore-v2,
body.app-dark .fade-in:not(.article-reader) {
  background: #0B0C0B;
  color: #F5F2EA;
}

body.app-dark .bottom-nav {
  background: rgba(15,17,15,.88);
  border-top-color: rgba(255,255,255,.09);
}

body.app-dark .lesson-card,
body.app-dark .lesson-card-full,
body.app-dark .foundation-pill,
body.app-dark .category-overview-item,
body.app-dark .explore-category-card,
body.app-dark .search-input-wrap,
body.app-dark .insight-preview,
body.app-dark .quick-action,
body.app-dark .today-plan-card,
body.app-dark .welcome-card {
  background: rgba(26,29,26,.92);
  border-color: rgba(255,255,255,.09);
  color: #F5F2EA;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

body.app-dark .today-plan-lesson {
  background: rgba(255,255,255,.06);
}

body.app-dark .today-task-check {
  background: rgba(168,213,186,.12);
  border-color: rgba(168,213,186,.22);
}

body.app-dark .today-task.done .today-task-check {
  background: #A8D5BA;
  border-color: #A8D5BA;
  color: #132116;
}

body.app-dark .search-input {
  color: #F5F2EA;
}

body.app-dark .today-lesson-card {
  background: #E8E0C8;
  color: #132116;
}

body.app-dark .today-copy p,
body.app-dark .today-kicker {
  color: rgba(19,33,22,.66);
}

body.app-dark .today-meta span {
  background: rgba(19,33,22,.10);
  color: rgba(19,33,22,.72);
}

body.app-dark .today-btn {
  background: #132116;
  color: #F7F4EC;
}

body.app-dark .page-header .subtitle,
body.app-dark .card-outcome,
body.app-dark .card-outcome-full,
body.app-dark .explore-category-copy p,
body.app-dark .category-overview-item small,
body.app-dark .foundation-pill small,
body.app-dark .home-top-v2 p {
  color: rgba(245,242,234,.62);
}

/* Hide duplicate global theme button inside reader cover on wider contexts by making it compact */
.reading-mode .global-theme-toggle {
  display: none;
}

/* Article typography correction: Medium-like mobile reading */
body.reading-mode {
  background: var(--bg);
}

body.reading-mode #app {
  background: var(--bg);
}

.reader-light.article-reader,
.reader-light .article-main {
  background: #FAFAF7;
}

.reader-dark.article-reader,
.reader-dark .article-main {
  background: #0B0C0B;
}

.article-cover {
  height: min(34vh, 238px);
  min-height: 192px;
}

.article-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 22px 12px;
}

.article-meta-row {
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: .01em;
}

.article-main h1 {
  max-width: 11ch;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(34px, 9vw, 46px);
  line-height: .98;
  letter-spacing: -.055em;
  margin-bottom: 16px;
}

.article-dek {
  max-width: 34ch;
  font-size: 18px;
  line-height: 1.48;
  letter-spacing: -.01em;
  margin-bottom: 24px;
}

.article-byline {
  margin-bottom: 34px;
}

.longform-reader .article-section {
  padding: 34px 0 42px;
}

.longform-reader .article-section:first-of-type {
  padding-top: 0;
}

.article-section-label {
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: .14em;
}

.article-section h2 {
  max-width: 18ch;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.035em;
  margin-bottom: 18px;
}

.article-text {
  max-width: 36ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18.5px;
  line-height: 1.74;
  letter-spacing: 0;
  text-wrap: pretty;
}

.article-text p {
  margin-bottom: 22px;
}

.article-text p + p {
  margin-top: 2px;
}

.article-callout {
  max-width: 36ch;
  margin: 26px 0 0;
  padding: 16px 17px;
  border-radius: 18px;
}

.article-callout p {
  font-size: 15.5px;
  line-height: 1.58;
}

.longform-reader .article-save-insight {
  margin-top: 20px;
  min-height: 44px;
  font-size: 14px;
}

.article-detail-block {
  max-width: 36ch;
}

.article-bottom-nav {
  max-width: 36ch;
  margin-left: 22px;
  margin-right: 22px;
}

@media (max-width: 390px) {
  .article-main {
    padding-left: 20px;
    padding-right: 20px;
  }
  .article-main h1 {
    font-size: 37px;
  }
  .article-dek {
    font-size: 17px;
  }
  .article-section h2 {
    font-size: 22px;
  }
  .article-text {
    font-size: 18px;
    line-height: 1.72;
    max-width: 35ch;
  }
  .article-cover {
    min-height: 180px;
  }
}


/* Keep global theme button from covering the home brand label */
.home-brand-row small {
  padding-right: 72px;
}

/* Reader progress and contents access */
.article-toc-btn {
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.46);
  color: #fff;
  font-size: 14px;
  font-weight: 780;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.article-read-progress {
  position: sticky;
  top: 0;
  z-index: 70;
  height: 3px;
  background: rgba(23,23,23,.08);
  overflow: hidden;
}

.article-read-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: #173324;
}

.reader-dark .article-read-progress {
  background: rgba(255,255,255,.12);
}

.reader-dark .article-read-progress span {
  background: #F7F7F2;
}

body.app-dark .toc-drawer {
  background: #151715;
  color: #F5F2EA;
}

body.app-dark .toc-item:active {
  background: rgba(255,255,255,.08);
}

.category-detail-count {
  margin: 0 20px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

.saved-v2 .page-header {
  padding-bottom: 12px;
}

body.app-dark .category-detail-count {
  background: rgba(168,213,186,.13);
  color: #A8D5BA;
}

/* Guided Home */
.guided-home {
  padding-bottom: 20px;
}

.guided-hero {
  padding: calc(var(--safe-top) + 26px) 20px 16px;
}

.guided-hero h1 {
  max-width: 9ch;
  margin-top: 18px;
  font-size: clamp(44px, 14vw, 66px);
  line-height: .9;
  letter-spacing: -.07em;
}

.guided-hero p {
  max-width: 31ch;
  margin-top: 14px;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.45;
}

.guided-current-card,
.guided-path-card,
.guided-explore-card,
.guided-next-card {
  margin: 14px 20px 0;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-md);
}

.guided-current-card {
  overflow: hidden;
  padding: 16px;
}

.guided-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.guided-step-row strong {
  color: var(--accent);
}

.guided-progress {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0,0,0,.07);
}

.guided-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.guided-cover {
  position: relative;
  height: 178px;
  margin-top: 16px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(45,106,79,.18), rgba(210,180,140,.24));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.guided-kicker {
  margin-top: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.guided-current-card h2 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -.05em;
}

.guided-current-card p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.guided-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.guided-meta span,
.guided-resume,
.guided-path-item small {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 720;
}

.guided-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
}

.guided-resume {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: #F8F5ED;
}

.guided-resume span {
  text-transform: uppercase;
  letter-spacing: .07em;
}

.guided-resume strong {
  color: var(--ink);
  font-size: 15px;
}

.guided-start-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 820;
}

.guided-path-card {
  padding: 16px;
}

.guided-section-head span,
.guided-explore-card span,
.guided-next-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.guided-section-head h3 {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.guided-path-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.guided-path-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  background: #FAFAF7;
  text-align: left;
}

.guided-path-item.current {
  background: var(--accent-bg);
}

.guided-path-item.upcoming {
  opacity: .62;
}

.guided-path-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 840;
}

.guided-path-index svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}

.guided-path-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.guided-path-item small {
  display: block;
  margin-top: 3px;
}

.guided-explore-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.guided-explore-card p {
  margin-top: 4px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.guided-next-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

body.app-dark .guided-current-card,
body.app-dark .guided-path-card,
body.app-dark .guided-explore-card,
body.app-dark .guided-next-card {
  background: rgba(26,29,26,.92);
  border-color: rgba(255,255,255,.09);
  color: #F5F2EA;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

body.app-dark .guided-hero p,
body.app-dark .guided-current-card p,
body.app-dark .guided-explore-card p,
body.app-dark .guided-path-item small,
body.app-dark .guided-resume {
  color: rgba(245,242,234,.64);
}

body.app-dark .guided-path-item,
body.app-dark .guided-resume {
  background: rgba(255,255,255,.055);
}

body.app-dark .guided-path-index {
  background: rgba(255,255,255,.08);
}

/* Reader cleanup: wider text, no cramped column */
body.reading-mode #app {
  max-width: 560px;
}

.article-main {
  padding-left: 18px;
  padding-right: 18px;
}

.article-main h1,
.article-dek,
.article-section h2,
.article-text,
.article-callout,
.article-detail-block,
.article-bottom-nav {
  max-width: none;
}

.article-text {
  width: 100%;
  font-size: 19px;
  line-height: 1.66;
}

.article-text p {
  margin-bottom: 20px;
}

@media (max-width: 430px) {
  .article-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-text {
    max-width: none;
    font-size: 18.5px;
    line-height: 1.64;
  }
}


/* ── V5 Course-home reset: no cringe hero, no decorative image cards ── */
.course-home {
  min-height: 100vh;
  padding: calc(var(--safe-top) + 18px) 20px 124px;
}

.course-home-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 72px;
}

.course-home-top h1 {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.045em;
}

.course-home-top p {
  max-width: 28ch;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.35;
  text-align: right;
}

.home-current-course,
.course-track-card,
.course-detail-top,
.course-next-lesson,
.course-lesson-path {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}

.home-current-course {
  padding: 16px;
  margin-bottom: 18px;
}

.home-current-label,
.course-track-top,
.course-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-current-label span,
.home-section-title span,
.course-next-lesson > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.home-current-label strong {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 760;
}

.home-current-course h2,
.course-next-lesson h2 {
  max-width: 15ch;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.home-current-course p,
.course-track-card p,
.course-detail-top p,
.course-next-lesson p {
  margin-top: 10px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.course-progress-line {
  height: 7px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23,23,23,.07);
}

.course-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.course-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.course-card-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
}

.home-open-current,
.course-next-lesson .btn-primary {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 820;
}

.home-course-list {
  display: grid;
  gap: 12px;
}

.home-section-title {
  margin: 6px 0 2px;
}

.home-section-title h2 {
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: -.03em;
}

.course-track-card {
  display: block;
  padding: 14px 16px;
  text-align: left;
}

.course-track-top {
  justify-content: flex-start;
}

.course-track-icon,
.course-detail-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 15px;
  background: var(--accent-bg);
  font-size: 20px;
}

.course-track-top strong {
  display: block;
  font-size: 18px;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.course-track-top small {
  display: block;
  margin-top: 3px;
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 720;
}

.course-track-card em {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.35;
}

.course-detail {
  min-height: 100vh;
  padding-bottom: 110px;
}

.course-detail-top {
  margin: 0 20px 14px;
  padding: calc(var(--safe-top) + 14px) 18px 18px;
}

.course-detail-top .btn-back {
  margin-bottom: 18px;
}

.course-detail-icon {
  margin-bottom: 14px;
}

.course-detail-top h1 {
  font-size: 38px;
  line-height: .98;
  letter-spacing: -.055em;
}

.course-next-lesson {
  margin: 0 20px 14px;
  padding: 18px;
}

.course-lesson-path {
  margin: 0 20px;
  padding: 16px;
}

.course-path-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 18px;
  background: #FAFAF7;
  text-align: left;
}

.course-path-row.current {
  background: var(--accent-bg);
}

.course-path-row.locked {
  opacity: .48;
}

.course-path-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 840;
}

.course-path-index svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}

.course-path-copy strong,
.course-path-copy small {
  display: block;
}

.course-path-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.course-path-copy small {
  margin-top: 3px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 720;
}

.article-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: rgba(250,249,245,.88);
  border-bottom: 1px solid rgba(23,23,23,.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.reader-dark .article-topbar {
  background: rgba(18,20,18,.88);
  border-bottom-color: rgba(255,255,255,.08);
}

.course-home .guided-cover,
.course-home .lesson-card-image,
.course-home .lesson-card-full-image,
.course-detail .lesson-card-image,
.course-detail .lesson-card-full-image,
.article-cover,
.explore-category-art {
  display: none !important;
}

@media (max-width: 390px) {
  .course-home-top {
    display: block;
    padding-right: 64px;
  }
  .course-home-top p {
    margin-top: 8px;
    text-align: left;
  }
  .home-current-course h2,
  .course-next-lesson h2 {
    font-size: 27px;
  }
}

/* ── v8: Kurser på hem + lektionsväg ── */

.kurs-home {
  padding: calc(var(--safe-top) + 24px) 20px 8px;
}

.kurs-home-top h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.kurs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kurs-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kurs-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-md);
}

.kurs-card-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  background-color: var(--bg-warm);
  background-size: cover;
  background-position: center;
}

.kurs-card-body {
  padding: 16px 18px 18px;
}

.kurs-card-body h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kurs-card-body p {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-secondary);
  margin: 4px 0 14px;
}

.kurs-progress-line {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-warm);
  overflow: hidden;
}

.kurs-progress-line span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.kurs-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-tertiary);
}

.kurs-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 600;
}

.kurs-done-badge svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

/* ── Kursdetalj / lektionsväg ── */

.kurs-detail {
  padding: calc(var(--safe-top) + 16px) 20px 8px;
}

.kurs-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.kurs-back-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink);
  stroke-width: 2;
  fill: none;
}

.kurs-detail-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-md);
  background-color: var(--bg-warm);
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
}

.kurs-detail-top h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kurs-detail-top > p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin: 6px 0 14px;
}

.kurs-detail-top .kurs-card-meta {
  margin-bottom: 22px;
}

.kurs-path {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.path-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
}

.path-row.upcoming {
  opacity: 0.45;
  background: transparent;
  border-color: transparent;
}

.path-row.done:active {
  transform: scale(0.985);
}

.path-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-warm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.path-index.done {
  background: var(--accent-bg);
  color: var(--accent);
}

.path-index.done svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.path-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.path-copy strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.path-copy small {
  font-size: 12.5px;
  color: var(--ink-tertiary);
}

/* Aktuell lektion - enda primära valet i vägen */

.path-current {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease;
}

.path-current:active {
  transform: scale(0.985);
}

.path-current-thumb {
  width: 100%;
  aspect-ratio: 21 / 9;
  background-color: var(--bg-warm);
  background-size: cover;
  background-position: center;
}

.path-current-body {
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
}

.path-current-body small {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

.path-current-body strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.path-current-body p {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-secondary);
  margin: 6px 0 0;
}

.path-current-meta {
  font-size: 13px;
  color: var(--ink-tertiary);
  margin-top: 10px;
}

.path-current-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 14px;
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
}

body.app-dark .path-current-cta {
  color: #0B0C0B;
}

/* ── Omslagsbild i läsaren ── */

.article-cover-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  background-color: var(--bg-warm);
  background-size: cover;
  background-position: center;
  margin: 20px 0 8px;
}

@media (min-width: 480px) {
  .kurs-card-cover,
  .path-current-thumb {
    aspect-ratio: 24 / 9;
  }
}

/* ── v9: Reader typography final - full-width measure, rich text ── */
/* Overrides the older 36ch cap that made the text column narrower than the phone. */

.article-main {
  padding-left: 20px;
  padding-right: 20px;
}

.article-main h1 {
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.article-dek {
  font-size: 16.5px;
  line-height: 1.5;
}

.article-section h2 {
  font-size: 21px;
  letter-spacing: -0.015em;
}

.article-text,
.article-callout,
.article-detail-block,
.article-bottom-nav {
  max-width: none;
  width: 100%;
}

.article-bottom-nav {
  margin-left: 0;
  margin-right: 0;
}

.article-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17.5px;
  line-height: 1.62;
  letter-spacing: 0;
  text-wrap: pretty;
}

.article-text p {
  margin-bottom: 16px;
}

.article-text p:last-child {
  margin-bottom: 0;
}

.article-text strong {
  font-weight: 700;
}

.article-text em {
  font-style: italic;
}

.article-callout p {
  font-size: 15px;
  line-height: 1.55;
}

.article-section-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background-color: var(--bg-warm);
  background-size: cover;
  background-position: center;
  margin: 4px 0 18px;
}

@media (max-width: 390px) {
  .article-main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .article-main h1 {
    font-size: 28px;
  }
  .article-text {
    font-size: 17px;
    line-height: 1.6;
    max-width: none;
  }
}
