:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --surface-3: #eaf0f7;
  --text: #162033;
  --muted: #667285;
  --line: #dce4ef;
  --line-strong: #c7d3e2;
  --primary: #245fc4;
  --primary-dark: #194b9e;
  --green: #16815d;
  --red: #b83a45;
  --amber: #9a620d;
  --violet: #6a4bc3;
  --shadow: 0 18px 45px rgba(28, 39, 63, 0.08);
  --shadow-soft: 0 8px 22px rgba(28, 39, 63, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

a {
  color: var(--primary);
}

strong {
  font-weight: 750;
}

.app-shell {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #12233e;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow-soft);
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 56px;
}

.workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.panel-header,
.panel-body,
.panel-footer {
  padding: 20px;
  min-width: 0;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.panel-footer {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-spread {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(36, 95, 196, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(36, 95, 196, 0.18);
}

.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.16), 0 8px 16px rgba(36, 95, 196, 0.14);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

.button.secondary:hover {
  background: var(--surface-2);
}

.button.danger {
  background: #fff;
  border-color: #efc8c8;
  color: var(--red);
  box-shadow: none;
}

.button.danger:hover {
  background: #fff4f4;
}

.button.success {
  background: var(--green);
  box-shadow: 0 8px 16px rgba(22, 129, 93, 0.14);
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.file-dropzone {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 168px;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.file-dropzone:hover,
.file-dropzone.is-dragging,
.file-dropzone.has-file {
  border-color: var(--primary);
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px rgba(36, 95, 196, 0.08);
}

.file-dropzone.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.dropzone-kicker {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e7f4ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.file-dropzone strong {
  font-size: 20px;
  line-height: 1.25;
}

.file-dropzone span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.published {
  background: #e6f7ef;
  color: var(--green);
}

.status-pill.closed {
  background: #fff2df;
  color: var(--amber);
}

.status-pill.draft {
  background: #edf5ff;
  color: #244365;
}

.notice {
  border: 1px solid #cfe0fa;
  background: #f1f6ff;
  color: #244365;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.6;
}

.notice.warn {
  border-color: #f1d7a8;
  background: #fff7e8;
  color: #674511;
}

.notice.error {
  border-color: #efc8c8;
  background: #fff3f3;
  color: #7b2525;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.quality-list {
  margin: 0;
  padding-left: 20px;
  color: var(--amber);
  font-size: 13px;
  line-height: 1.55;
}

.section-editor {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.section-editor:first-child {
  border-top: 0;
  padding-top: 0;
}

.question-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.question-meta {
  display: grid;
  grid-template-columns: 90px 170px 90px minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

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

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.link-box input {
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  background: #f8fafd;
  z-index: 1;
}

tbody tr {
  background: #fff;
}

tbody tr:hover {
  background: #fbfdff;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.record-title {
  font-weight: 760;
  line-height: 1.35;
}

.record-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.select-column {
  width: 46px;
  text-align: center;
}

.select-column input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.student-layout {
  display: grid;
  gap: 16px;
}

.question-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.question-block:first-child {
  border-top: 0;
}

.question-block.review-correct,
.question-block.review-wrong {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
}

.question-block.review-correct {
  background: #effaf4;
  border-color: #c6ecd8;
}

.question-block.review-wrong {
  background: #fff5f5;
  border-color: #efc8c8;
}

.question-title-row,
.field label:has(.answer-feedback) {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.answer-feedback {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.answer-feedback.correct {
  background: #dff6eb;
  color: var(--green);
}

.answer-feedback.wrong {
  background: #ffe8e8;
  color: var(--red);
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.choice-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.choice-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

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

.passage {
  white-space: pre-wrap;
  line-height: 1.72;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.result-score {
  font-size: 48px;
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.answer-sheet-result .result-score {
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.result-cell {
  padding: 9px;
  border-radius: 8px;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.result-cell.correct {
  color: var(--green);
  background: #effaf4;
}

.result-cell.wrong {
  color: var(--red);
  background: #fff5f5;
}

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

.asset-grid.readonly {
  margin: 10px 0;
}

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

.asset-thumb img,
.asset-grid.readonly img,
.writing-image-list img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.writing-prompt-editor {
  min-height: 120px;
}

.writing-shell {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.speaking-shell {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.writing-header,
.writing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.writing-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.writing-timer {
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cfe7dc;
  background: #eef8f3;
  color: var(--green);
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.writing-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.96fr) minmax(340px, 1.04fr);
}

.speaking-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
}

.writing-prompt,
.writing-answer {
  min-width: 0;
  min-height: 0;
}

.writing-prompt {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7f9fc;
}

.writing-prompt-inner {
  display: grid;
  gap: 14px;
  padding: 20px;
  line-height: 1.65;
}

.writing-prompt-inner h3 {
  margin: 0;
  font-size: 18px;
}

.writing-prompt-inner p {
  margin: 0;
}

.writing-answer {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #fff;
}

.speaking-answer {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  background: #fff;
}

.speaking-stage {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.speaking-countdown {
  font-size: 48px;
  line-height: 1;
  font-weight: 850;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.speaking-meter {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
  height: 72px;
  width: 140px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.speaking-meter span {
  width: 14px;
  min-height: 12px;
  border-radius: 8px;
  background: var(--line-strong);
}

.speaking-meter.is-recording span {
  background: var(--green);
  animation: meter 0.9s ease-in-out infinite;
}

.speaking-meter.is-recording span:nth-child(2) {
  animation-delay: 0.12s;
}

.speaking-meter.is-recording span:nth-child(3) {
  animation-delay: 0.24s;
}

.speaking-meter.is-recording span:nth-child(4) {
  animation-delay: 0.36s;
}

.speaking-part-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speaking-part-preview .result-cell {
  min-width: 180px;
  text-align: left;
}

.speaking-question-meta {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.speaking-topic-field {
  min-width: 180px;
}

.speaking-prompt-card {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 16px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.speaking-prompt-card.compact {
  padding: 12px;
  gap: 9px;
  background: #fbfcfe;
}

.speaking-topic {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.speaking-topic span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.speaking-topic strong {
  font-size: 18px;
}

.speaking-question-text,
.speaking-cue-line,
.speaking-cue-label,
.speaking-cue-closing,
.speaking-cue-lead {
  margin: 0;
  white-space: normal;
}

.speaking-question-text {
  font-size: 19px;
  font-weight: 650;
}

.speaking-cue-lead {
  font-size: 18px;
  font-weight: 780;
}

.speaking-cue-label {
  color: var(--muted);
  font-weight: 700;
}

.speaking-cue-closing {
  font-weight: 780;
}

.speaking-question-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.speaking-question-list li {
  padding-left: 4px;
}

.cue-list {
  gap: 7px;
}

.speaking-prompt-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px dashed var(--line-strong);
}

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

audio {
  width: 100%;
}

.writing-textarea {
  width: 100%;
  height: 100%;
  min-height: 420px;
  padding: 22px;
  border: 0;
  resize: none;
  outline: none;
  line-height: 1.85;
  color: var(--text);
  background: #fff;
  font-size: 16px;
}

.writing-answer-meta {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.writing-tabs,
.writing-task-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.writing-tabs .button {
  box-shadow: none;
}

.writing-task-preview .result-cell {
  display: grid;
  gap: 4px;
  min-width: 150px;
  text-align: left;
  padding: 12px;
}

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

.writing-review-panel {
  display: grid;
  gap: 16px;
}

.review-editor-grid,
.review-task-block,
.review-edit,
.review-original {
  display: grid;
  gap: 12px;
}

.review-task-columns {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.review-task-single {
  display: grid;
  gap: 14px;
}

.review-task-prompt {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.review-task-prompt p {
  margin: 0;
}

.review-original,
.review-edit,
.dimension-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.dimension-editor {
  background: #fff;
  border-left: 3px solid var(--primary);
}

.dimension-editor h4,
.dimension-editor h5 {
  margin: 0 0 10px;
  font-size: 15px;
}

.dimension-editor p {
  margin: 0 0 8px;
  line-height: 1.6;
}

.scoring-summary {
  display: grid;
  gap: 5px;
  border-color: #d9e5f7;
  background: #f5f8fd;
}

.compact-textarea {
  min-height: 56px;
}

.annotation-toolbar {
  justify-content: flex-end;
}

.revision-textarea,
.teacher-marked-answer {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.82;
  overflow-wrap: anywhere;
}

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

.teacher-marked-answer {
  min-height: 0;
}

.revision-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.teacher-marked-answer p {
  margin: 0 0 12px;
}

.teacher-marked-answer p:last-child {
  margin-bottom: 0;
}

.revision-preview {
  background: #fffdfb;
  border-color: #f0d7c7;
}

.teacher-mark {
  color: var(--red);
  font-weight: 750;
}

.teacher-deleted {
  color: var(--red);
  font-weight: 750;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.paragraph-review-list {
  display: grid;
  gap: 12px;
}

.paragraph-review-item,
.marked-paragraph-group {
  display: grid;
  gap: 10px;
}

.paragraph-review-header label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.paragraph-comment-editor {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.teacher-note {
  padding: 12px;
  border: 1px solid #efc8c8;
  border-radius: 8px;
  background: #fff7f7;
  color: #70252d;
}

.teacher-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.teacher-note p {
  margin: 0;
  white-space: pre-wrap;
}

.ai-reference-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fafc;
}

.ai-reference-task .review-edit {
  background: #fff;
}

.result-link-input {
  width: min(320px, 100%);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes meter {
  0%,
  100% {
    height: 18px;
  }

  50% {
    height: 52px;
  }
}

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

  .container {
    width: min(100% - 24px, 1180px);
    margin-top: 16px;
  }

  .panel-header,
  .panel-body,
  .panel-footer {
    padding: 16px;
  }

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

  .metric-card {
    min-height: 92px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .file-dropzone {
    min-height: 142px;
    padding: 18px;
  }

  .grid-2,
  .grid-3,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .question-meta {
    grid-template-columns: 1fr 1fr;
  }

  .question-meta .wide,
  .question-meta .row-action {
    grid-column: 1 / -1;
  }

  .link-box {
    grid-template-columns: 1fr;
  }

  .records-table {
    min-width: 0;
  }

  .records-table thead {
    display: none;
  }

  .records-table,
  .records-table tbody,
  .records-table tr,
  .records-table td {
    display: block;
    width: 100%;
  }

  .records-table tbody {
    display: grid;
    gap: 12px;
  }

  .records-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .records-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }

  .records-table td:last-child {
    border-bottom: 0;
  }

  .records-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .records-table td[colspan] {
    display: block;
    padding: 16px;
    border-bottom: 0;
  }

  .records-table td[colspan]::before,
  .records-table .select-column::before {
    content: "";
  }

  .records-table .select-column {
    display: block;
    width: 100%;
    text-align: left;
  }

  .records-table .record-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .writing-shell {
    min-height: calc(100vh - 130px);
  }

  .writing-header,
  .writing-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .writing-timer {
    width: 100%;
  }

  .writing-main,
  .speaking-main,
  .review-task-columns,
  .speaking-review-grid {
    grid-template-columns: 1fr;
  }

  .writing-prompt {
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .writing-textarea {
    min-height: 360px;
    padding: 18px;
  }

  .speaking-shell {
    min-height: calc(100vh - 130px);
  }

  .speaking-answer {
    min-height: 280px;
    padding: 18px;
  }

  .speaking-countdown {
    font-size: 38px;
  }

  .speaking-question-meta {
    grid-template-columns: 1fr 1fr;
  }

  .button {
    width: 100%;
  }

  .result-score {
    font-size: 38px;
  }

  .record-actions,
  .question-title-row,
  .field label:has(.answer-feedback) {
    align-items: stretch;
    flex-direction: column;
  }
}
