:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-alt: #faf8f3;
  --border: #e4ddd0;
  --text: #1c2220;
  --muted: #5a6460;

  --board-bg: #1b3f30;
  --board-bg-deep: #143225;
  --board-border: #3d6552;
  --board-text: #f3f7f4;
  --board-muted: #bdd2c6;

  --soft: #1d6e87;
  --soft-bg: #e6f4f8;
  --soft-chalk: #79e2ff;

  --hard: #b86b11;
  --hard-bg: #fdf3e3;
  --hard-chalk: #ffd275;

  --neg: #b43e37;
  --neg-bg: #fdeceb;
  --neg-chalk: #ff9c94;

  --end-chalk: #b7f5a3;
  --vague-chalk: #ffe57f;
  --vague-dot: #d97706;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(24, 34, 29, 0.06);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 92px;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

code {
  font-family: "Noto Sans", monospace;
  background: rgba(27, 63, 48, 0.08);
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* Header & Episode strip */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

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

.brand-badge {
  background: var(--board-bg);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-radius: 9px;
  white-space: nowrap;
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.topnav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.topnav a:hover {
  background: rgba(27, 63, 48, 0.1);
  color: var(--board-bg);
}

.episode-strip-wrap {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.episode-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 9px 0;
  scrollbar-width: thin;
}

.ep-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ep-pill:hover {
  border-color: var(--board-bg);
  color: var(--text);
}

.ep-pill.ready {
  color: var(--board-bg);
  border-color: rgba(27, 63, 48, 0.35);
}

.ep-pill.active {
  background: var(--board-bg);
  color: #fff;
  border-color: var(--board-bg);
}

.ep-pill .ep-dur {
  opacity: 0.72;
  font-size: 0.74rem;
}

/* Main layout */
.main-content {
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.planned-banner {
  background: #fff9ee;
  border: 1px solid #eccf9b;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.planned-banner strong {
  display: block;
  font-size: 1rem;
}

.planned-banner span {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Hero */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
}

.pill-board {
  background: var(--board-bg);
  color: #fff;
  border-color: var(--board-bg);
}

h1, h2, h3 {
  font-family: "Noto Serif", "Noto Sans", Georgia, serif;
  margin: 0;
  letter-spacing: -0.01em;
}

.hero-main h1 {
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
  line-height: 1.22;
  margin-bottom: 12px;
}

.hero-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.97rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-aside {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.aside-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.legend-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.legend-list strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.25;
}

.legend-list small {
  font-size: 0.78rem;
  color: var(--muted);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex: 0 0 auto;
}

.dot-soft { background: var(--soft); }
.dot-hard { background: var(--hard); }
.dot-neg { background: var(--neg); }
.dot-vague { background: var(--vague-dot); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.83rem;
  border-radius: 8px;
}

.btn-primary {
  background: var(--board-bg);
  color: #fff;
}

.btn-primary:hover {
  background: #143325;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--board-bg);
  background: var(--surface-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--board-bg);
  border-color: rgba(27, 63, 48, 0.25);
}

.btn-ghost:hover {
  background: rgba(27, 63, 48, 0.06);
}

.btn-audio {
  background: #edf5f1;
  color: var(--board-bg);
  border-color: #c5dbcf;
}

.btn-audio:hover {
  background: #dff0e8;
}

.btn-audio::before {
  content: "\25B6";
  font-size: 0.72rem;
}

/* Section header */
.section-block {
  scroll-margin-top: 120px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--board-bg);
  margin-bottom: 4px;
}

.section-head h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Builder controls */
.builder-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.verb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.verb-pill .vp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.verb-pill[data-harmony="soft"] .vp-dot { background: var(--soft); }
.verb-pill[data-harmony="hard"] .vp-dot { background: var(--hard); }

.verb-pill .vp-kal {
  font-weight: 800;
  font-size: 0.98rem;
}

.verb-pill .vp-ru {
  font-size: 0.82rem;
  color: var(--muted);
}

.verb-pill:hover {
  border-color: var(--board-bg);
  background: #fff;
}

.verb-pill.active[data-harmony="soft"] {
  background: var(--soft-bg);
  border-color: var(--soft);
  color: #0e4a5c;
}

.verb-pill.active[data-harmony="hard"] {
  background: var(--hard-bg);
  border-color: var(--hard);
  color: #7c4404;
}

.verb-pill.active .vp-ru {
  color: inherit;
  opacity: 0.82;
}

.control-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mode-switch {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.mode-btn,
.trainer-mode-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn.active,
.trainer-mode-btn.active {
  background: var(--board-bg);
  color: #fff;
}

.toggle-vague {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-vague input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d2cbc0;
  position: relative;
  transition: background 0.15s ease;
}

.toggle-track::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.15s ease;
}

.toggle-vague input:checked + .toggle-track {
  background: var(--vague-dot);
}

.toggle-vague input:checked + .toggle-track::after {
  transform: translateX(18px);
}

/* Chalkboard */
.chalkboard {
  background: radial-gradient(circle at 22% 18%, #23503d 0%, var(--board-bg) 55%, var(--board-bg-deep) 100%);
  color: var(--board-text);
  border: 8px solid #d9d2c5;
  outline: 1px solid #c5bcae;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(17, 36, 27, 0.22);
  padding: 22px 24px;
}

.chalkboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.16);
}

.chalk-head-left {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.chalk-inf-rule {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--board-muted);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  padding: 2px 8px;
}

.chalk-verb-title {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 800;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 2px;
}

.chalk-verb-ru {
  font-size: 1rem;
  color: var(--board-muted);
}

.chalk-head-center {
  display: flex;
  gap: 14px;
  font-weight: 700;
  font-size: 1rem;
  color: #e6efe9;
  background: rgba(0, 0, 0, 0.16);
  padding: 6px 14px;
  border-radius: 10px;
}

.chalk-head-right {
  text-align: right;
}

.chalk-harmony-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.chalk-harmony-badge.soft {
  background: rgba(121, 226, 255, 0.16);
  color: var(--soft-chalk);
  border: 1px solid rgba(121, 226, 255, 0.45);
}

.chalk-harmony-badge.hard {
  background: rgba(255, 210, 117, 0.16);
  color: var(--hard-chalk);
  border: 1px solid rgba(255, 210, 117, 0.45);
}

.chalk-formula {
  font-size: 0.92rem;
  color: var(--board-muted);
  font-weight: 600;
}

.chalk-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.chalk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.chalk-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--board-muted);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.chalk-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

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

