/* ═══════════════════════════════════════════════
   Design Tokens — svnsk
   ═══════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #fff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #888;
  --surface: #f7f7f7;
  --surface-elevated: #fff;
  --border: #ddd;
  --border-light: #eee;

  /* Accent colors */
  --accent-blue: #0C447C;
  --accent-blue-bg: #E6F1FB;
  --accent-blue-soft: #B5D4F4;
  --accent-green: #085041;
  --accent-green-bg: #E1F5EE;
  --accent-green-soft: #9FE1CB;
  --accent-red: #712B13;
  --accent-red-bg: #FCEBEB;
  --accent-red-soft: #F5C4B3;
  --accent-warm: #8B6914;
  --accent-warm-bg: #F5F0E8;
  --accent-warm-soft: #D4B44A;
  --accent-purple: #4A1A6B;
  --accent-purple-soft: #E8D5F5;
  --accent-olive: #27500A;
  --accent-olive-soft: #C0DD97;
  --accent-neutral: #444441;
  --accent-neutral-soft: #D3D1C7;
  --accent-faint: #5F5E5A;
  --accent-faint-bg: #F1EFE8;

  /* Feedback */
  --correct-bg: #E1F5EE;
  --correct-text: #085041;
  --correct-border: #5DCAA5;
  --wrong-bg: #FCEBEB;
  --wrong-text: #791F1F;
  --wrong-border: #F09595;
  --skip-bg: #FAEEDA;
  --skip-text: #633806;

  /* Typography */
  --font-family: system-ui, -apple-system, sans-serif;
  --max-width: 720px;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #e8e8e8;
    --text-secondary: #aaa;
    --text-muted: #888;
    --surface: #222;
    --surface-elevated: #2a2a2a;
    --border: #444;
    --border-light: #333;

    --accent-blue: #B5D4F4;
    --accent-blue-bg: #0C447C;
    --accent-blue-soft: #0C447C;
    --accent-green: #9FE1CB;
    --accent-green-bg: #085041;
    --accent-green-soft: #085041;
    --accent-red: #F5C4B3;
    --accent-red-bg: #712B13;
    --accent-red-soft: #712B13;
    --accent-warm: #D4B44A;
    --accent-warm-bg: #3D3011;
    --accent-warm-soft: #3D3011;
    --accent-purple: #E8D5F5;
    --accent-purple-soft: #4A1A6B;
    --accent-olive: #C0DD97;
    --accent-olive-soft: #27500A;
    --accent-neutral: #D3D1C7;
    --accent-neutral-soft: #444441;
    --accent-faint: #B4B2A9;
    --accent-faint-bg: #2C2C2A;

    --correct-bg: #0a2e22;
    --correct-text: #9FE1CB;
    --correct-border: #085041;
    --wrong-bg: #2e1515;
    --wrong-text: #F5C4B3;
    --wrong-border: #712B13;
    --skip-bg: #2e2010;
    --skip-text: #D4B44A;
  }
}


/* ═══════════════════════════════════════════════
   Base — svnsk
   ═══════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0 }

body {
  font-family: var(--font-family);
  color: var(--text);
  padding: 1.5rem;
  background: var(--bg);
  max-width: var(--max-width);
  margin: 0 auto;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 2rem 0 1rem;
}

h2:first-of-type { margin-top: 0 }

a { color: var(--accent-blue); text-decoration: none }
a:hover { text-decoration: underline }

.divider {
  border: none;
  border-top: .5px solid var(--border);
  margin: 2.5rem 0;
}

/* Subtitle text under headings */
.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Site navigation */
.site-nav {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: .5px solid var(--border);
}

.site-nav-brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .5px;
}


/* ═══════════════════════════════════════════════
   Reference — collapsible <details> section
   ═══════════════════════════════════════════════ */

details.ref { margin-bottom: 1.5rem }

