/* =====================================================================
   LINGUIST HUT DESIGN SYSTEM
   1. Foundations  2. App shell  3. Dashboard and cards  4. Lessons
   5. Inputs and overlays  6. Results and editor  7. Responsive/motion
   ===================================================================== */
/* ---------- 1. Foundations and accessible controls ---------- */
:root {
  --ink: #263247;
  --muted: #69758a;
  --purple: #6952df;
  --purple-soft: #efeafe;
  --lime: #d4f77d;
  --sky: #dff1ff;
  --cream: #fbfcf6;
  --line: #e8ebf0;
  --green: #326c42;
  --red: #a54643;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #f6f7fb;
  color: var(--ink);
  font-family: "Avenir Next", system-ui, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #4396c7;
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.22;
  letter-spacing: -.03em;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

small,
.muted {
  color: var(--muted);
}

.small {
  font-size: .9rem;
}

.eyebrow {
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 8px;
}

.skip {
  position: absolute;
  left: 10px;
  top: -100px;
  z-index: 100;
  background: white;
  padding: 10px;
}

.skip:focus {
  top: 10px;
}

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 11px 18px;
  background: var(--purple);
  color: white;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn.lime {
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 3px 0 #b1d65c;
}

.btn.secondary {
  background: #f0edf9;
  color: var(--purple);
}

.btn.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.danger {
  background: #fff0ee;
  color: var(--red);
}

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-width: 35px;
  min-height: 35px;
  border-radius: 9px;
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--purple-soft);
  color: var(--purple);
  border-radius: 99px;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.5;
}

.pill.green {
  color: var(--green);
  background: #e8f5e9;
}

.pill.orange {
  color: #97632d;
  background: #fff1d9;
}

.pill.blue {
  color: #3c759c;
  background: var(--sky);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spread {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 16px;
}

.loading {
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------- 2. Navigation shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: white;
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 850;
  padding: 0 12px 26px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--ink);
  background: var(--lime);
  font-size: 1.3rem;
}

.nav-label {
  padding: 10px 12px;
  text-transform: uppercase;
  color: #9a9fae;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 12px;
  margin-bottom: 5px;
  font-weight: 650;
}

.nav.active {
  color: var(--purple);
  background: var(--purple-soft);
}

.nav:hover {
  background: #f6f4fc;
}

.nav-icon {
  width: 25px;
  font-size: 1.1rem;
}

.sidebar-foot {
  margin-top: auto;
  padding: 20px 12px 0;
  font-size: .9rem;
  color: var(--muted);
}

.main-column {
  min-width: 0;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 38px;
  background: rgba(255, 255, 255, .8);
  border-bottom: 1px solid var(--line);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  background: var(--sky);
  border-radius: 50%;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: #487695;
  font-size: .9rem;
  font-weight: 800;
}

.content {
  max-width: 1280px;
  margin: auto;
  padding: 34px 38px 60px;
}

.page-heading {
  margin-bottom: 26px;
}

.page-heading p {
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- 3. Dashboard, lesson cards, and actual statistics ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  background: var(--purple-soft);
  border-radius: 26px;
  padding: 32px;
  margin-bottom: 26px;
  gap: 20px;
  align-items: center;
}

.hero h1 {
  max-width: 550px;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
}

.hero p {
  color: #6e6387;
  max-width: 520px;
  margin: 14px 0 22px;
}

.hero-art {
  position: relative;
  min-height: 190px;
  display: grid;
  place-items: center;
}

.star {
  font-size: 115px;
  color: #b6e864;
  transform: rotate(-12deg);
  text-shadow: 4px 5px 0 #9bc250;
  line-height: 1;
}

