:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    sans-serif;
  color: #191f28;
  background: #f4f6fa;
  font-synthesis: none;
  line-height: 1.5;
  --blue: #3182f6;
  --muted: #6b7684;
  --line: #e5e8eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #85b8ff;
  outline-offset: 3px;
}
.topbar {
  max-width: 1000px;
  margin: auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-size: 22px;
  font-weight: 850;
  color: #191f28;
}
.brand span {
  color: var(--blue);
}
.chip {
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  background: #e8f3ff;
  color: #1b64da;
  padding: 5px 11px;
}
main {
  max-width: 960px;
  margin: 8px auto 100px;
  padding: 0 24px;
}
.hero {
  padding: 20px 0 24px;
}
.eyebrow {
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
  margin: 0 0 8px;
}
h1 {
  font-size: 32px;
  letter-spacing: -1.2px;
  line-height: 1.3;
  margin: 0 0 12px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  margin: 0 0 14px;
}
h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
p {
  color: var(--muted);
  margin: 6px 0 14px;
}
small,
.muted {
  color: var(--muted);
}
.card {
  padding: 26px;
  background: white;
  border-radius: 24px;
  margin-bottom: 18px;
  border: 1px solid #edf0f3;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}
.cards .card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cards .card button {
  margin-top: auto;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 16px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 13px 18px;
  min-height: 48px;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}
.btn.secondary {
  background: #eef2f7;
  color: #4e5968;
}
.btn.danger {
  background: #fff0f0;
  color: #d64141;
}
.btn.full {
  width: 100%;
}
.btn.small {
  padding: 9px 13px;
  min-height: 44px;
  font-size: 14px;
}
.label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}
.label input,
.label select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #f9fafb;
  border-radius: 12px;
  padding: 13px;
  font-size: 16px;
  color: #191f28;
}
.label select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  padding-right: 26px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7684 50%),
    linear-gradient(135deg, #6b7684 50%, transparent 50%);
  background-position:
    calc(100% - 15px) center,
    calc(100% - 10px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.label small {
  font-weight: 400;
}
.identity {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.identity .name {
  grid-column: 1/-1;
}
.dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.key-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.key-grid input {
  font-size: 22px;
  letter-spacing: 5px;
  font-variant-numeric: tabular-nums;
}
.note {
  background: #f2f7ff;
  border-radius: 14px;
  padding: 14px;
  color: #466384;
  font-size: 14px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 20px;
}
.tabs button {
  white-space: nowrap;
}
.tabs button.active {
  background: #191f28;
  color: white;
}
.pill {
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f2f4f6;
  color: #6b7684;
}
.pill.open {
  background: #e8f3ff;
  color: #1b64da;
}
.pill.closed {
  background: #e9f8f1;
  color: #16845b;
}
.back {
  padding-left: 0;
  background: transparent;
  color: var(--muted);
}
.deadline {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: #1b64da;
}
.progress {
  height: 7px;
  width: 100%;
  accent-color: var(--blue);
  margin: 14px 0 0;
}
.omr {
  border: 2px solid #64b9cd;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 18px;
}
.omr-heading {
  background: #eaf7fb;
  border-bottom: 2px solid #64b9cd;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  color: #2788a0;
  font-weight: 800;
  font-size: 21px;
}
.omr-heading small {
  font-size: 13px;
  align-self: center;
  color: #42889a;
}
.omr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.omr-group {
  border-right: 1px solid #9ccfda;
  border-bottom: 1px solid #9ccfda;
  padding: 8px 10px;
}
.omr-group-title {
  font-size: 12px;
  color: #42889a;
  font-weight: 700;
  padding: 5px 8px;
}
.omr-line {
  border: 0;
  padding: 3px 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
}
.omr-line legend {
  float: left;
  min-width: 28px;
  text-align: center;
  font-weight: 750;
  color: #2788a0;
  font-size: 16px;
  padding: 0;
  line-height: 44px;
}
.bubble {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
}
.bubble input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bubble span {
  display: grid;
  place-items: center;
  border: 1.5px solid #d886ac;
  color: #c06191;
  border-radius: 50%;
  width: 29px;
  height: 33px;
  font-weight: 700;
  font-size: 16px;
  transition: 0.12s;
}
.bubble input:checked + span {
  background: #3182f6;
  border-color: #3182f6;
  color: white;
  box-shadow: 0 0 0 3px #e8f3ff;
}
.bubble input:focus-visible + span {
  outline: 3px solid #85b8ff;
  outline-offset: 3px;
}
.sticky {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  padding: 14px;
  border-radius: 20px;
  background: #fffffff5;
  border: 1px solid var(--line);
  box-shadow: 0 8px 40px #192e4b15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sticky p {
  margin: 0;
  font-size: 14px;
}
.sticky button {
  min-width: 150px;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 22px;
  background: #191f28;
  color: white;
  border-radius: 16px;
  z-index: 20;
  max-width: 90vw;
  width: max-content;
  box-shadow: 0 10px 40px #0002;
}
.toast[hidden] {
  display: none;
}
dialog {
  border: 0;
  border-radius: 24px;
  padding: 28px;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #101b2e60;
}
dialog .identity-summary {
  font-size: 22px;
  font-weight: 800;
  color: #191f28;
  white-space: pre-line;
  margin: 22px 0;
}
.score {
  font-size: 54px;
  color: var(--blue);
  letter-spacing: -2px;
  font-weight: 850;
}
.score small {
  font-size: 20px;
  letter-spacing: 0;
}
.check-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #e8f3ff;
  color: var(--blue);
  font-size: 32px;
  margin-bottom: 18px;
}
.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 8px;
}
.answer-result {
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}
.answer-result.wrong {
  background: #fff3f3;
  border-color: #ffd6d6;
}
.answer-result b {
  display: block;
}
.answer-result.wrong b {
  color: #c13c3c;
}
.chart {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  height: 185px;
  overflow-x: auto;
  padding: 20px 4px 0;
}
.chart-item {
  min-width: 56px;
  max-width: 92px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  text-align: center;
  font-size: 12px;
}
.chart-item progress {
  width: 100%;
  height: 14px;
  accent-color: var(--blue);
}
.chart-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-item strong {
  font-size: 20px;
  color: var(--blue);
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 600;
}
td .btn {
  margin-right: 6px;
}
.empty {
  padding: 35px 20px;
  text-align: center;
}
.inline-error {
  color: #c13c3c;
  background: #fff3f3;
  padding: 14px;
  border-radius: 12px;
}
.link-button {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  min-height: 44px;
  padding: 5px;
}
.privacy {
  font-size: 12px;
  margin-top: 18px;
}
.status-line {
  font-size: 14px;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 620px) {
  main {
    padding: 0 18px;
  }
  .topbar {
    padding: 18px;
  }
  .hero {
    padding-top: 12px;
  }
  h1 {
    font-size: 28px;
  }
  .card {
    padding: 22px 18px;
    border-radius: 20px;
  }
  .omr-grid {
    grid-template-columns: 1fr;
  }
  .omr-group {
    border-right: 0;
    padding: 8px 16px;
  }
  .omr-line {
    gap: 5px;
  }
  .bubble {
    flex: 1;
  }
  .omr-line legend {
    min-width: 30px;
  }
  .dates {
    grid-template-columns: 1fr;
  }
  .key-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sticky {
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 12px;
  }
  .sticky button {
    min-width: 130px;
  }
  .sticky small {
    font-size: 11px;
  }
  .identity {
    gap: 8px;
  }
  .label input,
  .label select {
    padding: 12px 9px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
dialog .btn + .btn {
  margin-top: 8px;
}
.hero p {
  word-break: keep-all;
}
main > .btn + .stack {
  margin-top: 20px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-width: 360px) {
  .omr-group {
    padding: 8px 4px;
  }
  .omr-line {
    gap: 0;
  }
  .omr-line legend {
    min-width: 24px;
  }
}

/* Paper proportions and print colors, with independent 44px minimum tap areas. */
.omr-paper {
  --omr-ink: #397f92;
  --omr-rule: #8dbbc7;
  --omr-tint: #eff7f9;
  --omr-pink: #b76790;
  width: 100%;
  max-width: 640px;
  margin: 26px auto;
  padding: 0 12px 16px;
  background: #fffefa;
  border: 1px solid #e0e4e4;
  border-radius: 3px;
  box-shadow:
    0 2px 3px #253b4910,
    0 12px 32px #253b4906;
}
.omr-paper-title {
  color: var(--omr-ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 2px 20px;
}
.omr-paper-title h2 {
  margin: 3px 0 0;
  font-size: 23px;
  letter-spacing: 4px;
  font-weight: 750;
  line-height: 1.3;
}
.omr-subject p {
  font-size: 10px;
  letter-spacing: 0.5px;
  margin: 0;
  color: var(--omr-ink);
}
.omr-period {
  display: grid;
  text-align: center;
  padding-right: 12px;
  border-right: 1px solid var(--omr-rule);
  line-height: 1.2;
}
.omr-period span {
  font-size: 29px;
}
.omr-period small {
  color: var(--omr-ink);
  font-size: 10px;
  margin-top: 3px;
}
.omr-question-count {
  margin-left: auto;
  align-self: flex-end;
  padding-bottom: 3px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.omr-paper .omr {
  border: 1px solid var(--omr-rule);
  border-radius: 3px;
  background: transparent;
  margin: 0;
}
.omr-paper .omr-heading {
  display: grid;
  grid-template-columns: 30px 1fr;
  padding: 0;
  height: 34px;
  background: var(--omr-tint);
  border-bottom: 1px solid var(--omr-rule);
  color: var(--omr-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  align-items: stretch;
}
.omr-number-heading {
  font-size: 10px;
  border-right: 1px solid var(--omr-rule);
  display: grid;
  place-items: center;
}
.omr-answer-heading {
  display: grid;
  place-items: center;
  letter-spacing: 22px;
  text-indent: 22px;
}
.omr-paper .omr-grid {
  display: block;
}
.omr-paper .omr-group {
  border: 0;
  padding: 0;
}
.omr-paper .omr-group + .omr-group {
  border-top: 1px solid var(--omr-rule);
}
.omr-paper .omr-line {
  display: grid;
  grid-template-columns: 30px repeat(5, minmax(44px, 1fr));
  gap: 0;
  padding: 0;
  min-height: 44px;
}
.omr-paper .omr-question-number {
  width: 30px;
  min-width: 30px;
  flex: 0 0 30px;
  height: 44px;
  line-height: 44px;
  background: var(--omr-tint);
  border-right: 1px solid var(--omr-rule);
  color: var(--omr-ink);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.omr-paper .bubble {
  flex: 1;
  min-width: 44px;
  height: 44px;
}
.omr-paper .bubble span {
  width: 20px;
  height: 29px;
  border: 1px solid var(--omr-pink);
  color: var(--omr-pink);
  font-size: 12px;
  font-family: Arial, sans-serif;
  font-weight: 500;
  box-shadow: none;
  transition: none;
}
.omr-paper .bubble input:checked + span {
  color: #24272a;
  background: #24272a;
  border-color: #24272a;
  box-shadow: none;
}
.omr-paper .bubble input:focus-visible + span {
  outline: 2px solid var(--omr-ink);
  outline-offset: 4px;
}
.omr-paper-note {
  color: var(--omr-ink);
  font-size: 11px;
  margin: 12px 0 0;
  word-break: keep-all;
}
.omr-paper .omr-group-heading {
  display: none;
}
.exam-form {
  min-width: 0;
}
.exam-form > * {
  min-width: 0;
}
.exam-identity {
  align-self: start;
}
.exam-list {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: white;
}
.exam-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}
.exam-list-item + .exam-list-item {
  border-top: 1px solid var(--line);
}
.exam-list-info {
  min-width: 0;
}
.exam-list-info h2 {
  font-size: 19px;
  margin: 9px 0 6px;
  overflow-wrap: anywhere;
}
.exam-list-info p {
  font-size: 13px;
  margin: 0;
  white-space: pre-line;
}
.exam-list-item > button {
  flex-shrink: 0;
}
.list-summary {
  font-size: 13px;
  margin: 18px 0 0;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 24px 0;
}
.lookup-form {
  display: grid;
  gap: 20px;
}
.lookup-code textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  resize: none;
  font:
    14px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: #333d4b;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
}
main[data-view="result"] {
  max-width: 768px;
}
.lookup-code input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.code-ack {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
}
.code-ack input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--blue);
}
.access-details {
  margin-top: 24px;
}
.access-details > .card {
  border: 0;
  padding: 20px 0 0;
  margin: 0;
}
.result-body {
  max-width: 720px;
  margin: 0 auto;
}
.result-overview {
  padding: 30px;
}
.result-overview .eyebrow {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.result-score {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 14px 0 4px;
}
.result-score strong {
  font-size: 64px;
  line-height: 1.15;
  letter-spacing: -3px;
}
.result-score span {
  font-size: 22px;
  color: #8b95a1;
}
.result-feedback {
  margin: 8px 0 24px;
  color: #333d4b;
  font-size: 16px;
}
.result-student {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin: 0;
  font-size: 13px;
}
.result-table {
  table-layout: fixed;
  white-space: normal;
  margin-top: 12px;
}
.result-table th,
.result-table td {
  padding: 14px 4px;
  text-align: center;
}
.result-table th:first-child {
  text-align: left;
}
.result-table tbody th {
  color: #333d4b;
}
.result-table .wrong td:nth-child(2) {
  color: #c74747;
}
.result-table .correct-answer {
  font-weight: 700;
  color: #1b64da;
}
.result-table tbody tr:last-child > * {
  border-bottom: 0;
}
.all-answers summary,
.access-details summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 650;
}
.chart {
  height: auto;
  display: grid;
  align-items: stretch;
  padding: 8px 0;
}
.chart-item {
  min-width: 0;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  gap: 10px;
  height: auto;
}
.chart-item progress {
  grid-column: 1 / -1;
  height: 8px;
}
.chart-label {
  min-width: 0;
}
.chart-label span {
  display: block;
  font-size: 14px;
}
.chart-label small {
  display: block;
  margin-top: 3px;
}
.chart-item strong {
  font-size: 18px;
}
.chart-item small {
  font-size: 10px;
}
.card h2,
.hero h1 {
  overflow-wrap: anywhere;
}
@media (min-width: 700px) {
  .exam-form .sticky {
    position: static;
    margin-top: 24px;
    box-shadow: none;
  }
  .omr-paper {
    padding: 0 18px 18px;
  }
  .omr-paper .omr {
    border: 0;
  }
  .omr-paper .omr > .omr-heading {
    display: none;
  }
  .omr-paper .omr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  .omr-paper .omr-group {
    border: 1px solid var(--omr-rule);
    border-radius: 3px;
    overflow: hidden;
  }
  .omr-paper .omr-group-heading {
    display: grid;
  }
}
@media (min-width: 1000px) {
  .exam-form {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .exam-form .omr-paper {
    margin: 0;
  }
  .exam-form .exam-identity {
    padding: 20px 16px;
  }
  .exam-form .identity {
    gap: 8px;
  }
  .exam-form .label input,
  .exam-form .label select {
    padding: 12px 6px;
  }
  .exam-form .sticky {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}
@media (max-width: 620px) {
  .exam-list-item {
    padding: 20px 18px;
    gap: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .exam-list-item > button {
    align-self: flex-start;
  }
  .lookup-code input {
    font-size: 12px;
    letter-spacing: 0;
    padding-inline: 8px;
  }
  .result-overview {
    padding: 24px 20px;
  }
}