details.ref summary {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 10px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

details.ref summary::-webkit-details-marker { display: none }

details.ref summary::before {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s;
}

details.ref[open] summary::before { transform: rotate(90deg) }

.rc {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-top: 8px;
}

.rc strong { color: var(--text); font-weight: 500 }

.rc h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 1.25rem 0 .5rem;
  color: var(--text);
}

.rc h3:first-child { margin-top: 0 }

.rc ul { margin: .5rem 0 .5rem 1.25rem; padding: 0 }
.rc ul li { margin-bottom: .35rem }

/* Interactive table embedded inside reference */
.rc #interactive-table { margin: .75rem 0 .25rem }

.rc .grammar-picker { margin-bottom: .75rem }

.rc .rules-table th.col-header { background: var(--bg) }
.rc .rules-table td:hover { background: var(--bg) }

.rc .grammar-example {
  background: var(--bg);
  border-left-color: var(--accent-blue-soft);
}

.interactive-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: .5rem 0 .25rem;
  font-style: italic;
}


/* ═══════════════════════════════════════════════
   Picker — row of pill buttons, one active
   ═══════════════════════════════════════════════ */

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.picker button {
  padding: 5px 12px;
  font-size: 13px;
  border: .5px solid var(--border);
  background: transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all .15s;
}

.picker button:hover { border-color: var(--text-muted) }

.picker button.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.picker-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}


/* ═══════════════════════════════════════════════
   Card — detail card on surface background
   ═══════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 24px;
  font-weight: 500;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-forms {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Meaning sections inside a card */
.meaning-section { margin-bottom: 1rem }

.meaning-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meaning-examples {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  padding-left: 0;
}

.meaning-examples em {
  font-style: italic;
  color: var(--text);
}


/* ═══════════════════════════════════════════════
   Table — grammar reference & interactive tables
   ═══════════════════════════════════════════════ */

/* Reference table (inside .rc blocks) */
.rg {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0;
  font-size: 13px;
}

.rg td, .rg th {
  padding: 6px 10px;
  border: .5px solid var(--border);
  text-align: left;
}

.rg th {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Form table (paradigm tables) */
.form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 1rem 0;
}

.form-table th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: .5px solid var(--border);
}

.form-table td {
  padding: 8px 10px;
  border-bottom: .5px solid var(--border-light);
}

.form-table tr:last-child td { border-bottom: none }

/* Interactive rules table (clickable cells) */
.rules-table-wrap { overflow-x: auto; margin-bottom: 1.25rem }

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.rules-table th {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 8px;
  text-align: center;
  border-bottom: .5px solid var(--border);
}

.rules-table th.col-header { background: var(--surface) }

.rules-table td {
  padding: 10px 8px;
  text-align: center;
  border: .5px solid var(--border-light);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}

.rules-table td:hover { background: var(--surface) }

.rules-table td.on {
  background: var(--accent-blue-bg);
  border-color: var(--accent-blue-soft);
  z-index: 1;
}

.rules-table .cell-form {
  font-weight: 500;
  font-size: 15px;
  display: block;
}

.rules-table .cell-form .stem { opacity: .35 }

