/* ═══════════════════════════════════════════════════════
   AI WORK LAB
   Fonts: Cormorant Garamond / DM Sans / JetBrains Mono
   Themes: light (default) · dark (data-theme="dark")
   Breakpoints: mobile-first — 481px · 721px · 1081px
═══════════════════════════════════════════════════════ */

/* ── Light theme (default) ───────────────────────────── */
:root {
  --bg:              #f0ede5;
  --surface:         rgba(255, 253, 248, 0.84);
  --surface-raised:  rgba(255, 253, 248, 0.95);
  --surface-hover:   rgba(255, 255, 255, 1);

  --text:            #192e20;
  --text-secondary:  #4b6657;
  --text-muted:      #7d9487;

  /* Green accent — primary in light */
  --accent:          #1a7a52;
  --accent-light:    #239166;
  --accent-dim:      rgba(26, 122, 82, 0.1);
  --accent-glow:     rgba(26, 122, 82, 0.08);

  /* Gold — secondary accent */
  --gold:            #896210;
  --gold-light:      #a97a18;
  --gold-dim:        rgba(137, 98, 16, 0.1);

  --border:          rgba(25, 46, 32, 0.1);
  --border-subtle:   rgba(25, 46, 32, 0.065);
  --border-hover:    rgba(26, 122, 82, 0.35);

  --shadow-sm:       0 2px 8px  rgba(25, 46, 32, 0.07);
  --shadow-md:       0 8px 32px rgba(25, 46, 32, 0.09);
  --shadow-lg:       0 20px 60px rgba(25, 46, 32, 0.11);
  --glow-accent:     0 0 40px rgba(26, 122, 82, 0.1), 0 0 1px rgba(26, 122, 82, 0.2);

  --bg-gradient:
    radial-gradient(ellipse 65% 55% at 10% -5%,  rgba(26, 122, 82, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 95%  5%,  rgba(137, 98, 16, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(26, 122, 82, 0.06) 0%, transparent 60%);

  --btn-primary-bg:     linear-gradient(135deg, #1a7a52 0%, #0f5a3a 100%);
  --btn-primary-shadow: rgba(26, 122, 82, 0.28);
  --btn-primary-hover:  rgba(26, 122, 82, 0.42);
  --btn-primary-text:   #fff;

  --tag-color:       #1a7a52;
  --stat-num-color:  #1a7a52;
  --chip-bg:         rgba(26, 122, 82, 0.1);
  --chip-border:     rgba(26, 122, 82, 0.3);
  --chip-text:       #0f5a3a;

  --brand-bg:        linear-gradient(135deg, #1a7a52, #3aaa72);
  --brand-text:      #fff;
  --brand-glow:      rgba(26, 122, 82, 0.15);

  --module-accent:   #1a7a52;
  --hint-accent:     #1a7a52;

  --select-arrow:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a7a52' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");

  --noise-opacity: 0.012;
  --prompt-bg:     #f4f1e8;
  --prompt-text:   #1a2e22;
  --prompt-border: rgba(26, 122, 82, 0.3);
  --prompt-caret:  #1a7a52;

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Dark theme ──────────────────────────────────────── */
html[data-theme="dark"] {
  --bg:              #09100d;
  --surface:         rgba(255, 246, 220, 0.042);
  --surface-raised:  rgba(255, 246, 220, 0.068);
  --surface-hover:   rgba(255, 246, 220, 0.09);

  --text:            #ede6d2;
  --text-secondary:  #96a89f;
  --text-muted:      #5e7a6e;

  --accent:          #c8a030;
  --accent-light:    #e2ba52;
  --accent-dim:      rgba(200, 160, 48, 0.18);
  --accent-glow:     rgba(200, 160, 48, 0.12);

  --gold:            #c8a030;
  --gold-light:      #e2ba52;
  --gold-dim:        rgba(200, 160, 48, 0.18);

  --border:          rgba(200, 160, 48, 0.22);
  --border-subtle:   rgba(255, 255, 255, 0.055);
  --border-hover:    rgba(200, 160, 48, 0.45);

  --shadow-sm:       0 2px 8px  rgba(0, 0, 0, 0.5);
  --shadow-md:       0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg:       0 20px 60px rgba(0, 0, 0, 0.65);
  --glow-accent:     0 0 50px rgba(200, 160, 48, 0.12), 0 0 1px rgba(200, 160, 48, 0.3);

  --bg-gradient:
    radial-gradient(ellipse 60% 50% at 15%  0%,  rgba(74, 148, 114, 0.09) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 90% 10%,  rgba(200, 160, 48, 0.07) 0%, transparent 100%),
    radial-gradient(ellipse 55% 45% at 50% 100%, rgba(74, 148, 114, 0.06) 0%, transparent 100%);

  --btn-primary-bg:     linear-gradient(135deg, #c8a030 0%, #a8831f 100%);
  --btn-primary-shadow: rgba(200, 160, 48, 0.3);
  --btn-primary-hover:  rgba(200, 160, 48, 0.45);
  --btn-primary-text:   #09100d;

  --tag-color:       #c8a030;
  --stat-num-color:  #e2ba52;
  --chip-bg:         rgba(200, 160, 48, 0.14);
  --chip-border:     rgba(200, 160, 48, 0.35);
  --chip-text:       #e2ba52;

  --brand-bg:        linear-gradient(135deg, #1a2e22 0%, #0f1f17 100%);
  --brand-text:      #e2ba52;
  --brand-glow:      rgba(200, 160, 48, 0.12);

  --module-accent:   #c8a030;
  --hint-accent:     #c8a030;

  --select-arrow:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a030' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");

  --noise-opacity: 0.025;
  --prompt-bg:     #060e09;
  --prompt-text:   #d4c99a;
  --prompt-border: rgba(200, 160, 48, 0.25);
  --prompt-caret:  #e2ba52;
}

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

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 350ms var(--ease-out), color 350ms var(--ease-out);
}

.noise-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

button, input, select, textarea { font: inherit; }

/* ── Typography ──────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 1.06;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0;
}

h2 { font-size: clamp(2rem, 5vw, 3.8rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 600; }

p { margin: 0; }

/* ── Layout ──────────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 1;
  width: calc(100% - 24px);
  max-width: 100%;
  margin: 0 auto;
  padding: 18px 0 56px;
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition:
    background 260ms var(--ease-out),
    border-color 260ms var(--ease-out),
    box-shadow 260ms var(--ease-out);
}

.card:hover {
  background: var(--surface-raised);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--glow-accent);
}

/* ── Tags & Labels ───────────────────────────────────── */
.eyebrow,
.section-tag,
.output-label,
.field-label {
  display: block;
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tag-color);
  opacity: 0.85;
}

.output-label { color: var(--text-muted); margin-bottom: 8px; }
.field-label  { color: var(--text-secondary); margin-bottom: 6px; opacity: 1; }

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
  overflow: hidden;
}

.brand h1,
.brand .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  transition: box-shadow 260ms ease;
}

.brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 30%, var(--brand-glow), transparent 70%);
}

.brand-mark-inner {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-text);
  position: relative;
  z-index: 1;
  letter-spacing: 0.05em;
}

