:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #18212b;
  --muted: #667481;
  --border: #d8e0e8;
  --brand: #1f4f7a;
  --brand-2: #163a59;
  --success: #16784a;
  --warning: #9a6510;
  --danger: #a83232;
  --shadow: 0 8px 24px rgba(25, 45, 65, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--brand-2);
  color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.brand-title { font-size: 19px; font-weight: 750; letter-spacing: .1px; }
.version { font-size: 12px; opacity: .75; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.container { max-width: 1240px; margin: 0 auto; padding: 28px; }
.narrow { max-width: 760px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card h1, .card h2, .card h3 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero { padding: 46px 34px; text-align: center; }
.hero-logo { width: 150px; height: 150px; border-radius: 28px; object-fit: cover; margin: 0 auto 18px; display: block; }
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { max-width: 650px; margin: 0 auto 26px; color: var(--muted); line-height: 1.55; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; text-align: left; }
.mode-card { border: 1px solid var(--border); border-radius: 12px; padding: 22px; background: #fbfdff; }
.mode-card h2 { margin-bottom: 8px; }
.mode-card p { min-height: 48px; }

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 15px;
  font-weight: 650;
  transition: transform .04s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-small { padding: 7px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 650; font-size: 14px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid #bbc8d4;
  background: white;
  color: var(--text);
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #4a83b2; box-shadow: 0 0 0 3px rgba(54, 116, 166, .14); }
.field textarea { resize: vertical; min-height: 110px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

.alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; border: 1px solid; }
.alert-info { background: #eef6fd; color: #244f70; border-color: #c5dff3; }
.alert-warning { background: #fff7e7; color: #79500d; border-color: #eed8ab; }
.alert-danger { background: #fff0f0; color: #7b2525; border-color: #efc4c4; }
.alert-success { background: #edf8f2; color: #145e3d; border-color: #bde2cd; }

.assessment-shell { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.assessment-toolbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 11px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  position: sticky;
  top: 64px;
  z-index: 10;
}
.assessment-title { font-weight: 750; }
.status-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--success); }
.status-dot.saving { background: var(--warning); }
.status-dot.error { background: var(--danger); }

.workspace { flex: 1; display: grid; grid-template-columns: minmax(280px, 32%) 1fr; gap: 18px; padding: 18px; max-width: 1440px; width: 100%; margin: 0 auto; }
.prompt-panel, .writing-panel { background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { background: var(--surface-2); padding: 13px 16px; font-weight: 750; border-bottom: 1px solid var(--border); }
.prompt-content { padding: 18px; line-height: 1.62; white-space: pre-wrap; overflow-y: auto; max-height: calc(100vh - 190px); }
.writing-panel { display: flex; flex-direction: column; min-height: calc(100vh - 160px); }
.editor-tools { padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fbfdff; display: flex; gap: 8px; }
.editor {
  flex: 1;
  width: 100%;
  min-height: 520px;
  border: 0;
  resize: none;
  outline: none;
  padding: 28px 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  color: #17202a;
  background: white;
}
.editor:disabled { background: #f5f7f9; color: #4e5964; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-top: 1px solid var(--border); background: #fbfdff; font-size: 13px; color: var(--muted); }

.teacher-grid { display: grid; grid-template-columns: 310px 1fr; gap: 18px; }
.sidebar-stack { display: flex; flex-direction: column; gap: 14px; }
.sidebar-item { padding: 12px 14px; border-radius: 9px; border: 1px solid var(--border); background: white; cursor: pointer; }
.sidebar-item.active { border-color: #5c88ad; background: #edf5fb; }
.sidebar-item strong { display: block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 11px 10px; vertical-align: top; }
th { background: var(--surface-2); font-size: 13px; }
td { font-size: 14px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.badge-success { background: #e6f5ed; color: #12603d; }
.badge-warning { background: #fff2d8; color: #80550d; }
.badge-muted { background: #edf0f3; color: #58636d; }
.badge-danger { background: #fde7e7; color: #852c2c; }

.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 10px; }
.option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 9px; padding: 11px; }
.option input { margin-top: 3px; }
.option span { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }

.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.submission-text { white-space: pre-wrap; line-height: 1.65; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; min-height: 300px; }
.event-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.event { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 13px; background: #fafcfe; }
.event strong { display: block; margin-bottom: 2px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 24, 36, .56); display: flex; justify-content: center; align-items: center; z-index: 100; padding: 20px; }
.modal { width: min(600px, 100%); background: white; border-radius: 14px; box-shadow: 0 20px 70px rgba(0,0,0,.25); padding: 24px; }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fbfdff; }
.kpi .value { font-size: 26px; font-weight: 800; }
.kpi .label { color: var(--muted); font-size: 12px; margin-top: 2px; }

@media (max-width: 900px) {
  .mode-grid, .form-grid, .workspace, .teacher-grid, .detail-grid, .kpi-grid { grid-template-columns: 1fr; }
  .workspace { padding: 10px; }
  .prompt-content { max-height: 300px; }
  .editor { min-height: 480px; padding: 22px; }
  .assessment-toolbar { align-items: flex-start; }
}

/* v0.3.0 district assessment and anonymous multi-reader scoring */
.district-container { max-width: 1360px; }
.district-assessment-card { margin-top: 18px; }
.district-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.district-policy-grid {
  display: grid;
  grid-template-columns: minmax(210px, .7fr) minmax(280px, 1.15fr) minmax(280px, 1.15fr);
  gap: 14px;
  align-items: stretch;
}
.district-toggle-option,
.district-rule-note {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfdff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.district-toggle-option input { margin-top: 4px; }
.district-toggle-option span,
.district-rule-note { line-height: 1.4; }
.district-toggle-option small,
.district-rule-note span { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.district-rule-note { flex-direction: column; gap: 0; }
.district-team-list { margin-top: 14px; color: var(--muted); font-size: 13px; }
.district-team-list strong { color: var(--text); }
.district-import-panel { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.district-import-panel summary { font-weight: 750; color: var(--brand); cursor: pointer; }
.district-import-grid { margin-top: 12px; }
.district-blind-header { border-left: 5px solid var(--success); }
.blind-identity-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.blind-identity-list span { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; }
.district-scoring-workspace { grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); }
.district-score-form-grid { grid-template-columns: 1fr; }
.district-confirm-actions { justify-content: center; margin-top: 20px; }

@media (max-width: 1100px) {
  .district-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .district-policy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .district-scoring-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .district-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v0.2.0 accessibility/PWA additions */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #2f79b7;
  outline-offset: 2px;
}

.pwa-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.support-banner {
  width: 100%;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  background: #eef6fd;
  color: #244f70;
  font-size: 13px;
}
.support-note { margin-left: 12px; opacity: .9; }

.assessment-shell {
  --student-editor-size: 18px;
  --student-prompt-size: 16px;
  --student-line-height: 1.65;
}
.assessment-shell .editor {
  font-size: var(--student-editor-size);
  line-height: var(--student-line-height);
}
.assessment-shell .prompt-content {
  font-size: var(--student-prompt-size);
  line-height: var(--student-line-height);
}

.assessment-shell[data-display-mode="high-contrast"] .prompt-panel,
.assessment-shell[data-display-mode="high-contrast"] .writing-panel,
.assessment-shell[data-display-mode="high-contrast"] .editor,
.assessment-shell[data-display-mode="high-contrast"] .prompt-content,
.assessment-shell[data-display-mode="high-contrast"] .editor-tools,
.assessment-shell[data-display-mode="high-contrast"] .editor-footer,
.assessment-shell[data-display-mode="high-contrast"] .panel-heading {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.assessment-shell[data-display-mode="high-contrast"] .muted,
.assessment-shell[data-display-mode="high-contrast"] .tool-status { color: #fff; }
.assessment-shell[data-display-mode="high-contrast"] .btn-secondary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.assessment-shell[data-display-mode="dark"] .prompt-panel,
.assessment-shell[data-display-mode="dark"] .writing-panel,
.assessment-shell[data-display-mode="dark"] .editor,
.assessment-shell[data-display-mode="dark"] .prompt-content,
.assessment-shell[data-display-mode="dark"] .editor-tools,
.assessment-shell[data-display-mode="dark"] .editor-footer,
.assessment-shell[data-display-mode="dark"] .panel-heading {
  background: #20262d;
  color: #f4f7fa;
  border-color: #53606c;
}
.assessment-shell[data-display-mode="dark"] .muted,
.assessment-shell[data-display-mode="dark"] .tool-status { color: #cbd4dc; }

.assessment-shell[data-display-mode="warm"] .prompt-panel,
.assessment-shell[data-display-mode="warm"] .writing-panel,
.assessment-shell[data-display-mode="warm"] .editor,
.assessment-shell[data-display-mode="warm"] .prompt-content,
.assessment-shell[data-display-mode="warm"] .editor-tools,
.assessment-shell[data-display-mode="warm"] .editor-footer,
.assessment-shell[data-display-mode="warm"] .panel-heading {
  background: #fff8e7;
  color: #282319;
  border-color: #dbcba9;
}

.timer-status {
  font-weight: 750;
  color: var(--text);
  background: #edf2f6;
  border-radius: 999px;
  padding: 5px 9px;
}
.tool-status { align-self: center; margin-left: 4px; }
.btn-active { background: #dff1e8; border-color: #83bda0; color: #0e5c38; }

.editor-tools { flex-wrap: wrap; align-items: center; }
.accessibility-modal { width: min(760px, 100%); }
.support-summary-box {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fbfd;
  line-height: 1.5;
}

.break-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #10283d;
  display: grid;
  place-items: center;
  padding: 24px;
}
.break-card {
  width: min(580px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,.32);
  text-align: center;
  padding: 42px 34px;
}
.break-card h1 { margin: 8px 0 10px; }
.break-card p { font-size: 18px; line-height: 1.55; }
.break-card .btn { margin-top: 24px; min-width: 210px; }
.break-icon {
  margin: 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9f2f9;
  color: #17476c;
  font-size: 28px;
  font-weight: 800;
}

.flash-alert {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.section-title-row h1 { margin-bottom: 4px; }
.prompt-preview { line-height: 1.55; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-section-title { margin-top: 26px; }
.link-btn {
  border: 0;
  background: transparent;
  color: #1f5f91;
  padding: 3px 0;
  text-decoration: underline;
  font-size: 12px;
  font-weight: 650;
}
.access-summary { font-size: 12px; line-height: 1.4; }
.kpi-five { grid-template-columns: repeat(5, 1fr); }

.detail-grid-wide { grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); margin-top: 18px; }
.detail-primary { margin-top: 0; }
.detail-side .card { margin-top: 0; }
.metadata-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-list { margin: 14px 0 0; }
.detail-list > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; font-weight: 650; }
.event-warning { border-color: #e6c486; background: #fff9ed; }

@media (max-width: 1100px) {
  .kpi-five { grid-template-columns: repeat(3, 1fr); }
  .detail-grid-wide { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .section-title-row { flex-direction: column; }
  .kpi-five { grid-template-columns: 1fr 1fr; }
  .support-note { display: block; margin: 5px 0 0; }
  .assessment-toolbar { position: static; }
  .topbar { position: static; height: auto; padding: 14px 18px; gap: 12px; }
  .workspace { grid-template-columns: 1fr; }
}

/* v0.3.0 rubric and teacher scoring additions */
.kpi-six { grid-template-columns: repeat(6, 1fr); }

.scoring-card { margin-top: 18px; }
.scoring-card h2 { margin-bottom: 4px; }
.scoring-meta-grid { margin-top: 18px; }
.scoring-note-field textarea { min-height: 72px; }
.score-actions { border-top: 1px solid var(--border); padding-top: 18px; }

.analytic-score-list {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.analytic-score-row {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) 110px minmax(280px, 1.8fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
}
.analytic-score-row select {
  width: 100%;
  border: 1px solid #bbc8d4;
  border-radius: 8px;
  padding: 9px;
  background: white;
}
.criterion-descriptor { font-size: 13px; line-height: 1.45; }
.criterion-descriptor ul { margin: 0; padding-left: 18px; }
.criterion-descriptor li + li { margin-top: 4px; }

.analytic-total-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid #9fb9cf;
  background: #eef6fd;
  border-radius: 10px;
}
.analytic-total-box > div { display: flex; flex-direction: column; gap: 3px; }
.analytic-total-box strong { font-size: 22px; }

.selected-score-summary {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fbfd;
  line-height: 1.45;
}
.selected-score-summary p { margin: 6px 0 0; }

.rubric-details {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.rubric-details > summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 16px;
  margin-bottom: 14px;
}
.rubric-reference { margin-top: 12px; }
.rubric-reference-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.rubric-criterion-reference {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}
.rubric-criterion-reference h4 {
  margin: 0;
  padding: 11px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.rubric-level-grid { display: grid; }
.rubric-level-5 { grid-template-columns: repeat(4, minmax(190px, 1fr)); }
.rubric-level-3 { grid-template-columns: repeat(3, minmax(190px, 1fr)); }
.rubric-level-cell {
  padding: 12px;
  border-right: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.42;
}
.rubric-level-cell:last-child { border-right: 0; }
.rubric-level-cell ul { margin: 8px 0 0; padding-left: 17px; }
.rubric-level-cell li + li { margin-top: 4px; }
.rubric-level-score { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.rubric-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff8e8;
  border: 1px solid #ead8ad;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.45;
}
.proficiency-key {
  margin-top: 12px;
  display: flex;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #f1f7f3;
  border: 1px solid #c9dfd0;
  border-radius: 9px;
  font-size: 13px;
}
.holistic-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.holistic-overview {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  background: #fbfdff;
  font-size: 12px;
  line-height: 1.45;
}
.holistic-overview p { margin: 5px 0 0; }
.rubric-selected { background: #eaf4fb !important; box-shadow: inset 0 0 0 2px #6f9fc4; }
.rubric-table-wrap { border: 1px solid var(--border); border-radius: 9px; }
.rubric-table { min-width: 1500px; }
.rubric-table th:first-child { min-width: 180px; position: sticky; left: 0; z-index: 2; }
.rubric-table thead th:first-child { z-index: 3; }
.rubric-table th:not(:first-child) { min-width: 205px; }
.rubric-table td { font-size: 11px; line-height: 1.4; vertical-align: top; }
.rubric-table td ul { margin: 0; padding-left: 16px; }
.rubric-table td li + li { margin-top: 5px; }
.rubric-table th span { font-size: 11px; font-weight: 600; }
.rubric-na { color: var(--muted); font-style: italic; }

.rubric-library-stack { display: flex; flex-direction: column; gap: 22px; }
.rubric-library-stack > .card { margin-top: 0; }

@media (max-width: 1200px) {
  .kpi-six { grid-template-columns: repeat(3, 1fr); }
  .analytic-score-row { grid-template-columns: 1fr 100px; }
  .criterion-descriptor { grid-column: 1 / -1; }
  .holistic-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .rubric-level-5, .rubric-level-3 { grid-template-columns: 1fr; }
  .rubric-level-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .rubric-level-cell:last-child { border-bottom: 0; }
  .holistic-overview-grid { grid-template-columns: 1fr; }
  .analytic-total-box { grid-template-columns: 1fr; }
  .kpi-six { grid-template-columns: 1fr 1fr; }
}

/* v0.3.1 fast scoring workspace */
.teacher-score-container { max-width: 1600px; }
.teacher-scoring-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(330px, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}
.student-response-card { min-width: 0; }
.scoring-submission-text {
  min-height: 680px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.72;
  padding: 26px 30px;
}
.quick-score-card {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 16px;
}
.quick-score-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.quick-score-header h2 { margin: 0 0 2px; font-size: 20px; }
.quick-response-status { margin-bottom: 12px; }
.quick-response-status select { padding: 8px 9px; }
.quick-rubric-note {
  font-size: 12px;
  line-height: 1.4;
  padding: 9px 10px;
  border: 1px solid #cbd8e4;
  background: #f3f8fc;
  border-radius: 8px;
  margin-bottom: 10px;
}
.quick-criterion {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.quick-criterion:last-of-type { border-bottom: 0; }
.quick-criterion-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13px;
}
.quick-criterion-heading > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.quick-score-buttons {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}
.quick-score-btn {
  min-width: 0;
  border: 1px solid #aebdca;
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 7px 4px;
  font-weight: 800;
  line-height: 1;
}
.quick-score-btn:hover:not(:disabled) { background: #edf5fb; border-color: #6f9fc4; }
.quick-score-btn.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  box-shadow: 0 0 0 2px rgba(31,79,122,.14);
}
.quick-score-btn:disabled { opacity: .38; cursor: not-allowed; }
.quick-descriptor {
  min-height: 31px;
  margin-top: 6px;
  color: #52616e;
  font-size: 11px;
  line-height: 1.35;
}
.quick-total-box {
  margin-top: 10px;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 8px;
  border: 1px solid #9fb9cf;
  background: #eef6fd;
  border-radius: 9px;
  padding: 10px;
}
.quick-total-box > div { display: flex; flex-direction: column; gap: 2px; }
.quick-total-box span { color: var(--muted); font-size: 11px; }
.quick-total-box strong { font-size: 16px; }
.quick-overall-score {
  margin-top: 12px;
  padding: 11px;
  border: 2px solid #8eaec9;
  background: #f5f9fc;
  border-radius: 10px;
}
.selected-score-summary.compact {
  margin-top: 8px;
  padding: 8px 9px;
  font-size: 11px;
}
.selected-score-summary.compact p { font-size: 11px; line-height: 1.35; margin-top: 4px; }
.quick-score-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.quick-submit-note { margin-top: 7px; text-align: center; }
.teacher-comments-card { margin-top: 18px; }
.scorer-name-field { max-width: 430px; }
.session-context-grid { margin-top: 18px; grid-template-columns: 1fr 1fr; }
.session-context-grid .card + .card { margin-top: 0; }

@media (max-width: 1100px) {
  .teacher-scoring-workspace { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
  .scoring-submission-text { padding: 22px; }
}

@media (max-width: 850px) {
  .teacher-scoring-workspace, .session-context-grid { grid-template-columns: 1fr; }
  .quick-score-card { position: static; max-height: none; }
  .scoring-submission-text { min-height: 480px; max-height: none; }
}


.ai-review-card { margin-top: 18px; border-color: #b8cfe3; }
.ai-review-card h2, .ai-review-card h3 { margin-bottom: 8px; }
.ai-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 16px; }
.ai-review-section { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fbfdff; }
.ai-review-section + .ai-review-section { margin-top: 14px; }
.ai-review-grid .ai-review-section + .ai-review-section { margin-top: 0; }
.ai-score-list { margin: 10px 0; padding-left: 20px; }
.ai-safety-flag { border-left: 5px solid var(--warning); background: #fff8e8; border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.ai-safety-high { border-left-color: var(--danger); background: #fff0f0; }
.ai-safety-low { border-left-color: #6f879b; background: #f4f7fa; }
@media (max-width: 800px) {
  .ai-review-grid { grid-template-columns: 1fr; }
}