.pron-cell {
  white-space: nowrap;
}

.pron-kal {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
}

.pron-ru {
  font-size: 0.82rem;
  color: var(--board-muted);
  margin-left: 6px;
}

.pron-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brace-mark {
  font-size: 1.7rem;
  line-height: 1;
  color: var(--board-muted);
  font-weight: 300;
}

.morph-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.m-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}

.m-stem {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.m-soft {
  background: rgba(121, 226, 255, 0.22);
  color: var(--soft-chalk);
}

.m-hard {
  background: rgba(255, 210, 117, 0.22);
  color: var(--hard-chalk);
}

.m-neg {
  background: rgba(255, 156, 148, 0.24);
  color: var(--neg-chalk);
}

.m-end {
  background: rgba(183, 245, 163, 0.2);
  color: var(--end-chalk);
}

.m-plus {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
}

.vague-mark {
  color: var(--vague-chalk);
  font-weight: 900;
  margin-left: 1px;
}

.word-result {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
}

.word-spoken {
  display: block;
  font-size: 0.78rem;
  color: var(--vague-chalk);
  margin-top: 2px;
}

.tr-ru {
  font-size: 0.94rem;
  color: #d9e7de;
}

.chalkboard-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.chalk-note {
  font-size: 0.88rem;
  color: var(--board-muted);
}

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

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.rule-card-wide {
  grid-column: 1 / -1;
}

.rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.rule-tag {
  display: inline-block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--board-bg);
  background: #ebf3ee;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 5px;
}

.rule-card h3 {
  font-size: 1.15rem;
}

.rule-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pronouns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.pron-card {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pron-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.pron-card-kal {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--board-bg);
}

.pron-card-end {
  font-size: 0.76rem;
  font-weight: 700;
  background: #e8f1ec;
  color: var(--board-bg);
  padding: 2px 7px;
  border-radius: 999px;
}

.pron-card-ru {
  font-weight: 700;
  font-size: 0.9rem;
}

.pron-card-note {
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.4;
}

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

.h-col {
  border-radius: 12px;
  padding: 14px;
}

.h-col-soft {
  background: var(--soft-bg);
  border: 1px solid #bde0eb;
}

