:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657289;
  --line: #dbe5f1;
  --paper: #ffffff;
  --wash: #f6f8fb;
  --teal: #2b6ea6;
  --teal-dark: #1e547f;
  --peach: #f2b38f;
  --peach-soft: #fff2ea;
  --coral: #c2410c;
  --gold: #b7791f;
  --blue: #2b6ea6;
  --green: #16803c;
  --shadow: 0 18px 50px rgba(48, 72, 102, 0.09);
  --soft-shadow: 0 10px 28px rgba(48, 72, 102, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(43, 110, 166, 0.13), transparent 34rem),
    linear-gradient(135deg, rgba(47, 111, 174, 0.05), rgba(244, 184, 151, 0.18)),
    var(--wash);
  font-family: Arial, Helvetica, sans-serif;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(43, 110, 166, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 70%, rgba(242, 179, 143, 0.34), transparent 30rem);
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 36px;
  line-height: 1.05;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card input,
.auth-card select,
.user-form input,
.user-form select,
.user-row input,
.user-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
}

.auth-card button,
.user-form button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  padding: 10px 14px;
}

.auth-card .ghost-button {
  color: var(--teal-dark);
  background: #f8fbff;
  border: 1px solid var(--line);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--coral);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(30, 84, 127, 0.98) 0%, rgba(43, 110, 166, 0.98) 58%, rgba(242, 179, 143, 0.9) 145%);
  color: #ffffff;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-block {
  display: flex;
  align-items: center;
  padding: 4px 0 10px;
}

.brand-block h1,
.brand-block p,
.student-panel h2,
.test-builder h3,
.panel h3,
.topbar h2 {
  margin: 0;
}

.brand-block h1 {
  font-size: 24px;
  line-height: 1.1;
}

.brand-block p {
  color: #eef6ff;
  margin-top: 4px;
}

.student-panel {
  display: grid;
  gap: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 20px 0;
}

.student-panel h2 {
  font-size: 14px;
  text-transform: uppercase;
  color: #fff3eb;
}

.student-panel label {
  color: #f8fbff;
  font-size: 13px;
}

.student-panel input,
.student-panel select,
.builder-controls select,
.author-form input,
.author-form select,
.author-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--paper);
  color: var(--ink);
}

.author-form textarea {
  min-height: 96px;
  resize: vertical;
}

.student-panel button,
.builder-controls button,
.submit-row button,
.answer-key-panel button,
.author-panel button:not(.ghost-button):not(.danger-button) {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  padding: 10px 14px;
}

.student-panel button:hover,
.builder-controls button:hover,
.submit-row button:hover,
.answer-key-panel button:hover,
.author-panel button:not(.ghost-button):not(.danger-button):hover,
.auth-card button:hover,
.user-form button:hover {
  background: var(--teal-dark);
}

.account-panel {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 20px;
}

.account-panel span {
  color: #eef6ff;
  overflow-wrap: anywhere;
}

.account-panel strong {
  color: #fff3eb;
}

.account-panel button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-button {
  min-height: 48px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 11px 14px;
  transition: background 0.16s ease, transform 0.16s ease;
}

.nav-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.nav-button.active {
  background: #fff7f1;
  color: #1f578d;
  border-color: rgba(255, 255, 255, 0.82);
}

.nav-button.locked,
.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.content-area {
  padding: 34px clamp(28px, 4vw, 56px);
  min-width: 0;
  max-width: 1680px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--teal);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  margin: 0 0 6px;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: 38px;
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.partner-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  display: block;
}

.countdown,
.pill,
.course-pill {
  border: 1px solid var(--line);
  background: var(--peach-soft);
  border-radius: 999px;
  padding: 11px 15px;
  color: #8f4b27;
  white-space: nowrap;
  box-shadow: var(--soft-shadow);
}

.course-pill {
  background: #eef6ff;
  color: var(--teal-dark);
  font-weight: 800;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.student-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.mission-copy,
.mission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.94);
}

.mission-copy {
  padding: 30px;
}

.mission-copy h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.mission-copy p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.mission-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 700;
}

.mission-actions button:not(.ghost-button) {
  border: 0;
  color: #ffffff;
  background: var(--teal);
}

.mission-card {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(47, 111, 174, 0.12), rgba(244, 184, 151, 0.32)),
    #ffffff;
}

.mission-card span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 800;
}

.mission-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.mission-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.metric-card,
.panel,
.test-builder,
.question-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 22px;
  min-height: 124px;
  display: grid;
  align-content: center;
  gap: 8px;
}

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

.metric-card strong {
  font-size: 32px;
  line-height: 1.1;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 22px;
  margin-bottom: 22px;
}

.panel,
.test-builder,
.question-card {
  padding: 24px;
}

