:root {
  --ink: #17202a;
  --ink-soft: #273445;
  --muted: #5d6c7d;
  --muted-strong: #425164;
  --line: #cfd8e3;
  --line-strong: #aebdcc;
  --surface: #eef2f6;
  --surface-warm: #f7f5f0;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --accent: #176f68;
  --accent-strong: #0d5650;
  --accent-soft: #e7f4f1;
  --blue: #2e5d89;
  --blue-soft: #eaf1f8;
  --gold: #9a6a12;
  --gold-soft: #fff6df;
  --danger: #9b1c1c;
  --danger-soft: #fff1ed;
  --shadow: 0 10px 28px rgba(31, 42, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fb 0, var(--surface) 260px),
    var(--surface);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button,
input,
textarea,
select,
.auth-panel,
.panel,
.profile-panel,
.record-form,
.result-panel,
.summary-panel,
.history-panel,
.feedback-card,
.history-card,
pre,
.feedback-editor,
.student-item,
.pill,
.tag {
  border-radius: 8px;
}

button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  padding: 0 15px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(23, 32, 42, 0.04);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

button:hover:not(:disabled) {
  border-color: #8798aa;
  background: #f8fbfd;
  box-shadow: 0 4px 12px rgba(31, 42, 55, 0.08);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  color: #8d99a6;
  background: #edf1f5;
  border-color: #d6dee7;
  box-shadow: none;
}

button.primary {
  min-height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0;
}

button.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

button.danger {
  border-color: #df9b91;
  background: var(--danger-soft);
  color: var(--danger);
}

button.danger:hover:not(:disabled) {
  border-color: #c97368;
  background: #ffe8e2;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  box-shadow: inset 0 1px 2px rgba(31, 42, 55, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a96a4;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 111, 104, 0.18);
  outline-offset: 2px;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.18;
}

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

h3 {
  font-size: 15px;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

body.is-busy {
  overflow: hidden;
}

.muted,
.status-line {
  color: var(--muted);
}

.status-line {
  min-height: 22px;
  font-size: 14px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 28px;
  align-items: center;
  padding: 36px;
}

.auth-copy {
  display: grid;
  gap: 18px;
  max-width: 780px;
  padding: 12px 0;
}

.auth-copy h1 {
  max-width: 720px;
  font-size: 44px;
  line-height: 1.12;
}

.auth-copy p {
  max-width: 650px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.75;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #b9d8d3;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.warn {
  border-color: #e3c177;
  background: var(--gold-soft);
  color: var(--gold);
}

.auth-panel,
.panel,
.profile-panel,
.record-form,
.result-panel,
.summary-panel,
.history-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  background: #eef3f7;
  padding: 4px;
  border-radius: 8px;
}

.segmented button {
  border: 0;
  min-height: 42px;
  background: transparent;
  box-shadow: none;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 42, 55, 0.16);
}

.auth-form,
.stack {
  display: grid;
  gap: 14px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  padding: 0;
  margin-top: 2px;
}

.check-row span {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0, #f3f6f8 64%),
    #f3f6f8;
  overflow-y: auto;
}

.brand {
  display: grid;
  gap: 7px;
  padding: 6px 4px 4px;
}

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

.brand p,
.topbar p {
  color: var(--muted-strong);
  line-height: 1.5;
}

