:root {
  --ink: #172033;
  --muted: #647086;
  --line: #dce3ef;
  --panel: #ffffff;
  --bg: #f6f8fc;
  --brand: #395ee8;
  --brand-2: #18a0a8;
  --good: #178a56;
  --warn: #b86b00;
  --bad: #c53b4a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { font-weight: 900; font-size: 1.25rem; letter-spacing: .01em; }
.brand span { color: var(--brand); }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .94rem; }
.pill, button, .button {
  border: 0; border-radius: 8px; background: var(--brand); color: white;
  padding: 10px 14px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.button.secondary, button.secondary { background: #e8edf8; color: var(--ink); }
.button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.hero {
  min-height: 560px; display: grid; align-items: center;
  background:
    linear-gradient(90deg, rgba(12,20,38,.86), rgba(12,20,38,.44)),
    url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: white; width: 100vw; margin-left: calc(50% - 50vw); padding: 48px max(16px, calc((100vw - 1180px) / 2));
}
.hero-content { max-width: 700px; }
.eyebrow { color: var(--brand-2); font-weight: 850; text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; }
h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: .98; margin: 12px 0 18px; letter-spacing: 0; }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); margin: 0 0 14px; }
h3 { margin: 0 0 10px; }
p { line-height: 1.58; }
.lead { font-size: 1.15rem; color: rgba(255,255,255,.86); max-width: 620px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel, .card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px;
}
.card { box-shadow: 0 10px 30px rgba(23,32,51,.06); }
.stat { font-size: 2rem; font-weight: 900; margin: 4px 0; }
.muted { color: var(--muted); }
.status { border-radius: 999px; padding: 4px 9px; font-size: .78rem; font-weight: 800; }
.status.strong { color: var(--good); background: #e7f6ef; }
.status.improving { color: var(--brand); background: #e8edff; }
.status.needs_work { color: var(--warn); background: #fff3dd; }
.status.weak { color: var(--bad); background: #ffe8ec; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 750; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  font: inherit; background: white; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.form-card { max-width: 480px; margin: 32px auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.practice-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.navigator { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nav-dot { border: 1px solid var(--line); background: white; color: var(--ink); padding: 8px 0; border-radius: 8px; }
.nav-dot.active { background: var(--brand); color: white; }
.choice { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 8px 0; cursor: pointer; }
.choice input { width: auto; margin-right: 8px; }
.flash { width: min(1180px, calc(100% - 32px)); margin: 14px auto 0; padding: 12px 14px; border-radius: 8px; }
.flash.success { background: #e7f6ef; color: var(--good); }
.flash.error { background: #ffe8ec; color: var(--bad); }
.footer { border-top: 1px solid var(--line); padding: 28px max(16px, calc((100vw - 1180px) / 2)); color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.loading { opacity: .6; pointer-events: none; }
.generated { white-space: normal; }
.lesson-section { border-top: 1px solid var(--line); padding: 16px 0; }
.progress { height: 10px; background: #e8edf8; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .25s ease; }

@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .grid.two, .grid.three, .grid.four, .practice-shell { grid-template-columns: 1fr; }
  .hero { min-height: 500px; }
}
