/* Product surface: compact exam work, clear actions, restrained state color. */
:root {
  --ink: #1c2936;
  --muted: #667584;
  --line: #d9e0e6;
  --surface: #fff;
  --canvas: #f7f8f9;
  --accent: #176b64;
  --accent-dark: #10574f;
  font-size: 14px;
}
body { color: var(--ink); background: var(--canvas); }
.sidebar { width: 214px; padding: 22px 10px 16px; background: #15252f; }
.brand { gap: 10px; padding: 0 10px 25px; font-size: 15px; letter-spacing: -.25px; }
.brand b { color: #fff; }
.brand small { margin-top: 4px; color: #a6bac3; font-size: 9px; letter-spacing: .75px; }
.brand-icon { width: 32px; height: 32px; border-radius: 6px; background: #19776e; font-size: 18px; }
.sidebar-label { margin: 0 12px 5px; color: #8499a4; font-size: 9px; letter-spacing: 1px; }
.sidebar nav { gap: 1px; }
.sidebar nav button { min-height: 38px; gap: 10px; padding: 8px 11px; border-radius: 5px; font-size: 12px; font-weight: 600; color: #c3d1d8; }
.sidebar nav button:hover { background: #ffffff12; color: #fff; }
.sidebar nav button.active { background: #ffffff17; box-shadow: inset 2px 0 #5fc4b2; color: #fff; }
.nav-icon { width: 17px; height: 17px; flex-basis: 17px; }
.sidebar-bottom { padding: 13px 10px 0; border-color: #354852; color: #a9bdc6; font-size: 11px; font-weight: 500; }
.pulse { width: 6px; height: 6px; margin-right: 5px; box-shadow: none; }
.main-wrap { margin-left: 214px; }
.topbar { height: 54px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); }
#breadcrumb { font-size: 12px; font-weight: 700; }
.top-exam-name { font-size: 12px; color: #697988; }
.top-right { gap: 12px; }
.local-badge { padding: 0; background: none; color: #5c706f; font-size: 11px; font-weight: 600; }
.avatar { width: 27px; height: 27px; background: #e6f2ef; color: #176b64; font-size: 10px; }
main { max-width: 1400px; padding: 24px 30px 70px; }
.heading { margin-bottom: 16px; gap: 16px; }
.heading h1 { margin-bottom: 3px; font-size: clamp(23px, 2vw, 27px); line-height: 1.22; letter-spacing: -.55px; }
.page h1[tabindex="-1"]:focus { outline: none; }
.heading p { font-size: 12px; line-height: 1.45; }
.eyebrow { margin-bottom: 4px; color: #6b7c86; font-size: 10px; letter-spacing: .85px; }
h2 { color: var(--ink); letter-spacing: -.2px; }
.panel, .step, .action-panel, .metrics article { border: 1px solid var(--line); border-radius: 7px; box-shadow: none; }
.panel { padding: 17px 19px; margin-bottom: 14px; }
.panel-head { margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; }
.panel-head p, .step p, .action-panel p { font-size: 12px; line-height: 1.4; }
.primary, .secondary, .subtle { min-height: 36px; padding: 7px 12px; border-radius: 5px; font-size: 12px; font-weight: 700; box-shadow: none; }
.primary { background: var(--accent); border-color: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary { color: #245e60; border-color: #bbcbd0; }
.secondary:hover { background: #eef6f4; border-color: #7fa9a4; }
.subtle { border-color: transparent; background: transparent; }
.text-link { color: #176b64; font-size: 12px; }
button:disabled { opacity: .48; }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 2px solid #288d80; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: #288d80; box-shadow: 0 0 0 2px #288d8024; }
.select-exam { gap: 3px; color: #637380; font-size: 10px; letter-spacing: .65px; }
.select-exam select, input[type=search], dialog input, dialog select, .result-toolbar select { border-color: #cbd5da; border-radius: 5px; color: var(--ink); }
.select-exam select { min-height: 36px; padding: 7px 10px; }
.exam-switch { margin: -2px 0 14px; }
.exam-switch .new-exam { min-height: 36px; }

/* Dashboard: next task and exam list are the primary content. */
#dashboard .heading .eyebrow { display: none; }
#dashboard .guide { padding: 16px 18px; margin-bottom: 11px; border-left: 3px solid var(--accent); background: #fff; }
#dashboard .guide-intro { align-items: center; }
#dashboard .guide-intro .eyebrow { display: block; }
#dashboard .guide-intro h2 { margin: 2px 0; font-size: 17px; }
#dashboard .guide-intro p { font-size: 12px; }
#dashboard .guide-steps { display: flex; gap: 0; margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
#dashboard .guide-step { flex: none; min-height: 30px; padding: 3px 10px 3px 0; border: 0; background: none; border-radius: 0; font-size: 11px; }
#dashboard .guide-step:not(:last-child)::after { content: '›'; margin-left: 14px; color: #aab6bc; }
#dashboard .guide-step span { width: 18px; height: 18px; border-radius: 50%; background: #e8edee; color: #61717a; font-size: 10px; }
#dashboard .guide-step.done span { background: #e0f3ed; color: #176b64; }
#dashboard .metrics { display: flex; gap: 0; margin: 0 0 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
#dashboard .metrics article { flex: 1; min-height: 66px; padding: 10px 16px; border: 0; border-radius: 0; background: transparent; }
#dashboard .metrics article + article { border-left: 1px solid var(--line); }
#dashboard .metrics span { font-size: 11px; font-weight: 500; }
#dashboard .metrics strong, #dashboard .metrics article:last-child strong { margin: 3px 0 0; font-size: 17px; line-height: 1.2; letter-spacing: -.3px; }
#dashboard .metrics small { margin-top: 2px; font-size: 10px; }
#dashboard .grid-two > .panel { padding: 0; }
#dashboard .grid-two .panel-head { padding: 16px 18px 0; }
#dashboard .grid-two .panel-head p { display: none; }
#dashboard .list-toolbar { margin: 10px 18px; }
#dashboard .exam-list { gap: 0; }
#dashboard .exam-row { min-height: 50px; padding: 8px 18px; border: 0; border-top: 1px solid #edf0f1; border-radius: 0; }
#dashboard .exam-row:hover { background: #f3f8f6; }
#dashboard .exam-mark { width: 29px; height: 29px; border-radius: 4px; background: #e4efed; color: #176b64; font-size: 12px; }
#dashboard .exam-row b { font-size: 12px; }
#dashboard .exam-row small { font-size: 11px; color: #71808b; }

/* Data entry, scanning and results. */
#students.page.active { gap: 13px; }
#students .panel-head p { max-width: 500px; }
#students.has-roster .roster-table-panel, #students.has-roster .roster-input-panel { grid-column: 1 / -1; }
#students.has-roster .roster-input-panel { order: 1; }
#students.has-roster .inline-entry { border-top: 1px solid var(--line); padding-top: 10px; }
#students.has-roster .inline-entry > summary { display: list-item; color: #176b64; font-size: 12px; font-weight: 700; cursor: pointer; }
#students.has-roster .inline-entry[open] > summary { margin-bottom: 10px; }
#students.has-roster .inline-entry:not([open]) + .optional-import { margin-top: 10px; }
#students .roster-input-panel > #remove-students { display: block; margin-top: 14px; padding-left: 0; border-top: 1px solid var(--line); border-radius: 0; }
#students .optional-import { margin-top: 14px; padding-top: 12px; }
#roster-paste { min-height: 145px; }
.dropzone { min-height: 110px; padding: 14px; border-color: #adbec3; border-radius: 5px; background: #fafcfc; }
.dropzone.compact { min-height: 104px; padding: 14px; }
.dropzone:hover, .dropzone.dragging { border-color: #368c7f; background: #f1f8f6; }
.upload-icon svg { width: 22px; height: 22px; color: #537e7b; }
.dropzone b { font-size: 12px; }
.dropzone span { font-size: 11px; }
.dropzone .secondary { margin-top: 1px; }
.upload-grid { gap: 12px; }
.upload-grid .panel { padding: 15px; }
.readiness-strip { padding: 9px 12px; border-radius: 5px; }
.action-panel { margin: 13px 0; padding: 15px 17px; background: #eef6f3; border-color: #bed7d0; }
.action-panel h2 { font-size: 15px; }
.action-panel > div { flex-basis: 270px; }
.retention-note { color: #5d726f; font-size: 11px; }
#mode-warning:not(:empty) { padding: 10px 13px; margin: 0 0 13px; border-radius: 5px; font-size: 12px; }
.scan-manifest { margin-top: 10px; }
.scan-row { padding: 7px 0; }
.key-group-tabs button, .key-choice, .written-item { border-radius: 5px; }
.key-group-tabs button { min-height: 39px; border-color: var(--line); background: #f7f9f9; color: #465c68; }
.key-group-tabs button small { color: #687b84; }
.key-choice { border-color: var(--line); }
.key-choice button { border-color: #d5dee1; background: #fff; color: #435965; }
.key-choice button:hover { border-color: #5a9b91; background: #f2f8f5; }
.key-group-tabs button[aria-pressed="true"], .key-choice button[aria-pressed="true"] { border-color: var(--accent); background: #e7f3ef; color: #175d55; }
.written-panel details > summary { color: #315954; }
.key-choice-grid { gap: 6px; }
.key-choice { padding: 6px; }
.result-toolbar { margin-bottom: 11px; }
.result-summary { gap: 0; margin: 0 0 11px; border-bottom: 1px solid var(--line); }
.result-summary span { padding: 5px 14px 8px 0; border: 0; border-radius: 0; background: none; color: #475b68; font-size: 12px; }
.result-data-panel { padding: 13px 17px; }
.table-scroll { max-width: 100%; }
table { font-variant-numeric: tabular-nums; }
th { padding: 9px 10px; background: #f4f6f6; color: #657782; font-size: 10px; letter-spacing: .4px; }
td { padding: 9px 10px; color: #3d515d; font-size: 12px; }
tbody tr:hover { background: #f5faf8; }
.table-scroll thead { position: sticky; top: 0; z-index: 1; }
.pill { border-radius: 4px; padding: 3px 6px; font-size: 10px; }
.pill.ok { background: #e3f2e9; color: #246b4d; }
.pill.bad { background: #faeae7; color: #9a4f40; }
.result-empty { padding: 24px; }
.empty-icon { display: none; }
.result-empty h2 { font-size: 17px; }
.detail-card { box-shadow: -8px 0 35px #142a3240; }
.detail-metrics div { padding: 12px; border-radius: 5px; }
.answer { border-radius: 3px; }

/* Titles: sequential work, without three competing cards. */
#titles .workflow { max-width: 930px; display: block; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
#titles .step { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 12px; padding: 16px 18px; margin: 0; border: 0; border-radius: 0; background: transparent; }
#titles .step + .step { border-top: 1px solid var(--line); }
#titles .step > span { width: 22px; height: 22px; border-radius: 50%; background: #e8f2ef; color: #176b64; font-size: 11px; }
#titles .step h2 { font-size: 14px; }
#titles .step p { margin: 0 0 5px; }
#titles .step .muted { font-size: 11px; }
#titles .skip-titles { margin: 0 0 12px; }
.question-bank-panel { max-width: 930px; }
.question-bank-panel .panel-head { margin-bottom: 9px; }
.question-bank-panel > .muted { margin: 7px 0 0; font-size: 11px; }

/* DTM banks use dense status rows; the inputs and downloads stay in place. */
#dtm-bank-panel { max-width: 1080px; }
.dtm-config { margin-bottom: 12px; }
.dtm-config .panel-head { margin-bottom: 10px; }
.dtm-format { padding: 8px 11px; margin-bottom: 13px; border-radius: 5px; background: #f7f9f9; }
.dtm-format summary { color: #176b64; font-size: 12px; }
.dtm-main-names { gap: 9px; }
.dtm-main-names label { gap: 4px; font-size: 11px; }
.dtm-main-names input { min-height: 36px; padding: 7px 9px; border: 1px solid #cbd5da; border-radius: 5px; }
.dtm-bank-group { margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.dtm-group-heading { display: flex; align-items: baseline; gap: 12px; padding: 11px 15px; background: #f4f6f6; border-bottom: 1px solid var(--line); }
.dtm-group-heading h2 { margin: 0; font-size: 13px; }
.dtm-group-heading span { color: #72818b; font-size: 11px; }
.dtm-bank-list { display: block; }
.dtm-bank-row { display: grid; grid-template-columns: minmax(130px,1.3fr) 110px 88px auto; gap: 12px; align-items: center; min-height: 54px; padding: 8px 15px; }
.dtm-bank-row + .dtm-bank-row { border-top: 1px solid #edf0f1; }
.dtm-bank-name { min-width: 0; }
.dtm-bank-name strong { display: block; font-size: 12px; }
.dtm-bank-name small { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7b8991; font-size: 10px; }
.dtm-bank-count { color: #526774; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtm-bank-status { color: #8b5a43; font-size: 11px; font-weight: 650; }
.dtm-bank-status.ready { color: #1e745a; }
.dtm-bank-actions { display: flex; justify-content: flex-end; align-items: center; gap: 11px; white-space: nowrap; }
.dtm-bank-actions label { cursor: pointer; }
.dtm-bank-preview { grid-column: 1 / -1; }
.dtm-bank-preview:empty { display: none; }
.dtm-bank-preview h4 { margin: 8px 0; }
.dtm-bank-preview details { padding: 9px 0; border-top: 1px solid var(--line); }
.dtm-bank-preview summary { cursor: pointer; }
.dtm-generate .inline-actions { justify-content: flex-start; gap: 12px; }
.dtm-generate label { font-size: 11px; }
#dtm-book-count { width: 105px; min-height: 36px; padding: 7px 9px; border: 1px solid #cbd5da; border-radius: 5px; }
#dtm-next-book { font-size: 11px; }
.dtm-generations { margin-top: 14px; gap: 0; }
.dtm-generations h3 { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.dtm-generation { padding: 9px 0; border: 0; border-top: 1px solid #edf0f1; border-radius: 0; }
.dtm-generation .bank-actions { margin: 0; gap: 6px; }
.dtm-more-downloads { position: relative; font-size: 11px; color: #176b64; }
.dtm-more-downloads summary { cursor: pointer; padding: 7px; }
.dtm-more-downloads[open] { display: flex; gap: 10px; align-items: center; }

/* Directory and dialogs: denser lists, stable alignment, quiet secondary tools. */
.directory-layout { gap: 12px; margin-bottom: 0; }
.directory-layout .panel { margin-bottom: 12px; }
.directory-group { padding: 6px 9px; border-radius: 4px; background: #f5f8f7; border-color: var(--line); }
.directory-selection-bar { padding: 8px 10px; border-radius: 5px; background: #f0f7f4; border-color: #c7ded6; }
.directory-bulk { padding: 9px 0; }
.directory-trash { border-radius: 5px; }
dialog { border: 1px solid #cbd5da; border-radius: 8px; box-shadow: 0 20px 55px #11263245; }
dialog::backdrop { background: #0b1d28a8; }
.exam-dialog form { padding: 22px; }
.exam-dialog .dialog-head h2 { font-size: 20px; }
.exam-dialog-intro { margin: 4px 0 16px; font-size: 12px; }
.exam-type-picker { gap: 7px; }
.exam-type-picker button { grid-template-columns: 1fr; gap: 2px; min-height: 63px; padding: 10px 12px; border-radius: 5px; }
.exam-type-icon { display: none; }
.exam-type-picker button[aria-pressed="true"], .subject-picker button[aria-pressed="true"] { border-color: #368b7e; background: #e8f4f0; box-shadow: none; color: #145e54; }
.exam-type-picker button:hover, .subject-picker button:hover { border-color: #67a99b; background: #f4faf7; }
.exam-choice-section { margin-top: 15px; }
.subject-picker { gap: 5px; }
.subject-picker button { min-height: 36px; border-radius: 4px; }
.exam-dialog #exam-mode-help { padding: 8px 10px; border-radius: 4px; background: #f4f7f6; }
.exam-dialog .custom-fields { margin-top: 14px; }
.exam-name-field { margin-top: 14px; }
.dialog-actions { margin-top: 16px; }

@media (max-width: 1000px) {
  .dtm-bank-row { grid-template-columns: minmax(110px,1fr) 105px 78px auto; gap: 7px; }
  .dtm-generation { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .sidebar { width: min(82vw, 285px); }
  #menu-backdrop { left: min(82vw, 285px); }
  .main-wrap { margin-left: 0; }
  .topbar { padding: 0 14px; }
  main { padding: 17px 13px 55px; }
  .heading { gap: 8px; }
  .heading h1 { font-size: 23px; }
  .heading .primary { align-self: stretch; }
  .panel { padding: 14px; }
  .exam-switch { grid-template-columns: minmax(0,1fr) auto; }
  #dashboard .guide-intro { align-items: flex-start; }
  #dashboard .guide-steps { overflow-x: auto; flex-wrap: nowrap; }
  #dashboard .guide-step { white-space: nowrap; }
  #dashboard .metrics { display: grid; grid-template-columns: 1fr 1fr; }
  #dashboard .metrics article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  #dashboard .metrics article:nth-child(4) { border-top: 1px solid var(--line); }
  #dashboard .metrics article { min-height: 61px; padding: 9px 12px; }
  #dashboard .metrics strong, #dashboard .metrics article:last-child strong { font-size: 15px; }
  .dtm-main-names { grid-template-columns: 1fr; }
  .dtm-bank-row { grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; padding: 11px 13px; }
  .dtm-bank-name { grid-column: 1; }
  .dtm-bank-count { grid-column: 1; grid-row: 2; }
  .dtm-bank-status { grid-column: 2; grid-row: 1; text-align: right; }
  .dtm-bank-actions { grid-column: 2; grid-row: 2; }
  .dtm-bank-actions label { padding: 5px 8px; min-height: 32px; }
  .dtm-bank-preview { grid-row: 3; }
  .dtm-generation .bank-actions { flex-wrap: wrap; }
  #titles .workflow { border-radius: 5px; }
  #titles .step { padding: 13px; }
  #students tbody tr, #results > .panel:not(#item-analysis) tbody tr { border-radius: 5px; }
  .result-summary { display: flex; }
  .exam-type-picker button { min-height: 58px; }
}
@media (max-width: 390px) {
  .exam-switch { grid-template-columns: 1fr; }
  .dtm-bank-row { grid-template-columns: 1fr; }
  .dtm-bank-name, .dtm-bank-count, .dtm-bank-status, .dtm-bank-actions { grid-column: 1; grid-row: auto; text-align: left; justify-content: flex-start; }
  .dtm-bank-preview { grid-row: auto; }
}