.panel-heading,
.test-builder,
.builder-controls,
.submit-row,
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading p,
.test-builder p,
.empty-state {
  color: var(--muted);
  margin: 7px 0 0;
  line-height: 1.45;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(140px, 0.8fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 18px 0 10px;
}

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

.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) auto minmax(150px, 0.9fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.user-row div {
  min-width: 0;
}

.user-row strong,
.user-row span,
.user-row small {
  display: block;
}

.user-row span,
.user-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.user-row small {
  font-size: 11px;
  margin-top: 4px;
}

.user-detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  margin: 18px 0;
  box-shadow: var(--soft-shadow);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.admin-detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.admin-detail-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-detail-card strong {
  display: block;
  font-size: 22px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.admin-detail-section {
  margin-top: 18px;
}

.admin-detail-section h4 {
  margin-bottom: 10px;
}

.password-note {
  background: var(--peach-soft);
  border-left: 4px solid var(--peach);
  border-radius: 8px;
  color: #7a4a25;
  line-height: 1.45;
  margin-top: 12px;
  padding: 12px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
  min-height: 0;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 13px;
  color: var(--muted);
}

.ghost-button:hover {
  border-color: rgba(43, 110, 166, 0.36);
  color: var(--teal-dark);
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
  margin-top: 18px;
}

canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.topic-list,
.history-list,
.bank-list,
.question-stack,
.answer-key-list,
.custom-worksheet-list {
  display: grid;
  gap: 14px;
}

.topic-list {
  margin-top: 18px;
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}

.topic-row {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #edf2f8;
  border-radius: 8px;
  background: #ffffff;
}

.topic-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.topic-meta strong {
  color: var(--ink);
}

.bar {
  height: 9px;
  background: #e8eef6;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.history-item,
.bank-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.bank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bank-main {
  flex: 1;
  min-width: 0;
}

.bank-preview-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.bank-preview-button:hover strong {
  color: var(--teal);
}

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

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-main {
  min-width: 0;
}

.history-item strong,
.bank-item strong {
  display: block;
  margin-bottom: 6px;
}

.history-item span,
.bank-item span {
  color: var(--muted);
  font-size: 13px;
}

.test-builder {
  margin-bottom: 22px;
}

.builder-controls {
  flex-wrap: wrap;
}

.builder-controls label {
  color: var(--muted);
  font-size: 13px;
}

.question-card fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.question-card legend {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 12px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  background: #eef4fb;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
  font-weight: 700;
}

.choice-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 82px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 8px 10px 0;
  background: #ffffff;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(48, 72, 102, 0.04);
}

.choice-label:hover {
  border-color: rgba(43, 110, 166, 0.4);
}

.choice-label input {
  margin: 0;
}

.free-response {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.question-image {
  display: block;
  width: auto;
  max-width: min(100%, 560px);
  max-height: 340px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  margin: 8px 0 16px;
}

.question-image-button {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.question-image-button:hover .question-image,
.question-image-button:focus-visible .question-image {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 110, 166, 0.16);
}

.practice-preview-text-button {
  margin: 4px 0 12px;
}

.compact-question-image {
  max-width: min(100%, 340px);
  max-height: 190px;
}

.act-question-image {
  max-width: min(100%, 820px);
  max-height: none;
  object-position: left top;
}

.section-page-image {
  max-width: min(100%, 720px);
  max-height: 520px;
  object-position: left top;
}

.test-timer {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(43, 110, 166, 0.24);
  border-radius: 8px;
  margin-bottom: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(48, 72, 102, 0.12);
}

.test-timer div {
  display: grid;
  gap: 2px;
}

.test-timer span {
  color: var(--muted);
}

#testTimerValue {
  min-width: 86px;
  text-align: center;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#testTimerValue.urgent {
  color: #b45309;
}

.section-response-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.subquestion-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.subquestion-row legend {
  float: left;
  width: 44px;
  padding: 0;
  font-size: 14px;
}

.section-choice-label {
  min-width: 54px;
  margin: 0 6px 6px 0;
  padding: 7px 9px;
}

.bank-thumb {
  display: block;
  width: 220px;
  height: 132px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  margin-bottom: 10px;
}

.bank-filter,
.answer-key-filter {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(220px, 420px);
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.bank-filter label,
.answer-key-filter label {
  color: var(--muted);
  font-size: 13px;
}

.bank-filter select,
.answer-key-filter select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 8px 10px;
}

.author-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.author-form label {
  color: var(--muted);
  font-size: 13px;
}

.author-note {
  border-left: 4px solid var(--gold);
  background: #fffbeb;
  color: #704e0f;
  border-radius: 6px;
  padding: 12px;
  margin: 16px 0;
  font-size: 14px;
}

.custom-worksheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.standalone-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
  margin-top: 18px;
}

.custom-worksheet-item strong {
  display: block;
  margin-bottom: 6px;
}

.custom-worksheet-item span {
  color: var(--muted);
  font-size: 13px;
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #f3c8b2;
  border-radius: 8px;
  background: #fff7ed;
  padding: 16px;
  margin-top: 18px;
}

.danger-zone h3,
.danger-zone p {
  margin: 0;
}

.danger-zone p {
  color: #704e0f;
  margin-top: 6px;
}

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

.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--coral);
  color: white;
  font-weight: 700;
  padding: 10px 14px;
}

