/* Exam studio uses the workbench palette with a warm paper accent. */
[data-exam-admin], .ex-candidate, .ex-dialog {
  --ex-ink: #213b39;
  --ex-muted: #546a62;
  --ex-line: #dde6dd;
  --ex-accent: #805a29;
  --ex-warm: #f4ead6;
  color: var(--ex-ink);
}
[data-exam-admin] h2, [data-exam-admin] h3, .ex-candidate h1, .ex-candidate h2, .ex-dialog h2 {
  margin: 0;
  line-height: 1.25;
}
.ex-page-head, .ex-row, .ex-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ex-page-head, .ex-row { justify-content: space-between; }
.ex-page-head { margin-bottom: 18px; }
.ex-page-head h2 { font-size: 30px; margin-top: 6px; }
.ex-kicker { color: var(--ex-muted); letter-spacing: .13em; font-size: 11px; font-weight: 600; }
.ex-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 24px;
  border: 1px solid #cddfd3;
  border-radius: 14px;
  padding: clamp(22px, 4vw, 38px);
  background: #e8f0e8;
}
.ex-hero h3 { margin: 10px 0 12px; font-size: clamp(23px, 3vw, 34px); }
.ex-hero p, .ex-ticket p { margin: 12px 0 20px; max-width: 58ch; color: var(--ex-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.ex-paper-art {
  justify-self: center;
  display: grid;
  gap: 7px;
  width: 108px;
  padding: 12px;
  background: #fbf6e9;
  border: 1px solid #cbb693;
  border-radius: 5px;
  transform: rotate(7deg);
  box-shadow: 9px 9px 0 #bdd3c3;
  color: var(--ex-accent);
}
.ex-paper-art span { font-size: 10px; }
.ex-paper-art b { font-family: Georgia, "Songti SC", serif; font-size: 35px; line-height: 1; }
.ex-paper-art i { height: 1px; background: #dac9aa; }
.ex-paper-art i:last-child { width: 60%; }
.ex-flow {
  list-style: none;
  margin: 18px 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ex-flow li, .ex-card, .ex-paper-question {
  border: 1px solid var(--ex-line);
  background: #fff;
  border-radius: 12px;
  min-width: 0;
}
.ex-flow li { display: flex; align-items: start; padding: 16px; gap: 12px; }
.ex-flow li > span, .ex-serial {
  color: var(--ex-accent);
  font: 18px/1.4 Georgia, "Songti SC", serif;
}
.ex-flow p { margin: 3px 0 0; color: var(--ex-muted); font-size: 12px; }
.ex-card { padding: clamp(16px, 2.5vw, 23px); }
.ex-card h3 { font-size: 16px; }
.ex-note { color: var(--ex-muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.ex-card .ex-note { margin: 8px 0 12px; }
.ex-status { color: #286b60; font-size: 13px; margin: 10px 0; overflow-wrap: anywhere; }
.ex-status:empty { display: none; }
.ex-status[data-error="true"] { color: #9a3e32; }
.ex-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--ex-line);
  background: #fff;
  color: inherit;
  width: 100%;
  padding: 14px 4px;
}
.ex-list-row:hover { background: #f4f8f3; }
.ex-list-row strong, .ex-list-row small { display: block; overflow-wrap: anywhere; }
.ex-list-row small { color: var(--ex-muted); margin-top: 3px; }
.ex-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  background: var(--ex-warm);
  color: var(--ex-accent);
}
.ex-chip[data-state="open"] { background: #e1f1e8; color: #235f48; }
.ex-chip[data-state="closed"] { background: #edf0eb; color: var(--ex-muted); }
.ex-selected { margin-bottom: 18px; }
.ex-selected h3 { margin: 12px 0 0; font-size: 22px; overflow-wrap: anywhere; }
.ex-tabs { display: flex; gap: 15px; border-bottom: 1px solid var(--ex-line); margin: 0 0 20px; }
.ex-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 8px 10px;
  color: var(--ex-muted);
}
.ex-tabs button[aria-pressed="true"] { border-bottom-color: #286b60; color: #234e46; font-weight: 650; }
.ex-tabs button:disabled { opacity: .52; }
.ex-grid, .ex-taking-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.ex-stack, .ex-fields { display: grid; gap: 14px; min-width: 0; }
.ex-fields { border: 0; padding: 0; margin: 16px 0 0; }
.ex-fields label, .ex-share label, .ex-grade-item label { display: grid; gap: 5px; font-size: 12px; color: var(--ex-muted); }
.ex-fields label.ex-check { display: flex; align-items: center; }
.ex-field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ex-option-edit { display: grid; grid-template-columns: auto 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.ex-option-edit .q-button, .ex-question-editor .ex-actions .q-button { font-size: 11px; min-height: 28px; padding: 4px 8px; }
.ex-letter { color: var(--ex-muted); font: 13px/1.4 Georgia, serif; text-align: center; }
.ex-check input, .ex-answer-option input, .ex-option-edit input { accent-color: #286b60; }
.ex-add .ex-actions { margin-top: 12px; }
.ex-side { position: sticky; top: 96px; }
.ex-total { display: flex; align-items: baseline; gap: 8px; }
.ex-total strong { font: 44px/1.25 Georgia, "Songti SC", serif; color: #2c6d5e; }
.ex-total span { color: var(--ex-muted); }
.ex-side-actions { margin-top: 18px; gap: 8px; }
.ex-share { border-top: 1px solid var(--ex-line); margin-top: 18px; padding-top: 14px; }
.ex-share .ex-actions { margin-top: 10px; gap: 8px; }
.ex-actions a { text-decoration: none; }
.ex-qr { width: 122px; margin: 12px auto 0; }
.ex-qr svg { width: 100%; height: auto; display: block; }
.ex-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.ex-metrics > div { background: #edf4ed; border-radius: 8px; padding: 13px; }
.ex-metrics span { display: block; font-size: 12px; color: var(--ex-muted); }
.ex-metrics strong { display: block; color: #286b60; font: 25px/1.4 Georgia, serif; }
.ex-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: 90dvh;
  border: 1px solid var(--ex-line);
  border-radius: 14px;
  padding: clamp(16px, 4vw, 26px);
  box-shadow: 0 22px 60px #19332e30;
}
.ex-dialog::backdrop { background: #192f2c80; }
.ex-dialog h2 { font-size: 21px; overflow-wrap: anywhere; min-width: 0; }
.ex-icon { border: 0; background: #edf3ed; color: inherit; border-radius: 6px; width: 34px; height: 34px; font-size: 20px; }
.ex-dialog-footer { justify-content: flex-end; margin-top: 18px; }
.ex-dialog .ex-paper-question, .ex-grade-item { margin-top: 16px; }
.ex-grade-item { border-top: 1px solid var(--ex-line); padding-top: 14px; }
.ex-grade-item h3 { margin: 0 0 10px; font-size: 15px; overflow-wrap: anywhere; }
.ex-grade-item label { margin-top: 10px; max-width: 220px; }
.ex-candidate-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px max(16px, calc((100% - 1000px) / 2));
  background: #1c3437;
  color: #fff;
}
.ex-brand { color: inherit; font-size: 21px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.ex-brand span { margin-left: 12px; font-size: 12px; font-weight: 400; color: #c1d9d2; }
.ex-candidate-main { max-width: 1032px; margin: 0 auto; padding: 24px 16px 50px; }
.ex-ticket {
  padding: clamp(19px, 4vw, 33px);
  background: #ebf2e9;
  border: 1px solid #d3e2d4;
  border-left: 4px solid #3e7965;
  border-radius: 12px;
  margin-bottom: 16px;
}
.ex-ticket h1 { font-size: clamp(24px, 4vw, 38px); margin-top: 8px; overflow-wrap: anywhere; }
.ex-ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ex-ticket-meta span { color: #3f5c50; background: #f8fbf6; border-radius: 5px; padding: 4px 9px; font-size: 12px; }
.ex-ticket p:last-child { margin-bottom: 0; }
.ex-candidate h2 { font-size: 20px; }
.ex-paper-question { padding: 16px; margin: 0; scroll-margin-top: 20px; }
.ex-paper-question legend {
  max-width: 100%;
  padding: 4px 10px;
  background: #f5eddb;
  color: var(--ex-accent);
  border-radius: 5px;
  font-size: 12px;
}
.ex-paper-question legend span + span { margin-left: 10px; }
.ex-paper-question h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.ex-answer-option {
  display: grid;
  grid-template-columns: auto 19px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  background: #f5f8f3;
  border: 1px solid var(--ex-line);
  border-radius: 7px;
  padding: 9px 10px;
  margin-top: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.ex-answer-option:has(input:checked) { border-color: #74a890; background: #e8f3ea; }
.ex-answer-text { background: #f5f7f2; border-radius: 6px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ex-review { border-top: 1px solid var(--ex-line); margin-top: 12px; padding-top: 12px; color: var(--ex-muted); }
.ex-review p { white-space: pre-wrap; overflow-wrap: anywhere; }
.ex-clock { position: sticky; top: 16px; }
.ex-clock > strong { color: #255f50; font: 37px/1.3 Georgia, serif; font-variant-numeric: tabular-nums; }
.ex-clock > strong[data-urgent="true"] { color: #9a3e32; }
.ex-answer-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ex-answer-nav a {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  height: 29px;
  color: #405b52;
  background: #f0f3ee;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}
.ex-answer-nav a[data-answered="true"] { background: #daeee1; color: #235f48; }
.ex-clock .q-button { width: 100%; }
.ex-finish { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.ex-finish h2 { margin-top: 5px; }
.ex-candidate .ex-review-title { margin-bottom: 12px; }

@media (max-width: 880px) {
  .ex-grid { grid-template-columns: minmax(0, 1fr); }
  .ex-side { position: static; grid-row: 1; }
  .ex-side-actions { display: flex; flex-wrap: wrap; }
  .ex-qr { margin-left: 0; }
}
@media (max-width: 620px) {
  .ex-hero, .ex-flow, .ex-taking-grid { grid-template-columns: minmax(0, 1fr); }
  .ex-hero { gap: 0; }
  .ex-paper-art { display: none; }
  .ex-flow li { padding: 11px 14px; }
  .ex-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-clock {
    grid-row: 1;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 14px;
  }
  .ex-clock .ex-kicker { grid-column: 1 / -1; }
  .ex-clock > strong { font-size: 27px; }
  .ex-clock .ex-note { margin: 0; }
  .ex-clock .ex-answer-nav { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; margin: 5px 0; }
  .ex-clock .q-button { grid-column: 2; grid-row: 2; }
  .ex-clock .ex-status { grid-column: 1 / -1; }
  .ex-paper-question { scroll-margin-top: 176px; }
}