.panel {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.section-head,
.topbar,
.result-head,
.voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.section-head h2,
.result-head h3 {
  min-width: 0;
}

.topbar {
  align-items: flex-start;
  padding: 2px 2px 0;
}

.topbar h1 {
  font-size: 30px;
}

.topbar button,
.topbar .prep-link-button {
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prep-link-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
  box-shadow:
    0 0 0 3px rgba(23, 111, 104, 0.14),
    0 8px 18px rgba(13, 86, 80, 0.13);
}

.prep-link-button:hover,
.prep-link-button:focus-visible {
  border-color: #083f3b;
  background: var(--accent-strong);
  color: #fff;
  outline: none;
  box-shadow:
    0 0 0 3px rgba(23, 111, 104, 0.22),
    0 10px 22px rgba(13, 86, 80, 0.18);
}

#startTourBtn,
.onboarding-tour-btn {
  min-height: 44px;
  border-color: #bd7d11;
  background: #f4b13e;
  color: #2d1c00;
  padding: 0 18px;
  font-weight: 800;
  box-shadow:
    0 0 0 3px rgba(244, 177, 62, 0.22),
    0 8px 18px rgba(87, 56, 4, 0.15);
}

#startTourBtn:hover:not(:disabled),
.onboarding-tour-btn:hover:not(:disabled) {
  border-color: #9b6100;
  background: #e5a22e;
  box-shadow:
    0 0 0 3px rgba(244, 177, 62, 0.28),
    0 10px 22px rgba(87, 56, 4, 0.2);
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.onboarding-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid #b9d8d3;
  background: #f4fbf9;
  padding: 16px;
}

.onboarding-panel h2 {
  margin-top: 4px;
  font-size: 20px;
}

.onboarding-tour-btn {
  margin-top: 12px;
  min-height: 38px;
  padding: 0 13px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-steps li {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.onboarding-steps strong,
.onboarding-steps span {
  display: block;
}

.onboarding-steps strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.onboarding-steps span {
  margin-top: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.class-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.class-filter-row button {
  width: 100%;
}

.class-filter-row select {
  min-height: 44px;
}

.class-filter-hint {
  margin: -2px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#selectClassBtn {
  height: auto;
  min-height: 38px;
  padding-block: 7px;
  line-height: 1.35;
  white-space: normal;
}

.student-list {
  display: grid;
  gap: 9px;
  max-height: 390px;
  overflow-y: auto;
  padding-right: 2px;
}

.student-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.student-item:hover {
  border-color: #a9b8c7;
  box-shadow: 0 5px 15px rgba(31, 42, 55, 0.08);
}

.student-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
}

.student-item strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.student-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 3px;
}

.student-class-line {
  display: flex !important;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.class-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid #d7c186;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 750;
}

.student-class-edit {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 3px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
}

.student-class-edit:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
}

.student-item.active {
  border-color: #73aaa4;
  background: #f2faf8;
  box-shadow: inset 4px 0 0 var(--accent);
}

.student-focus {
  display: block;
  margin-top: 6px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.student-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.student-create-panel {
  align-self: start;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 22px;
  min-width: 0;
  overflow: visible;
}

.record-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(360px, 0.88fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.record-form,
.result-panel,
.profile-panel,
.summary-panel,
.history-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-width: 0;
}

.profile-panel {
  align-self: start;
}

.profile-body {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  color: var(--ink-soft);
  line-height: 1.6;
}

.profile-section {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.profile-section + .profile-section {
  border-top: 1px solid #edf1f5;
  padding-top: 10px;
}

.profile-section strong {
  font-size: 14px;
  color: var(--ink);
}

.profile-section p {
  color: var(--muted-strong);
}

.tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #d2dce7;
  background: #f2f5f8;
  color: #364658;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 650;
}

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

.voice-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid #d8e2eb;
  background: var(--blue-soft);
  border-radius: 8px;
}

.voice-row .muted {
  flex: 1 1 240px;
  color: #425a73;
}

.classroom-recording-panel {
  border: 1px solid rgba(35, 45, 60, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: #fffdf7;
}

.classroom-recorder {
  display: grid;
  gap: 12px;
}

.classroom-timer {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0;
  color: #1f2937;
}

.classroom-actions,
.result-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-tabs button.active {
  border-color: #1f6f68;
  background: #e9f6f3;
  color: #14544f;
}

.classroom-result {
  margin-top: 16px;
}

.classroom-result pre {
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(35, 45, 60, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  max-height: 420px;
  overflow: auto;
}

.summary-form {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(260px, 1fr) minmax(220px, auto);
  gap: 13px;
  align-items: end;
}

.summary-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

pre {
  min-height: 170px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
  font-family: inherit;
}

.feedback-editor {
  min-height: 170px;
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel-soft);
  color: var(--ink-soft);
  line-height: 1.65;
  font-family: inherit;
}

.result-feedback-editor {
  min-height: 280px;
}

.individual-list,
.history-list {
  display: grid;
  gap: 12px;
}

.history-filter {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.3fr) repeat(2, minmax(145px, 0.8fr)) auto;
  gap: 11px;
  align-items: end;
}

.history-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.feedback-card,
.history-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.feedback-card {
  background: #fbfcfd;
}

.history-card {
  box-shadow: 0 4px 16px rgba(31, 42, 55, 0.06);
}

.history-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card-head h3 {
  font-size: 16px;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.history-feedback-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.history-feedback-block h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.history-feedback-block pre {
  min-height: 130px;
  max-height: 270px;
  overflow: auto;
}

.history-feedback-block .feedback-editor {
  min-height: 160px;
  max-height: 330px;
}

.history-detail {
  display: grid;
  gap: 11px;
}

.history-detail summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
}

.history-detail section {
  display: grid;
  gap: 7px;
}

.history-detail pre {
  min-height: 0;
  max-height: 270px;
  overflow: auto;
}

.student-access-panel {
  border-color: rgba(39, 124, 87, 0.24);
  background: #f7fbf8;
}

.student-access-copy-grid {
  display: grid;
  gap: 9px;
}

.student-access-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

.student-access-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.student-access-field strong,
.student-access-field code {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.student-access-link code {
  font-size: 12px;
}

.student-access-code-list {
  display: grid;
  gap: 8px;
}

.student-access-code-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

.student-access-code-card strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.student-access-code-card span {
  color: var(--muted);
  font-size: 12px;
}

.student-access-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-question-actions {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

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

.student-question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.tag.warning {
  background: var(--gold-soft);
  color: var(--gold);
}

.feedback-card pre {
  min-height: 130px;
}

.history-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tour-shade {
  position: fixed;
  z-index: 80;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(15, 23, 35, 0.7);
  pointer-events: none;
}

.tour-highlight {
  position: relative;
  z-index: 110 !important;
  border-radius: 8px;
  border-color: #bd7d11 !important;
  outline: 0 !important;
  box-shadow:
    0 0 0 5px rgba(244, 177, 62, 0.92),
    0 18px 42px rgba(12, 18, 24, 0.28) !important;
}

input.tour-highlight,
select.tour-highlight,
textarea.tour-highlight {
  border-color: #bd7d11 !important;
  outline: 0 !important;
  box-shadow:
    0 0 0 5px rgba(244, 177, 62, 0.92),
    0 18px 42px rgba(12, 18, 24, 0.28) !important;
}

.tour-card {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 22px 58px rgba(7, 14, 22, 0.36);
}

.tour-card h2 {
  font-size: 22px;
  line-height: 1.25;
}

.tour-card p {
  color: var(--muted-strong);
  line-height: 1.7;
}

.tour-counter {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

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

.tour-actions button {
  min-width: 86px;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, 0.58);
  backdrop-filter: blur(2px);
}

.busy-panel {
  width: min(430px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: #fff;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 18px 54px rgba(12, 18, 24, 0.3);
}

.busy-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 3px solid #d9eee9;
  border-radius: 8px;
}

.busy-mark span {
  width: 46px;
  height: 46px;
  border: 5px solid #c9ddd9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: busy-spin 0.85s linear infinite;
}

.busy-panel h2 {
  font-size: 28px;
  line-height: 1.2;
}

.busy-panel p {
  max-width: 330px;
  color: var(--muted-strong);
  line-height: 1.65;
}

.teacher-profile-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #e6ba5c;
  background: var(--gold-soft);
  color: var(--ink);
}

.teacher-profile-prompt p {
  margin: 2px 0 0;
  color: var(--muted-strong);
}

.teacher-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 33, 0.55);
}