.danger-button:hover {
  background: #9a3412;
}

.answer-key-list {
  margin-top: 16px;
}

.answer-key-filter {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.answer-key-filter label {
  color: var(--muted);
  font-size: 13px;
}

.answer-key-filter select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  padding: 10px 12px;
}

.answer-key-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.4fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.answer-key-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.answer-key-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 10px 12px;
}

.section-answer-key-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
}

.section-answer-key-editor label {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.section-answer-key-editor input {
  min-height: 36px;
  padding: 7px 8px;
  text-align: center;
  font-weight: 700;
}

.answer-key-preview {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.answer-key-preview-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.answer-key-preview-button strong {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-key-preview-button span:not(.tag) {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.answer-key-preview-button:hover .answer-thumb,
.answer-key-preview-button:focus-visible .answer-thumb {
  border-color: rgba(43, 110, 166, 0.5);
  box-shadow: 0 0 0 3px rgba(43, 110, 166, 0.12);
}

.answer-thumb {
  width: 160px;
  height: 96px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.preview-answer-editor {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

.preview-answer-editor input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 10px 12px;
}

.preview-save-answer {
  width: fit-content;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
  margin-top: 12px;
  padding: 10px 14px;
}

.submit-row {
  margin-top: 16px;
}

.result-box {
  border-left: 4px solid var(--teal);
  background: #eef6ff;
  padding: 14px;
  border-radius: 6px;
  margin-top: 12px;
}

.incorrect {
  border-left-color: var(--coral);
  background: #fff7ed;
}

.score-badge {
  color: var(--green);
  font-weight: 800;
}

.email-report-button {
  white-space: nowrap;
}

.report-panel[hidden] {
  display: none;
}

.report-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.55);
}

.report-card,
.question-preview-card {
  width: min(760px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.question-preview-card {
  width: min(980px, 100%);
}

.question-preview-body {
  display: grid;
  gap: 18px;
}

.preview-question-image {
  display: block;
  width: auto;
  max-width: min(100%, 820px);
  max-height: 52vh;
  object-fit: contain;
  object-position: left top;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.student-question-preview-body .preview-question-image {
  width: min(100%, 1100px);
  max-width: min(100%, 1100px);
  max-height: 72vh;
  cursor: zoom-out;
}

.act-preview-question-image,
.student-question-preview-body .act-preview-question-image {
  width: auto;
  max-width: min(100%, 1200px);
  max-height: 82vh;
  object-position: left top;
}

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

.preview-choices div,
.preview-answer-note {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
}

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

.section-preview-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
}

.section-preview-grid span {
  color: var(--muted);
  word-spacing: 8px;
}

.section-preview-grid em {
  color: var(--green);
  font-style: normal;
  font-weight: 700;
}

.section-preview-grid .preview-answer-editor {
  margin-top: 4px;
}

.section-preview-grid .preview-answer-editor input {
  min-height: 36px;
  padding: 7px 8px;
  text-align: center;
  font-weight: 700;
}

.report-card label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 8px;
}

.report-card input,
.report-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 10px 12px;
}

.report-card textarea {
  min-height: 320px;
  resize: vertical;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.report-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  padding: 10px 14px;
}

.report-actions button:hover {
  background: var(--teal-dark);
}

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

  .sidebar {
    position: static;
  }

  .metric-grid,
  .dashboard-layout,
  .admin-detail-grid,
  .student-hero {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .content-area,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .test-builder,
  .panel-heading,
  .submit-row,
  .history-item,
  .bank-item,
  .custom-worksheet-item {
    align-items: stretch;
    flex-direction: column;
  }

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

  .partner-logo {
    width: 42px;
    height: 42px;
  }

  .answer-key-row {
    grid-template-columns: 1fr;
  }

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

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

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

  .metric-grid,
  .dashboard-layout,
  .student-hero,
  .admin-detail-grid,
  .user-form,
  .user-row {
    grid-template-columns: 1fr;
  }

  .mission-copy h3 {
    font-size: 25px;
  }

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

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