:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --titlebar: #1c2029;   /* section title bars: a step lighter than --panel */
  --line: #2a303c;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --accent: #4f9dff;     /* your EQ */
  --answer: #e6a84d;     /* question / correct answer */
  --ok: #3ecf8e;
  --bad: #ff5d6c;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Make the `hidden` attribute win over any display rule below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 16px 32px;
}

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

/* App header: full-width bar pinned to the top. */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -16px 36px;
  padding: 0 16px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 64px;
  padding-block: 14px 10px;
}
.brand { margin: 0; font-size: 24px; line-height: 1; }
.brand a { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-logo { display: block; flex: none; }
.wordmark { font-weight: 600; letter-spacing: 0.12em; color: var(--text); }
.wordmark > span { color: var(--accent); font-weight: 500; }
.brand-div { width: 1px; height: 22px; background: #5a6478; }
.top .sub { color: var(--muted); }

@media (max-width: 900px) { .top .sub, .brand-div { display: none; } }

/* Page tabs (teachers), under the header: Practice mode | Classes | Teachers */
.page-nav { display: flex; gap: 4px; max-width: 1200px; margin: -14px auto 20px; }
.top-tab {
  padding: 8px 16px; border-radius: 8px; color: var(--muted); font-weight: 600; text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.top-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.top-tab.sel { color: var(--text); background: rgba(79, 157, 255, 0.16); }

/* Every page's content fades in on load. */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* Pages stay invisible until their first render is complete (no pieces popping in or jumping),
   then appear all at once with a short fade. common.js: pageReady(). */
body > main, body > .page-nav { transition: opacity 0.25s ease-out; }
body.booting > main, body.booting > .page-nav { opacity: 0; }
.fade-in { animation: page-fade-in 0.3s ease-out both; }
@media (prefers-reduced-motion: reduce) { body > main, body > .page-nav { transition: none; } .fade-in { animation: none; } }

@media (max-width: 560px) {
  .brand-div, .top .sub { display: none; }
  .page-nav { margin-top: 0; }
  .top-tab { flex: 1; text-align: center; padding-inline: 8px; }
  /* On phones the wrapped header is tall, so let it scroll away and keep it compact. */
  .top { position: static; }
  .top .user-bar { gap: 10px; }
  .top .profile-btn .who { display: none; }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Sidebar order: practice view = settings, assignments, progress;
   assignments view = assignments, progress (settings hidden). */
.col-side.view-practice #settingsPanel { order: 1; }
.col-side.view-practice #assignPanel { order: 2; }
.col-side.view-assignments #assignPanel { order: 1; }
.col-side.view-assignments #hwPanel { order: 2; }

/* Fade the sidebar panels in when switching practice <-> homework. */
@keyframes side-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.col-side > section.fade-in, .answer-row > section.fade-in { animation: side-fade-in 0.35s ease-out both; }
.col-side > section.fade-in:nth-child(n+2) { animation-delay: 0.06s; }
/* Frequency chips / answer buttons fade in after picking a frequency group. */
@keyframes chip-fade-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}
.chip-fade { animation: chip-fade-in 0.3s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .chip-fade { animation-duration: 0.01s; animation-delay: 0s !important; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .col-side > section.fade-in, .answer-row > section.fade-in { animation-duration: 0.01s; animation-delay: 0s; transform: none; }
}

/* homework stats */
.hw-stats h3:first-of-type { margin-top: 4px; }
.range-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; }
.range-lbl .small { font-size: 11px; }
.range-bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.range-fill { height: 100%; background: var(--accent); border-radius: 5px; }
.range-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.range-fill.good, .pf-fill.good { background: var(--ok); }
.range-fill.mid, .pf-fill.mid { background: var(--answer); }
.range-fill.low, .pf-fill.low { background: var(--bad); }
.range-val.good { color: var(--ok); }
.range-val.mid { color: var(--answer); }
.range-val.low { color: var(--bad); }
.ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ops li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.ops button { flex: none; padding: 6px 10px; font-size: 12px; }
.op-title { font-weight: 600; }
.col-side.view-practice #assignPanel h2 { cursor: pointer; }
.col-side.view-practice #assignPanel h2:hover { color: var(--accent); }
.col-side.view-practice #assignPanel h2::after { content: " ↑"; color: var(--muted); font-weight: 400; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 15px; }

/* Title bar: a section's first heading spans the top of its panel. */
.panel > h2:first-child,
.panel > .panel-head:first-child {
  margin: -16px -16px 14px;
  padding: 11px 16px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.panel > .panel-head:first-child { padding-block: 7px; min-height: 43px; }
.panel > .panel-head:first-child h2 { margin: 0; }
.panel > .panel-head:first-child button,
.panel > .panel-head:first-child .btn-link { padding: 5px 12px; font-size: 13px; }
.panel h3 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }

kbd {
  display: inline-block;
  font: 11px/1 ui-monospace, monospace;
  padding: 2px 5px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
  vertical-align: 1px;
}

/* generic buttons */
button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover { border-color: #3a4252; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary kbd { color: #dce9ff; border-color: #7db6ff; }
button.link { background: none; border: none; padding: 0; color: var(--muted); text-decoration: underline; margin-top: 14px; }
button.link.confirm { color: var(--bad); }

select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}

/* transport */
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.play { min-width: 96px; font-weight: 600; }
.play.on { background: var(--ok); border-color: var(--ok); color: #06261a; }
.field { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.field select { color: var(--text); max-width: 220px; }
.volume input { width: 120px; accent-color: var(--accent); }
.volume output { color: var(--text); min-width: 48px; font-variant-numeric: tabular-nums; }
.file-btn {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  color: var(--muted);
}
.file-btn:hover { color: var(--text); border-color: #3a4252; }
.file-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
select:disabled { opacity: 0.4; cursor: not-allowed; }
.field:has(select:disabled) > span { opacity: 0.4; }
.lock-note { color: var(--answer); font-size: 12px; }

/* listening modes */
.ab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ab button { padding: 16px 8px; font-size: 16px; font-weight: 600; }
.ab button.active[data-mode="bypass"]   { background: #3a4252; border-color: #56607a; }
.ab button.active[data-mode="question"] { background: var(--answer); border-color: var(--answer); color: #2a1a00; }
.ab button.active[data-mode="response"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ab button.active kbd { color: inherit; border-color: currentColor; opacity: 0.7; }
.ab button { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
/* Hover on an inactive mode button: a muted version of its active color. */
.ab button:not(.active)[data-mode="bypass"]:hover   { background: rgba(58, 66, 82, 0.55); border-color: #56607a; }
.ab button:not(.active)[data-mode="question"]:hover { background: rgba(230, 168, 77, 0.16); border-color: rgba(230, 168, 77, 0.55); color: #ecca94; }
.ab button:not(.active)[data-mode="response"]:hover { background: rgba(79, 157, 255, 0.16); border-color: rgba(79, 157, 255, 0.55); color: #b3d4ff; }
.hint { color: var(--muted); margin: 12px 0 0; }
.hint.small { font-size: 12px; }

/* answer bands */
.band + .band { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.band-head { font-weight: 600; margin-bottom: 8px; }
.row-lbl { color: var(--muted); font-size: 12px; margin: 10px 0 6px; }
.btn-grid { display: flex; flex-wrap: wrap; gap: 6px; }

/* Answer frequencies grouped in labelled rows: High / Mid / Low */
.freq-groups { display: flex; flex-direction: column; gap: 6px; }
.freq-row { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 8px; }
.freq-row-lbl { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* Answer panel beside practice progress (answer left, progress right).
   align-items: stretch keeps both panels the same height whichever is taller. */
.answer-row { display: flex; gap: 16px; align-items: stretch; }
.answer-row > .answer { flex: 1 1 auto; min-width: 0; order: 1; }
.answer-row > .stats { flex: 0 0 300px; order: 2; }
@media (max-width: 760px) {
  .answer-row { flex-direction: column; align-items: stretch; }
  .answer-row > .stats { flex: none; }
}
.opt {
  min-width: 52px;
  padding: 8px 6px;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.opt.sel { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.opt.is-answer { box-shadow: 0 0 0 2px var(--answer); }
.opt.is-answer.sel { box-shadow: 0 0 0 2px var(--ok); background: var(--ok); border-color: var(--ok); color: #06261a; }
.opt.is-wrong { background: var(--bad); border-color: var(--bad); color: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.q-timer {
  margin-left: auto;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--answer);
}
.q-timer.waiting { font-size: 13px; font-weight: 600; color: var(--muted); }
.q-timer.urgent { color: var(--bad); animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .q-timer.urgent { animation: none; } }
.ai-limits { font-size: 12px; color: var(--muted); }

#feedback { margin-top: 14px; min-height: 1.5em; }
#feedback .verdict { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
#feedback .verdict.ok { color: var(--ok); }
#feedback .verdict.bad { color: var(--bad); }
#feedback ul { margin: 0; padding-left: 18px; }
#feedback li { margin: 3px 0; }
#feedback .ok { color: var(--ok); }
#feedback .bad { color: var(--bad); }
#feedback .muted { color: var(--muted); }

/* graph */
.graph canvas { display: block; width: 100%; height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.key::before {
  content: "";
  display: inline-block;
  width: 18px; height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.key-response::before { background: var(--accent); }
.key-question::before { background: var(--answer); }
.key-result::before { background: var(--text); }
.ab button:disabled { opacity: 0.45; }
/* Locked Question (memory modes): a ⊘ centred behind the word "Question" (not the key hint). */
.ab button.locked .q-label { position: relative; isolation: isolate; display: inline-block; }
.ab button.locked .q-label::before {
  content: '⊘'; position: absolute; inset: -20px 0; z-index: -1;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 400; line-height: 1; color: var(--muted); opacity: 0.55; pointer-events: none;
}

/* stats */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.stat-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-lbl { color: var(--muted); font-size: 12px; }

.perfreq { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; align-items: end; }
.pf { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pf-bar { width: 100%; height: 70px; background: var(--panel-2); border-radius: 4px; position: relative; overflow: hidden; }
.pf-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); }
.pf-lbl { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-pct { font-size: 10px; font-variant-numeric: tabular-nums; }

/* settings */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.setting-lbl { color: var(--muted); }
/* Button groups (pick one or pick several): separate rounded buttons with a small gap, everywhere. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border-radius: 8px; min-width: 40px; }
.seg button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.setting.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 5px 8px; min-width: 42px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chips button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.checks input { accent-color: var(--accent); }

body.dragging .col-main { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--radius); }

/* ---------------- shared bits ---------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.err { color: var(--bad); }
.late { color: var(--bad); }
.strong { font-weight: 600; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.confirm, button.danger.confirm { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger { color: var(--bad); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* user bar in the header */
.user-bar { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.user-bar .who { color: var(--muted); }
.user-bar .link { margin: 0; }
.nav-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.nav-link:hover { text-decoration: underline; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.panel-head h2 { margin: 0; }
.btn-link {
  color: var(--text);
  text-decoration: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
}
.btn-link:hover { border-color: #3a4252; }

/* ---------------- login ---------------- */
.login { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-card .hint { margin: 4px 0 16px; }
.stack-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--muted); }
.stack-field input { color: var(--text); }
button.wide { width: 100%; margin-top: 4px; padding: 10px; }
.login .err { margin-top: 10px; min-height: 1.4em; }
.dev-list { display: flex; flex-direction: column; gap: 6px; }
.dev-acct { text-align: left; }

/* ---------------- assignment banner / list (student) ---------------- */
.assign-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-color: var(--answer);
}
.assign-banner.practice { border-color: var(--line); }
.assign-banner.practice .ab-kicker { color: var(--accent); }
.ab-kicker { color: var(--answer); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.ab-title { font-size: 18px; font-weight: 700; }
.ab-sub { color: var(--muted); font-size: 12px; }
.ab-prog { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Keep the banner one fixed shape: info on the left (cut short if long), progress on the right
   as [count] over [bar | button], so the button never wraps and the height doesn't jump. */
.assign-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; min-height: 104px; }
.ab-info { min-width: 0; }
.ab-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 2px; }
.ab-prog { display: grid; grid-template-columns: 140px auto; align-items: center; justify-items: end; gap: 8px 12px; flex-wrap: nowrap; }
.ab-prog > .ab-count { grid-column: 1 / -1; white-space: nowrap; }
.ab-prog > .ab-bar { grid-column: 1; }
.ab-prog > button { grid-column: 2; white-space: nowrap; min-width: 136px; }
@media (max-width: 600px) {
  .assign-banner { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .ab-prog { justify-items: start; grid-template-columns: minmax(0, 1fr) auto; }
  .ab-prog > .ab-bar { width: 100%; }
}
.ab-count { font-variant-numeric: tabular-nums; }
.ab-count.done { color: var(--ok); font-weight: 700; }
.ab-bar { width: 140px; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.ab-fill { height: 100%; background: var(--answer); transition: width 0.2s; }

.assign-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.ai-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.assign-item:first-child { border-top: none; padding-top: 0; }
.assign-item.current .ai-title { color: var(--answer); }
.ai-title { font-weight: 600; }
.ai-sub { color: var(--muted); font-size: 12px; }
.ai-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.assign-item > button { flex: none; white-space: nowrap; }
.more-toggle {
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--accent);
  font-weight: 600;
}
.more-toggle:hover { border-color: var(--accent); }

/* ---------------- teacher dashboard ---------------- */
.teacher { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 16px; align-items: center; max-width: 720px; }
.form-grid > input[type="text"] { max-width: 420px; }
.form-grid select { justify-self: start; }
.f-lbl { color: var(--muted); }
.narrow { max-width: 100px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline input { width: auto; }
.form-grid .chips { margin-top: 8px; }
.all-toggle { display: inline-block; margin-bottom: 8px; font-weight: 600; }
/* student management */
textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  resize: vertical;
  font: inherit;
  color: var(--text);
}
.add-area { margin: 12px 0 16px; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.add-box { background: var(--panel-2); border-radius: 8px; padding: 14px; }
.add-box h3 { margin: 0 0 10px; color: var(--text); }
.add-box input, .add-box textarea { background: var(--panel); }
.add-box .hint { margin: 0 0 10px; }
.assign-all { display: inline-block; margin-top: 12px; }
#sMsg, #tMsg { margin-top: 8px; min-height: 1.4em; }
#sMsg:empty, #tMsg:empty { margin: 0; min-height: 0; }
#teachersPanel .hint { margin: 4px 0 0; }
#tAdd .add-grid { max-width: 520px; }
.you-tag {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.pw-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 4px 0; }
.pw-form .stack-field { margin: 0; flex: 1 1 180px; max-width: 240px; }
.pw-form button { margin-bottom: 1px; }
.creds {
  border: 1px solid var(--ok);
  background: rgba(62, 207, 142, 0.07);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.creds h3 { margin: 0; color: var(--ok); }
.creds-table { max-width: 560px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
table.data td input[type="text"] { padding: 5px 8px; min-width: 120px; }
table.data tbody tr { vertical-align: middle; }

/* avatars */
.avatar {
  --size: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  color: var(--av);
  background: color-mix(in srgb, var(--av) 18%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--av) 55%, transparent);
  font-size: calc(var(--size) * 0.38);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}
.avatar svg { width: 62%; height: 62%; }
.avatar.img { overflow: hidden; background: var(--panel-2); border-color: transparent; }
.avatar.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person { display: inline-flex; align-items: center; gap: 9px; vertical-align: middle; }
.person-sub { padding-left: 35px; }
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 10px 3px 3px;
}
.profile-btn:hover { background: var(--panel); border-color: var(--line); }
.profile-btn .who { color: var(--muted); }
.profile-btn:hover .who { color: var(--text); }
.profile-btn .caret { color: var(--muted); font-size: 11px; margin-left: -2px; }
.profile-btn:hover .caret { color: var(--text); }

/* profile dialog */
.profile-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
/* All 25 choices fit at once (7 across, 4 rows), on the dialog's own background. */
.avatar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.avatar-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  background: none;
  border: 2px solid transparent;
  aspect-ratio: 1;
}
.avatar-choice:hover { border-color: var(--line); background: none; }
.avatar-choice.sel { border-color: var(--accent); }
/* profile dialog tabs: Avatar (default) | Password, the shown panel fades in */
.profile-nav { margin: 14px 0 14px; }
.profile-nav button { min-width: 96px; }
.profile-panel { display: flow-root; }   /* keep child margins inside, so both tabs measure the same */
.profile-panel[hidden] { display: none; }
.profile-panel .stack-field { max-width: 300px; }
.profile-panel.fade-in { animation: side-fade-in 0.3s ease-out both; }
@media (prefers-reduced-motion: reduce) { .profile-panel.fade-in { animation: none; } }

/* change-password dialog */
.pw-dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  width: min(380px, calc(100vw - 32px));
}
.pw-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.pw-dialog h2 { margin: 0 0 14px; font-size: 16px; }
.pw-dialog .hint { margin: 0 0 8px; }
.pw-dialog .actions { margin-top: 12px; }
.pw-msg { min-height: 1.4em; }

/* classes */
/* Teacher views: Classes list → one class (tabs) ; Teachers */
.view { display: flex; flex-direction: column; gap: 16px; }
.view[hidden], .tab-panel[hidden] { display: none; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.view-title { margin: 0; font-size: 22px; }
.class-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.class-actions select { max-width: 240px; }
.back-link { color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: -6px; align-self: flex-start; }
.back-link:hover { color: var(--text); }
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.class-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.class-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.class-card-name { font-size: 17px; font-weight: 700; }
.class-card-meta { color: var(--muted); }
.class-card-go { color: var(--accent); font-weight: 600; margin-top: 6px; }
.empty-card { padding: 4px 0; }
.archived-head { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.class-card.archived { opacity: 0.7; }
.class-card.archived:hover { opacity: 1; }
.archived-note {
  padding: 10px 14px; border-radius: var(--radius); border: 1px dashed var(--line);
  background: var(--panel-2); color: var(--muted);
}
#classesPanel .class-cards { margin-top: 4px; }
.class-form.add-area { margin: 4px 0 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs .tab {
  padding: 10px 16px; color: var(--muted); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.sel { color: var(--text); border-bottom-color: var(--accent); }
.class-bar { padding-block: 12px; }
.class-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.class-label { font-weight: 700; margin-right: 2px; }
#classSelect { font-weight: 600; min-width: 220px; max-width: 100%; }
.no-classes { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.class-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.class-form .stack-field { margin: 0; flex: 1 1 260px; max-width: 420px; }
#cMsg { min-height: 0; }
#cMsg:not(:empty) { margin-top: 8px; }
.class-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79, 157, 255, 0.12);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 2px;
}
.ai-class { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }

#formPanel.editing { border-color: var(--answer); }
#formPanel.editing h2 { color: var(--answer); }
.edit-note {
  background: rgba(230, 168, 77, 0.1);
  border: 1px solid rgba(230, 168, 77, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
tr.editing-row td { background: rgba(230, 168, 77, 0.08); }
.gain-btns button { min-width: 64px; font-variant-numeric: tabular-nums; }
.gain-btns + .hint { margin-top: 6px; }
.type-help { margin: 6px 0 0; max-width: 520px; }
.source-audio { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.source-audio .inline { flex-wrap: wrap; }
.source-audio select { max-width: 320px; }
.source-audio .hint { margin: 0; }
.summary { margin-top: 16px; color: var(--muted); font-size: 13px; }
#fMsg { align-self: center; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .f-lbl { margin-top: 8px; }
}

.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data caption { caption-side: top; text-align: left; padding: 4px 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { padding: 5px 10px; }
.row-actions button + button { margin-left: 6px; }
.score.good { color: var(--ok); }
.score.mid { color: var(--answer); }
.score.low { color: var(--bad); }
.gradebook td { white-space: nowrap; }
.perfreq.wide { justify-content: start; margin-bottom: 8px; }
.class-cards .full-row { grid-column: 1 / -1; margin: 0; }

/* Metrics tab */
.metrics-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .metrics-tiles { grid-template-columns: 1fr 1fr; } }
.pf-mark { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--text); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.pf-bar:has(.pf-mark) { overflow: visible; }
table.metrics th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.metrics th.sortable:hover, table.metrics th.sorted { color: var(--text); }
table.metrics tr.clickable { cursor: pointer; }
table.metrics tr.clickable:hover td { background: rgba(255, 255, 255, 0.03); }
table.metrics tr.class-row td { border-top: 2px solid var(--line); background: var(--panel-2); }
.small-select { gap: 8px; color: var(--muted); font-size: 13px; }
.small-select select { padding: 4px 8px; font-size: 13px; }
.soon {
  margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(230, 168, 77, 0.15); color: var(--answer); vertical-align: middle;
}

/* Metrics: accuracy curve (same axes as the practice EQ graph) */
.curve-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.curve-controls .seg button { padding: 6px 12px; font-size: 13px; }
.curve-canvas { display: block; width: 100%; height: 260px; }
.curve-readout { min-height: 1.5em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.curve-legend { gap: 6px 8px; }
.curve-key {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; color: var(--text);
}
.curve-key.off { opacity: 0.4; }
.curve-swatch { width: 18px; height: 3px; border-radius: 2px; background: var(--c); }
.curve-swatch.dashed { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }

/* Teachers tab: invites (admin) */
.head-actions { display: flex; gap: 8px; }
.admin-tag { color: var(--accent); border-color: rgba(79, 157, 255, 0.4); }
.invite-box { max-width: 520px; }
.invite-ready { display: flex; flex-direction: column; gap: 8px; }
.invite-ready p { margin: 0; }
.invite-link { width: 100%; max-width: 640px; font-size: 12px; }
.btn-link.primary-link { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-link.primary-link:hover { filter: brightness(1.08); }
#invitesBox h3 { margin-top: 20px; }

/* Join codes */
.join-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.join-code {
  font-size: 30px; font-weight: 700; letter-spacing: 0.12em; padding: 8px 18px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.join-code.off { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.join-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.join-opts { display: flex; flex-direction: column; gap: 6px; }
.join-opts label { display: inline-flex; align-items: center; gap: 8px; }
#jMsg:not(:empty) { margin-top: 8px; }
.class-card-wait { color: var(--answer); font-weight: 600; font-size: 13px; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.join-title { margin: 0 0 4px; font-size: 16px; }
.code-row { display: flex; gap: 8px; margin-top: 10px; }
.code-row input { flex: 1; min-width: 0; font-size: 16px; }
#codeErr:not(:empty) { margin-top: 8px; }
.join-class-card { padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 14px; }
.join-class-card .strong { font-size: 16px; }
.join-class-card .link { margin: 4px 0 0; padding: 0; }
.join-mode { display: flex; margin-bottom: 14px; }
.join-mode button { flex: 1; }
.join-note { padding: 8px 10px; margin-bottom: 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }

.backup-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Audio library (admin) */
.song-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.song-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); transition: border-color 0.15s, background-color 0.15s; }
.song-card.drop { border-color: var(--accent); border-style: dashed; background: rgba(79, 157, 255, 0.06); }
.song-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.song-card .song-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.song-actions { margin-left: auto; display: flex; gap: 6px; }
.song-rename { margin-bottom: 10px; gap: 6px; flex-wrap: wrap; }
.stem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.stem-slot { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.stem-slot.filled { border-style: solid; }
.stem-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stem-name { font-weight: 600; }
.stem-meta { font-size: 12px; color: var(--muted); }
.stem-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.small-btn { padding: 3px 9px !important; font-size: 12px !important; }
.stem-play { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 11px; line-height: 1; }
.stem-play.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.song-drop { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* ---------- Trainer switch (EQ | Dynamics) ---------- */
.trainer-tabs { grid-column: 1 / -1; justify-self: start; display: inline-flex; gap: 6px; width: fit-content; margin-bottom: -4px; }
.trainer-tabs a {
  min-width: 96px; padding: 7px 18px; text-align: center; font-weight: 600; text-decoration: none; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.trainer-tabs a:hover { color: var(--text); border-color: #3a4252; }
.trainer-tabs a.sel { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- Dynamics trainer ---------- */
.no-source { margin: -6px 0 16px; }
.opt.opt-wide { flex: 1 1 0; min-width: 0; max-width: 160px; padding: 12px 10px; font-size: 15px; }
.per-level { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.per-level .pf-lbl { font-size: 10px; }
.level-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.level-list .level { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; }
.level-list .level.sel { background: rgba(79, 157, 255, 0.16); border-color: var(--accent); }
.level-list .level:disabled { opacity: 0.45; cursor: not-allowed; }
.level-name { font-weight: 600; }
.level-blurb { font-size: 12px; color: var(--muted); }
.dyn-vis { display: flex; gap: 16px; align-items: stretch; }
.dyn-vis canvas { flex: 1 1 auto; min-width: 0; height: 260px; }
.gr-meter { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gr-title { font-size: 12px; color: var(--muted); }
.gr-bar { position: relative; width: 22px; flex: 1 1 auto; min-height: 150px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.gr-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: var(--accent); transition: height 0.05s linear; }
.gr-hold { position: absolute; left: 0; right: 0; height: 2px; margin-top: -2px; background: var(--text); }
.gr-val { font-variant-numeric: tabular-nums; font-weight: 600; min-height: 1.3em; }
.gr-meter.hidden-q .gr-val { color: var(--answer); }
.key-unity::before { background: none; border-top: 2px dashed var(--muted); height: 0; }
@media (max-width: 600px) {
  .dyn-vis canvas { height: 220px; }
  .gr-meter { flex-basis: 70px; }
  .opt.opt-wide { min-width: 0; flex: 1 1 0; }
}
.fixed-note { font-size: 12px; color: var(--muted); margin-bottom: 10px; padding: 6px 10px; background: var(--panel-2); border-radius: 6px; display: inline-block; }
.opt-sub { display: block; font-size: 11px; font-weight: 400; opacity: 0.75; margin-top: 2px; }
.level-item { display: flex; flex-direction: column; }
.level-head { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.level-caret { color: var(--muted); font-size: 12px; transform: rotate(-90deg); transition: transform 0.2s; }
.level-caret.open { transform: none; }
.level-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease; }
.level-fold.open { grid-template-rows: 1fr; }
.level-fold-inner { overflow: hidden; min-height: 0; opacity: 0; transition: opacity 0.18s; }
.level-fold.open .level-fold-inner { opacity: 1; }
.level-opt { padding: 8px 4px 2px 12px; border-left: 2px solid var(--accent); margin: 6px 0 0 10px; }
.level-opt + .level-opt { margin-top: 0; padding-top: 6px; }
.level-opt-lbl { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.level-opt .seg { flex-wrap: wrap; }
.level-opt .seg button { padding: 6px 10px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .level-fold, .level-fold-inner, .level-caret { transition: none; } }
.verdict.partial { color: var(--answer); }
.ab button:disabled { cursor: not-allowed; }
.ab button:disabled:not(.active):hover { background: var(--panel-2); border-color: var(--line); color: inherit; }
.level-opt .seg.multi button.sel { background: rgba(79, 157, 255, 0.85); }
.history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.history-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.history canvas { display: block; width: 100%; height: 150px; }
.key-input::before { background: rgba(150, 160, 180, 0.5); height: 8px; }
.key-output::before { background: var(--accent); opacity: 0.55; height: 8px; }
.key-gr::before { background: var(--accent); }
.key-thr::before { background: none; border-top: 2px dashed var(--accent); height: 0; }

/* Assignment form: EQ rows vs Dynamics rows */
#newForm.trainer-dynamics .eq-only, #newForm:not(.trainer-dynamics) .dyn-only { display: none !important; }
.dyn-opts { display: contents; }
.seg.wrap { flex-wrap: wrap; }
/* Class modules */
.module-picks { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.module-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 2px; }
.module-bar-lbl { color: var(--muted); font-size: 13px; }
.module-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.module-chip {
  /* Same look as the app's other toggle buttons (.seg): grey when off, solid blue when on. */
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.module-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
button.module-chip:not(:disabled):not(.on):hover { border-color: #3a4252; color: var(--text); }
button.module-chip:disabled { cursor: default; opacity: 1; }
.small-chips .module-chip { padding: 2px 8px; font-size: 11px; border-radius: 6px; }
/* Assignment type: Matching | Return to flat, plus a From memory toggle */
.type-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toggle-btn { padding: 8px 12px; color: var(--muted); }
.toggle-btn::before { content: "○ "; }
.toggle-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle-btn.sel::before { content: "✓ "; }
.form-grid .gain-btns { margin-top: 0; }
.form-grid .chips button { padding: 8px 12px; font-size: inherit; min-width: 48px; }
.attempts-num { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.attempts-num input { width: 70px; }

/* Button groups: slimmer buttons, more space between them (applies across the app). */
.seg, .chips, .type-row, .module-chips, .trainer-tabs { gap: 10px; }
.seg button, .form-grid .chips button, .toggle-btn, .trainer-tabs a { padding-top: 5px; padding-bottom: 5px; }
.chips button { padding-top: 3px; padding-bottom: 3px; }
.form-grid .chips button { padding-top: 5px; padding-bottom: 5px; }
.module-chip { padding-top: 4px; padding-bottom: 4px; }
.level-opt .seg { gap: 8px; }
.level-opt .seg button { padding-top: 4px; padding-bottom: 4px; }
.form-grid { row-gap: 16px; }
.form-grid { max-width: 780px; }

/* Source preview: a single Play / Stop button next to the clip menu */
/* Just an icon: a blue triangle. Click it and it flashes green, then becomes a red stop
   square while the clip plays; click the square to stop. */
.preview-btn {
  width: 24px; height: 24px; padding: 0; border: none; background: none; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.preview-btn::before {
  content: ""; width: 0; height: 0;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--accent);
  margin-left: 2px; transition: border-color 0.15s;
}
.preview-btn:hover::before { border-left-color: #7db6ff; }
.preview-btn.on.flash::before { border-left-color: var(--ok); }
.preview-btn.on:not(.flash)::before { width: 10px; height: 10px; border: none; margin: 0; background: var(--bad); border-radius: 2px; }
.preview-btn.on:not(.flash):hover::before { background: #ff8a95; }
.preview-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* EQ Practice settings (narrow sidebar): every button group the same compact size. */
.settings .seg, .settings .chips, .settings .type-row { gap: 6px; }
.settings .seg button, .settings .chips button, .settings .toggle-btn {
  padding: 4px 9px; font-size: 13px; min-width: 0; border-radius: 7px;
}
.settings .chips button { min-width: 44px; }
.settings .gain-btns button { min-width: 56px; }
.settings .type-row { flex-wrap: nowrap; }
.ab-sub { min-height: 2.9em; }   /* always room for two lines, so the banner never changes height */
.assign-banner.fade-in { animation: side-fade-in 0.35s ease-out both; }
@media (prefers-reduced-motion: reduce) { .assign-banner.fade-in { animation: none; } }
/* A heading that folds a section out underneath it (Opportunity areas) */
.fold-head {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  margin: 14px 0 0; padding: 8px 10px; font-weight: 600; font-size: 14px; text-align: left;
}
.fold-head[aria-expanded="true"] { border-color: var(--accent); background: rgba(79, 157, 255, 0.10); }
.fold-head + .level-fold .level-fold-inner > * { margin-top: 8px; }
/* Same as the level options on the Dynamics page: a thin blue line and a slight indent. */
.fold-head + .level-fold .level-fold-inner { border-left: 2px solid var(--accent); margin: 6px 0 0 10px; padding: 0 0 2px 12px; }
.fold-head + .level-fold .level-fold-inner > :first-child { margin-top: 8px; }
.fold-head + .level-fold .ops li { background: none; padding: 4px 0; border-radius: 0; }
.key-spectrum::before { background: rgba(150, 160, 180, 0.45); height: 8px; }
/* Individual frequencies in rows like the player: High / Mid / Low */
.chip-rows { display: flex; flex-direction: column; gap: 6px; }
.chip-row { display: flex; align-items: center; gap: 8px; }
.chip-row-lbl { width: 34px; flex: none; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.form-grid .chip-rows { margin-top: 8px; }
.chip-rows .chips { margin-top: 0 !important; }