.h-col-hard {
  background: var(--hard-bg);
  border: 1px solid #f0d3a8;
}

.h-col-title {
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.h-col-soft .h-col-title { color: var(--soft); }
.h-col-hard .h-col-title { color: var(--hard); }

.h-col-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.h-verbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.h-verb-btn {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.h-verb-btn:hover {
  border-color: var(--board-bg);
  transform: translateY(-1px);
}

.h-verb-btn span {
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.vague-list {
  display: grid;
  gap: 9px;
}

.vague-row {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vague-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.92rem;
}

.vague-written {
  font-weight: 800;
  color: var(--board-bg);
}

.vague-arrow {
  color: var(--muted);
}

.vague-spoken {
  font-weight: 700;
  color: #9a5305;
  background: #fef3dc;
  padding: 1px 7px;
  border-radius: 6px;
}

.vague-meaning {
  color: var(--muted);
  font-size: 0.84rem;
  margin-left: auto;
}

.vague-note {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Ideas & Timeline */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.idea-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--board-bg);
  margin-bottom: 6px;
}

.idea-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.idea-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.split-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.panel-box h3 {
  font-size: 1.12rem;
  margin-bottom: 12px;
}

.muted-small {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.tl-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tl-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tl-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 8px;
  background: #ebf3ee;
  color: var(--board-bg);
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
}

.tl-time:hover {
  background: var(--board-bg);
  color: #fff;
}

.tl-title {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 3px;
}

.tl-summary {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 7px;
}

.tl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.tl-btn:hover {
  border-color: var(--board-bg);
}

.audio-highlights-list {
  display: grid;
  gap: 9px;
}

.ah-card {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ah-title {
  font-weight: 700;
  font-size: 0.88rem;
}

.ah-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.participants-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.participants-box h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.students-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.student-chip {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Dictionary */
.dict-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-input {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 270px;
  outline: none;
}

.search-input:focus {
  border-color: var(--board-bg);
}

.dict-filter-btns,
.trainer-scope {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.filter-btn,
.scope-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.filter-btn.active,
.scope-btn.active {
  background: var(--board-bg);
  color: #fff;
}

.dict-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.dict-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.dict-table th {
  text-align: left;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.dict-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

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

.dict-word {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--board-bg);
}

.tag-soft,
.tag-hard,
.tag-pron {
  display: inline-block;
  font-size: 0.77rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-soft { background: var(--soft-bg); color: var(--soft); }
.tag-hard { background: var(--hard-bg); color: var(--hard); }
.tag-pron { background: #eceae3; color: #4d5450; }

.dict-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

/* Trainer */
.trainer-stats {
  display: flex;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.trainer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.trainer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.trainer-body {
  padding-top: 18px;
}

.q-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.q-prompt {
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.q-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

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

.opt-btn {
  text-align: left;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--board-bg);
  background: #fff;
}

.opt-btn.correct {
  background: #e6f4ea;
  border-color: #2e7d32;
  color: #1b5e20;
}

.opt-btn.wrong {
  background: var(--neg-bg);
  border-color: var(--neg);
  color: var(--neg);
}

.trainer-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trainer-feedback.ok {
  background: #edf7ef;
  border-color: #a9d9b4;
}

.trainer-feedback.bad {
  background: #fdf0ef;
  border-color: #e7b5b1;
}

.flashcard-box {
  background: var(--board-bg);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.flashcard-answer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.flashcard-kal {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--soft-chalk);
}

.flashcard-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Footer */
.site-footer {
  margin-top: 52px;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner a {
  color: var(--board-bg);
  font-weight: 700;
  text-decoration: none;
}

/* Floating Audio Bar */
.audio-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  z-index: 60;
  background: #172720;
  color: #fff;
  border: 1px solid #355446;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  padding: 10px 14px;
}

.audio-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-ctrl-btn,
.audio-close-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.audio-ctrl-btn:hover,
.audio-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.audio-meta {
  flex: 1;
  min-width: 0;
}

.audio-bar-title {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.audio-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #b7cbc0;
}

.audio-progress-row input[type="range"] {
  flex: 1;
  accent-color: #79e2ff;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 920px) {
  .hero-card,
  .rules-grid,
  .split-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card {
    padding: 18px;
  }

  .chalkboard {
    padding: 14px;
    border-width: 5px;
  }

  .harmony-columns,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .tl-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .vague-meaning {
    margin-left: 0;
  }
}