.rules-table .cell-ending {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.rules-table .row-label {
  text-align: right;
  padding-right: 12px;
  font-size: 12px;
  color: var(--text-muted);
  border: none;
  cursor: default;
  font-weight: 400;
}

.rules-table .row-label:hover { background: transparent }

.rules-table .group-header {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 8px;
  border: none;
  border-bottom: .5px solid var(--border);
}

/* Active row in form explorer */
.rules-table tr.active-row td.row-label {
  color: var(--text);
  font-weight: 500;
}

/* Color-coded form cells */
.form-en { color: var(--text); font-weight: 500 }
.form-ett { color: var(--accent-red); font-weight: 500 }
.form-pl { color: var(--accent-olive); font-weight: 500 }


/* ═══════════════════════════════════════════════
   Sentence — color-coded word blocks with labels
   ═══════════════════════════════════════════════ */

.sentence-display {
  margin: 1rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sentence-display--left { justify-content: flex-start }

.word {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 500;
  position: relative;
  transition: all .2s;
}

.word--lg { padding: 6px 12px; font-size: 20px }

.word .word-label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  font-weight: 400;
}

.word--lg .word-label { bottom: -18px }

/* Color classes for word blocks */
.wc-blue { background: var(--accent-blue-soft); color: var(--accent-blue) }
.wc-green { background: var(--accent-green-soft); color: var(--accent-green) }
.wc-red { background: var(--accent-red-soft); color: var(--accent-red) }
.wc-neutral { background: var(--accent-neutral-soft); color: var(--accent-neutral) }
.wc-faint { background: var(--accent-faint-bg); color: var(--accent-faint) }
.wc-ghost { background: transparent; color: var(--text-muted); border: .5px solid var(--border) }
.wc-olive { background: var(--accent-olive-soft); color: var(--accent-olive) }
.wc-purple { background: var(--accent-purple-soft); color: var(--accent-purple) }

@media (prefers-color-scheme: dark) {
  .wc-blue { background: var(--accent-blue-soft); color: var(--accent-blue) }
  .wc-green { background: var(--accent-green-soft); color: var(--accent-green) }
  .wc-red { background: var(--accent-red-soft); color: var(--accent-red) }
  .wc-neutral { background: var(--accent-neutral-soft); color: var(--accent-neutral) }
  .wc-faint { background: var(--accent-faint-bg); color: var(--accent-faint) }
  .wc-ghost { border-color: var(--border) }
  .wc-olive { background: var(--accent-olive-soft); color: var(--accent-olive) }
  .wc-purple { background: var(--accent-purple-soft); color: var(--accent-purple) }
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1rem;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Chain diagram */
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin: 1rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.chain-box {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.chain-box small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chain-arrow {
  font-size: 18px;
  color: var(--border);
  margin: 0 6px;
}


/* ═══════════════════════════════════════════════
   Tabs — small tab buttons for switching views
   ═══════════════════════════════════════════════ */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.tabs button {
  padding: 5px 10px;
  font-size: 12px;
  border: .5px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all .15s;
}

.tabs button.on {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

@media (prefers-color-scheme: dark) {
  .tabs button { border-color: var(--border) }
  .tabs button.on { color: #0C447C }
}


/* ═══════════════════════════════════════════════
   Quiz — input, check/skip, feedback banners
   ═══════════════════════════════════════════════ */

.quiz-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.quiz-input:focus { border-color: var(--accent-blue) }
.quiz-input::placeholder { color: var(--border) }
.quiz-input:disabled { opacity: .5 }

@media (prefers-color-scheme: dark) {
  .quiz-input { background: var(--surface) }
  .quiz-input::placeholder { color: #555 }
}

.quiz-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  color: var(--text);
  transition: all .15s;
}

.quiz-btn:hover { background: var(--surface) }

@media (prefers-color-scheme: dark) {
  .quiz-btn { background: var(--border); color: var(--text) }
  .quiz-btn:hover { background: var(--surface-elevated) }
}

.quiz-btn--secondary {
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}

@media (prefers-color-scheme: dark) {
  .quiz-btn--secondary { background: var(--border); color: var(--text-muted) }
}

.quiz-next {
  margin-top: 10px;
  padding: 8px 20px;
  font-size: 14px;
  font-family: inherit;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  color: var(--text);
}

.quiz-next:hover { background: var(--surface) }

@media (prefers-color-scheme: dark) {
  .quiz-next { background: var(--border); color: var(--text) }
  .quiz-next:hover { background: var(--surface-elevated) }
}

/* Feedback banners */
.feedback {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
}

.feedback--correct {
  background: var(--correct-bg);
  color: var(--correct-text);
}

.feedback--wrong {
  background: var(--wrong-bg);
  color: var(--wrong-text);
}

.feedback--skip {
  background: var(--skip-bg);
  color: var(--skip-text);
}

/* Stats bar */
.quiz-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 1rem;
  font-size: 13px;
  color: var(--text-muted);
}

/* Sentence with blank */
.quiz-sentence {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.quiz-blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px solid var(--border);
  margin: 0 4px;
}

/* Hint text */
.quiz-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  min-height: 18px;
}

/* Adjective badge shown in quiz */
.quiz-adj-badge {
  font-size: 14px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  vertical-align: middle;
}

/* Controls row */
.quiz-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: .5rem;
}


/* ═══════════════════════════════════════════════
   Search — autocomplete/lookup input
   ═══════════════════════════════════════════════ */

.search-wrap { position: relative; margin-bottom: 1.25rem }

.search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.search-input:focus { border-color: var(--accent-blue) }
.search-input::placeholder { color: var(--border) }

@media (prefers-color-scheme: dark) {
  .search-input { background: var(--surface) }
  .search-input::placeholder { color: #555 }
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.dropdown.open { display: block }

@media (prefers-color-scheme: dark) {
  .dropdown { background: var(--surface) }
}

.dropdown-item {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-item:hover, .dropdown-item.hl { background: var(--surface) }

@media (prefers-color-scheme: dark) {
  .dropdown-item:hover, .dropdown-item.hl { background: var(--surface-elevated) }
}

.dropdown-item .dropdown-pattern {
  font-size: 11px;
  color: var(--text-muted);
}

/* Lookup result card */
.lookup-result {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: none;
}

.lookup-result.vis { display: block }

.lookup-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 1rem;
}

.lookup-header span:first-child { font-size: 24px; font-weight: 500 }

.lookup-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.lookup-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 1rem;
}

.lookup-form-cell {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: .5px solid var(--border-light);
}

.lookup-form-cell div:first-child {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.lookup-form-cell div:last-child { font-size: 18px; font-weight: 500 }

.lookup-explanation {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.lookup-explanation strong { color: var(--text); font-weight: 500 }

.lookup-examples {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.lookup-examples em {
  font-style: italic;
  color: var(--text);
}


/* ═══════════════════════════════════════════════
   Grid — card grid with expandable items
   ═══════════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 1rem 0;
}

.grid-item {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: .5px solid var(--border-light);
  cursor: pointer;
  transition: all .15s;
}

.grid-item:hover { border-color: var(--text-muted) }

.grid-item.on {
  border-color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

@media (prefers-color-scheme: dark) {
  .grid-item.on { border-color: var(--accent-blue); background: var(--accent-blue-soft) }
}

.grid-item div:first-child { font-size: 15px; font-weight: 500 }
.grid-item div:last-child { font-size: 12px; color: var(--text-muted); margin-top: 2px }

/* Expanded detail below grid */
.grid-detail {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
}

.grid-detail.vis { display: block }


/* ═══════════════════════════════════════════════
   Badge — small pill metadata labels
   ═══════════════════════════════════════════════ */

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.badge--blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.badge--green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge--warm {
  background: var(--accent-warm-bg);
  color: var(--accent-warm);
}

.badge--tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-lg);
  background: var(--accent-warm-bg);
  color: var(--accent-warm);
  font-weight: 400;
}


/* ═══════════════════════════════════════════════
   Note — left-bordered explanation block
   ═══════════════════════════════════════════════ */

.note {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-left: 3px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.note strong {
  color: var(--text);
  font-weight: 500;
}

/* Explanation block (used in sentence display context) */
.explanation {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.explanation strong {
  color: var(--text);
  font-weight: 500;
}


/* Exercise list — section index pages */
.exercise-list {
  list-style: none;
  padding: 0;
  font-size: 15px;
  line-height: 2;
}

.exercise-list a {
  display: inline-block;
}

.exercise-list .exercise-num {
  display: inline-block;
  min-width: 2em;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════
   Navigation — prev/next, breadcrumbs, section nav
   ═══════════════════════════════════════════════ */

/* Breadcrumb trail */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--text); text-decoration: underline }
.breadcrumb .sep { color: var(--border); user-select: none }

/* Prev/Next navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: .5px solid var(--border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border: .5px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
  min-width: 0;
  flex: 1;
  max-width: 48%;
}

.page-nav a:hover {
  border-color: var(--accent-blue-soft);
  background: var(--surface);
}

.page-nav a.next { align-items: flex-end; text-align: right; margin-left: auto }

.page-nav-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.page-nav-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Section pills in the site nav */
.section-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 0;
  margin-bottom: .5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section-pills a {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border: .5px solid transparent;
  transition: all .15s;
}

.section-pills a:hover {
  background: var(--surface);
  border-color: var(--border);
}

.section-pills a.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}


/* ═══════════════════════════════════════════════
   Section cards — landing page and section index
   ═══════════════════════════════════════════════ */

/* Landing page grid — single column */
.section-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.5rem;
}

/* Card base */
.section-card {
  border: .5px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 200ms cubic-bezier(0.23, 1, 0.32, 1),
              background 200ms cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hover — gate behind fine pointer so touch devices don't trigger */
@media (hover: hover) and (pointer: fine) {
  .section-card:hover {
    border-color: var(--accent-blue-soft);
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
  }
}

.section-card:active {
  transform: scale(0.99);
}

/* Header row */
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-title {
  font-size: 18px;
  font-weight: 600;
}

.section-card-count {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--surface);
  border-radius: 99px;
  white-space: nowrap;
}

/* Colored word highlights — always visible */
.section-card-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.word--sm {
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 500;
}

/* Reveal container — animates height from 0 to auto on hover.
   Asymmetric timing: fast expand (180ms), slow collapse (400ms)
   so scanning across cards feels fluid. */
.section-card-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 400ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 350ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.section-card-reveal-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (hover: hover) and (pointer: fine) {
  .section-card:hover .section-card-reveal {
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 180ms cubic-bezier(0.23, 1, 0.32, 1),
                opacity 150ms cubic-bezier(0.23, 1, 0.32, 1);
  }
}

/* Reduced motion: skip the height animation, keep opacity */
@media (prefers-reduced-motion: reduce) {
  .section-card-reveal {
    transition: opacity 150ms ease;
  }
}

/* Description & preview pills (inside reveal) */
.section-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.section-card-preview {
  font-size: 12px;
  color: var(--text-muted);
  border-top: .5px solid var(--border-light);
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.section-card-preview .preview-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: .5px solid var(--border);
  background: var(--bg);
}

.section-card-preview .preview-sample {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 13px;
  width: 100%;
}

/* Section index — exercise cards */
.exercise-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.exercise-card {
  display: block;
  border: .5px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
}

.exercise-card:hover {
  border-color: var(--accent-blue-soft);
  background: var(--surface);
}

.exercise-card-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.exercise-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
}

.exercise-card-type {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  border: .5px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.exercise-card-preview {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Grammar table picker (like word picker but inline with table) */
.grammar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}

.grammar-picker button {
  padding: 5px 12px;
  border: .5px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.grammar-picker button:hover { background: var(--surface) }
.grammar-picker button.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.grammar-picker .picker-note {
  font-size: 10px;
  opacity: .6;
}

/* Grammar example display (below interactive table) */
.grammar-example {
  margin-top: .75rem;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--accent-blue-soft);
}

.grammar-example-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.grammar-example-sentence {
  font-size: 15px;
}

/* Section overview hero */
.section-hero {
  margin-bottom: 1.5rem;
}

.section-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* Section exercises list on overview page */
.section-exercises {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: .5px solid var(--border);
}

.section-exercises h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
