:root {
  --estair: #0F766E;
  --estair-soft: #D1FAE5;
  --se: #B45309;
  --se-soft: #FFEDD5;
  --hrv: #4338CA;
  --hrv-soft: #E0E7FF;
  --bg: #F6F1E6;
  --ink: #1C1917;
  --muted: #57534E;
  --card: #FFFcf6;
  --line: #E7E0D4;
  --focus: #0F766E;
  --radius: 18px;
}

body.theme-dark {
  --bg: #1C1917;
  --ink: #F5F0E6;
  --muted: #D6D3D1;
  --card: #292524;
  --line: #44403C;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Lexend", system-ui, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

body.dyslexia-font {
  font-family: "Lexend", "Atkinson Hyperlegible", sans-serif;
  word-spacing: 0.08em;
}

body.large-text { font-size: 1.15rem; }
body.large-text h1 { font-size: 2.1rem; }
body.reduce-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #fff;
  padding: 8px 12px;
}
.skip-link:focus { left: 8px; z-index: 10; }

.site-header {
  background: var(--card);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar-brand {
  font-weight: 700;
  color: var(--ink) !important;
  letter-spacing: 0.02em;
}
.nav-link { color: var(--ink) !important; font-weight: 600; }
.nav-link:hover, .nav-link:focus { text-decoration: underline; }

.user-chip {
  background: var(--estair-soft);
  color: #064E3B;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
body.theme-dark .user-chip { background: #064E3B; color: #D1FAE5; }

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

h1, h2, h3 { line-height: 1.25; max-width: 22ch; }
p, li { max-width: 62ch; }
.lead { font-size: 1.15rem; }

.card-soft {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: 100%;
}

.treat-estair { border-top: 10px solid var(--estair); }
.treat-se { border-top: 10px solid var(--se); }
.treat-hrv { border-top: 10px solid var(--hrv); }

.badge-estair { background: var(--estair); color: #fff; }
.badge-se { background: var(--se); color: #fff; }
.badge-hrv { background: var(--hrv); color: #fff; }

.btn { border-radius: 12px; font-weight: 700; padding: 0.55rem 1rem; }
.btn-primary { background: var(--estair); border-color: var(--estair); }
.btn-primary:hover { background: #115E59; border-color: #115E59; }
.btn-se { background: var(--se); border-color: var(--se); color: #fff; }
.btn-hrv { background: var(--hrv); border-color: var(--hrv); color: #fff; }

.form-control, .form-select {
  border-radius: 12px;
  border: 2px solid var(--line);
  padding: 0.7rem 0.85rem;
  background: var(--card);
  color: var(--ink);
}
.form-control:focus, .form-select:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: none;
}

.lesson-row {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
  background: var(--card);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-weight: 600;
}
.swatch {
  width: 14px; height: 14px; border-radius: 4px; display: inline-block;
}

.alert-plain {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 14px;
}

.progress-meter {
  height: 16px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-meter > span { display: block; height: 100%; }

@media (max-width: 767px) {
  h1 { font-size: 1.8rem; }
}
