:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #142642;
  background: #f2f5f9;
  --ink: #142642;
  --muted: #52657d;
  --line: #d8e1ec;
  --blue: #164fa3;
  --blue-dark: #123d7f;
  --white: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button, a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 12px; color: var(--blue); background: #fff; border: 1px solid #bdcce0; font-weight: 650; border-radius: 7px; text-decoration: none; cursor: pointer; white-space: nowrap; }
button:hover, a.button:hover { background: #edf3fc; }
button:disabled { opacity: .57; cursor: default; }
.primary, a.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.primary:hover, a.primary:hover { color: #fff; background: var(--blue-dark); }
:focus-visible { outline: 3px solid #356cd2; outline-offset: 3px; }
label { display: grid; gap: 5px; font-weight: 600; }
input:not([type="checkbox"], [type="radio"]), textarea, select { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid #b9c7d9; border-radius: 7px; background: white; color: var(--ink); }
input:is([type="checkbox"], [type="radio"]) { accent-color: var(--blue); width: 17px; height: 17px; margin: 0; }
textarea { resize: vertical; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.025em; line-height: 1.25; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 16px; }
p { color: var(--muted); overflow-wrap: anywhere; }
.topbar { background: #152b4b; color: #fff; }
.container { max-width: 1400px; width: calc(100% - 64px); margin: 0 auto; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 58px; }
.topbar strong { font-size: 16px; letter-spacing: .04em; }
main.container { padding: 32px 0 55px; }
.surface { border: 1px solid var(--line); border-radius: 10px; padding: 22px; background: var(--white); }
.page-title, .section-head, .bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-title { margin-bottom: 20px; }
.page-title p, .section-head p { margin-top: 5px; }
.layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); align-items: start; gap: 18px; }
.sidebar { padding: 10px; }
.session-group + .session-group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.session-group h2 { color: var(--muted); font-size: 13px; margin: 8px 10px; }
.sidebar-button { display: grid; width: 100%; min-height: 40px; text-align: left; justify-content: initial; padding: 8px 10px; white-space: normal; color: var(--ink); border: 1px solid transparent; }
.sidebar-button small { color: var(--muted); font-weight: 500; }
.sidebar-button.selected { color: var(--blue-dark); background: #eaf1fc; border-color: #adc5ec; }
#history-button { margin-top: 10px; border-top-color: var(--line); }
.content, form { display: grid; gap: 14px; }
.content { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.content > section { min-width: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
dt, small, .muted { color: var(--muted); }
dd { margin: 5px 0 0; font-weight: 620; }
.check { display: flex; align-items: center; gap: 8px; }
.tag { display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 9px; border-radius: 6px; background: #eff3f8; color: #3c506d; font-weight: 650; font-size: 12px; }
.tag.open, .tag.graded, .tag.passed, .tag.synced, .tag.submitted { background: #e8f5ee; color: #166043; }
.tag.active, .tag.grading, .tag.syncing { background: #eaf1ff; color: #164998; }
.tag.review, .tag.failed { background: #fff0e0; color: #854006; }
.status { margin: 9px 0; color: #175333; }
.status:empty { display: none; }
.error, .warning { color: #ad2d1f !important; }
.filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(104px, .6fr) minmax(105px, .6fr); gap: 10px; margin: 15px 0 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 9px; white-space: nowrap; }
th { color: #3b506e; font-weight: 650; background: #f3f6fa; font-size: 12px; }
td strong, .table-sub { display: block; }
td .actions { flex-wrap: nowrap; }
td .actions button { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.score { color: var(--blue-dark); font: 750 27px/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.score-max { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px 10px; }
.login-card { max-width: 460px; margin: 26px auto; }
.login-card form { margin-top: 18px; }
.login-card a { margin-top: 16px; }
dialog { border: 1px solid var(--line); border-radius: 12px; color: var(--ink); padding: 0; width: min(720px, calc(100% - 32px)); max-height: 88vh; }
dialog::backdrop { background: rgb(16 34 56 / 48%); }
.dialog-shell { padding: 22px; }
.dialog-shell > .section-head { margin-bottom: 15px; }
.dialog-shell .bottom, .dialog-shell .actions, .dialog-shell label { margin-top: 8px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-wide { grid-column: 1 / -1; }
.schedule-preview { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; background: #f3f6fb; border: 1px solid var(--line); border-radius: 7px; padding: 13px 14px; }
.schedule-preview dd { overflow-wrap: anywhere; }
.schedule-actions { justify-content: space-between; }
.dialog-shell .schedule-actions label { margin-top: 0; }
.detail-part { padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-part > div { margin-top: 9px; }
.detail-part input { max-width: 100px; }
.candidate-container { max-width: 900px; }
.candidate-session, .written-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.candidate-session p { margin: 3px 0; }
.written-head { position: sticky; top: 8px; z-index: 1; box-shadow: 0 3px 13px rgb(20 38 66 / 12%); }
#written-timer { color: var(--blue-dark); font: 700 32px/1.1 ui-monospace, monospace; }
.question { min-width: 0; margin: 0 0 12px; padding-top: 10px; }
.question legend { padding: 0 6px; color: var(--blue-dark); font-size: 18px; font-weight: bold; }
.question-label { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.question-label span { color: var(--muted); white-space: nowrap; font-size: 12px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 5px; font-weight: 400; }
.option input { flex: 0 0 17px; margin-top: 3px; }
@media (max-width: 1030px) {
  .container { width: calc(100% - 36px); }
  .layout { grid-template-columns: 195px minmax(0, 1fr); gap: 12px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 26px); }
  main.container { padding-top: 20px; }
  .layout, .form-grid, .schedule-preview { grid-template-columns: minmax(0, 1fr); }
  .page-title, .section-head { flex-wrap: wrap; }
  .surface { padding: 14px; }
  .sidebar { max-height: 210px; overflow-y: auto; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > label:first-child { grid-column: span 2; }
}

/* Brand colors shared by the sign-in screens and the administrator workspace. */
.admin-page,
.candidate-page {
  --admin-navy: #10243b;
  --admin-paper: #faf9f6;
  --admin-accent: #ffab33;
  --admin-ink: #192941;
  --admin-border: #e8e2d8;
  --admin-tint: #f6f3ee;
  --admin-selection: #fff2de;
  --admin-white: #fffefa;
}
.admin-brand-definitions { position: absolute; }
.admin-page-signed-out { background: var(--admin-paper); }
.admin-page-signed-out main.container { width: 100%; max-width: none; padding: 0; }
.admin-login { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 100vh; min-height: 100svh; }
.admin-login-brand {
  position: relative;
  display: grid;
  grid-template-rows: min-content 1fr;
  align-items: center;
  gap: 56px;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 6vw, 96px);
  color: #fff;
  background: radial-gradient(ellipse at 100% 100%, #233f60, transparent 66%), var(--admin-navy);
}
.admin-login-logo-frame {
  display: grid;
  justify-items: center;
  justify-self: start;
  padding: 11px 15px;
  border-radius: 9px;
  background: #fff;
}
.admin-login-logo { display: block; width: clamp(142px, 12vw, 188px); height: auto; }
.admin-login-brand-copy { padding-bottom: 10vh; }
.admin-login-product {
  color: #fff;
  font-size: clamp(46px, 5.25vw, 82px);
  font-weight: 760;
  line-height: 1.13;
  letter-spacing: -.045em;
}
.admin-login-product span { display: block; margin-top: .11em; }
.admin-login-purpose { margin-top: 25px; color: #ccdaea; font-size: clamp(14px, 1.3vw, 19px); }
.admin-login-art {
  position: absolute;
  z-index: -1;
  right: -13%;
  bottom: -24%;
  width: clamp(440px, 55vw, 870px);
  aspect-ratio: 1;
  pointer-events: none;
  background-image: linear-gradient(#b9d7fa11 1px, transparent 1px), linear-gradient(90deg, #b9d7fa11 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 55% 48%, #000 0 34%, transparent 70%);
}
.admin-login-art span {
  position: absolute;
  inset: 12%;
  border: 1px solid #bdd8f34d;
  border-radius: 50%;
}
.admin-login-art span:nth-child(2) { inset: 4%; border-color: #a4cafa36; }
.admin-login-art span:nth-child(3) { inset: -4%; border-color: #a4cafa24; }
.admin-login-art span:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: #f7a632cf;
  border-radius: 50%;
  transform: rotate(-27deg);
}
.admin-login-panel {
  display: grid;
  place-items: center;
  padding: clamp(36px, 7vw, 112px);
  background: var(--admin-paper);
}
.admin-login-content { width: 100%; max-width: 430px; }
.admin-login h1 { color: #14263d; font-size: clamp(34px, 3.2vw, 50px); }
.admin-login-help { margin-top: 12px; color: #526279; font-size: 15px; }
.admin-login form { gap: 22px; margin-top: 40px; }
.admin-password-field label { display: block; margin-bottom: 8px; color: #24364d; }
.admin-password-control {
  display: flex;
  align-items: stretch;
  padding: 3px 4px 3px 0;
  border: 1px solid #a8b7c9;
  border-radius: 9px;
  background: #fff;
}
.admin-password-control:focus-within { border-color: #265eb3; box-shadow: 0 0 0 3px #265eb324; }
.admin-password-control input {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  font-size: 16px;
}
.admin-password-control input::placeholder { color: #66758a; opacity: 1; }
.admin-password-control input:focus { outline: none; }
.admin-password-control input::-ms-reveal { display: none; }
.admin-password-toggle {
  align-self: center;
  flex: 0 0 auto;
  min-width: 55px;
  min-height: 40px;
  border: 0;
  color: #254e8a;
}
.admin-password-control:has(input[aria-invalid="true"]) { border-color: #a63b24; }
.admin-login-submit {
  justify-content: space-between;
  min-height: 54px;
  padding: 11px 16px;
  border-color: var(--admin-accent);
  border-radius: 9px;
  background: var(--admin-accent);
  color: var(--admin-ink);
  font-size: 16px;
}
.admin-login-submit::after { content: "→" / ""; font-size: 22px; font-weight: 400; }
.admin-login-submit:hover:not(:disabled) { border-color: #ffb949; background: #ffb949; }
.admin-login-submit:active:not(:disabled) { background: #f29713; }
.admin-login-error { margin: -6px 0 0; padding: 10px 12px; border-radius: 7px; background: #fff0e9; }
@media (max-width: 780px) {
  .admin-login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .admin-login-brand { gap: 22px; padding: 25px max(24px, calc((100% - 430px) / 2)); }
  .admin-login-logo-frame { padding: 6px 10px; }
  .admin-login-logo { width: 124px; }
  .admin-login-brand-copy { padding: 0; }
  .admin-login-product { font-size: clamp(29px, 6vw, 50px); line-height: 1.2; }
  .admin-login-product span { display: inline; margin: 0 0 0 .14em; }
  .admin-login-purpose { margin-top: 7px; font-size: 13px; }
  .admin-login-art { right: -32%; bottom: -125%; }
  .admin-login-panel { align-items: start; padding: 36px 24px 48px; }
  .admin-login form { margin-top: 28px; gap: 18px; }
}

/* Authenticated administrator workspace */
.admin-page:not(.admin-page-signed-out) {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--admin-paper);
  color: var(--admin-ink);
  --line: var(--admin-border);
}
.admin-page #admin-topbar { background: var(--admin-navy); border-bottom: 1px solid #415166; }
.admin-page .topbar-inner { min-height: 72px; gap: 16px; }
.admin-topbar-brand { display: flex; align-items: center; gap: 17px; min-width: 0; }
.admin-topbar-brand strong { font-size: 16px; letter-spacing: .045em; }
.admin-topbar-logo { display: flex; flex: 0 0 auto; align-items: center; padding: 4px 8px; border-radius: 5px; background: #fff; }
.admin-topbar-logo svg { display: block; width: 94px; height: auto; }
.admin-page #logout { background: transparent; border-color: #62778f; color: #f4f8ff; }
.admin-page #logout:hover { background: #223c59; border-color: #9baec4; }
.admin-page #logout:focus-visible { outline-color: var(--admin-accent); }

.admin-page #workspace {
  --admin-surface-padding: clamp(18px, 2vw, 27px);
}
.admin-page #workspace .page-title { margin-bottom: 26px; }
.admin-page #workspace .page-title h1 { color: var(--admin-navy); font-size: clamp(32px, 3.25vw, 47px); }
.admin-page #workspace .page-title p { margin-top: 8px; }
.admin-page #workspace .page-title .actions { gap: 10px; }
.admin-page #workspace .surface {
  border-radius: 11px;
  border-color: var(--admin-border);
  background: var(--admin-white);
  box-shadow: 0 2px 3px #36281405;
}
.admin-page #workspace :is(.layout, .content) { gap: 18px; }
.admin-page #workspace .content > section { padding: var(--admin-surface-padding); }
.admin-page #workspace #session-head.empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 240px;
  background: radial-gradient(ellipse at 50% 100%, #fff4e2, transparent 73%), var(--admin-white);
}
.admin-page #workspace #session-head.empty h2 { color: var(--admin-navy); margin-bottom: 8px; }
.admin-page #workspace .sidebar { padding: 11px; }
.admin-page #workspace .session-group h2 { color: #536175; }
.admin-page #workspace .sidebar-button { gap: 2px; text-align: left; padding: 10px 11px; border-radius: 7px; }
.admin-page #workspace .sidebar-button:hover { background: var(--admin-tint); }
.admin-page #workspace .sidebar-button.selected,
.admin-page #workspace .sidebar-button.selected:hover {
  color: var(--admin-ink);
  background: var(--admin-selection);
  border-color: #e8c693;
  box-shadow: inset 3px 0 #cd842e;
}
.admin-page #history-button:not(.selected) { border-top-color: var(--admin-border); }
.admin-page :is(#workspace, #dialog) :is(button, .button):not(.sidebar-button) {
  border-color: #d6cfc4;
  color: var(--admin-navy);
  background: #fff;
}
.admin-page :is(#workspace, #dialog) :is(button, .button):not(.sidebar-button):hover { background: #f5f2ec; }
.admin-page :is(#workspace, #dialog) :is(button, .button).primary {
  border-color: var(--admin-accent);
  background: var(--admin-accent);
  color: var(--admin-ink);
}
.admin-page :is(#workspace, #dialog) :is(button, .button).primary:hover:not(:disabled) { border-color: #ffb949; background: #ffb949; }
.admin-page #workspace .page-title button { min-height: 42px; padding-inline: 14px; }
.admin-page #workspace #session-head .section-head { align-items: flex-start; }
.admin-page #workspace #session-head .section-head p { margin: 0 0 5px; }
.admin-page #workspace #session-head h2 { color: var(--admin-navy); font-size: clamp(22px, 2vw, 31px); overflow-wrap: anywhere; }
.admin-page #workspace #session-head .facts {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-tint);
}
.admin-page #workspace .facts dd { word-break: break-word; }
.admin-page #workspace .section-head h2 { color: var(--admin-navy); }
.admin-page #workspace :is(#roster, #submissions) .empty {
  margin-top: 14px;
  border: 1px dashed #dfd6c8;
  border-radius: 8px;
  background: #faf8f3;
}
.admin-page #workspace :is(th, td) { padding: 12px 10px; }
.admin-page :is(#workspace, #dialog) th { background: var(--admin-tint); color: #405168; }
.admin-page :is(#workspace, #dialog) tbody tr:hover { background: #fffbf4; }
.admin-page .score { color: var(--admin-navy); font-size: 31px; }
.admin-page #dialog {
  border-color: #dad3c8;
  background: var(--admin-white);
  box-shadow: 0 20px 70px #10243b32;
}
.admin-page #dialog .dialog-shell > .section-head { padding-bottom: 14px; border-bottom: 1px solid var(--admin-border); }
.admin-page #dialog .schedule-preview { background: var(--admin-tint); border-radius: 8px; }

.admin-page #dialog.submission-dialog {
  --detail-gutter: 24px;
  width: min(1040px, calc(100% - 32px));
  max-height: min(900px, calc(100dvh - 48px));
  overflow: hidden;
  border-radius: 14px;
}
.submission-dialog .dialog-shell { display: flex; flex-direction: column; max-height: inherit; padding: 0; }
.admin-page #dialog.submission-dialog .dialog-shell > .section-head {
  margin: 0;
  padding: 14px var(--detail-gutter);
  flex: 0 0 auto;
}
.submission-dialog #dialog-title { overflow-wrap: anywhere; }
.submission-dialog #dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px var(--detail-gutter) 20px; }
.submission-dialog #dialog-status { margin: 0; padding: 8px var(--detail-gutter); border-top: 1px solid var(--admin-border); }
.submission-dialog #dialog-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 12px var(--detail-gutter);
  border-top: 1px solid var(--admin-border);
}
.detail-summary {
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-tint);
}
.detail-total { align-self: stretch; display: grid; align-content: center; padding-inline-end: 18px; border-inline-end: 1px solid #ded6ca; }
.detail-total > span { color: var(--muted); font-size: 13px; }
.admin-page .detail-total .score { font-size: 38px; }
.detail-info { min-width: 0; overflow-wrap: anywhere; }
.detail-info > strong { color: var(--admin-navy); font-size: 16px; }
.detail-info p { margin-block: 2px 6px; font-size: 13px; }
.detail-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.submission-dialog .detail-controls { justify-content: flex-end; margin-top: 0; }
.detail-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--admin-border); }
.detail-meta > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); font-size: 13px; }
.detail-meta a { color: var(--blue-dark); text-underline-offset: 3px; white-space: nowrap; }
.detail-meta button { min-height: 32px; padding-block: 4px; }
.detail-error { margin-top: 12px; padding: 10px 12px; color: #854006; background: #fff0e0; border-radius: 8px; }
.detail-content { display: grid; gap: 8px; margin-top: 15px; }
.detail-content #review-form { gap: 8px; }
.detail-content .detail-manual { padding: 14px 16px; border: 1px solid var(--admin-border); border-radius: 9px; }
.submission-dialog .detail-manual label { margin-top: 0; }
.detail-manual input { max-width: 144px; }

.rubric-workspace { display: grid; grid-template-columns: minmax(178px, 222px) minmax(0, 1fr); align-items: start; gap: 14px; }
.rubric-tabs { display: grid; align-content: start; gap: 4px; padding: 6px; border: 1px solid var(--admin-border); border-radius: 9px; background: var(--admin-tint); }
.admin-page #dialog .rubric-tabs .rubric-tab {
  display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-color: transparent;
  background: transparent; text-align: start; white-space: normal; overflow-wrap: anywhere;
}
.admin-page #dialog .rubric-tabs .rubric-tab:hover { background: var(--admin-white); }
.admin-page #dialog .rubric-tabs .rubric-tab[aria-selected="true"] {
  border-color: #e8c693; background: var(--admin-selection); box-shadow: inset 3px 0 #cd842e;
}
.rubric-panel { min-width: 0; border: 1px solid var(--admin-border); border-radius: 9px; background: #fff; }
.rubric-panel > h3 {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 11px 15px; border-bottom: 1px solid var(--admin-border); border-radius: 8px 8px 0 0; background: var(--admin-tint);
  overflow-wrap: anywhere;
}
.rubric-panel :focus-visible { outline-offset: -2px; }
.rubric-table { margin: 0; table-layout: fixed; }
.admin-page #dialog .rubric-table th { background: transparent; }
.rubric-table th, .rubric-table td { padding: 6px 12px; border-color: #eee9e0; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.rubric-table tr > :first-child { padding-inline-start: 16px; text-align: left; }
.rubric-table tr > :nth-child(2) { width: 106px; }
.rubric-table tr > :nth-child(3) { width: 128px; }
.rubric-table tbody th { font-size: 14px; }
.rubric-table tbody th strong { color: var(--admin-ink); }
.rubric-table tbody p { margin-top: 3px; font-size: 13px; font-weight: 400; white-space: pre-wrap; }
.rubric-table tbody tr:last-child > * { border-bottom: 0; }
.rubric-table input[type="number"] { max-width: 82px; min-height: 31px; padding: 4px 7px; font-variant-numeric: tabular-nums; }
.rubric-score { color: var(--admin-navy); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rubric-score small { font-size: 12px; font-weight: 500; }

@media (min-width: 761px) and (min-height: 660px) {
  .submission-dialog #dialog-body:has(.rubric-workspace) { display: flex; flex-direction: column; overflow: hidden; }
  .submission-dialog #dialog-body:has(.rubric-workspace) > :not(.detail-content) { flex: 0 0 auto; }
  .detail-content:has(.rubric-workspace) { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .detail-content:has(.rubric-workspace) #review-form { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .rubric-workspace, .rubric-tabs, .rubric-panel { min-height: 0; }
  .rubric-workspace { align-items: stretch; }
  .rubric-tabs, .rubric-panel { overflow-y: auto; overscroll-behavior: contain; }
  .rubric-tabs { align-self: start; max-height: 100%; }
}
@media (max-width: 760px) {
  .rubric-workspace { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rubric-tabs { position: sticky; top: 0; z-index: 1; display: flex; overflow-x: auto; }
  .admin-page #dialog .rubric-tabs .rubric-tab { flex: 0 0 auto; padding: 7px 10px; }
}

@media (max-width: 620px) {
  .admin-page #dialog.submission-dialog { --detail-gutter: 12px; width: calc(100% - 16px); max-height: calc(100dvh - 20px); }
  .submission-dialog #dialog-body { padding-block: 12px; }
  .submission-dialog #dialog-footer button { width: 100%; }
  .detail-summary { grid-template-columns: minmax(74px, auto) minmax(0, 1fr); gap: 10px; padding: 12px; }
  .detail-total { padding-inline-end: 10px; }
  .admin-page .detail-total .score { font-size: 31px; }
  .submission-dialog .detail-controls { grid-column: 1 / -1; justify-content: flex-start; }
  .rubric-panel > h3 { padding-inline: 10px; }
  .rubric-table th, .rubric-table td { padding-inline: 6px; }
  .rubric-table tr > :first-child { padding-inline-start: 10px; }
  .rubric-table tr > :nth-child(2) { width: 61px; }
  .rubric-table tr > :nth-child(3) { width: 76px; }
}

@media (max-width: 850px) {
  .admin-page #workspace #session-head .section-head { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .admin-page .topbar-inner { min-height: 66px; }
  .admin-topbar-brand { gap: 9px; }
  .admin-topbar-brand strong { letter-spacing: normal; font-size: 14px; }
  .admin-topbar-logo { padding: 4px 6px; }
  .admin-topbar-logo svg { width: 76px; }
  .admin-page #workspace { --admin-surface-padding: 16px; }
  .admin-page #workspace :is(.layout, .content) { gap: 13px; }
  .admin-page #workspace .page-title { margin-bottom: 17px; }
  .admin-page #workspace #session-head.empty { min-height: 190px; }
  .admin-page #workspace .sidebar { max-height: none; overflow: visible; }
  .admin-page #session-list { max-height: min(35vh, 260px); overflow-y: auto; }
  .admin-page #workspace #session-head .facts { padding: 12px; gap: 12px; }
  .admin-page #workspace :is(#roster, #submissions) { overflow: visible; }
  .admin-page #workspace :is(#roster, #submissions) :is(table, tbody) { display: block; }
  .admin-page #workspace :is(#roster, #submissions) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .admin-page #workspace :is(#roster, #submissions) tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    margin-bottom: 9px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
  }
  .admin-page #workspace :is(#roster, #submissions) td { min-width: 0; padding: 0; border: 0; white-space: normal; }
  .admin-page #workspace :is(#roster, #submissions) td:first-child { grid-column: 1 / -1; }
  .admin-page #workspace :is(#roster, #submissions) td:not(:first-child, :last-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
  }
  .admin-page #workspace :is(#roster, #submissions) td:last-child { grid-column: 1 / -1; }
  .admin-page #workspace :is(#roster, #submissions) td .actions { flex-wrap: wrap; }
}

/* Feishu candidate picker */
.admin-page #dialog.directory-dialog {
  width: min(880px, calc(100% - 28px));
  max-height: calc(100% - 28px);
}
.directory-updated { margin-bottom: 13px; font-size: 13px; }
.directory-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  height: clamp(270px, 49svh, 460px);
  border: 1px solid var(--admin-border);
  border-radius: 9px;
  overflow: hidden;
}
.directory-picker h3 { color: var(--admin-navy); font-size: 15px; }
.directory-source, .directory-selection {
  min-width: 0;
  min-height: 0;
  display: grid;
  padding: 14px 14px 8px;
}
.directory-source { grid-template-rows: auto auto auto minmax(0, 1fr); }
.directory-selection {
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--admin-paper);
  border-left: 1px solid var(--admin-border);
}
.directory-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 33px;
  margin-bottom: 12px;
}
.admin-page #dialog .directory-selection-head button { min-height: 32px; padding: 4px 10px; }
.directory-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.directory-filters label { font-size: 13px; }
.directory-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--admin-border);
}
.directory-bulk > span { color: var(--muted); font-size: 12px; }
.admin-page #dialog .directory-picker :is(.check, .directory-person) { margin-top: 0; }
.directory-bulk .check { min-height: 36px; cursor: pointer; }
.directory-bulk .check:has(:disabled) { cursor: default; color: var(--muted); }
.directory-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 3px;
}
.directory-scroll .empty { font-size: 13px; }
.directory-person {
  display: grid;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--admin-border);
}
.directory-choice {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  font-weight: 400;
  cursor: pointer;
}
.directory-choice:hover { background: var(--admin-tint); }
.directory-choice:has(input:checked:not(:disabled)) { background: var(--admin-selection); }
.directory-choice:has(input:disabled) { cursor: default; }
.directory-picked { grid-template-columns: auto minmax(0, 1fr) auto; }
.directory-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8edf4;
  color: #243e5e;
  font-size: 13px;
  font-weight: 650;
}
.directory-picked .directory-avatar { background: #f6e8d5; color: #6f491c; }
.directory-person-text { display: grid; min-width: 0; }
.directory-person-text strong, .directory-person-text small { overflow-wrap: anywhere; }
.directory-person-text small { line-height: 1.4; }
.directory-assigned { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-page #dialog.directory-dialog .directory-remove {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 19px;
  font-weight: 400;
}
.admin-page #dialog.directory-dialog .directory-remove:hover { background: #eee7dc; }
.directory-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 15px;
}
@media (max-width: 640px) {
  .admin-page #dialog.directory-dialog .dialog-shell { padding: 14px; }
  .directory-picker { grid-template-columns: minmax(0, 1fr); height: auto; }
  .directory-source { height: clamp(210px, 42svh, 325px); }
  .directory-selection {
    height: clamp(112px, 21svh, 155px);
    border-left: 0;
    border-top: 1px solid var(--admin-border);
  }
  .directory-selection-head { margin-bottom: 3px; }
}

/* Administrator dropdowns */
.admin-select-field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.admin-select { min-width: 0; }
.admin-page :is(#workspace, #dialog, #grade-center) .admin-select-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  border: 1px solid #c8bcab;
  border-radius: 7px;
  background: #fff;
  color: var(--admin-ink);
  text-align: left;
}
.admin-select-trigger > span { min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.admin-select-trigger::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.admin-page :is(#workspace, #dialog, #grade-center) .admin-select-trigger.placeholder { color: #647186; font-weight: 500; }
.admin-page :is(#workspace, #dialog, #grade-center) .admin-select-trigger:hover:not(:disabled) { background: #fffcf7; border-color: #ad9d8a; }
.admin-page :is(#workspace, #dialog, #grade-center) .admin-select-trigger[aria-expanded="true"] {
  background: #fffbf3;
  border-color: #bd842f;
  box-shadow: 0 0 0 2px #bd842f25;
}
.admin-select-trigger[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(225deg); }
.admin-page :is(#workspace, #dialog, #grade-center) .admin-select-trigger[aria-invalid="true"] { border-color: #a63b24; }
.admin-select-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  align-content: start;
  gap: 2px;
  box-sizing: border-box;
  width: 200px;
  max-height: 302px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 5px;
  border: 1px solid #dfd4c5;
  border-radius: 9px;
  background: var(--admin-white);
  box-shadow: 0 10px 28px #1929412b;
}
.admin-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border-radius: 5px;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.admin-select-option[aria-selected="true"] { background: var(--admin-selection); color: var(--admin-navy); font-weight: 650; }
.admin-select-option[aria-selected="true"]::after {
  content: "";
  justify-self: center;
  width: 5px;
  height: 9px;
  border: solid #965800;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}
.admin-select-option:is(:hover, .active):not([aria-disabled="true"]) { background: #f5ead7; color: var(--admin-navy); }
.admin-select-option[aria-disabled="true"] { color: #657082; cursor: default; }

/* Personnel grade center */
.admin-main-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-inline: auto; }
#system-filters:empty, #system-pagination:empty { display: none; }
#system-pagination { align-items: center; justify-content: flex-end; margin-top: 12px; }
.log-comparison { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.log-fields { margin: 0; overflow-wrap: anywhere; }
.log-fields > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.log-fields dd { margin: 4px 0 0; }
.log-fields .log-fields { padding-left: 9px; }
.admin-page #admin-topbar .admin-main-nav button[aria-pressed="true"] { color: #fff2d8; background: #314964; border-color: #7990a7; }
.admin-page #grade-center { --admin-accent: #ffa52b; }
.grade-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 20px; }
.grade-overview > div { display: flex; flex-direction: column; gap: 4px; background: #fffdfa; border-color: #e6decd; }
.grade-overview strong { color: #122941; line-height: 1; font-size: clamp(24px, 3vw, 42px); font-variant-numeric: tabular-nums; }
.grade-overview span { color: #506278; }
.grade-surface { background: #fffdfa; border-color: #e6decd; }
.grade-surface .filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.grade-surface label { color: var(--admin-ink); }
#grade-center :is(.admin-select-trigger, #center-search, [data-action="assign-retake"]) {
  min-height: 44px;
  border-radius: 8px;
}
#center-search { border-color: #c8bcab; }
#center-search::placeholder { color: #647186; opacity: 1; }
.center-retake {
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 9px;
  background: var(--admin-tint);
  margin-bottom: 16px;
}
.center-retake-controls {
  display: grid;
  grid-template-columns: minmax(0, 26rem) auto;
  align-items: end;
  justify-content: start;
  gap: 10px;
}
#center-retake-hint { margin-top: 8px; font-size: 13px; }
.admin-page #grade-center .primary { color: #172a42; border-color: #eaa138; background: #ffb748; }
.admin-page #grade-center .primary:hover:not(:disabled) { background: #ffca6f; }
#grade-center :is(.admin-select-trigger, [data-action="assign-retake"]):disabled {
  background: #eee9e1;
  border-color: #d9cfc1;
  color: #5e6270;
  opacity: 1;
}
#center-table { border: 1px solid #ebe4d8; border-radius: 9px; }
#center-table table { min-width: 1200px; }
#center-table th { background: #f2eee6; color: #213850; }
#center-table td, #center-table th { vertical-align: middle; }
#center-table :is(td, th):nth-child(2) { position: sticky; left: 0; background: #fffdfa; min-width: 94px; box-shadow: 1px 0 #e9e1d3; }
#center-table th:nth-child(2) { background: #f2eee6; }
#center-table .center-name { padding: 0; min-height: 26px; color: #234b78; border: 0; background: none; }
#center-table small { display: block; color: #586a81; }
#center-table .center-grade small { display: inline; }
.center-grade > span { display: block; font-size: 12px; }
.center-grade.passed > span { color: #176044; }
.center-grade.failed > span { color: #a32436; font-weight: 700; }
.center-score { color: #142941; font-size: 22px; font-variant-numeric: tabular-nums; }
.center-account { max-width: 140px; }
.center-account button { margin-top: 4px; min-height: 28px; padding: 3px 7px; font-size: 12px; }
@media (max-width: 720px) {
  .grade-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-surface .filters { grid-template-columns: minmax(0, 1fr); }
  .grade-surface .filters > label:first-child { grid-column: auto; }
  .admin-main-nav { order: 3; flex-basis: 100%; }
  .admin-page .topbar-inner:has(.admin-main-nav) { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .center-retake-controls { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
}