.hero-note {
  position: absolute;
  bottom: 5px;
  right: 0;
  padding: 9px 16px;
  background: white;
  border-radius: 12px;
  font-weight: 800;
  font-size: .9rem;
  transform: rotate(-5deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat {
  padding: 22px;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.stat strong {
  font-size: 1.8rem;
  display: block;
  line-height: 1.3;
}

.stat span {
  color: var(--muted);
  font-size: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 23px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card h3 {
  margin: 12px 0 8px;
}

.card p {
  color: var(--muted);
  font-size: .9rem;
}

.card .actions {
  margin-top: 20px;
}

.lesson-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e9f3df;
  font-size: 1.8rem;
}

.lesson-icon.blue {
  background: var(--sky);
}

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

.section-title {
  margin: 30px 0 18px;
}

.empty {
  padding: 36px 25px;
  text-align: center;
  background: white;
  border: 1px dashed #d7dce5;
  border-radius: 20px;
  color: var(--muted);
}

.filters {
  margin-bottom: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filters input {
  flex: 1;
  min-width: 180px;
}

.filters select {
  width: auto;
  min-width: 150px;
}

.progress {
  height: 7px;
  background: #edf0e8;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 18px;
}

.progress span {
  display: block;
  height: 100%;
  background: #b8df70;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
}

.list-item .item-copy {
  flex: 1;
  min-width: 0;
}

.list-item p {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 4px;
}

.page-number {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 750;
  flex: 0 0 35px;
}

/* ---------- 4. Lesson reader, mixed exercise templates, and media ---------- */
.lesson-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.page-rail {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  max-height: 75vh;
  overflow: auto;
  position: sticky;
  top: 20px;
}

.page-link {
  display: block;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
  font-size: .9rem;
  margin: 4px 0;
  color: var(--muted);
}

.page-link.active {
  color: var(--purple);
  background: var(--purple-soft);
  font-weight: 750;
}

.page-link small {
  display: block;
  font-size: .9rem;
}

.lesson-page {
  min-width: 0;
}

.lesson-page>.card {
  padding: 30px;
}

.lesson-page h1 {
  font-size: 1.8rem;
  margin: 12px 0 15px;
}

.block {
  margin: 25px 0;
}

.block h2 {
  font-size: 1.13rem;
  margin-bottom: 12px;
}

.prose {
  white-space: pre-line;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.lesson-image {
  width: 100%;
  max-height: 580px;
  object-fit: contain;
  border-radius: 15px;
  background: #fafafa;
  display: block;
}

.image-controls {
  margin-top: 8px;
  text-align: right;
}

audio,
video {
  width: 100%;
  margin-top: 12px;
  border-radius: 12px;
}

video {
  max-height: 450px;
  background: #172333;
}

.media-card {
  padding: 18px;
  background: #f4f0fd;
  border-radius: 16px;
}

.wordbank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}

.wordbank span {
  background: #edf4f9;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .9rem;
}

.question-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px;
  margin: 14px 0;
}

.question-prompt {
  margin-bottom: 12px;
  white-space: pre-line;
  font-weight: 650;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e0e5ed;
  padding: 12px;
  border-radius: 11px;
  margin: 8px 0;
  background: white;
  font-weight: 500;
  cursor: pointer;
}

.option-label:has(input:checked) {
  background: var(--sky);
  border-color: #88c1e4;
}

.option-label input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--purple);
  margin: 0;
}

.highlight {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 850;
}

.source {
  margin-top: 26px;
  color: #8a93a5;
  font-size: .9rem;
}

.notice {
  padding: 14px 17px;
  border-radius: 12px;
  background: #eef5fb;
  color: #45677c;
  font-size: .9rem;
  margin: 16px 0;
}

.notice.warning {
  background: #fff4db;
  color: #8a6326;
}

/* ---------- 5. Forms, dialogs, login, and live/demo boundaries ---------- */
label {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce2e9;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.6;
}

input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: var(--purple);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  margin: 16px 0;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  background: radial-gradient(circle at 20% 20%, #e7f1dc, transparent 40%), radial-gradient(circle at 85% 80%, #e8e0fa, transparent 40%), #fafbf7;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 36px;
  border-radius: 28px;
  background: white;
  box-shadow: 0 20px 70px #30304d12;
}

.login-card .brand {
  padding: 0 0 26px;
}

.login-card h1 {
  font-size: 1.9rem;
}

.login-card>p {
  color: var(--muted);
  margin-top: 12px;
}

.error {
  color: var(--red);
  font-size: .9rem;
  margin: 14px 0;
  white-space: pre-line;
}

.demo-bar {
  background: #fff0c9;
  color: #76571f;
  padding: 9px 20px;
  text-align: center;
  font-size: .9rem;
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #16223466;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 25px 90px #18243933;
}

.modal h2 {
  margin-bottom: 20px;
}

.modal-close {
  float: right;
}

.check-list {
  max-height: 280px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  font-size: .9rem;
  font-weight: 500;
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 14px 22px;
  background: var(--ink);
  color: white;
  border-radius: 13px;
  max-width: 90%;
  font-size: .9rem;
  display: none;
}

#toast.visible {
  display: block;
}

/* ---------- 6. Results, statistics, and structured authoring ---------- */
.result-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: var(--purple-soft);
  border-radius: 20px;
  margin: 20px 0;
}

.score-bubble {
  min-width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border: 8px solid var(--lime);
  border-radius: 50%;
  background: white;
  font-size: 1.55rem;
  font-weight: 850;
}

