:root {
  --ink: #1d2521;
  --muted: #707872;
  --line: #dfe4e0;
  --soft: #f4f7f5;
  --accent: #17634f;
  --accent-soft: #e5f0eb;
  --warm: #c89342;
}

* { box-sizing: border-box; }
html { background: #fff; }
body { margin: 0; color: var(--ink); background: #fff; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea { border: 1px solid var(--line); background: #fff; color: inherit; }
button { cursor: pointer; }
button:hover:not(:disabled) { background: var(--soft); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--warm) 28%, transparent); outline-offset: 2px; }

.exam-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 70px; }
.exam-header { display: flex; justify-content: space-between; gap: 40px; padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.back-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.eyebrow { margin: 22px 0 8px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .18em; }
h1 { margin: 0; font: 500 clamp(34px, 5vw, 58px)/1.1 Georgia, serif; letter-spacing: -.045em; }
.intro { max-width: 650px; margin: 18px 0 0; color: var(--muted); line-height: 1.7; }
.format-note { display: grid; align-content: end; grid-template-columns: auto auto; gap: 7px 18px; min-width: 250px; padding-bottom: 7px; color: var(--muted); font-size: 13px; }
.format-note strong { color: var(--ink); font-weight: 650; }

.task-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.task-tabs button { display: grid; gap: 2px; min-width: 108px; padding: 10px 14px; border-radius: 7px; text-align: left; }
.task-tabs button small { color: var(--muted); font-size: 11px; }
.task-tabs button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.task-tabs button.active small { color: #d9eee6; }

.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding: 20px 0; }
.controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.controls select, .controls input { min-height: 40px; padding: 0 11px; border-radius: 6px; }
.search-label { min-width: min(330px, 100%); flex: 1; }
.result-count { margin-left: auto; padding-bottom: 11px; color: var(--muted); font-size: 12px; }

.exam-layout { display: grid; grid-template-columns: minmax(270px, .75fr) minmax(0, 1.65fr); gap: 28px; align-items: start; }
.task-list-panel { min-width: 0; border-top: 1px solid var(--ink); }
.task-list { max-height: 720px; overflow: auto; }
.task-item { display: block; width: 100%; padding: 15px 12px 15px 0; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.task-item:hover { background: var(--soft); }
.task-item.active { padding-left: 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.task-item-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.task-item-prompt { display: -webkit-box; margin-top: 7px; overflow: hidden; color: var(--ink); font: 15px/1.45 Georgia, serif; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.load-more { width: 100%; margin-top: 12px; padding: 10px; border-radius: 6px; }

.workspace { min-height: 680px; padding: 24px 0 0 32px; border-left: 1px solid var(--line); }
.workspace-topline { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.task-label { color: var(--accent); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.task-meta { white-space: nowrap; }
.workspace h2 { margin: 17px 0 18px; font: 500 clamp(27px, 4vw, 42px)/1.16 Georgia, serif; letter-spacing: -.03em; }
.task-prompt { padding: 20px 0; color: var(--ink); font: 21px/1.75 Georgia, serif; white-space: pre-wrap; }
.task-prompt.empty { color: var(--muted); font-size: 16px; }
.documents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 10px 0 22px; }
.document { padding: 15px; background: var(--soft); border-left: 3px solid var(--accent); }
.document h3 { margin: 0 0 8px; color: var(--accent); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.document p { margin: 0; color: #46504a; font: 15px/1.65 Georgia, serif; }

.timer-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.timer-phase { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.timer { color: var(--accent); font: 650 42px/1 Georgia, serif; letter-spacing: .06em; }
.timer-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.timer-actions button { min-height: 40px; padding: 0 13px; border-radius: 6px; }
.accent-button { color: #fff; background: var(--accent); border-color: var(--accent); }
.accent-button:hover:not(:disabled) { background: #145542; }

.response-panel { margin-top: 24px; }
.character-keys { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 8px; padding: 9px 10px; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; }
.character-keys[hidden] { display: none; }
.character-keys button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--accent); font: 17px/1 Georgia, serif; transition: background .15s, border-color .15s; }
.character-keys button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.character-keys button:active { background: var(--accent-soft); }
.character-keys button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.character-key-hint { flex-basis: 100%; color: var(--muted); font-size: 12px; margin: 3px 0 0; }
@media (pointer: coarse) { .character-keys button { width: 38px; height: 40px; } }
.response-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.response-head label { color: var(--ink); font-weight: 650; }
#response-editor { width: 100%; min-height: 210px; padding: 14px; resize: vertical; border-radius: 6px; font: 16px/1.7 Georgia, serif; }
#response-editor:disabled { background: var(--soft); }
.recording-panel { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.recording-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recording-actions button, .record-download { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.record-download { display: inline-flex; align-items: center; color: var(--accent); background: var(--accent-soft); }
.recording-actions audio { max-width: min(100%, 360px); height: 40px; }
.recording-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .exam-header { display: block; }
  .format-note { margin-top: 28px; }
  .exam-layout { grid-template-columns: 1fr; }
  .task-list { max-height: 340px; }
  .workspace { min-height: 0; padding: 28px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 560px) {
  .exam-shell { width: min(100% - 24px, 1240px); padding-top: 22px; }
  .task-tabs button { flex: 1 1 calc(50% - 8px); }
  .documents { grid-template-columns: 1fr; }
  .timer-panel { display: block; }
  .timer-actions { justify-content: flex-start; margin-top: 16px; }
}