.teacher-profile-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(16, 24, 33, 0.24);
}

.teacher-profile-head {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.teacher-profile-head p:last-child {
  color: var(--muted-strong);
}

.teacher-profile-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.teacher-profile-section h3 {
  font-size: 16px;
}

.teacher-profile-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.teacher-profile-chip {
  min-height: 44px;
  border-color: var(--line);
  background: var(--panel-soft);
}

.teacher-profile-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .result-feedback-editor {
    min-height: 220px;
  }
}

@media (max-width: 960px) {
  body {
    background: var(--surface);
  }

  .auth-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    align-items: start;
    padding: 18px;
  }

  .auth-copy h1 {
    font-size: 32px;
  }

  .auth-copy p {
    font-size: 15px;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .student-list {
    max-height: 260px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .two-cols,
  .summary-form,
  .history-filter,
  .history-feedback-grid,
  .onboarding-panel,
  .onboarding-steps {
    grid-template-columns: 1fr;
  }

  .summary-actions,
  .history-filter-actions {
    align-items: stretch;
  }

  .summary-actions button,
  .history-filter-actions button {
    flex: 1 1 150px;
  }

  .busy-panel {
    padding: 24px 18px;
  }

  .busy-panel h2 {
    font-size: 24px;
  }

  .tour-card {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .auth-shell,
  .workspace,
  .sidebar {
    padding: 12px;
  }

  .auth-panel,
  .panel,
  .profile-panel,
  .record-form,
  .result-panel,
  .summary-panel,
  .history-panel {
    padding: 13px;
  }

  .auth-copy h1 {
    font-size: 28px;
  }

  h1 {
    font-size: 24px;
  }

  .tour-card {
    padding: 14px;
  }

  .tour-card h2 {
    font-size: 18px;
  }

  .tour-actions button {
    flex: 1 1 96px;
  }

  .section-head,
  .result-head,
  .history-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-actions,
  .history-actions {
    width: 100%;
  }

  .inline-actions button,
  .history-actions button {
    flex: 1 1 130px;
  }

  button {
    min-height: 42px;
  }
}

.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
}

.admin-login-form,
.admin-panel,
.admin-metric {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.admin-login-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

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

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

.admin-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.admin-metric span,
.admin-metric em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.admin-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.admin-panel {
  padding: 16px;
  min-width: 0;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted-strong);
  font-size: 13px;
  background: var(--panel-soft);
}

.admin-table td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.admin-teacher-table {
  min-width: 1080px;
}

.admin-account-head {
  align-items: end;
}

.admin-search {
  max-width: 320px;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 96px 112px minmax(180px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  width: min(100%, 780px);
}

.admin-inline-form input,
.admin-inline-form select {
  min-height: 38px;
}

.admin-invite-table {
  min-width: 860px;
}

.admin-status {
  display: inline-block !important;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 750;
}

.admin-status.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.admin-status.is-disabled {
  color: var(--danger);
  background: var(--danger-soft);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-recent-list,
.admin-error-list {
  display: grid;
  gap: 10px;
}

.admin-recent-item,
.admin-error-item {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 11px;
}

.admin-recent-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-recent-item span,
.admin-error-item span {
  color: var(--muted);
  font-size: 13px;
}

.admin-error-item p,
.admin-recent-item p {
  margin-top: 5px;
}

@media (max-width: 980px) {
  .admin-shell {
    padding: 16px;
  }

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

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

  .admin-topbar,
  .admin-account-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-search {
    max-width: none;
  }

  .admin-inline-form {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-inline-form {
    grid-template-columns: 1fr;
  }
}