/* ── Theme toggle ────────────────────────────────────── */
.theme-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 320ms var(--ease-out);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--accent);
  transform: rotate(20deg);
}

.auth-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.auth-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--accent);
}

.auth-toggle.logged-in {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Show/hide icons based on theme */
.icon-sun  { display: none; }
.icon-moon { display: block; }

html[data-theme="dark"] .icon-sun  { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
  box-shadow: 0 4px 16px var(--btn-primary-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--btn-primary-hover);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface-hover);
}

.btn-ghost {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}

.wide-button { width: 100%; }

/* ── Hero ────────────────────────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.hero-copy,
.hero-panel {
  padding: 28px 24px;
}

.hero-text {
  color: var(--text-secondary);
  font-size: 0.97rem;
  margin-top: 16px;
  line-height: 1.75;
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 28px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  flex: 1;
  min-width: 80px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
}

.stat-item strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--stat-num-color);
  line-height: 1;
}

.stat-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feature-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.feature-list li {
  padding: 11px 14px 11px 36px;
  position: relative;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.feature-list li:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface-hover);
}

.feature-list li::before {
  content: "→";
  position: absolute;
  left: 13px;
  top: 11px;
  color: var(--accent);
  font-size: 0.82rem;
  font-family: "DM Sans", sans-serif;
}

.ticker-wrap {
  margin-top: 16px;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.ticker-track {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: ticker-scroll 22s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: border-color 200ms ease, color 200ms ease;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.hero-typewriter {
  margin-top: 16px;
  min-height: 1.5em;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── Sections ────────────────────────────────────────── */
