:root {
  --navy: #244964;
  --navy-dark: #173348;
  --blue: #2684c7;
  --blue-soft: #eaf5fc;
  --green: #16824b;
  --green-soft: #eaf8f0;
  --red: #c83c3c;
  --amber: #ad7100;
  --line: #d5e0e8;
  --muted: #657887;
  --text: #26333e;
  --surface: #fff;
  --bg: #f3f6f9;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }
.service-header { min-height: 78px; display: grid; grid-template-columns: 310px 1fr 230px; align-items: center; gap: 16px; padding: 10px 28px; background: var(--navy); color: white; box-shadow: 0 3px 14px rgba(16,45,65,.2); }
.service-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark, .student-brand span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: #56d1e5; color: #173348; font-size: 13px; font-weight: 900; }
.service-brand strong { display: block; font-size: 17px; }
.service-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.7); }
.service-tabs { display: flex; justify-content: center; gap: 8px; }
.service-tabs a { padding: 9px 15px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: rgba(255,255,255,.82); font-size: 13px; font-weight: 900; text-decoration: none; }
.service-tabs a:hover { background: rgba(255,255,255,.1); }
.service-tabs a.active { color: var(--navy-dark); background: white; border-color: white; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.teacher-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.text-button { border: 0; background: transparent; color: white; font-size: 13px; text-decoration: underline; }
main { min-height: calc(100vh - 78px); }
.center-card { width: min(440px, calc(100% - 28px)); margin: 70px auto; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 35px rgba(37,68,91,.08); text-align: center; }
.center-card h1 { margin: 9px 0; font-size: 25px; }
.center-card p { color: var(--muted); line-height: 1.65; }
.spinner { width: 42px; height: 42px; margin: 0 auto 18px; border: 4px solid #d9e4eb; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow, .panel-kicker { color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.version-badge { display: inline-flex; margin-left: 8px; padding: 4px 8px; border-radius: 999px; background: #e8f7ee; color: var(--green); font-size: 11px; font-weight: 900; vertical-align: middle; }
.stack-form { display: grid; gap: 14px; margin-top: 24px; text-align: left; }
label, fieldset { color: #334b60; font-size: 14px; font-weight: 800; }
input, select, textarea { width: 100%; margin-top: 7px; border: 1px solid #b9c8d4; border-radius: 9px; background: white; padding: 11px 12px; color: var(--text); }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(38,132,199,.15); border-color: var(--blue); }
fieldset { margin: 0 0 16px; padding: 0; border: 0; }
legend { margin-bottom: 8px; }
.unit-fieldset legend { display: flex; align-items: baseline; gap: 7px; }
.unit-fieldset legend small { color: var(--muted); font-weight: 400; }
.unit-options { max-height: 255px; display: grid; gap: 7px; margin-bottom: 16px; padding: 9px; overflow-y: auto; border: 1px solid #b9c8d4; border-radius: 10px; background: #f8fafc; }
.unit-options > span { padding: 7px; color: var(--muted); font-size: 13px; }
.unit-options label { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: white; cursor: pointer; }
.unit-options label:has(input:checked) { border-color: #86badd; background: var(--blue-soft); color: #175a87; }
.unit-options input { width: 18px; height: 18px; margin: 0; }
.unit-options strong { font-size: 13px; line-height: 1.4; }
.unit-options small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.primary-button, .secondary-button, .danger-button, .small-button { border-radius: 9px; padding: 11px 15px; font-weight: 900; }
.primary-button { border: 1px solid var(--navy); background: var(--navy); color: white; }
.secondary-button { border: 1px solid #9eb0bf; background: white; color: var(--text); }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.danger-button { border: 1px solid #d9a1a1; background: white; color: var(--red); }
.small-button { border: 1px solid #b8c7d3; background: white; color: #43596a; padding: 7px 10px; font-size: 12px; }
.form-message { min-height: 22px; margin-top: 12px; color: var(--red); font-size: 14px; }
.teacher-workspace { max-width: 1500px; margin: 0 auto; padding: 28px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 6px 0; color: var(--navy-dark); font-size: 30px; }
.page-heading p { max-width: 850px; margin: 0; color: var(--muted); line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.usage-badge { padding: 8px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 900; white-space: nowrap; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 22px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.stepper li { position: relative; min-height: 76px; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: 1fr 1fr; column-gap: 10px; padding: 14px 18px; border-right: 1px solid var(--line); }
.stepper li:last-child { border-right: 0; }
.stepper li > span { grid-row: 1 / 3; align-self: center; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e8eef3; color: #6a7d8b; font-weight: 900; }
.stepper strong { align-self: end; font-size: 14px; }
.stepper small { color: var(--muted); }
.stepper li.active { background: var(--blue-soft); }
.stepper li.active > span, .stepper li.done > span { background: var(--navy); color: white; }
.stepper li.done { background: #f6fbf8; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 5px 18px rgba(37,68,91,.055); }
.workspace-grid { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 18px; align-items: start; }
.settings-card, .summary-panel, .question-picker, .progress-panel, .results-panel { padding: 22px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-title-row h2 { margin: 4px 0 0; color: var(--navy-dark); font-size: 20px; }
.settings-card > label { display: block; margin-bottom: 16px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.three-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.chip-options { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-options input { position: absolute; opacity: 0; pointer-events: none; }
.chip-options span { display: block; padding: 8px 11px; border: 1px solid #b9c8d4; border-radius: 999px; background: white; font-size: 12px; }
.chip-options input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: #175a87; }
.check-row { display: flex !important; align-items: flex-start; gap: 10px; margin: 14px 0 18px !important; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; }
.check-row span { display: grid; gap: 3px; }
.check-row small, .field-help { color: var(--muted); font-weight: 400; line-height: 1.45; }
.settings-card > .primary-button, .settings-card > .secondary-button { width: 100%; }
.picker-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.selection-summary { color: var(--green); font-size: 14px; font-weight: 900; }
.question-list { height: 520px; overflow-y: auto; display: grid; gap: 9px; padding-right: 5px; }
.question-list.empty-state { place-items: center; text-align: center; color: var(--muted); }
.question-list.empty-state strong { color: var(--navy); }
.question-row { display: grid; grid-template-columns: 26px 64px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.question-row:hover { border-color: #9db7ca; background: #fbfdff; }
.question-row.selected { border-color: var(--blue); background: var(--blue-soft); }
.question-row input { width: 18px; height: 18px; margin: 3px 0 0; }
.question-row .qid { color: var(--navy); font-weight: 900; }
.question-row .qtext { line-height: 1.55; }
.difficulty-badge { padding: 4px 8px; border-radius: 999px; background: #eef2f5; color: #536776; font-size: 11px; font-weight: 900; white-space: nowrap; }
.qbadges { display: grid; justify-items: end; gap: 5px; }
.frequency-badge { padding: 4px 8px; border-radius: 999px; background: #fff5d8; color: #775000; font-size: 11px; font-weight: 900; white-space: nowrap; }
.unit-badge { padding: 4px 8px; border-radius: 999px; background: #e7f4fb; color: #17638f; font-size: 11px; font-weight: 900; }
.frequency-options span { letter-spacing: -.02em; }
.panel-footer { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.info-box { margin: 0 0 18px; padding: 13px; border-radius: 10px; background: var(--blue-soft); color: #175a87; font-size: 13px; line-height: 1.6; }
.summary-list { display: grid; grid-template-columns: 130px 1fr; margin: 0; }
.summary-list dt, .summary-list dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { font-weight: 900; }
.notice-list { margin: 20px 0; padding: 16px; border-radius: 12px; background: #f6fbf8; }
.notice-list p { display: flex; gap: 9px; margin: 8px 0; line-height: 1.5; }
.notice-list span { color: var(--green); font-weight: 900; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.monitor-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 18px; }
.qr-panel { padding: 24px; text-align: center; }
.qr-panel h2 { margin: 7px 0; }
.qr-panel p, .qr-panel small { color: var(--muted); }
.qr-box { width: 236px; height: 236px; display: grid; place-items: center; margin: 18px auto 10px; border: 1px solid var(--line); background: white; }
.qr-box img { width: 222px; height: 222px; image-rendering: pixelated; }
.exam-code { margin: 7px 0 3px; color: var(--navy); font-size: 35px; font-weight: 900; letter-spacing: 7px; }
.qr-panel .secondary-button { width: 100%; margin-top: 18px; }
.status-pill { padding: 7px 12px; border-radius: 999px; background: #edf1f4; color: #536776; font-size: 13px; font-weight: 900; }
.status-pill.open { background: var(--green-soft); color: var(--green); }
.status-pill.closed { background: #fff0f0; color: var(--red); }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 30px 0 22px; }
.metric-grid > div { padding: 23px 12px; border: 1px solid var(--line); border-radius: 13px; background: #f9fbfc; text-align: center; }
.metric-grid strong { display: block; color: var(--navy); font-size: 34px; }
.metric-grid span { color: var(--muted); font-size: 13px; }
.progress-track { height: 15px; border-radius: 999px; overflow: hidden; background: #e7edf2; }
.progress-track > div { height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.progress-copy { margin: 10px 0 26px; color: var(--muted); text-align: center; }
.result-summary-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 20px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.result-summary-strip > div { padding: 18px; border-right: 1px solid var(--line); text-align: center; }
.result-summary-strip > div:last-child { border-right: 0; }
.result-summary-strip span { display: block; color: var(--muted); font-size: 13px; }
.result-summary-strip strong { display: block; margin-top: 5px; color: var(--navy); font-size: 23px; }
.analysis-list { display: grid; gap: 15px; }
.analysis-card { padding: 20px; border: 1px solid var(--line); border-radius: 13px; }
.analysis-card h3 { margin: 0 0 14px; line-height: 1.55; }
.analysis-question-image, .student-question-image { display: block; width: 100%; height: auto; margin: 12px 0 20px; border: 1px solid #d8e1e8; border-radius: 10px; background: white; }
.analysis-question-image { max-width: 920px; }
.analysis-meta { display: flex; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.option-bar { display: grid; grid-template-columns: 35px minmax(160px,1fr) minmax(120px,2fr) 75px; gap: 10px; align-items: center; margin: 9px 0; }
.option-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 19px; border-radius: 999px; background: #e8eef3; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: #7caed0; }
.option-bar.correct { color: var(--green); font-weight: 900; }
.option-bar.correct .bar-fill { background: var(--green); }
.explanation { margin-top: 15px; padding: 13px; border-left: 4px solid var(--green); border-radius: 8px; background: var(--green-soft); line-height: 1.6; }
.recent-section { margin-top: 24px; }
.recent-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.recent-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.recent-card strong { display: block; margin-bottom: 7px; }
.recent-card span { color: var(--muted); font-size: 13px; }
.student-shell { width: min(470px, calc(100% - 28px)); margin: 28px auto; }
.student-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; color: var(--navy-dark); }
.student-card { padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 10px 30px rgba(37,68,91,.07); }
.student-card h1 { margin: 8px 0; }
.student-card > p { color: var(--muted); }
.student-exam { max-width: 1300px; margin: 0 auto; padding: 22px; }
.exam-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 15px; padding: 16px 21px; border-radius: 14px; background: var(--navy); color: white; }
.exam-header span { display: block; color: rgba(255,255,255,.72); font-size: 12px; }
.exam-header strong { display: block; margin-top: 4px; font-size: 20px; }
.exam-timer { text-align: right; }
.exam-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 15px; align-items: start; }
.exam-nav { position: sticky; top: 15px; padding: 17px; }
.student-info { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.student-info span { color: var(--muted); font-size: 12px; }
.number-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.number-grid button { aspect-ratio: 1; border: 1px solid #b8c7d3; border-radius: 7px; background: white; font-weight: 900; }
.number-grid button.current { background: var(--navy); color: white; }
.number-grid button.answered:not(.current) { border-color: #8bc3a4; background: var(--green-soft); color: var(--green); }
.nav-legend { display: flex; gap: 12px; margin: 12px 0 17px; color: var(--muted); font-size: 11px; }
.nav-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border: 1px solid #b8c7d3; border-radius: 2px; }
.nav-legend i.current { background: var(--navy); }
.nav-legend i.answered { background: var(--green-soft); border-color: #8bc3a4; }
.exam-nav .primary-button { width: 100%; }
.exam-question { min-height: 590px; padding: 30px; }
.question-number { color: var(--blue); font-weight: 900; }
.exam-question h2 { margin: 10px 0 22px; font-size: 25px; line-height: 1.55; }
.visual-question-label { display: inline-block; margin-left: 8px; padding: 2px 6px; border-radius: 999px; background: #eef4f8; color: var(--blue); font-size: 10px; font-weight: 900; vertical-align: middle; }
.student-option { width: 100%; display: flex; align-items: flex-start; gap: 11px; margin: 9px 0; padding: 14px; border: 1px solid #c8d5df; border-radius: 11px; background: white; text-align: left; font-size: 17px; line-height: 1.5; }
.student-option .num { color: var(--blue); font-weight: 900; }
.student-option.selected { border: 2px solid var(--blue); background: var(--blue-soft); }
.question-move { display: flex; justify-content: space-between; margin-top: 25px; }
.student-preview-banner { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid #f0cb70; border-radius: 10px; background: #fff8df; color: #6d4c00; font-size: 13px; text-align: center; }
.student-preview-banner strong { color: #523900; }
body.phone-preview-mode { min-height: 100vh; padding: 12px 0 34px; background: radial-gradient(circle at top,#eaf2f7 0,#cdd9e1 68%,#bdcbd5 100%); }
body.phone-preview-mode main { min-height: auto; }
body.phone-preview-mode .student-exam { width: 430px; max-width: calc(100% - 20px); min-height: 820px; margin: 10px auto; padding: 13px; overflow: hidden; border: 9px solid #1f2a33; border-radius: 38px; background: var(--bg); box-shadow: 0 22px 55px rgba(20,43,60,.28); }
body.phone-preview-mode .student-preview-banner { display: grid; gap: 4px; padding: 12px; font-size: 15px; line-height: 1.45; }
body.phone-preview-mode .exam-header { padding: 15px 16px; }
body.phone-preview-mode .exam-header span { font-size: 14px; }
body.phone-preview-mode .exam-header strong { font-size: 19px; line-height: 1.4; }
body.phone-preview-mode .exam-layout { display: flex; flex-direction: column; }
body.phone-preview-mode .exam-question { order: 1; width: 100%; min-height: 0; padding: 22px 17px; }
body.phone-preview-mode .exam-nav { order: 2; position: static; width: 100%; padding: 18px; }
body.phone-preview-mode .question-number { font-size: 15px; }
body.phone-preview-mode .exam-question h2 { margin: 12px 0 22px; font-size: 25px; line-height: 1.55; }
body.phone-preview-mode .student-option { min-height: 60px; margin: 11px 0; padding: 16px 14px; font-size: 19px; line-height: 1.55; }
body.phone-preview-mode .question-move button { min-width: 112px; min-height: 48px; font-size: 16px; }
body.phone-preview-mode .student-info { font-size: 16px; }
body.phone-preview-mode .student-info span { font-size: 14px; }
body.phone-preview-mode .number-grid button { font-size: 16px; }
body.phone-preview-mode .nav-legend { font-size: 13px; }
body.phone-preview-mode .exam-nav .primary-button { min-height: 52px; font-size: 18px; }
.complete-icon { display: grid; place-items: center; width: 65px; height: 65px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 34px; font-weight: 900; }
.banner { margin-bottom: 18px; padding: 13px 15px; border: 1px solid #edca73; border-radius: 10px; background: #fff8df; color: #6d4c00; line-height: 1.55; }
.template-hub { display: grid; grid-template-columns: minmax(280px,1.1fr) minmax(430px,1.6fr); gap: 16px 24px; align-items: end; margin-bottom: 18px; padding: 20px 22px; border-color: #b8d8cb; background: linear-gradient(135deg,#f7fcf9 0%,#fff 65%); }
.template-hub h2 { margin: 4px 0 7px; color: var(--navy-dark); font-size: 20px; }
.template-hub p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.template-controls { display: grid; grid-template-columns: minmax(230px,1fr) auto auto; gap: 8px; align-items: end; }
.template-controls label { min-width: 0; }
.template-controls select { margin-top: 6px; }
.template-preview { grid-column: 1 / -1; padding: 11px 13px; border: 1px dashed #b8d8cb; border-radius: 9px; background: white; color: #496173; font-size: 13px; line-height: 1.55; }
.template-preview strong { color: var(--navy); }
.template-save-box { display: grid; gap: 9px; margin-top: 14px; padding: 14px; border: 1px solid #cbd9e3; border-radius: 11px; background: #f8fafc; }
.template-save-box small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.full-button { width: 100%; margin: -5px 0 12px; }
.group-preview { margin-bottom: 15px; padding: 12px 13px; border: 1px dashed #b8c7d3; border-radius: 10px; background: #f8fafc; color: var(--muted); font-size: 13px; line-height: 1.55; }
.group-preview.active { border-style: solid; border-color: #91c5a7; background: var(--green-soft); color: #276343; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: 380px; padding: 13px 16px; border-radius: 10px; background: var(--navy-dark); color: white; box-shadow: 0 8px 25px rgba(0,0,0,.2); }
.unit-workspace-tabs { display: flex; gap: 8px; margin-bottom: 18px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.unit-workspace-tabs button { min-height: 45px; padding: 9px 20px; border: 0; border-radius: 9px; background: transparent; color: #526978; font-weight: 900; }
.unit-workspace-tabs button.active { background: var(--navy); color: white; box-shadow: 0 4px 12px rgba(36,73,100,.2); }
.followup-workspace { display: grid; gap: 18px; }
.followup-heading { display: grid; grid-template-columns: minmax(300px,1.2fr) minmax(460px,1fr); gap: 22px; align-items: end; padding: 22px; }
.followup-heading h2 { margin: 5px 0 8px; color: var(--navy-dark); font-size: 25px; }
.followup-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.followup-assessment-picker { display: grid; grid-template-columns: minmax(260px,1fr) auto; gap: 9px; align-items: end; }
.followup-empty { padding: 60px 24px; color: var(--muted); text-align: center; }
.followup-empty strong { color: var(--navy); font-size: 20px; }
.followup-empty p { margin-bottom: 0; }
.followup-summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.followup-summary-grid button { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--text); text-align: left; box-shadow: 0 5px 18px rgba(37,68,91,.045); }
.followup-summary-grid button:hover { border-color: #8fb5cf; }
.followup-summary-grid span { display: block; color: var(--muted); font-size: 13px; }
.followup-summary-grid strong { display: block; margin-top: 7px; color: var(--navy); font-size: 27px; }
.followup-exam-hub { display: grid; grid-template-columns: minmax(330px,1fr) minmax(560px,1.6fr); gap: 18px 28px; align-items: center; margin-bottom: 18px; padding: 22px; border-color: #b8d8cb; background: linear-gradient(135deg,#f5fbf8 0%,#fff 70%); }
.followup-exam-hub h2 { margin: 5px 0 8px; color: var(--navy-dark); font-size: 22px; }
.followup-exam-hub p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.followup-exam-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.followup-issued-exams { grid-column: 1 / -1; display: grid; gap: 8px; }
.followup-issued-exams:empty { display: none; }
.followup-issued-card { display: grid; grid-template-columns: minmax(220px,1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #c9d8e2; border-radius: 10px; background: white; }
.followup-issued-card strong { display: block; color: var(--navy-dark); }
.followup-issued-card small { color: var(--muted); line-height: 1.45; }
.followup-issued-card .exam-code-mini { color: var(--blue); font-size: 17px; font-weight: 900; letter-spacing: .08em; }
.followup-list-panel { padding: 22px; }
.followup-filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.followup-filter-row button { padding: 7px 13px; border: 1px solid #b7c7d3; border-radius: 999px; background: white; color: #4d6373; font-weight: 900; }
.followup-filter-row button.active { border-color: var(--navy); background: var(--navy); color: white; }
.followup-student-list { display: grid; gap: 9px; }
.followup-student-card { display: grid; grid-template-columns: 34px minmax(170px,.8fr) 115px 120px minmax(240px,1.5fr) 125px auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.followup-student-card:hover { border-color: #9db7ca; }
.followup-student-card.selected { border-color: #5f9cc4; background: #f5faff; box-shadow: 0 0 0 2px rgba(41,111,155,.08); }
.followup-select { display: grid; place-items: center; }
.followup-select input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.followup-select .selection-placeholder { width: 20px; height: 20px; }
.followup-student-card .student-name strong { display: block; color: var(--navy-dark); }
.followup-student-card .student-name small, .followup-student-card .weak-copy, .followup-student-card .followup-latest { color: var(--muted); font-size: 12px; line-height: 1.5; }
.followup-student-card .followup-latest { grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed var(--line); }
.result-badge, .management-badge { display: inline-flex; justify-content: center; padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.result-badge.passed { background: var(--green-soft); color: var(--green); }
.result-badge.below_standard { background: #fff0e6; color: #a14d08; }
.result-badge.absent, .result-badge.not_started { background: #f1f3f5; color: #63727e; }
.result-badge.in_progress { background: var(--blue-soft); color: #17638f; }
.management-badge { background: #eef2f5; color: #536776; }
.management-badge.completed { background: var(--green-soft); color: var(--green); }
.followup-score { color: var(--navy); font-size: 19px; font-weight: 900; text-align: center; }
.followup-dialog { width: min(720px,calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 0; border-radius: 18px; box-shadow: 0 22px 70px rgba(20,43,60,.35); }
.followup-dialog::backdrop { background: rgba(20,43,60,.55); }
.followup-dialog-card { padding: 24px; }
.followup-dialog-card > label { display: block; margin-bottom: 15px; }
.followup-dialog-analysis { margin-bottom: 18px; padding: 15px; border-radius: 11px; background: #f5f8fa; line-height: 1.65; }
.followup-dialog-analysis strong { color: var(--navy); }
.external-exam-entry { margin: 0 0 16px; padding: 15px; border: 1px solid #c8d9e5; border-radius: 12px; background: #f8fbfd; }
.external-exam-entry .info-box { margin-bottom: 12px; }
.external-exam-entry > button { width: 100%; }
.external-exam-fields { margin-top: 15px; padding-top: 15px; border-top: 1px dashed #b9ccd9; }
.external-exam-fields .two-fields { margin-bottom: 8px; }
.external-exam-fields small { display: block; color: var(--muted); line-height: 1.55; }
.followup-wrong-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #c6d2db; }
.followup-wrong-list b { color: var(--navy-dark); }
.followup-wrong-list ol { max-height: 180px; margin: 8px 0 0; padding-left: 22px; overflow-y: auto; }
.followup-wrong-list li { margin: 5px 0; color: #455b6b; font-size: 13px; }
.followup-wrong-list li span { display: inline-block; min-width: 62px; color: var(--blue); font-weight: 900; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.followup-history-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.followup-history-section h3 { margin: 0 0 11px; color: var(--navy-dark); }
.followup-history { display: grid; gap: 8px; }
.followup-history article { padding: 11px 12px; border-left: 3px solid #8fb5cf; border-radius: 7px; background: #f7fafc; font-size: 13px; line-height: 1.55; }
.followup-history article strong { color: var(--navy); }
.followup-history article small { display: block; color: var(--muted); }
.followup-history > span { color: var(--muted); font-size: 13px; }
.followup-exam-dialog { width: min(760px,calc(100% - 24px)); }
.followup-exam-dialog label { display: block; margin-bottom: 15px; }
.followup-exam-dialog .info-box { margin: 0 0 16px; }
.followup-exam-issued { padding: 8px 0 2px; text-align: center; }
.followup-exam-issued h2 { margin: 8px 0; color: var(--navy-dark); }
.followup-exam-issued p { color: var(--muted); line-height: 1.55; }
.followup-exam-issued .qr-box { margin-top: 15px; }
.followup-issued-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
@media (max-width: 1040px) {
  .service-header { grid-template-columns: 1fr auto; }
  .service-tabs { grid-row: 2; grid-column: 1 / 3; }
  main { min-height: calc(100vh - 124px); }
  .workspace-grid, .monitor-grid { grid-template-columns: 1fr; }
  .question-list { height: 460px; }
  .recent-list { grid-template-columns: 1fr 1fr; }
  .template-hub { grid-template-columns: 1fr; align-items: start; }
  .template-preview { grid-column: auto; }
  .followup-heading { grid-template-columns: 1fr; }
  .followup-exam-hub { grid-template-columns: 1fr; }
  .followup-exam-actions { justify-content: flex-start; }
  .followup-student-card { grid-template-columns: 34px minmax(180px,1fr) 100px 110px minmax(220px,1fr); }
}
@media (max-width: 700px) {
  .service-header { display: block; padding: 12px 14px; }
  .service-brand { justify-content: center; }
  .service-tabs { margin-top: 11px; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  .service-tabs a { flex: 0 0 auto; }
  .header-actions { display: none; }
  .teacher-workspace { padding: 16px 11px; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 14px; align-items: stretch; flex-direction: column; }
  .page-heading .secondary-button { width: 100%; }
  .template-hub { padding: 16px 14px; }
  .template-controls { grid-template-columns: 1fr 1fr; }
  .template-controls label { grid-column: 1 / -1; }
  .template-controls .primary-button { width: 100%; }
  .unit-workspace-tabs { position: sticky; z-index: 8; top: 0; }
  .unit-workspace-tabs button { flex: 1; min-width: 0; padding: 9px 6px; font-size: 13px; }
  .stepper { grid-template-columns: repeat(4, minmax(80px,1fr)); overflow-x: auto; }
  .stepper li { display: flex; min-height: 62px; align-items: center; gap: 7px; padding: 10px; }
  .stepper li > span { flex: 0 0 30px; width: 30px; height: 30px; }
  .stepper small { display: none; }
  .panel { border-radius: 13px; }
  .settings-card, .summary-panel, .question-picker, .progress-panel, .results-panel { padding: 17px 14px; }
  .panel-title-row { align-items: flex-start; }
  .three-fields, .two-fields { grid-template-columns: 1fr; }
  .followup-heading { padding: 17px 14px; }
  .followup-assessment-picker { grid-template-columns: 1fr; }
  .followup-summary-grid { grid-template-columns: 1fr 1fr; }
  .followup-exam-hub { padding: 17px 14px; }
  .followup-exam-actions > button { flex: 1 1 calc(50% - 8px); }
  .followup-issued-card { grid-template-columns: 1fr auto; }
  .followup-issued-card > div:first-child { grid-column: 1 / -1; }
  .followup-list-panel { padding: 17px 14px; }
  .followup-student-card { grid-template-columns: 34px 1fr 1fr; }
  .followup-student-card .student-name, .followup-student-card .weak-copy, .followup-student-card .followup-latest { grid-column: 2 / -1; }
  .followup-student-card .followup-score { text-align: left; }
  .followup-dialog-card { padding: 18px 14px; }
  .followup-issued-actions { display: grid; }
  .picker-actions { justify-content: flex-start; }
  .question-row { grid-template-columns: 24px 55px minmax(0,1fr); }
  .question-row .qbadges { grid-column: 3; justify-items: start; display: flex; flex-wrap: wrap; }
  .metric-grid { gap: 7px; }
  .metric-grid > div { padding: 16px 5px; }
  .metric-grid strong { font-size: 26px; }
  .result-summary-strip { grid-template-columns: 1fr 1fr; }
  .result-summary-strip > div:nth-child(2) { border-right: 0; }
  .result-summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .option-bar { grid-template-columns: 28px minmax(0,1fr) 58px; }
  .option-bar .bar-track { grid-column: 2 / 4; }
  .recent-list { grid-template-columns: 1fr; }
  .student-exam { padding: 10px; }
  .student-preview-banner { display: grid; gap: 4px; padding: 12px; font-size: 15px; line-height: 1.45; }
  .exam-header { position: sticky; z-index: 5; top: 0; padding: 14px 15px; }
  .exam-header span { font-size: 14px; }
  .exam-header strong { font-size: 19px; line-height: 1.4; }
  .exam-layout { display: flex; flex-direction: column; }
  .exam-question { order: 1; min-height: 0; padding: 22px 16px; }
  .exam-nav { order: 2; position: static; padding: 18px; }
  .question-number { font-size: 15px; }
  .exam-question h2 { margin: 12px 0 22px; font-size: 25px; line-height: 1.55; }
  .student-option { min-height: 60px; margin: 11px 0; padding: 16px 14px; font-size: 19px; line-height: 1.55; }
  .question-move button { min-width: 108px; min-height: 48px; font-size: 16px; }
  .student-info { font-size: 16px; }
  .student-info span { font-size: 14px; }
  .number-grid button { font-size: 16px; }
  .nav-legend { font-size: 13px; }
  .exam-nav .primary-button { min-height: 52px; font-size: 18px; }
  body.phone-preview-mode { padding: 0; background: var(--bg); }
  body.phone-preview-mode .student-exam { width: auto; max-width: none; min-height: 100vh; margin: 0; padding: 10px; border: 0; border-radius: 0; box-shadow: none; }
}

@media print {
  .service-header, .page-heading, .unit-workspace-tabs, #assessment-workspace, .followup-heading, .followup-exam-hub, .followup-filter-row, .button-row, .followup-select, .manage-cell, .toast { display: none !important; }
  body, main { background: white; }
  .teacher-workspace { max-width: none; padding: 0; }
  #followup-workspace, #followup-content { display: block !important; }
  .followup-summary-grid { grid-template-columns: repeat(4,1fr); }
  .followup-student-card { break-inside: avoid; grid-template-columns: 1.2fr .7fr .7fr 1.5fr 1fr; box-shadow: none; }
}
