:root {
  --bg: #f0f7ff;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --line-strong: #94a3b8;
  --primary: #0ea5e9;
  --primary-strong: #0284c7;
  --primary-soft: #e0f2fe;
  --green: #10b981;
  --green-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 25px 50px rgba(15, 23, 42, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-soft: #334155;
  --ink: #f1f5f9;
  --muted: #cbd5e1;
  --line: #475569;
  --line-strong: #64748b;
  --primary: #06b6d4;
  --primary-strong: #0891b2;
  --primary-soft: #164e63;
  --green: #34d399;
  --green-soft: #064e3b;
  --amber: #fbbf24;
  --amber-soft: #78350f;
  --red: #f87171;
  --red-soft: #7f1d1d;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* ========== HAMBURGER MENU ========== */
.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  color: var(--ink);
  padding: 0;
  margin-right: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: 0 0 44px;
}

.sidebar-toggle:hover {
  background: var(--panel-soft);
  transform: scale(1.1);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

.login-panel {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  z-index: auto !important;
  overflow: visible !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none !important;
  border-radius: 10px !important;
  border: 1px solid var(--line) !important;
  padding: 16px !important;
}

.login-panel.open {
  left: auto !important;
  top: auto !important;
}

/* Mobil'de hamburger menü */
@media (max-width: 920px) {
  .sidebar-toggle {
    display: flex;
  }
  
  .login-panel {
    position: fixed !important;
    left: -100% !important;
    top: 64px !important;
    width: 100% !important;
    max-width: 85vw !important;
    height: calc(100vh - 64px) !important;
    z-index: 40 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -2px 0 16px rgba(15, 23, 42, 0.25) !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 16px !important;
  }
  
  .login-panel.open {
    left: 0 !important;
  }
  
  /* Sidebar açıkken overlay */
  body::after {
    content: '';
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 35;
    display: none;
    transition: all 0.3s ease;
  }
  
  body.login-panel-open::after {
    display: block;
  }
}

/* ========== END HAMBURGER ========== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%), var(--bg);
  transition: background-color 0.3s ease;
}

:root[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%), var(--bg);
}

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

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.3;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  height: 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .topbar {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: var(--line);
}

.sidebar-toggle {
  display: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: var(--ink);
  padding: 0;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.sidebar-toggle:hover {
  background: var(--panel-soft);
}

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

.brand-logo {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  background: #ffffff;
}

:root[data-theme="dark"] .brand-logo {
  background: #1e293b;
}

.brand > div {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.brand p {
  margin: 0;
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex: 0 0 auto;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--ink);
}

.btn-icon-only:hover {
  background: var(--panel-soft);
}

.session {
  display: none;
}

@media (max-width: 680px) {
  .sidebar-toggle {
    display: flex;
  }
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
}

body.is-authenticated .shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.panel:hover {
  box-shadow: var(--shadow-lg);
}

.login-panel {
  align-self: start;
  position: sticky;
  top: 90px;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-form-subfields {
  display: grid;
  gap: 10px;
}

.auth-form-subfields[hidden] {
  display: none;
}

.file-picker {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-picker input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px;
}

.compact-form {
  margin: 0;
}

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

.two-col-form label {
  min-width: 0;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 12px;
}

.weekday-picker label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.weekday-picker input {
  width: auto;
  min-height: 0;
}

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

.register-box,
.demo-box {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.register-box summary,
.demo-box summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.demo-list {
  display: grid;
  gap: 7px;
}

.demo-list button {
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
  color: var(--primary);
  border-color: var(--line);
  background: var(--panel-soft);
  font-size: 12px;
}

.account-card {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 10px;
}

.account-card[hidden],
#authForms[hidden] {
  display: none;
}

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-pills span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
}

body.is-authenticated .login-panel {
  padding: 14px;
}

.log-panel {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.button-grid,
.actions,
.workspace,
.list {
  display: grid;
  gap: 10px;
}

.role-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(28, 79, 156, .10), transparent 52%),
    var(--panel-soft);
}

:root[data-theme="dark"] .role-hero {
  background:
    linear-gradient(135deg, rgba(78, 168, 255, .16), transparent 55%),
    var(--panel-soft);
}

.role-hero h2 {
  margin-bottom: 7px;
  font-size: 22px;
}

.role-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-panel .login-lgs-hero {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  overflow: hidden;
  margin-bottom: 18px;
}

.login-lgs-copy {
  min-width: 0;
}

.login-lgs-copy .eyebrow {
  margin-bottom: 8px;
  max-width: none;
  font-size: 13px;
  line-height: 1.35;
}

.login-lgs-copy h2 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  overflow-wrap: normal;
  word-break: keep-all;
}

.login-lgs-cta {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 12px 22px rgba(14, 165, 233, 0.20);
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: var(--panel);
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.metric-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.flow-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel);
}

.flow-step.active {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(28, 79, 156, .10), transparent 54%),
    var(--panel);
}

:root[data-theme="dark"] .flow-step.active {
  background:
    linear-gradient(135deg, rgba(78, 168, 255, .14), transparent 54%),
    var(--panel);
}

.flow-step span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 850;
}

.flow-step strong {
  display: block;
  margin-bottom: 5px;
}

.flow-step p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.monthly-progress-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.readiness-card {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  min-width: 0;
}

.readiness-card.good {
  border-color: rgba(34, 197, 94, .35);
  background: linear-gradient(135deg, rgba(34, 197, 94, .10), transparent 72%), var(--panel-soft);
}

.readiness-card.warn {
  border-color: rgba(245, 158, 11, .38);
  background: linear-gradient(135deg, rgba(245, 158, 11, .12), transparent 72%), var(--panel-soft);
}

.readiness-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.readiness-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.readiness-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.readiness-badges span {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  background: var(--panel);
}

.progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, .42fr);
  gap: 10px;
  align-items: stretch;
}

.progress-head > div,
.progress-mini-grid > div,
.progress-band {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: var(--panel-soft);
}

.progress-head span,
.progress-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.progress-head strong {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
}

.progress-head p,
.progress-band p,
.progress-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.target-gap {
  text-align: center;
}

.target-gap strong {
  color: var(--amber);
  font-size: clamp(21px, 6vw, 28px);
  line-height: 1.08;
}

.target-gap.good strong {
  color: var(--good);
}

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

.progress-bands {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.progress-mini-grid strong,
.progress-band strong,
.progress-focus b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.progress-band span {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.progress-focus {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: linear-gradient(135deg, var(--primary-soft), transparent 70%), var(--panel);
}

.progress-focus ul {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.progress-focus li {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.progress-focus li span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

button,
select,
input,
textarea {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
}

select,
input,
textarea {
  width: 100%;
  color: var(--ink);
  background: var(--panel);
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

button {
  cursor: pointer;
  color: white;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  font-weight: 750;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(15, 168, 233, 0.25);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  filter: brightness(1.06);
}

button:hover {
  background: linear-gradient(135deg, var(--primary-strong) 0%, #0369a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 168, 233, 0.35);
}

button:active {
  transform: translateY(0);
}

button.ghost {
  color: var(--primary);
  border-color: transparent;
  background: var(--primary-soft);
}

button.ghost:hover {
  background: #dce9ff;
}

:root[data-theme="dark"] button.ghost:hover {
  background: #193451;
}

button.warn {
  color: white;
  border-color: var(--amber);
  background: var(--amber);
}

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

.button-grid button {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel);
}

.button-grid button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.button-grid button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.button-grid button strong {
  font-size: 14px;
}

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

.card {
  min-width: 0;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel-soft);
}

.card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-workbench {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  background: linear-gradient(135deg, var(--panel), var(--panel-soft));
}

.admin-workbench-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.admin-workbench-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.admin-workbench-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-workbench-picker {
  display: grid;
  gap: 6px;
}

.admin-workbench-picker label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-workbench-picker select {
  width: 100%;
}

.admin-secondary-tools {
  margin-top: 14px;
}

.admin-secondary-tools > summary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
  font-weight: 900;
}

.admin-secondary-tools[open] > summary {
  margin-bottom: 12px;
}

.admin-page-audit {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  background: var(--panel);
}

.admin-page-audit.needs-review {
  border-left-color: var(--amber);
}

.admin-page-audit header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.admin-page-audit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.admin-page-image-panel {
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-page-image-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-page-text-panel {
  display: grid;
  gap: 10px;
}

.admin-page-text-panel label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-page-text-panel textarea {
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.admin-page-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-page-pager,
.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.admin-page-pager {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.recommendation-list {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-card {
  display: grid;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: var(--panel);
}

.report-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.report-card strong {
  display: block;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.report-card header span:not(.status) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-summary {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.report-recommendations {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.report-recommendations b {
  color: var(--ink);
  font-size: 12px;
}

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

.ocr-draft-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ocr-draft-form label:last-child {
  grid-column: 1 / -1;
}

.unknown-exam-field[hidden] {
  display: none !important;
}

.exam-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.exam-picker label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.exam-picker-results {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.exam-picker-result {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.exam-picker-result strong,
.exam-picker-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-picker-result em {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-style: normal;
  font-weight: 900;
}

.exam-picker-selected,
.exam-picker-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  line-height: 1.45;
}

.exam-picker-selected strong {
  color: var(--ink);
}

.exam-picker-selected[hidden] {
  display: none !important;
}

.answer-entry-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.answer-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: end;
}

.answer-entry-head strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.answer-entry-head p,
.answer-entry-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.answer-entry-head label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.answer-grid {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.answer-section {
  display: grid;
  gap: 8px;
}

.answer-section-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.answer-section-title strong {
  font-size: 13px;
}

.answer-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.answer-section-rows {
  display: grid;
  gap: 8px;
}

.answer-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.answer-no {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.answer-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.answer-choice {
  min-height: 34px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.answer-choice.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.ocr-job {
  display: grid;
  min-width: 0;
  gap: 8px;
}

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

.booklet-page-slot {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 12px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
}

.booklet-page-slot.complete {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft);
}

.page-actions {
  display: grid;
  width: 100%;
  gap: 6px;
}

.divider-label {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.divider-label::before,
.divider-label::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.page-actions button {
  width: 100%;
  min-height: 36px;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(3, 7, 18, .88);
}

.process-result {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
}

.process-result.success {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.process-result.review {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.progress-button,
.progress-button:disabled {
  position: relative;
  min-height: 54px;
  padding: 0;
  overflow: hidden;
  border-color: var(--primary);
  opacity: 1;
  cursor: wait;
  background: var(--panel);
  color: var(--text);
}

.progress-button-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--primary-soft);
  transition: width .35s ease;
}

.progress-button-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
}

.progress-button-content strong {
  min-width: 42px;
}

.booklet-result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.booklet-result-metrics span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.booklet-page-results {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.booklet-page-results summary {
  cursor: pointer;
  font-weight: 700;
}

.booklet-page-result {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.booklet-page-result:last-child {
  border-bottom: 0;
}

.booklet-page-result p {
  margin: 4px 0 0;
}

.admin-review-toolbar,
.admin-identity-fields,
.admin-question-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-bulk-answer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.admin-bulk-answer p {
  grid-column: 1 / -1;
  margin: 0;
}

.admin-review-toolbar {
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  margin-bottom: 12px;
}

.admin-review-list {
  display: grid;
  gap: 10px;
  max-height: 760px;
  overflow: auto;
}

.admin-question-review {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: var(--panel);
}

.admin-question-review.filtered-out {
  display: none;
}

.admin-question-review.needs-review {
  border-left-color: var(--amber);
}

.admin-question-review header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-preview,
.review-reasons {
  margin: 0;
}

.review-reasons {
  color: var(--amber);
  font-weight: 700;
}

.camera-modal-panel {
  display: grid;
  gap: 12px;
  width: min(680px, 100%);
  max-height: calc(100vh - 28px);
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
  background: var(--panel);
}

@media (max-width: 640px) {
  .booklet-result-metrics {
    grid-template-columns: 1fr;
  }

  .admin-workbench-head {
    grid-template-columns: 1fr;
  }

  .admin-workbench-actions {
    justify-content: stretch;
  }

  .admin-workbench-actions button {
    width: 100%;
  }

  .admin-page-audit-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-image-panel {
    max-height: 420px;
  }

  .admin-page-pager button,
  .admin-page-actions button {
    width: 100%;
  }

  .admin-review-toolbar,
  .admin-identity-fields,
  .admin-question-fields,
  .admin-bulk-answer {
    grid-template-columns: 1fr;
  }

  .admin-bulk-answer p {
    grid-column: auto;
  }
}

.live-camera-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background: #05070d;
}

.live-camera-frame video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.live-page-guide {
  position: absolute;
  width: min(72%, 420px);
  aspect-ratio: .72;
  border: 3px solid #4ea8ff;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .24);
}

.live-page-guide::before,
.live-page-guide::after,
.live-page-guide i::before,
.live-page-guide i::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #ffffff;
}

.live-page-guide::before { top: -3px; left: -3px; border-top: 4px solid; border-left: 4px solid; }
.live-page-guide::after { top: -3px; right: -3px; border-top: 4px solid; border-right: 4px solid; }
.live-page-guide i::before { bottom: -3px; left: -3px; border-bottom: 4px solid; border-left: 4px solid; }
.live-page-guide i::after { bottom: -3px; right: -3px; border-bottom: 4px solid; border-right: 4px solid; }

.camera-scan-status {
  margin: 0;
  padding: 9px 10px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 13px;
}

.booklet-page-slot img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.page-number {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
}

.camera-guide {
  position: relative;
  width: 82%;
  aspect-ratio: .72;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background:
    linear-gradient(var(--primary), var(--primary)) left top / 22px 3px no-repeat,
    linear-gradient(var(--primary), var(--primary)) left top / 3px 22px no-repeat,
    linear-gradient(var(--primary), var(--primary)) right top / 22px 3px no-repeat,
    linear-gradient(var(--primary), var(--primary)) right top / 3px 22px no-repeat,
    linear-gradient(var(--primary), var(--primary)) left bottom / 22px 3px no-repeat,
    linear-gradient(var(--primary), var(--primary)) left bottom / 3px 22px no-repeat,
    linear-gradient(var(--primary), var(--primary)) right bottom / 22px 3px no-repeat,
    linear-gradient(var(--primary), var(--primary)) right bottom / 3px 22px no-repeat;
}

.camera-guide i {
  position: absolute;
  inset: 12%;
  border: 1px dashed var(--line-strong);
}

.page-state {
  font-size: 11px;
  line-height: 1.35;
}

.ocr-preview {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
}

.ocr-preview summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.ocr-preview pre {
  max-width: 100%;
  min-height: auto;
  max-height: 220px;
  margin-top: 9px;
  color: var(--ink);
  background: var(--panel-soft);
}

body:not(.is-admin-user) .log-panel {
  display: none;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--panel);
}

.row strong {
  display: block;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.row button {
  min-width: 138px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions button {
  min-width: 118px;
}

.teacher-request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 158px;
}

.lesson-request-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  justify-items: end;
}

.lesson-request-actions button {
  min-width: 96px;
}

.message-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.active-lesson-messages {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 12px;
  background: rgba(37, 99, 235, .06);
}

.active-lesson-messages > strong {
  font-size: 14px;
}

.active-lesson-messages > p {
  margin: 0;
}

.active-lesson-messages .row {
  background: var(--surface);
}

.message-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.message-notification-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 12px;
  background: rgba(37, 99, 235, .06);
}

.message-notification-prompt.enabled {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(22, 163, 74, .08);
}

.message-notification-prompt strong {
  display: block;
  font-size: 13px;
}

.message-notification-prompt p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.message-notification-prompt button {
  min-width: 126px;
}

.message-date-divider {
  display: flex;
  justify-content: center;
  margin: 5px 0 2px;
}

.message-date-divider span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.message-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.message-bubble.mine {
  justify-self: end;
  background: rgba(37, 99, 235, .12);
  border-color: rgba(37, 99, 235, .2);
}

.message-bubble strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.message-bubble p {
  margin: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-time {
  min-width: 0;
  white-space: nowrap;
}

.message-delivery {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.message-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.message-compose button {
  min-width: 84px;
}

.teacher-request-actions button {
  min-width: 0;
  width: 100%;
  padding-inline: 10px;
}

@media (max-width: 520px) {
  .teacher-request-row,
  .lesson-request-row {
    grid-template-columns: 1fr;
  }

  .teacher-request-actions,
  .lesson-request-actions {
    min-width: 0;
    width: 100%;
    justify-items: stretch;
  }

  .lesson-request-actions button,
  .lesson-request-actions .status {
    width: 100%;
  }

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

  .message-notification-prompt {
    grid-template-columns: 1fr;
  }

  .message-notification-prompt button {
    width: 100%;
  }
}

.support-task-list {
  display: grid;
  gap: 10px;
}

.support-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: var(--panel);
}

.support-task-card.high {
  border-left-color: var(--amber);
}

.support-task-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.support-task-role,
.support-task-count {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 850;
}

.support-task-card.high .support-task-role {
  color: var(--amber);
  background: var(--amber-soft);
}

.support-task-main strong,
.support-task-main p,
.support-task-main small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.support-task-main small {
  color: var(--muted);
  line-height: 1.35;
}

.support-task-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-task-actions button {
  min-width: 0;
  flex: 1 1 118px;
  white-space: normal;
}

.support-task-actions button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.support-task-actions button.selected {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .28);
}

.mapping-table {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.mapping-head,
.mapping-row {
  display: grid;
  grid-template-columns: 56px 64px minmax(90px, .8fr) minmax(140px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.mapping-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.mapping-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 13px;
}

.mapping-row strong {
  display: inline-grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.status.good {
  color: var(--green);
  background: var(--green-soft);
}

.status.bad {
  color: var(--red);
  background: var(--red-soft);
}

.teacher-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(92px, .62fr);
  gap: 6px;
  align-items: end;
  margin-bottom: 8px;
}

.teacher-filter-grid label {
  min-width: 0;
}

.teacher-filter-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.teacher-choice-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.teacher-choice-preview.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .07);
}

.teacher-card-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.teacher-card-button > span:first-child {
  min-width: 0;
}

.teacher-card-button strong,
.teacher-card-button p {
  overflow-wrap: anywhere;
}

.teacher-choice-preview p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.teacher-slot-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.teacher-slot-choice {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.teacher-slot-choice.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .12);
  font-weight: 800;
}

.teacher-slot-item.selected {
  margin-top: 6px;
}

.teacher-slot-item.selected .teacher-slot-choice {
  margin-top: 0;
}

.teacher-slot-mode-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 10px;
  background: rgba(37, 99, 235, .06);
  font-size: 13px;
}

.teacher-slot-mode-row > span {
  color: var(--muted);
  font-weight: 800;
}

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

.teacher-slot-mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  line-height: 1.15;
}

.teacher-slot-mode-option.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .14);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .18);
}

.teacher-slot-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.teacher-slot-mode-option span {
  color: inherit;
  font-weight: inherit;
}

.teacher-inline-request {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 12px;
  background: var(--surface);
}

.teacher-inline-request p {
  margin: 0 0 8px;
}

.teacher-inline-request button {
  width: 100%;
}

.teacher-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  max-width: 96px;
  min-width: 0;
}

.teacher-rating,
.teacher-trust {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(148, 163, 184, .16);
}

.teacher-trust {
  min-width: 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 15px;
}

.teacher-rating.good {
  color: inherit;
  background: rgba(245, 158, 11, .1);
}

.teacher-card-button .teacher-rating {
  max-width: none;
  padding: 3px 5px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-rating-star {
  position: relative;
  display: inline-block;
  width: 1em;
  color: rgba(148, 163, 184, .55);
  line-height: 1;
}

.teacher-rating-star::before {
  content: "★";
  position: absolute;
  inset: 0;
  width: var(--fill, 0%);
  overflow: hidden;
  color: #f59e0b;
}

.teacher-trust.good {
  color: var(--green);
  background: var(--green-soft);
}

pre {
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 13px;
  border-radius: 8px;
  color: #dbeafe;
  background: #111827;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

  .login-panel {
    position: static;
  }

  .button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-hero,
  .metric-grid,
  .student-flow,
  .teacher-filter-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions button {
    width: 100%;
  }

  .teacher-choice-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-badges {
    justify-content: flex-start;
  }
}

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

  .session {
    width: 100%;
    max-width: none;
  }

  .top-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    width: 116px;
    height: 62px;
  }

  .shell {
    padding: 12px;
  }

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

  .section-head,
  .row,
  .support-task-card,
  .report-card header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .row button {
    width: 100%;
    min-width: 0;
  }

  .row-actions {
    flex-direction: column;
  }

  .mapping-head,
  .mapping-row {
    grid-template-columns: 44px 52px minmax(70px, 1fr) minmax(100px, 1.2fr);
    font-size: 12px;
  }
}

@media (max-width: 920px) {
  body.is-authenticated .shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    background: var(--bg);
  }

  .topbar {
    position: static;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand .eyebrow {
    margin-top: 2px;
  }

  .brand-logo {
    width: 88px;
    height: 48px;
  }

  .top-actions {
    flex-direction: row;
    gap: 8px;
  }

  .top-actions button,
  .session {
    flex: 1;
    min-width: 0;
  }

  .session {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
  }

  .shell {
    gap: 10px;
    padding: 10px;
  }

  .panel {
    border-radius: 8px;
    padding: 12px;
  }

  body.is-authenticated .login-panel {
    padding: 10px 12px;
  }

  .account-card {
    gap: 7px;
  }

  .account-card h2 {
    font-size: 16px;
  }

  .role-pills span {
    padding: 5px 7px;
    font-size: 11px;
  }

  .section-head {
    gap: 8px;
  }

  .section-head button,
  .hero-actions button,
  .auth-form button {
    width: 100%;
  }

  .role-hero {
    padding: 13px;
  }

  .role-hero h2 {
    font-size: 18px;
  }

  .role-hero p {
    font-size: 13px;
  }

  .metric-grid,
  .grid,
  .student-flow,
  .button-grid,
  .progress-head,
  .progress-mini-grid {
    grid-template-columns: 1fr;
  }

  .progress-bands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card,
  .card,
  .flow-step {
    min-height: auto;
    padding: 11px;
  }

  .row-actions {
    width: 100%;
  }

  .mapping-table {
    max-width: 100%;
    overflow-x: auto;
  }

  .mapping-head,
  .mapping-row {
    min-width: 520px;
    grid-template-columns: 44px 52px minmax(90px, 1fr) minmax(140px, 1.2fr);
  }

  .ocr-draft-form {
    grid-template-columns: 1fr;
  }

  .booklet-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-camera-frame {
    min-height: 55vh;
  }

  .log-panel {
    display: none;
  }
}