.panel-section {
  margin-top: 52px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-top: 8px;
}

/* ── Grids ───────────────────────────────────────────── */
.grid-two,
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.workspace-left,
.workspace-right {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hero-copy,
.hero-panel {
  min-width: 0;
}

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

/* ── Card inner padding ──────────────────────────────── */
.hero-copy,
.hero-panel,
.form-card,
.summary-card,
.lesson-card,
.scenario-card,
.playbook-card,
.prompt-card,
.progress-card {
  padding: 22px 20px;
}

/* ── Рабочие зоны: выделение ────────────────────────────── */
.lesson-card {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.lesson-card .section-tag {
  color: var(--accent);
  opacity: 1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.prompt-card {
  --prompt-blue: #2d6fa4;
  border-left: 3px solid var(--prompt-blue);
  background: color-mix(in srgb, var(--prompt-blue) 5%, var(--surface));
}

.prompt-card .section-tag {
  color: var(--prompt-blue);
  opacity: 1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
}

.card-header h3 { margin-top: 5px; }

/* ── Form ────────────────────────────────────────────── */
.form-card {
  display: grid;
  gap: 18px;
}

.form-card label {
  display: grid;
  gap: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  color: var(--text);
  padding: 12px 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

input::placeholder { color: var(--text-muted); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

select {
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Prompt editor ───────────────────────────────────── */
#prompt-editor {
  min-height: 220px;
  width: 100%;
  resize: vertical;
  line-height: 1.65;
  background: var(--prompt-bg);
  color: var(--prompt-text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.87rem;
  border: 1px solid var(--prompt-border);
  border-radius: var(--r-md);
  caret-color: var(--prompt-caret);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

#prompt-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.action-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
}

/* ── Review & Hint ───────────────────────────────────── */
.review-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.review-box,
.hint-box {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  min-height: 56px;
}

.review-box strong { color: var(--accent); }

.hint-box {
  border-left: 2px solid var(--hint-accent);
}

.hint-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}

/* ── Rich content ────────────────────────────────────── */
.rich-content {
  display: grid;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.72;
}

.rich-content ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.rich-content li { margin-bottom: 6px; }
.rich-content strong { color: var(--text); }

/* ── Summary card ────────────────────────────────────── */
.summary-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

/* ── Status chip ─────────────────────────────────────── */
.status-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Muted text ──────────────────────────────────────── */
.muted-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-divider {
  opacity: 0.35;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 180ms ease;
}

.footer-link:hover {
  color: var(--accent);
}

/* ── Hidden ──────────────────────────────────────────── */
.hidden { display: none; }

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.65s var(--ease-out) var(--delay, 0s) both;
}

/* ───────────────────────────────────────────────────────
   JS-GENERATED ELEMENTS
─────────────────────────────────────────────────────── */
.module-card {
  padding: 18px 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 220ms ease, background 220ms ease;
}

.module-card:hover {
  background: var(--surface-raised);
  border-left-color: var(--module-accent);
  border-color: var(--border);
}

.module-card .section-tag { margin-bottom: 8px; }

.module-card h3 {
  font-size: 0.97rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}

.module-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.summary-box {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  display: grid;
  gap: 5px;
}

.summary-box strong {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
}

.summary-box span {
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.5;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

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

.progress-item strong {
  color: var(--text-muted);
  font-weight: 400;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.progress-item span {
  color: var(--text);
  text-align: right;
  font-size: 0.88rem;
}

/* ═══════════════════════════════════════════════════════
   BREAKPOINTS — mobile-first
═══════════════════════════════════════════════════════ */

/* ── Tablet: ≥ 481px ──────────────────────────────── */
@media (min-width: 481px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cta-row,
  .hint-row,
  .action-row {
    flex-direction: row;
    align-items: center;
  }

  .wide-button { width: auto; }
}

/* ── Medium: ≥ 721px ──────────────────────────────── */
@media (min-width: 721px) {
  .app-shell {
    width: min(1340px, calc(100% - 48px));
    padding: 24px 0 72px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-grid {
    margin-top: 22px;
    gap: 20px;
  }

  .hero-copy,
  .hero-panel {
    padding: 36px 32px;
  }

  .form-card,
  .summary-card,
  .lesson-card,
  .scenario-card,
  .playbook-card,
  .prompt-card,
  .progress-card {
    padding: 28px;
  }

  .card-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

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

  .workspace-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .module-grid { gap: 14px; }
  .panel-section { margin-top: 68px; }

  #prompt-editor { min-height: 260px; }
}

/* ── Desktop: ≥ 1081px ────────────────────────────── */
@media (min-width: 1081px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-layout {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Scroll-to-top ───────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 900;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #1a7a52;
  color: rgb(255 255 255);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 250ms var(--ease-out),
    transform 250ms var(--ease-out),
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: #155f40;
  color: rgb(255 255 255);
}

/* ═══════════════════════════════════════════════════════
   AUTH & PAYMENT MODALS
═══════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 16, 13, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeInModal 200ms var(--ease-out) both;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  padding: 28px 24px 24px;
  animation: slideUpModal 250ms var(--ease-out) both;
  position: relative;
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-header h3 { margin-top: 4px; }

.modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.modal-close:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}

/* ── Auth tabs ──────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.auth-tab.active {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── Auth form ──────────────────────────────────────────── */
.auth-form {
  display: grid;
  gap: 14px;
}

.auth-error {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(180, 40, 40, 0.08);
  border: 1px solid rgba(180, 40, 40, 0.25);
  color: #c0392b;
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   MODULE PROGRESS BARS
═══════════════════════════════════════════════════════ */

.module-progress {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.module-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.module-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

.module-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.module-card.completed .module-progress-fill {
  background: var(--accent-light);
}

/* ── Global course progress bar ─────────────────────────── */
.global-progress-bar {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.global-progress-bar .module-progress-track {
  height: 6px;
}

.topbar .global-progress-bar {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.mark-done-btn {
  background: none;
  border: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
  transition: opacity 150ms ease;
}

.mark-done-btn:hover { opacity: 1; }

.module-done-check {
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Workspace active state (paid+auth) ─────────────────── */
.workspace--active {
  border-top: 2px solid var(--accent);
  padding-top: 32px;
}

.workspace--active .section-heading p.section-tag::before {
  content: "→ ";
}

/* ── Continue CTA ───────────────────────────────────────── */
.continue-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ── Module navigator (workspace) ──────────────────────── */
.module-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}
.module-nav.hidden { display: none; }
#module-nav-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-align: center;
  flex: 1;
}
.module-nav-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Active module card (currently loaded in workspace) ─── */
.module-card.active {
  border-left-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  cursor: default;
}
.module-card.active:hover {
  border-left-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   LOCKED MODULES & PAYWALL
═══════════════════════════════════════════════════════ */

.module-card.current {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.module-card.current:hover {
  background: var(--accent-dim);
  border-left-color: var(--accent-light);
}

.current-module-label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.module-card.locked {
  opacity: 0.72;
  border-left-color: var(--border) !important;
}

.module-card.locked:hover {
  opacity: 1;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--border-subtle);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 10px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.lock-badge:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* ── Workspace paywall overlay ──────────────────────────── */
.paywall-gate {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 40px 24px;
  text-align: center;
  gap: 16px;
}

.paywall-gate h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 4px;
}

.paywall-gate p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 340px;
  line-height: 1.75;
}

.paywall-features {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.paywall-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.paywall-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.paywall-price {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.paywall-price span {
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Payment modal specifics ────────────────────────────── */
.payment-modal-card {
  max-width: 460px;
}

.payment-feature-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.payment-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.payment-feature-list li::before {
  content: "→";
  color: var(--accent);
  font-size: 0.85rem;
}

.payment-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
}

.payment-price-amount {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.payment-price-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Auth modal box ──────────────────────────────────── */
.modal-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  padding: 32px 28px 28px;
  position: relative;
  animation: slideUpModal 250ms var(--ease-out) both;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.modal-box .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 4px;
}

.modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.btn-google:hover {
  background: var(--surface-raised);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.auth-email-form input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 150ms ease;
  box-sizing: border-box;
}

.auth-email-form input:focus {
  border-color: var(--accent);
}

.auth-error {
  font-size: 0.83rem;
  color: var(--error, #e05c5c);
  text-align: center;
  padding: 6px 0 2px;
}

.auth-reset-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.auth-reset-link:hover {
  color: var(--text);
}

/* ─── Technique Block ─────────────────────────────────────── */
.technique-block {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.technique-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.technique-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.technique-template {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  background: var(--prompt-bg);
  border: 1px solid var(--prompt-border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--prompt-text);
  margin: 0 0 10px;
}

.technique-examples {
  margin: 0 0 4px;
  padding-left: 18px;
}

.technique-examples li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 6px;
  font-style: italic;
}

.technique-tones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.tone-card {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--prompt-bg);
  border: 1px solid var(--border-subtle);
}

.tone-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 5px;
}

.tone-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* cascade steps */
.cascade-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.cascade-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cascade-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.cascade-step > div {
  flex: 1;
}

.cascade-step strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 2px;
}

.cascade-step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  font-style: italic;
}

.cascade-result {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

/* ─── Comparison Block ────────────────────────────────────── */
.comparison-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .comparison-block { grid-template-columns: 1fr; }
}

.comparison-bad,
.comparison-good {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.comparison-bad { border-left: 3px solid #d95757; }
.comparison-good { border-left: 3px solid var(--accent); }

.comparison-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.comparison-bad .comparison-label { color: #d95757; }
.comparison-good .comparison-label { color: var(--accent); }

.comparison-bad pre,
.comparison-good pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Cases Section ───────────────────────────────────────── */
.cases-section { }

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.case-card {
  padding: 20px 20px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.case-header {
  margin-bottom: 14px;
}

.case-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 20px;
}

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

@media (max-width: 480px) {
  .case-columns { grid-template-columns: 1fr; }
}

.case-before,
.case-after {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.case-before { background: rgba(217, 87, 87, 0.06); border: 1px solid rgba(217, 87, 87, 0.2); }
.case-after  { background: rgba(26, 122, 82, 0.06); border: 1px solid rgba(26, 122, 82, 0.2); }

.case-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.case-label-bad  { color: #d95757; }
.case-label-good { color: var(--accent); }

.section-note {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}

/* ─── Social Proof Section ────────────────────────────────── */
.social-proof-section { }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.testimonial-card {
  padding: 20px 20px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  margin: 0;
  position: relative;
}

.testimonial-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}

.testimonial-card footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: normal;
}

.testimonial-placeholder {
  opacity: 0.75;
  border-style: dashed;
}

/* ── Prompt history (Playbook) ────────────────────────── */
.playbook-role-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.playbook-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.playbook-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}
.prompt-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prompt-history-item {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 10px 14px;
}
.ph-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.ph-scenario {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
}
.ph-score {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2d6fa4;
  background: color-mix(in srgb, #2d6fa4 10%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
}
.ph-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}
.ph-text {
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ph-weak {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Blog preview ─────────────────────────────────────── */
.blog-preview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}
.blog-preview-grid .blog-card:first-child {
  grid-row: span 2;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s;
}
.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.blog-card__img {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  flex-shrink: 0;
  height: 140px;
}
.blog-card:first-child .blog-card__img {
  height: 200px;
}
.blog-card--placeholder .blog-card__img {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--border) 40%, transparent) 0px,
    color-mix(in srgb, var(--border) 40%, transparent) 1px,
    transparent 1px,
    transparent 12px
  );
}
.blog-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.blog-card__tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.blog-card--placeholder .blog-card__tag {
  color: var(--text-muted);
}
.blog-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
}
.blog-card--placeholder .blog-card__title {
  color: var(--text-muted);
}
.blog-card__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
@media (max-width: 720px) {
  .blog-preview-grid {
    grid-template-columns: 1fr;
  }
  .blog-preview-grid .blog-card:first-child {
    grid-row: span 1;
  }
}

/* ── Onboarding modal ───────────────────────────────────── */
.onboarding-box {
  width: 100%;
  max-width: 580px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  padding: 36px 32px 28px;
  animation: slideUpModal 280ms var(--ease-out) both;
  text-align: center;
}

.onb-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.onb-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 6px;
}

.onb-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.onb-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.onb-cards--level {
  grid-template-columns: repeat(3, 1fr);
}

.onb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
  text-align: center;
}

.onb-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.onb-card.selected {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.onb-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  user-select: none;
}

.onb-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.onb-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.onb-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.onb-skip:hover {
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .onboarding-box {
    padding: 28px 18px 22px;
  }
  .onb-cards {
    grid-template-columns: 1fr 1fr;
  }
  .onb-cards--level {
    grid-template-columns: 1fr;
  }
}
