@import url("/fonts.css");
:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --raised: #17171a;
  --border: #27272a;
  --text: #fafafa;
  --secondary: #a1a1aa;
  --muted: #85858e;
  --accent: #b5f34a;
  --error: #f87171;
  --radius: 9px;
  font-family:
    Inter,
    Geist,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
input,
textarea,
select {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button,
a {
  touch-action: manipulation;
}
svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
}
h1 {
  letter-spacing: -0.045em;
}
h2 {
  letter-spacing: -0.035em;
}
h3 {
  letter-spacing: -0.02em;
}
p {
  color: var(--secondary);
}
small {
  color: var(--secondary);
}
.mono,
.eyebrow,
.badge,
.stat-label,
.table-label {
  font-family: "Geist Mono", Consolas, monospace;
}
.muted {
  color: var(--secondary);
}
.dim {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.error-text {
  color: var(--error);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  padding: 10px;
  background: var(--accent);
  color: var(--bg);
  z-index: 200;
}
.skip-link:focus {
  top: 12px;
}
.container {
  max-width: 1220px;
  padding: 0 42px;
  margin: auto;
}
.navbar {
  height: 76px;
  border-bottom: 1px solid #222225;
  background: var(--bg);
  position: relative;
  z-index: 20;
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
.brand-square {
  width: 11px;
  height: 11px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 30px;
  margin-left: auto;
  font-size: 13px;
  color: var(--secondary);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
}
.nav-toggle {
  display: none;
}
.btn {
  height: 42px;
  padding: 0 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  transition:
    background 0.18s,
    border-color 0.18s;
  white-space: nowrap;
}
.btn:hover {
  background: #222226;
  border-color: #424248;
}
.btn.primary {
  background: var(--text);
  color: #111113;
  border-color: var(--text);
}
.btn.primary:hover {
  background: #dedee2;
}
.btn.lime {
  background: var(--accent);
  border-color: var(--accent);
  color: #172006;
}
.btn.lime:hover {
  background: #c7ff63;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--raised);
}
.btn.danger {
  color: var(--error);
  border-color: #553136;
  background: #241416;
}
.btn.small {
  height: 33px;
  padding: 0 11px;
  font-size: 12px;
}
.btn.icon {
  width: 38px;
  padding: 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.hero {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 65px;
  align-items: center;
  min-height: 645px;
  padding-top: 76px;
  padding-bottom: 78px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--secondary);
  text-transform: uppercase;
}
.hero .eyebrow {
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 4px;
  margin-bottom: 27px;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.hero h1 {
  font-size: 61px;
  line-height: 1.08;
  letter-spacing: -0.055em;
}
.hero h1 span {
  color: #93939c;
}
.hero-copy > p {
  max-width: 390px;
  margin-top: 23px;
  font-size: 15px;
  line-height: 1.8;
}
.hero-copy .actions {
  margin-top: 30px;
  gap: 11px;
}
.hero-note {
  margin-top: 21px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.hero-note svg {
  width: 13px;
  height: 13px;
}
.quiz-preview {
  background: #101012;
  border: 1px solid #323237;
  border-radius: 12px;
  box-shadow: 0 18px 70px #0005;
  overflow: hidden;
}
.window-bar {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  color: var(--muted);
  font-size: 10px;
}
.window-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36363c;
}
.window-bar .mono {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.04em;
}
.preview-content {
  padding: 22px 24px;
}
.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--secondary);
}
.quiz-meta .subject {
  color: var(--text);
  font-weight: 550;
}
.slash {
  padding: 0 6px;
  color: #52525b;
}
.progress-track {
  height: 3px;
  background: #29292e;
  border-radius: 5px;
  overflow: hidden;
  margin: 15px 0 22px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.preview-question {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.question-marker {
  font-family: Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 9px;
}
.choices {
  display: grid;
  gap: 9px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  width: 100%;
  padding: 11px 13px;
  color: #b8b8c1;
  background: #151518;
  border: 1px solid #2a2a30;
  border-radius: 7px;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  transition:
    background 0.15s,
    border 0.15s;
}
.choice:hover {
  border-color: #51515c;
  background: #1b1b20;
}
.choice input {
  appearance: none;
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.choice:has(input:checked):not(.correct):not(.incorrect),
.choice.selected:not(.correct):not(.incorrect) {
  border-color: #92929f;
  background: #24242b;
  color: #fafafa;
}
.choice-letter {
  height: 23px;
  min-width: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #424248;
  border-radius: 50%;
  font-family: Consolas, monospace;
  font-size: 10px;
  color: #a1a1aa;
}
.choice:has(input:checked):not(.correct):not(.incorrect) .choice-letter,
.choice.selected:not(.correct):not(.incorrect) .choice-letter {
  border-color: #d4d4d8;
  color: #fafafa;
}
.choice.correct {
  border-color: var(--accent);
  background: #b5f34a0b;
  color: var(--text);
}
.choice.incorrect {
  border-color: var(--error);
  background: #ef444414;
  color: #fecaca;
}
.choice.correct .choice-letter {
  color: var(--accent);
  border-color: var(--accent);
}
.choice.incorrect .choice-letter {
  color: var(--error);
  border-color: var(--error);
}
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.preview-content .check-row .btn {
  height: 36px;
  font-size: 11px;
  gap: 9px;
}
.check-row small {
  font-size: 9px;
}
.preview-footer {
  border-top: 1px solid var(--border);
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}
.preview-footer svg {
  width: 11px;
  height: 11px;
}
.feedback {
  padding: 15px 0 0;
  font-size: 13px;
}
.feedback strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
}
.feedback.wrong strong {
  color: var(--error);
}
.feedback p {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.7;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 55px;
  border-top: 1px solid var(--border);
  padding: 36px 0 39px;
}
.feature svg {
  margin-bottom: 16px;
  color: #b7b7bf;
  width: 20px;
  height: 20px;
}
.feature h3 {
  font-size: 14px;
  margin-bottom: 9px;
}
.feature p {
  font-size: 12px;
  line-height: 1.8;
  max-width: 265px;
}
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 25px;
  margin-bottom: 27px;
}
.section-top h2 {
  font-size: 28px;
  margin-top: 10px;
}
.section-top p {
  font-size: 13px;
  max-width: 380px;
}
.home-section {
  padding: 68px 0;
  border-top: 1px solid var(--border);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  padding: 30px 0 32px;
  gap: 25px;
}
.stat-number {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 3px;
}
.course-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.course-row {
  padding: 19px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 15px;
}
.course-row:last-child {
  border-bottom: 0;
}
.course-row h3 {
  font-size: 14px;
}
.course-row small {
  font-size: 11px;
}
.course-row .course-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}
.course-icon > svg {
  color: var(--accent);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
}
.step-number {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 18px;
}
.steps h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
.steps p {
  font-size: 12px;
}
.cta-strip {
  padding: 40px 0 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.cta-strip h2 {
  font-size: 27px;
}
.cta-strip p {
  margin-top: 8px;
  font-size: 13px;
}
.footer {
  border-top: 1px solid var(--border);
  padding: 25px 0 28px;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer .brand {
  font-size: 14px;
}
.footer .brand-square {
  width: 7px;
  height: 7px;
}
.footer-note {
  font-size: 10px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  margin-left: auto;
  gap: 22px;
  font-size: 10px;
  color: var(--secondary);
}
.copyright {
  font-size: 9px;
  color: var(--muted);
  margin-top: 17px;
}
.auth-wrap {
  max-width: 390px;
  margin: 68px auto 95px;
  padding: 0 20px;
}
.auth-wrap.wide {
  max-width: 460px;
}
.back-link {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--secondary);
  margin-bottom: 32px;
}
.auth-wrap h1 {
  font-size: 30px;
  margin-bottom: 10px;
}
.auth-wrap > p {
  font-size: 13px;
  margin-bottom: 27px;
}
.form-grid {
  display: grid;
  gap: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
label.field {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #d4d4d8;
}
input,
select,
textarea {
  border: 1px solid #303036;
  border-radius: 6px;
  background: #121215;
  color: var(--text);
  width: 100%;
  padding: 11px 12px;
  min-height: 42px;
}
input::placeholder,
textarea::placeholder {
  color: #696975;
}
input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}
input[type="file"] {
  font-size: 12px;
}
textarea {
  resize: vertical;
  line-height: 1.65;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #788d50;
}
.form-help {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.form-foot {
  font-size: 12px;
  color: var(--secondary);
  text-align: center;
  margin-top: 25px;
}
.form-foot a {
  color: var(--text);
}
.form-error {
  color: var(--error);
  font-size: 12px;
}
.notice {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  font-size: 12px;
  color: var(--secondary);
  line-height: 1.8;
}
.notice strong {
  color: var(--text);
}
.notice svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 6px;
}
.stack {
  display: grid;
  gap: 20px;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 42px 80px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 35px;
}
.page-header h1 {
  font-size: 32px;
  margin-top: 9px;
}
.page-header p {
  margin-top: 10px;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--secondary);
  white-space: nowrap;
}
.badge.green {
  color: var(--accent);
  background: #b5f34a08;
  border-color: #b5f34a30;
}
.badge.red {
  color: var(--error);
  border-color: #ef444438;
}
.badge.yellow {
  color: #e5cb83;
  border-color: #e5cb8338;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 35px;
  background: var(--surface);
}
.metric {
  padding: 20px 23px;
  border-right: 1px solid var(--border);
}
.metric:last-child {
  border-right: 0;
}
.metric .stat-number {
  font-size: 25px;
}
.metric-label {
  font-size: 11px;
  color: var(--secondary);
  margin-bottom: 7px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 16px;
  gap: 15px;
}
.section-heading h2 {
  font-size: 18px;
}
.subject-group {
  margin-top: 26px;
}
.subject-group > h3 {
  font-size: 14px;
  margin-bottom: 15px;
}
.bank-row {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  align-items: center;
  gap: 22px;
}
.bank-row:last-child {
  border-bottom: 1px solid var(--border);
}
.bank-row > svg {
  color: var(--muted);
}
.bank-main {
  flex: 1;
  min-width: 0;
}
.bank-main h3 {
  font-size: 14px;
}
.bank-main p {
  font-size: 11px;
  margin-top: 5px;
}
.bank-progress {
  width: 145px;
}
.bank-progress .progress-track {
  margin: 6px 0 0;
  height: 3px;
}
.bank-progress small {
  font-size: 10px;
}
.empty {
  padding: 56px 25px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}
.empty svg {
  height: 28px;
  width: 28px;
  color: var(--muted);
  margin-bottom: 18px;
}
.empty h2 {
  font-size: 19px;
  margin-bottom: 10px;
}
.empty p {
  font-size: 12px;
  max-width: 430px;
  margin: auto;
}
.empty .btn {
  margin-top: 20px;
}
.loading {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.loading p {
  font-size: 13px;
}
.quiz-page {
  max-width: 870px;
  margin: auto;
  padding: 36px 35px 70px;
}
.quiz-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}
.quiz-toolbar a {
  color: var(--secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.quiz-page .quiz-meta {
  font-size: 12px;
}
.quiz-page .progress-track {
  margin: 18px 0 40px;
}
.question-content {
  position: relative;
  isolation: isolate;
}
.question-content.deterrents {
  user-select: none;
  -webkit-user-select: none;
}
.question-content .question-marker {
  font-size: 10px;
  margin-bottom: 16px;
}
.question-prompt {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 26px;
}
.stimulus {
  font-size: 14px;
  line-height: 1.8;
  padding: 20px;
  border-left: 2px solid #45454e;
  background: var(--surface);
  white-space: pre-wrap;
  margin-bottom: 26px;
}
.question-image {
  display: block;
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  margin: 0 auto 25px;
  background: white;
  border-radius: 5px;
}
.quiz-page .choice {
  font-size: 15px;
  min-height: 62px;
  padding: 15px 19px;
  gap: 16px;
  white-space: pre-wrap;
}
.quiz-page .choice-letter {
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.quiz-page .choices {
  gap: 12px;
}
.quiz-page .check-row {
  margin-top: 24px;
}
.quiz-page .feedback {
  padding: 24px 0;
  font-size: 15px;
}
.quiz-page .feedback p {
  font-size: 14px;
  white-space: pre-wrap;
}
.quiz-bottom { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-bottom small {
  font-size: 11px;
}
.workspace {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #0d0d0f;
}
.sidebar-label {
  padding: 0 12px 17px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--secondary);
  font-size: 12px;
  border-radius: 6px;
}
.sidebar a:hover {
  background: var(--raised);
  color: var(--text);
}
.sidebar a.active {
  background: #b5f34a0b;
  color: var(--accent);
}
.sidebar a svg {
  width: 16px;
  height: 16px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 28px 12px 0;
  font-size: 10px;
  color: var(--muted);
}
.admin-main {
  padding: 35px 38px 65px;
  min-width: 0;
  max-width: 1500px;
  width: 100%;
  margin: auto;
}
.admin-main .page-header {
  margin-bottom: 29px;
}
.admin-main .page-header h1 {
  font-size: 28px;
}
.admin-main .metric-grid {
  grid-template-columns: repeat(4, 1fr);
}
.admin-main .metric {
  padding: 17px 19px;
}
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  gap: 18px;
}
.panel-head h2 {
  font-size: 14px;
}
.panel-body {
  padding: 20px;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
th {
  font-weight: 400;
  font-size: 10px;
  color: var(--muted);
  background: #101012;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 15px 18px;
  border-bottom: 1px solid #242428;
  color: var(--secondary);
}
td strong {
  font-weight: 500;
  color: var(--text);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #ffffff02;
}
.table-actions {
  display: flex;
  gap: 7px;
  justify-content: end;
}
td.wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 400px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.search {
  max-width: 300px;
  position: relative;
}
.search svg {
  position: absolute;
  top: 13px;
  left: 12px;
  color: var(--muted);
  width: 16px;
  height: 16px;
}
.search input {
  padding-left: 38px;
  font-size: 12px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--secondary);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.record-list {
  display: grid;
  gap: 0;
}
.record {
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.record:last-child {
  border: 0;
}
.record h3 {
  font-size: 13px;
}
.record p {
  font-size: 11px;
  margin-top: 6px;
}
.record .actions {
  flex-shrink: 0;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.check-label input {
  flex-shrink: 0;
}
.assignment-list {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}
.assignment-list .check-label {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #b5f34a40;
  color: var(--accent);
  background: #b5f34a08;
  border-radius: 9px;
  font-family: Consolas, monospace;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  font-size: 12px;
}
.detail-grid dt {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}
.detail-grid dd {
  margin: 0;
  color: #d4d4d8;
  overflow-wrap: anywhere;
}
.editor-question {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 20px;
}
.editor-question .form-grid {
  gap: 14px;
}
.choice-editor {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.choice-editor textarea {
  font-size: 12px;
}
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.editor-top h3 {
  font-size: 13px;
}
.review-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 19px;
}
.source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 265px;
  gap: 22px;
}
.source-image {
  width: 100%;
  background: white;
  display: block;
}
.source-container {
  position: relative;
  align-self: start;
  user-select: none;
  touch-action: none;
}
.crop-selection {
  position: absolute;
  border: 2px solid #94ca30;
  background: #b5f34a22;
  pointer-events: none;
}
.code {
  padding: 15px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font:
    12px/1.8 Consolas,
    monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.prose {
  max-width: 740px;
}
.prose h1 {
  font-size: 34px;
  margin-bottom: 25px;
}
.prose h2 {
  font-size: 19px;
  margin: 30px 0 12px;
}
.prose p {
  font-size: 14px;
  margin: 12px 0;
  line-height: 1.9;
}
.prose a {
  color: var(--accent);
}
dialog {
  background: #111113;
  color: var(--text);
  border: 1px solid #3a3a42;
  border-radius: 12px;
  padding: 28px;
  max-height: 90vh;
  width: min(580px, calc(100% - 30px));
  box-shadow: 0 25px 90px #0009;
}
dialog::backdrop {
  background: #000b;
}
dialog.wide {
  width: min(1100px, calc(100% - 30px));
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.modal-head h2 {
  font-size: 20px;
}
.modal-head .btn {
  height: 30px;
  width: 30px;
}
.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 22px;
}
#toasts {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: min(360px, calc(100% - 40px));
  display: grid;
  gap: 10px;
  z-index: 100;
}
.toast {
  border: 1px solid #3a3a42;
  background: #1a1a1e;
  border-radius: 8px;
  box-shadow: 0 8px 25px #0006;
  padding: 15px 17px;
  font-size: 12px;
  animation: appear 0.18s ease;
}
.toast.error {
  border-color: #79434a;
}
.toast strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
.toast button {
  float: right;
  border: 0;
  background: none;
  color: var(--secondary);
}
.nowrap {
  white-space: nowrap;
}
.mt {
  margin-top: 20px;
}
.mb {
  margin-bottom: 20px;
}
.full {
  width: 100%;
}
.spacer {
  flex: 1;
}
.align-end {
  align-self: end;
}
.text-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notification-item {
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}
.notification-item h3 {
  font-size: 14px;
}
.notification-item p {
  font-size: 12px;
  margin: 8px 0;
  white-space: pre-wrap;
}
.notification-item small {
  font-size: 10px;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1450px) {
  .container {
    max-width: 1290px;
  }
  .hero {
    min-height: 690px;
    gap: 95px;
  }
  .hero h1 {
    font-size: 68px;
  }
  .preview-content {
    padding: 26px 28px;
  }
}
@media (max-width: 1100px) {
  .hero {
    gap: 35px;
  }
  .hero h1 {
    font-size: 50px;
  }
  .container {
    padding-left: 30px;
    padding-right: 30px;
  }
  .nav-inner {
    gap: 25px;
  }
  .nav-links {
    gap: 20px;
  }
  .admin-main {
    padding: 28px 24px;
  }
  .workspace {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .metric {
    padding: 18px 15px;
  }
  .bank-progress {
    width: 100px;
  }
}
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 45px;
    padding: 52px 0;
    min-height: auto;
  }
  .hero-copy {
    max-width: 590px;
  }
  .hero h1 {
    font-size: 55px;
  }
  .hero-copy > p {
    max-width: 450px;
  }
  .quiz-preview {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-actions {
    gap: 12px;
  }
  .nav-inner {
    gap: 20px;
  }
  .features {
    gap: 30px;
  }
  .home-section {
    padding: 45px 0;
  }
  .section-top {
    align-items: start;
  }
  .section-top p {
    max-width: 290px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 10px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar a {
    white-space: nowrap;
    padding: 9px 11px;
  }
  .sidebar-label,
  .sidebar-bottom {
    display: none;
  }
  .admin-main .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-grid .metric:nth-child(2) {
    border-right: 0;
  }
  .metric-grid .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bank-row {
    gap: 14px;
  }
  .source-layout {
    grid-template-columns: 1fr;
  }
  .page {
    padding: 35px 25px 65px;
  }
  .page-header h1 {
    font-size: 28px;
  }
  .watermarks {
    font-size: 8px;
  }
}
@media (max-width: 580px) {
  .container {
    padding: 0 22px;
  }
  .navbar {
    height: 66px;
  }
  .brand {
    font-size: 19px;
  }
  .nav-inner {
    gap: 10px;
    justify-content: space-between;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: #111113;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    margin: 0;
    flex-wrap: wrap;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-actions .btn {
    height: 34px;
    padding: 0 11px;
    font-size: 11px;
  }
  .nav-actions {
    gap: 10px;
    font-size: 11px;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav-actions .hide-mobile {
    display: none;
  }
  .hero {
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 35px;
  }
  .hero h1 {
    font-size: 43px;
  }
  .hero .eyebrow {
    font-size: 8px;
    margin-bottom: 22px;
  }
  .hero-copy > p {
    font-size: 14px;
    max-width: 340px;
    margin-top: 20px;
  }
  .hero-copy .actions {
    margin-top: 25px;
    gap: 6px;
  }
  .hero-copy .btn {
    font-size: 12px;
    padding: 0 13px;
  }
  .hero-note {
    font-size: 10px;
  }
  .preview-content {
    padding: 19px 17px;
  }
  .preview-question {
    font-size: 14px;
  }
  .preview-content .choice {
    font-size: 11px;
    gap: 9px;
    padding: 10px;
  }
  .quiz-meta {
    font-size: 10px;
  }
  .features {
    grid-template-columns: 1fr;
    padding: 29px 0;
    gap: 25px;
  }
  .feature {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 15px;
  }
  .feature svg {
    grid-row: span 2;
    margin: 2px 0 0;
  }
  .feature h3 {
    margin: 0 0 5px;
  }
  .feature p {
    max-width: 330px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 25px;
  }
  .stat-number {
    font-size: 25px;
  }
  .stat-label {
    font-size: 8px;
  }
  .section-top {
    display: block;
  }
  .section-top p {
    margin-top: 15px;
    max-width: 340px;
  }
  .section-top h2 {
    font-size: 25px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .step-number {
    margin-bottom: 8px;
  }
  .cta-strip {
    display: block;
    padding: 20px 0 40px;
  }
  .cta-strip h2 {
    font-size: 25px;
  }
  .cta-strip .btn {
    margin-top: 20px;
  }
  .footer-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .footer-note {
    font-size: 9px;
  }
  .footer-links {
    margin-left: 0;
    width: 100%;
    margin-top: 10px;
    gap: 20px;
  }
  .copyright {
    font-size: 8px;
  }
  .auth-wrap {
    margin-top: 40px;
  }
  .page {
    padding: 29px 20px 55px;
  }
  .page-header {
    display: block;
    margin-bottom: 25px;
  }
  .page-header .actions {
    margin-top: 20px;
  }
  .page-header h1 {
    font-size: 27px;
  }
  .bank-row {
    flex-wrap: wrap;
  }
  .bank-row > svg {
    display: none;
  }
  .bank-main {
    flex-basis: 70%;
  }
  .bank-progress {
    width: 100px;
  }
  .bank-row .actions {
    margin-left: auto;
  }
  .bank-row .btn {
    font-size: 11px;
  }
  .quiz-page {
    padding: 23px 20px 50px;
  }
  .quiz-toolbar {
    margin-bottom: 25px;
  }
  .quiz-page .quiz-meta {
    font-size: 10px;
    align-items: start;
  }
  .quiz-page .quiz-meta > div {
    max-width: 70%;
  }
  .quiz-page .progress-track {
    margin: 16px 0 28px;
  }
  .question-prompt {
    font-size: 16px;
  }
  .quiz-page .choice {
    font-size: 13px;
    min-height: 56px;
    padding: 13px;
    gap: 12px;
  }
  .quiz-bottom {
    flex-wrap: wrap;
  }
  .quiz-bottom small {
    order: 3;
    width: 100%;
    text-align: center;
  }
  .admin-main {
    padding: 25px 17px;
  }
  .panel-head {
    padding: 15px;
  }
  .panel-body {
    padding: 16px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .search {
    width: 100%;
    max-width: none;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    gap: 18px;
  }
  .review-tools {
    flex-wrap: wrap;
  }
  .editor-question {
    padding: 16px;
  }
  .source-layout {
    gap: 18px;
  }
  .cta-strip .btn {
    width: 100%;
  }
  .record {
    padding: 16px;
    flex-wrap: wrap;
  }
  .record .actions {
    margin-left: auto;
  }
  dialog {
    padding: 22px;
  }
  .metric .stat-number {
    font-size: 23px;
  }
  #toasts {
    bottom: 16px;
    right: 20px;
  }
  .prose h1 {
    font-size: 29px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.choices {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.choices-fields {
  display: grid;
  gap: 10px;
}
summary {
  cursor: pointer;
}
summary::-webkit-details-marker {
  display: none;
}
.metric-grid {
  overflow: hidden;
}
.nav-actions .nav-toggle {
  display: none;
}
@media (max-width: 580px) {
  .nav-actions .nav-toggle {
    display: inline-flex;
  }
}
.fixture-banner {
  background: #1f2814;
  color: #b5f34a;
  font:
    10px/1.7 Consolas,
    monospace;
  text-align: center;
  padding: 5px 15px;
  letter-spacing: 0.03em;
}
.nav-actions > a {
  white-space: nowrap;
}
@media (max-width: 580px) {
  .navbar .brand {
    font-size: 18px;
  }
  .nav-actions {
    gap: 7px;
  }
  .nav-actions .btn.primary svg {
    display: none;
  }
  .nav-actions .btn.primary {
    padding: 0 10px;
  }
}
[hidden] {
  display: none !important;
}
.choice-editor {
  grid-template-columns: 24px minmax(0, 1fr) 30px;
}
.choice-editor .btn.icon {
  width: 30px;
  height: 30px;
}
.example-link {
  font-size: 12px !important;
  margin-top: 17px !important;
}
.example-link a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.quiz-page.with-stimulus {
  max-width: 1460px;
}
.question-layout {
  min-width: 0;
}
.with-stimulus .question-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 46px;
}
.stimulus-pane {
  border-right: 1px solid var(--border);
  padding-right: 35px;
  min-width: 0;
}
.question-pane {
  min-width: 0;
}
.stimulus-text {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.9;
  color: #d4d4d8;
}
.source-prompt,
.source-choice,
.source-stimulus {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 4px;
}
.source-prompt {
  width: 100%;
  margin-bottom: 25px;
}
.source-choice {
  width: 100%;
  max-height: 700px;
  object-fit: contain;
  object-position: left center;
}
.source-stimulus {
  width: 100%;
  margin-top: 15px;
}
.choice-body {
  display: block;
  min-width: 0;
  flex: 1;
}
.with-stimulus .question-prompt {
  font-size: 16px;
}
.with-stimulus .choices {
  gap: 12px;
}
.unit-group-title {
  font-size: 13px !important;
  color: var(--secondary);
  margin: 20px 0 5px;
}
@media (max-width: 850px) {
  .with-stimulus .question-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .stimulus-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 25px;
  }
  .quiz-page.with-stimulus {
    max-width: 870px;
  }
}
.extraction-preview:has(.stimulus-pane) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 25px;
}
.extraction-preview .choice {
  margin-bottom: 10px;
}
.extraction-preview .source-choice {
  min-width: 0;
}
.extraction-preview .source-prompt {
  margin-top: 15px;
}
@media (max-width: 850px) {
  .extraction-preview:has(.stimulus-pane) {
    grid-template-columns: 1fr;
  }
}

.quiz-page .question-prompt, .quiz-page .choice, .quiz-page .stimulus-text, .quiz-page .feedback p { white-space: pre-line; }
.quiz-page .check-row { margin-top: 18px; min-height: 42px; }
/* A screen-sized practice workspace; only the reading panes scroll. */
.practice-workspace {
  --practice-font: 16px;
  --practice-split: 45%;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  padding: 12px clamp(14px, 3vw, 48px) max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.practice-workspace .quiz-toolbar { gap: 16px; margin: 0 0 8px; flex-shrink: 0; min-height: 40px; }
.practice-title { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-workspace .quiz-toolbar .actions { gap: 6px; flex-wrap: nowrap; }
.practice-workspace .quiz-toolbar .btn { min-height: 40px; }
.practice-workspace .quiz-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; flex-shrink: 0; }
.practice-unit { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-workspace .progress-track { margin: 10px 0 14px; flex-shrink: 0; }
.practice-workspace .question-content { flex: 1; min-height: 0; overflow: hidden; }
.practice-workspace .question-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.practice-workspace.with-stimulus .question-layout { grid-template-columns: minmax(0, var(--practice-split)) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); }
.practice-workspace:not(.with-stimulus) .question-layout { max-width: 860px; margin: auto; }
.practice-workspace .question-pane, .practice-workspace .stimulus-pane { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 4px 8px 16px 0; overflow-wrap: anywhere; }
.practice-workspace .stimulus-pane { border-right: 1px solid var(--border); padding-right: clamp(14px, 2vw, 28px); }
.practice-workspace .question-marker { margin-bottom: 10px; font-size: 10px; }
.practice-workspace .question-prompt { font-size: var(--practice-font); line-height: 1.5; margin-bottom: 16px; }
.practice-workspace .stimulus-text { font-size: var(--practice-font); line-height: 1.65; }
.practice-workspace .choices { gap: 8px; }
.practice-workspace .choice { font-size: var(--practice-font); min-height: 48px; padding: 10px 14px; gap: 12px; line-height: 1.45; }
/* Figures keep full width and scroll in their pane; shrinking to the viewport height made tables unreadable. */
.practice-workspace .question-image, .practice-workspace .source-stimulus { max-height: none; margin: 4px auto 12px; }
.practice-workspace .source-choice { max-height: none; }
.practice-workspace .feedback { padding: 14px 0 4px; font-size: var(--practice-font); }
.practice-workspace .feedback p { font-size: var(--practice-font); line-height: 1.55; }
.practice-workspace .quiz-bottom { flex-shrink: 0; display: block; padding-top: 8px; margin-top: 8px; background: var(--bg); }
.practice-status { display: flex; justify-content: space-between; gap: 12px; min-height: 24px; align-items: center; }
.practice-workspace .quiz-bottom small { width: auto; order: initial; font-size: 11px; }
.practice-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.practice-controls .btn { min-height: 44px; }
.practice-controls #previous { justify-self: start; }
.practice-controls #next { justify-self: end; min-width: 100px; }
.practice-tabs { display: flex; gap: 4px; flex-shrink: 0; padding-bottom: 10px; }
.practice-tabs button { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; border: 1px solid var(--border); border-radius: 7px; color: var(--secondary); background: var(--surface); }
.practice-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.practice-workspace [hidden] { display: none !important; }
.practice-workspace[data-layout="stack"] .question-layout { display: block; overflow: auto; overscroll-behavior: contain; }
.practice-workspace[data-layout="stack"] .stimulus-pane, .practice-workspace[data-layout="stack"] .question-pane { overflow: visible; }
.practice-workspace[data-layout="stack"] .stimulus-pane { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 18px; margin-bottom: 18px; }
@media (max-width: 800px) {
  .nav-actions .nav-toggle { display: inline-flex; min-width: 44px; min-height: 44px; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 30; flex-wrap: wrap; gap: 8px 20px; }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .workspace, .admin-main, .page, .panel, .two-col > * { min-width: 0; }
}
@media (max-width: 700px) {
  .practice-workspace { padding: max(8px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); }
  .practice-workspace .quiz-toolbar { gap: 10px; margin-bottom: 6px; }
  .practice-workspace .quiz-toolbar a { min-height: 44px; }
  .practice-workspace #restart { width: 44px; padding: 0; }
  .practice-workspace #restart span { display: none; }
  .practice-workspace #practice-display { padding: 0 10px; }
  .practice-workspace #practice-display span { display: none; }
  .practice-workspace .quiz-meta > * { max-width: none; }
  .practice-workspace .progress-track { margin: 6px 0 10px; }
  .practice-workspace.with-stimulus .question-layout { display: block; }
  .practice-workspace:not([data-layout="stack"]) .question-pane, .practice-workspace:not([data-layout="stack"]) .stimulus-pane { height: 100%; border: 0; margin: 0; padding: 2px 4px 12px 0; }
  .practice-workspace .choice { min-height: 48px; padding: 10px 12px; gap: 10px; }
  .practice-workspace .choice-letter { height: 25px; width: 25px; }
  .practice-workspace .question-marker { margin-bottom: 8px; }
  .practice-controls { gap: 8px; grid-template-columns: 1fr 1.45fr 1fr; }
  .practice-controls .btn { width: 100%; min-width: 0 !important; height: 46px; padding: 0 10px; font-size: 13px; gap: 5px; }
  .practice-controls #previous span { display: none; }
  .practice-workspace .practice-status small { font-size: 10px; }
  .field input:not([type="range"]), .field select, .field textarea { font-size: 16px; min-height: 44px; }
  .page-header .actions, .bank-row .actions { flex-wrap: wrap; }
  .bank-row .actions { width: 100%; justify-content: flex-end; }
  .bank-row .btn, .sidebar a, .pagination .btn { min-height: 44px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
  #toasts { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; }
  .toast { max-width: 100%; overflow-wrap: anywhere; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-height: 500px) {
  .practice-workspace .quiz-toolbar { min-height: 32px; margin: 0; }
  .practice-workspace .quiz-toolbar .btn { min-height: 32px; height: 32px; }
  .practice-workspace .progress-track { margin: 4px 0 6px; }
  .practice-workspace .quiz-meta { font-size: 10px; }
  .practice-workspace .practice-status { min-height: 20px; }
  .practice-workspace .quiz-bottom { margin-top: 4px; padding-top: 4px; }
}
.practice-workspace:not(.with-stimulus) .quiz-bottom { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
.autocheck-control { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; cursor: pointer; font-size: 12px; white-space: nowrap; color: var(--secondary); }
.autocheck-control input { appearance: auto; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.autocheck-control:has(input:checked) { color: var(--text); }
.practice-workspace .practice-controls.autocheck { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .practice-workspace .quiz-toolbar { gap: 6px; } .autocheck-control { font-size: 11px; padding: 0 3px; gap: 5px; } }
/* Remove buttons on access rules appear on hover; always visible on touch screens and keyboard focus. */
.record .remove-x { opacity: 0; transition: opacity 0.15s; }
.record:hover .remove-x, .record:focus-within .remove-x { opacity: 1; }
.record .remove-x:hover { color: var(--error); }
@media (hover: none) { .record .remove-x { opacity: 1; } }
/* Presence and chat */
.presence { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3f3f46; }
.presence.online { color: var(--accent); }
.presence.online::before { background: var(--accent); }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: #09090b; font-size: 11px; font-weight: 700; line-height: 1; }

/* The chat fills everything under the navbar; only the message list scrolls. */
.chat-page { height: calc(100dvh - 76px); padding: 16px clamp(12px, 2vw, 24px); }
.chat-shell { height: 100%; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.chat-sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: #0e0e10; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 18px; }
.chat-sidebar-head h1 { font-size: 20px; }
.chat-list { flex: 1; overflow: auto; padding: 0 8px 8px; }
.chat-list-label { margin: 12px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.chat-item:hover, .chat-item:focus-visible { background: var(--raised); }
.chat-item.active { background: #1c1c20; }
.chat-item-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.chat-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.chat-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-item-head small { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.chat-item .chat-preview { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); }
.chat-item.unread strong, .chat-item.unread .chat-preview { color: var(--text); font-weight: 700; }
.chat-notify { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--secondary); font-size: 13px; cursor: pointer; }
.chat-hint { padding: 12px 10px; color: var(--muted); }
.chat-avatar { position: relative; flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: hsl(var(--hue) 45% 26%); color: hsl(var(--hue) 80% 85%); font-size: 13px; font-weight: 700; }
.chat-avatar-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #52525b; border: 2px solid var(--surface); }
.chat-avatar-dot.online { background: var(--accent); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--secondary); }
.chat-empty svg { width: 40px; height: 40px; color: var(--muted); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-header-text { flex: 1; min-width: 0; }
.chat-header-text h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-text p { margin-top: 2px; font-size: 12px; color: var(--muted); }
.chat-header-actions { display: flex; gap: 4px; }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow: auto; display: flex; flex-direction: column; padding: 16px clamp(14px, 3vw, 40px) 8px; }
.chat-day { display: flex; justify-content: center; margin: 14px 0 10px; }
.chat-day span { padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 600; }
.chat-sender { margin: 8px 0 3px 12px; font-size: 12px; color: var(--muted); }
.chat-bubble-row { display: flex; margin-top: 2px; }
.chat-bubble-row.first { margin-top: 8px; }
.chat-bubble-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(620px, 75%); padding: 8px 13px; border-radius: 18px; background: #232327; color: var(--text); font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble-row:not(.mine):not(.first) .chat-bubble { border-top-left-radius: 6px; }
.chat-bubble-row:not(.mine):not(.last) .chat-bubble { border-bottom-left-radius: 6px; }
.chat-bubble-row.mine .chat-bubble { background: var(--accent); color: #0b0f05; }
.chat-bubble-row.mine:not(.first) .chat-bubble { border-top-right-radius: 6px; }
.chat-bubble-row.mine:not(.last) .chat-bubble { border-bottom-right-radius: 6px; }
.chat-bubble-row { align-items: center; gap: 6px; }
.chat-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.chat-actions .btn.icon { width: 30px; height: 30px; min-height: 0; padding: 0; }
.chat-actions svg { width: 15px; height: 15px; }
.chat-bubble-row:hover .chat-actions, .chat-actions:focus-within { opacity: 1; }
@media (hover: none) { .chat-actions { opacity: 0.6; } }
.chat-edited { font-size: 11px; color: var(--muted); }
.chat-time { margin: 3px 12px 0; font-size: 11px; color: var(--muted); }
.chat-time.mine { text-align: right; }
.chat-receipt { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 2px 12px 0; font-size: 11px; color: var(--muted); }
.chat-receipt svg { width: 14px; height: 14px; }
.chat-composer { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 16px 16px; }
.chat-composer textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 11px 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--raised); color: var(--text); font: inherit; font-size: 15px; line-height: 1.4; }
.chat-composer textarea:focus { outline: none; border-color: #3f3f46; }
.chat-send { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--accent); color: #0b0f05; cursor: pointer; }
.chat-send:hover { filter: brightness(1.08); }
.chat-send:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-composer .form-error { flex-basis: 100%; }
.chat-request { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); background: #0e0e10; }
.people-results { display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.people-option { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.people-option .chat-avatar { width: 32px; height: 32px; font-size: 11px; }
.people-option > span:not(.chat-avatar) { flex: 1; }
@media (max-width: 760px) {
  .chat-page { padding: 0; }
  .chat-shell { grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .chat-shell.has-open .chat-sidebar { display: none; }
  .chat-shell:not(.has-open) .chat-main { display: none; }
  .chat-sidebar { border-right: 0; }
  .chat-back { display: inline-grid; }
  .chat-bubble { max-width: 85%; }
}
@media (max-width: 580px) {
  .chat-page { height: calc(100dvh - 66px); }
}
/* Video call overlay sits above everything so navigating the app doesn't drop the call. */
.call-overlay { position: fixed; inset: 0; z-index: 100; background: #050506; display: grid; }
.call-remote { width: 100%; height: 100%; object-fit: cover; background: #050506; }
/* Kept rendering (not display:none) so their audio keeps playing while only the name tile shows. */
.call-remote.hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#call-ui { display: contents; }
/* Shared screens are shown whole, never cropped. */
.call-remote.screen { object-fit: contain; }
.call-tile svg { width: 28px; height: 28px; color: var(--secondary); }
.call-local { position: absolute; right: 20px; bottom: 110px; width: min(220px, 32vw); aspect-ratio: 3 / 4; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.15); background: #111; overflow: hidden; display: grid; }
.call-local video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.call-tile { display: grid; place-content: center; justify-items: center; gap: 12px; width: 100%; height: 100%; background: #18181b; }
.call-tile-avatar { display: grid; place-items: center; width: clamp(56px, 14vmin, 120px); aspect-ratio: 1; border-radius: 50%; background: #3f3f46; color: #fff; font-size: clamp(20px, 5vmin, 42px); font-weight: 700; }
.call-local .call-tile { gap: 6px; font-size: 12px; }
.call-local .call-tile-avatar { width: 48px; font-size: 18px; }
.call-muted { display: inline-flex; vertical-align: middle; color: #f87171; }
.call-muted svg { width: 18px; height: 18px; }
.call-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.call-status { position: absolute; top: 24px; left: 0; right: 0; display: grid; justify-items: center; gap: 4px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.call-status strong { font-size: 22px; }
.call-status span { color: var(--secondary); }
.call-status .call-stats { font: 11px var(--mono, monospace); color: var(--muted); }
.call-controls { position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 18px; }
.call-btn { display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; backdrop-filter: blur(8px); }
.call-btn:hover { background: rgba(255, 255, 255, 0.24); }
.call-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.call-btn[aria-pressed="true"] { background: #fff; color: #09090b; }
.call-btn.accept { background: #22c55e; }
.call-btn.end { background: #ef4444; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.admin-tabs a {
  padding: 9px 14px;
  margin-bottom: -1px;
  font-size: 13px;
  color: var(--secondary);
  border-bottom: 2px solid transparent;
}
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* Speaking indicators: green ring on whoever is talking. */
.call-local, .call-tile-avatar, .call-status strong { transition: box-shadow 0.12s, border-color 0.12s, color 0.12s; }
.call-overlay.me-speaking .call-local { border-color: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.call-overlay.them-speaking > #call-ui > .call-tile .call-tile-avatar { box-shadow: 0 0 0 4px #22c55e; }
.call-overlay.them-speaking .call-status strong { color: #22c55e; }
/* Minimized call: a floating window bottom-left (clear of the chat's send button), over the page instead of covering it. */
.call-overlay.mini { inset: auto auto 16px 16px; width: min(320px, calc(100vw - 32px)); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
.call-overlay.mini .call-local, .call-overlay.mini #call-text, .call-overlay.mini .call-stats { display: none; }
.call-overlay.mini .call-status { top: 10px; }
.call-overlay.mini .call-status strong { font-size: 14px; }
.call-overlay.mini .call-tile-avatar { width: 52px; font-size: 18px; }
.call-overlay.mini .call-controls { bottom: 10px; gap: 8px; }
.call-overlay.mini .call-btn { width: 38px; height: 38px; }
.call-overlay.mini .call-btn svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .call-overlay.mini { inset: 72px 12px auto auto; width: 200px; } }