.answer-row {
  border-left: 4px solid #dbe4ee;
  padding: 17px;
  background: #f7f9fc;
  margin: 14px 0;
  border-radius: 0 13px 13px 0;
}

.answer-row.correct {
  border-color: #80ba80;
  background: #eff8ef;
}

.answer-row.incorrect {
  border-color: #dfa09a;
  background: #fff2f0;
}

.answer-row p {
  margin: 8px 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.answer-row .correct-answer {
  color: var(--green);
}

.feedback-editor {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.feedback-editor textarea {
  min-height: 65px;
}

.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .9rem;
}

th,
td {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: .9rem;
  background: #fbfcfe;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: start;
}

.editor-block {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  margin: 18px 0;
}

.editor-block .block-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.editor-question {
  padding: 18px;
  background: #f6f7fb;
  border-radius: 14px;
  margin: 14px 0;
}

.toolbox {
  position: sticky;
  top: 20px;
}

.toolbox button {
  display: block;
  width: 100%;
  margin: 9px 0;
  text-align: left;
}

.stat-bar {
  height: 8px;
  border-radius: 10px;
  background: #e9edf0;
  margin-top: 8px;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: 10px;
  background: var(--purple);
}

/* ---------- 7. Small screens, motion preference, and print ---------- */
@media(max-width:1050px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .content {
    padding: 28px 24px;
  }

  .topbar {
    padding: 18px 24px;
  }

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

  .page-rail {
    position: static;
    max-height: 200px;
  }

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

  .toolbox {
    position: static;
  }

  .toolbox .actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .sidebar {
    height: auto;
    position: static;
    padding: 16px;
    border-right: 0;
  }

  .sidebar .brand {
    padding: 0 0 12px;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 8px;
  }

  .nav {
    white-space: nowrap;
    margin: 0;
    padding: 9px 12px;
    font-size: .9rem;
  }

  .nav-icon {
    display: none;
  }

  .topbar {
    padding: 14px 20px;
    min-height: 60px;
  }

  .profile .profile-name {
    display: none;
  }

  .content {
    padding: 22px 18px 40px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 25px;
  }

  .hero-art {
    display: none;
  }

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

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 15px 10px;
  }

  .stat strong {
    font-size: 1.4rem;
  }

  .stat span {
    font-size: .9rem;
  }

  .list-item {
    flex-wrap: wrap;
    padding: 16px;
  }

  .list-item .actions {
    width: 100%;
  }

  .lesson-page>.card {
    padding: 22px 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal {
    padding: 23px;
  }

  .result-summary {
    gap: 16px;
    padding: 18px;
  }

  .score-bubble {
    min-width: 85px;
    height: 85px;
    font-size: 1.2rem;
  }

  .feedback-editor {
    grid-template-columns: 1fr;
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {

  .sidebar,
  .topbar,
  .actions,
  .demo-bar {
    display: none !important;
  }

  .shell,
  .lesson-layout {
    display: block;
  }

  .page-rail {
    display: none;
  }

  .content {
    padding: 0;
  }

  .card {
    border: 0;
  }
}

/* Keep horizontal mobile navigation inside the viewport. */
.sidebar {
  min-width: 0;
}

.lesson-icon svg {
  width: 34px;
  height: 34px;
}

@media(max-width:720px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar nav {
    min-width: 0;
    max-width: 100%;
  }

  .sidebar .nav {
    flex: 0 0 auto;
  }
}

/* Linguist Hut 0.0.2 — warm paper, larger type, and textbook skill colors. */
html { font-size:18px; }
:root {
  --ink:#3e392f; --muted:#756c5e; --purple:#556d48; --purple-soft:#edf1e3;
  --lime:#d7e7b9; --sky:#edf3fa; --cream:#fffaf0; --line:#e5ddcd;
  --green:#37663d; --radius:24px;
}
body { font-size:18px; background:#f7f3e9; }
h1,h2,h3,h4 { font-weight:850; letter-spacing:-.025em; }
h1 { font-size:clamp(2rem,3.2vw,2.8rem); }
h2 { font-size:1.5rem; }
h3 { font-size:1.2rem; }
.brand { font-family:Georgia,'Times New Roman',serif; font-size:1.35rem; gap:10px; }
.brand-mark { background:#e1eacb; color:#526440; border:1px solid #c2cfad; }
.shell { grid-template-columns:270px minmax(0,1fr); }
.sidebar { background:#fffaf1; border-color:var(--line); }
.sidebar-foot { line-height:1.7; }
.nav:hover { background:#f2eddf; }
.nav-label { color:#756c5e; letter-spacing:.08em; }
.topbar { background:#fffaf1dd; }
.content { max-width:1480px; }
.card,.list-item,.page-rail,.modal,.editor-block { background:#fffdf7; border-color:var(--line); box-shadow:0 3px 0 #eae2d3; }
.hero { background:linear-gradient(120deg,#e8eedb,#f7ecd5); border:1px solid #dfdfca; }
.hero-art .star { color:#647a4e; background:#e5edcf; font-family:Georgia,serif; }
.hero-note { background:#fffaf0; color:#705d3d; }
.btn.lime { box-shadow:0 3px 0 #b7c69a; }
.btn.secondary { background:#f0ebdf; color:#5d674b; }
.btn.ghost { background:#fffdf7; }
.avatar,.lesson-icon { background:#e5eed7; color:#526540; }
.page-number { width:44px; height:44px; flex-basis:44px; }
.field input,.field select,.field textarea,input,select,textarea { background:#fffefa; border-color:#d6ccba; }
.stats { gap:16px; }
.stat { background:#fffdf7; border-color:var(--line); }
.lesson-page > .card { padding:34px; }
.lesson-page h1 { font-size:clamp(1.85rem,2.5vw,2.45rem); }
.block h2 { font-size:1.35rem; font-weight:850; }
.question-card,.option-label,.wordbank { font-size:20px; }
.question-card { background:#fffdf9; border-color:#e3ddcf; padding:22px; }
.question-card input,.question-card textarea,.question-card select { font-size:20px; }
.question-prompt { font-size:20px; line-height:1.6; }
.option-label { line-height:1.6; background:#fffefa; }
.prose { white-space:normal; }
.text-block { padding:24px 28px; background:#fdf9ee; border:1px solid var(--line); border-radius:18px; }
.text-block .prose { font-family:Georgia,'Times New Roman',serif; font-size:24px; line-height:1.8; }
.text-block .prose p + p { margin-top:1em; }
.text-block .prose h3 { font-family:'Avenir Next',system-ui,sans-serif; font-size:1.25em; margin:1em 0 .5em; color:var(--skill-ink,var(--ink)); }
.text-block .prose ul,.text-block .prose ol { margin:1em 0; padding-left:1.3em; }
.text-block .prose li { margin:.35em 0; }
.text-block .prose strong { color:var(--skill-ink,#526440); font-weight:800; }
.text-block .prose mark { background:var(--skill-soft,#e8edce); color:var(--skill-ink,#526440); padding:.1em .2em; border-radius:5px; box-decoration-break:clone; }
.text-block .prose blockquote { margin:1em 0; background:var(--skill-soft,#f1eddf); border-left:5px solid var(--skill-color,#71815f); border-radius:0 12px 12px 0; padding:18px 22px; }
.text-block .prose code { font-family:inherit; font-weight:bold; background:var(--skill-soft,#efebde); padding:2px 5px; border-radius:4px; }
.reference-page .text-block { padding:26px 28px; border-top:3px solid var(--skill-color,#7a8568); }
.reference-table-wrap { overflow-x:auto; margin:22px 0; border:1px solid var(--skill-border,#cfd7c2); border-radius:12px; }
.reference-table { font:inherit; background:#fffefb; min-width:520px; }
.reference-table th { font-family:'Avenir Next',system-ui,sans-serif; font-size:18px; font-weight:800; background:var(--skill-soft,#e8edce); color:var(--skill-ink,#526440); }
.reference-table td,.reference-table th { padding:15px 18px; vertical-align:top; border-bottom:1px solid var(--skill-border,#dbe1d3); }
.reference-table tr:last-child td { border-bottom:0; }
.skill-vocabulary { --skill-color:#40825c; --skill-ink:#255c3a; --skill-soft:#edf5e8; --skill-border:#b1cfb3; }
.skill-grammar { --skill-color:#4b85b8; --skill-ink:#255e8f; --skill-soft:#edf5fd; --skill-border:#b0cbe0; }
.skill-listening { --skill-color:#c57597; --skill-ink:#983f64; --skill-soft:#fceef3; --skill-border:#e5bad0; }
.skill-reading { --skill-color:#c0884f; --skill-ink:#885323; --skill-soft:#fbf1df; --skill-border:#e4c697; }
.skill-speaking { --skill-color:#9a81bb; --skill-ink:#70529a; --skill-soft:#f3eef9; --skill-border:#d1c0e6; }
.skill-pronunciation { --skill-color:#bd9843; --skill-ink:#825f13; --skill-soft:#fcf5de; --skill-border:#e5d298; }
.skill-writing { --skill-color:#53998f; --skill-ink:#2c6d65; --skill-soft:#eaf5f2; --skill-border:#b1d6cd; }
.skill-practice { --skill-color:#8d956c; --skill-ink:#58613e; --skill-soft:#f1f3e6; --skill-border:#ccd2b3; }
.skill-card { border:1px solid var(--skill-border); border-top:5px solid var(--skill-color); }
.skill-card h1,.skill-card h3 { color:var(--skill-ink); }
.skill-card .page-number { color:var(--skill-ink); background:var(--skill-soft); }
.skill-badge { background:var(--skill-soft); color:var(--skill-ink); border:1px solid var(--skill-border); gap:7px; padding:5px 12px; font-size:16px; font-weight:850; }
.skill-badge > span { font-size:17px; }
.skill-tags { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.skill-legend { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 24px; }
.exercise-block { border:2px solid var(--skill-border); border-top:5px solid var(--skill-color); padding:22px; border-radius:18px; }
.exercise-block h2 { color:var(--skill-ink); }
.exercise-block .option-label:has(input:checked) { border-color:var(--skill-color); background:var(--skill-soft); }
.exercise-block input[type=radio] { accent-color:var(--skill-color); }
.media-card { background:var(--skill-soft); border:1px solid var(--skill-border); border-top:4px solid var(--skill-color); }
.media-card h2 { color:var(--skill-ink); }
.page-link { border-left:3px solid var(--skill-color); padding-left:12px; }
.page-link.active { background:var(--skill-soft); color:var(--skill-ink); }
.notice { background:#f2f0e5; color:#655c49; }
.demo-bar { font-size:16px; background:#eedfb8; color:#5b492c; }
.login { min-height:100svh; display:grid; grid-template-columns:minmax(0,1fr) 480px; gap:64px; padding:64px max(4vw,28px); align-items:center; background:linear-gradient(90deg,rgba(27,24,17,.37),rgba(27,24,17,.04)),url('assets/images/linguist-hut.png') center/cover no-repeat; }
.login-welcome { align-self:end; padding:0 0 14px 24px; color:#fff8e8; text-shadow:0 2px 18px #302512; }
.login-welcome h1 { font:700 clamp(2.4rem,4vw,4.3rem)/1.12 Georgia,'Times New Roman',serif; letter-spacing:-.025em; margin:18px 0; }
.login-welcome p { font-size:22px; }
.login-eyebrow { font-size:17px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.login-card { width:100%; max-width:none; padding:38px; border:1px solid #dfd2b8; border-radius:28px; background:rgba(255,250,239,.97); box-shadow:0 18px 70px #241b1760,0 5px 0 #bda77d66; }
.login-card .brand { padding:0 0 24px; font-size:30px; }
.login-card .brand-mark { width:48px; height:48px; font-size:32px; }
.login-card h2 { font-size:28px; margin:10px 0 12px; line-height:1.25; }
.login-card .login-subtitle { font-size:18px; color:var(--muted); margin:0 0 24px; }
.login-card .field { margin:20px 0; }
.login-card input { min-height:54px; }
.login-submit { width:100%; min-height:56px; font-size:20px; background:#dce8c2; }
.login-foot { display:flex; justify-content:space-between; gap:12px; color:var(--muted); border-top:1px solid #e1d8c7; padding-top:18px; margin-top:12px; font-size:16px; }
.login-card .error:empty { display:none; }
@media (max-width:1200px) {
  .shell { grid-template-columns:240px minmax(0,1fr); }
  .lesson-layout { grid-template-columns:1fr; }
  .page-rail { position:static; max-height:230px; }
}
@media (max-width:900px) {
  .login { grid-template-columns:1fr; justify-items:center; gap:26px; padding:40px 22px; }
  .login-welcome { width:min(100%,480px); padding:0; align-self:auto; }
  .login-welcome h1 { font-size:38px; }
  .login-welcome h1 br { display:inline; }

  .login-card { max-width:480px; }
}
@media (max-width:720px) {
  .shell { grid-template-columns:1fr; }
  .stats { grid-template-columns:1fr; }
  .stat { display:flex; align-items:center; gap:18px; }
  .stat span { font-size:18px; }
  .nav { font-size:17px; }
  .login { padding:26px 18px; background-position:45% center; }
  .login-welcome p { font-size:18px; }
  .login-card { padding:28px 24px; }
  .login-card .brand { font-size:28px; }
  .text-block,.reference-page .text-block { padding:20px 18px; }
  .text-block .prose { font-size:22px; }
  .text-block .prose blockquote { padding:16px; }
  .lesson-page > .card { padding:24px 16px; }
  .exercise-block { padding:16px 12px; }
  .question-card { padding:16px 14px; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }
