/* Default military theme: olive service header, clear form divisions, large touch targets. */
:root {
  --canvas: #f0f1eb;
  --paper: #ffffff;
  --ink: #272c24;
  --muted: #606656;
  --line: #d3d7ca;
  --accent: #555c48;
  --green: #e5ebdd;
  --yellow: #f0e8cf;
  --radius: 2px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

h1,
.login-page h1,
.assessment-heading h1 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
  margin: 12px 0 14px;
}

h2 { font-size: 20px; letter-spacing: -.015em; }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .075em; }
.lead { font-size: 15px; line-height: 1.65; }
.count {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 28px;
  letter-spacing: 0;
  color: var(--accent);
  border: 1px solid #a8b095;
  padding: 0 9px;
  margin: 4px 0 0 12px;
  min-width: 34px;
  text-align: center;
}

/* Service bar: the symbol is an app mark, not an official unit insignia. */
.topbar { background: var(--accent); border-bottom: 4px solid #b3b99c; color: #fff; }
.topbar-inner { min-height: 76px; }
.brand { gap: 12px; letter-spacing: .055em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #b6bda3;
  border-radius: 2px;
  background: transparent;
}
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: #f2f4e9; stroke-width: 2.5; }
.brand-name { font-size: 21px; font-weight: 700; line-height: 1.1; }
.brand-caption { display: block; margin: 5px 0 0; font-family: var(--mono); font-size: 9px; letter-spacing: .075em; color: #e2e6d8; }
.form-number { font-family: var(--mono); font-size: 11px; color: #e2e6d8; margin-left: 20px; padding-left: 20px; border-left: 1px solid #929c7d; }
.topbar .text-button { color: #fff; text-decoration-color: #c5ccb8; }
.topbar a:focus-visible, .topbar button:focus-visible { outline-color: #f0f3e6; }

.page-heading { border-left: 4px solid var(--accent); padding-left: 20px; margin-bottom: 30px; }
.heading-actions { padding-left: 20px; }
.person-surname { text-transform: uppercase; }
.assessment-heading h1 { font-size: clamp(29px, 4vw, 38px); }
.assessment-heading { padding-left: 18px; }
.assessment-page .back-link { margin-bottom: 16px; }
.person-meta { font-size: 12px; }

.button,
input:not([type=radio]),
select,
textarea,
.notice,
.import-row,
.toast { border-radius: 2px; }
.button { font-size: 14px; letter-spacing: .01em; }
.button.primary:hover:not(:disabled) { background: #424b35; }
.button.secondary { border-color: #aeb69e; }
input:not([type=radio]), select, textarea { border-color: #b5bba9; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-color: #7d8965; }
.notice { border-left: 3px solid currentColor; }
.notice.success { color: #435537; }
.login-page { padding-top: 52px; }
.login-page > .eyebrow { margin-bottom: 20px; }
.login-panel { border: 1px solid #c2c8b6; border-top: 4px solid var(--accent); border-radius: 2px; margin-top: 28px; }
.pin-input { font-family: var(--mono); }

/* Personnel list and administration read like a compact personnel register. */
.list-summary, .progress-caption, .section-progress { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.list-summary { padding: 12px 0; border-top: 2px solid var(--accent); }
.roster { background: var(--paper); border: 1px solid #c5ccb8; }
.roster:empty { display: none; }
.person-row { padding: 20px 16px; }
.person-row:last-child { border-bottom: 0; }
.person-row:hover { background: #e9eddf; }
.person-avatar { font-family: var(--mono); font-size: 14px; border-radius: 1px; border-color: #aeb69e; background: #e9eddf; color: #4c5840; }
.person-info h3 { font-weight: 700; }
.badge { border-radius: 1px; font-family: var(--mono); font-weight: 500; }
.badge.open { background: #eaede4; color: #525b45; }
.badge.submitted { background: #dfe8d2; color: #38512a; }
.badge.transferred { background: #dce2d2; color: #34482b; }
.admin-tools { border: 1px solid #c5ccb8; background: #fafbf7; margin: 28px 0 32px; }
.setup-panel { padding: 0 18px; }
.setup-panel:first-child { border-top: 0; }
.setup-panel:last-child { border-bottom: 0; }
.setup-panel > summary { font-size: 14px; }
.setup-panel[open] > summary { color: #424d35; }
.column-guide { border-left: 3px solid #8f9b77; background: #e9eddf; }
.page-footer { font-family: var(--mono); font-size: 11px; }

/* A–F section bars echo the source form while keeping the accordion touch-friendly. */
.form-progress { margin-top: 24px; }
#progress-label { font-family: var(--mono); font-weight: 600; }
progress { height: 5px; background: #dce1d2; }
progress::-webkit-progress-bar { background: #dce1d2; }
progress::-webkit-progress-value { background: #69764f; }
progress::-moz-progress-bar { background: #69764f; }
.qual-section { border: 1px solid #bcc4ad; margin: 12px 0; background: #f7f8f3; }
.qual-section > summary { padding: 14px; min-height: 62px; gap: 12px; background: #e3e7da; color: #3d4732; font-size: 16px; }
.qual-section[open] > summary { background: var(--accent); color: #fff; }
.section-letter { font-family: var(--mono); font-size: 16px; font-weight: 600; border-radius: 1px; border-color: #a9b195; background: transparent; }
.qual-section[open] > summary .section-letter { border-color: #abb596; }
.qual-section[open] > summary .section-progress,
.qual-section[open] > summary::after { color: #f1f3e9; }
.section-content { padding: 0; }
.criterion { border: 0; border-bottom: 1px solid #c5ccb8; border-radius: 0; padding: 24px; margin: 0; }
.criterion:last-child { border-bottom: 0; }
.criterion-heading { border-bottom: 1px solid #d6dbce; padding-bottom: 14px; margin-bottom: 16px; }
.criterion-heading .eyebrow { font-size: 11px; font-weight: 600; color: #5b6947; }
.statement { font-size: 14px; }
.statement.strike .statement-text { color: #656c5b; }
.mark-label { font-family: var(--mono); font-size: 10px; }
.statement.bold .mark-label, .statement.strike .mark-label { color: #435537; }
.grade-grid { gap: 8px; }
.grade-option span { font-family: var(--mono); font-size: 20px; min-height: 54px; border-color: #b6bea5; border-radius: 2px; background: #f5f7ef; }
.grade-option input:checked + span { background: #555f44; border-color: #555f44; font-weight: 700; }
.grade-option input:checked + span::after { content: "✓"; position: absolute; top: 4px; right: 6px; font-size: 10px; }
.grade-description { color: #455737; font-weight: 600; }
.text-field { padding: 22px 24px; margin: 0; background: var(--paper); }
.view-switch { gap: 0; border: 1px solid #bcc4ad; background: #e7ebdf; }
.view-switch button { flex: 1; padding: 10px 14px; border-bottom: 0; }
.view-switch button.active { background: var(--accent); color: #fff; }
.person-details { margin-bottom: 8px; }
.transfer-block { padding: 20px 0; }
.transfer-block > h2 { border-left: 4px solid var(--accent); padding: 10px 14px; background: #e3e7da; }
.transfer-grade { border-radius: 1px; font-family: var(--mono); font-size: 14px; border-left: 3px solid #78865e; }

/* Opaque action bar keeps saved state legible over long forms. */
.save-dock { background: #f4f5ef; border-top: 2px solid #a6b08e; }
.save-info { color: #515e40; }
.save-dot { border-radius: 1px; background: #64764a; }
dialog { border-radius: 3px; border: 1px solid #929e7b; border-top: 4px solid var(--accent); }
.mark-choice.active { background: #e5ebd9; border-color: #77885b; }

/* Guided entry: grade first, supporting statements on demand. */
.form-guide { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.form-guide .text-button { font-size: 11px; text-align: right; }
.statement-disclosure { margin-top: 20px; border-top: 1px solid var(--line); }
.statements-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 0; background: transparent; padding: 12px 0; font-size: 13px; text-align: left; }
.statements-count { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.statements-count.has-marks { color: #435537; font-weight: 700; }
.disclosure-symbol { font-size: 20px; }
.statement-disclosure .statements { margin: 0; }
.statement-disclosure .statement-hint { margin-top: 4px; }
.autosave-caption { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.step-navigation { display: flex; align-items: center; gap: 6px; }
.step-navigation #previous-point { min-width: 44px; }
.save-dock-inner { flex-wrap: wrap; }
.save-info { flex: 1; min-width: 180px; }
.criterion h2:focus, .text-field > label:focus { outline: none; }
.notice .text-button { text-align: left; }

.review-intro { margin: 24px 0; }
.review-intro h2 { font-size: 28px; scroll-margin-top: 90px; }
.review-intro p { line-height: 1.6; }
.review-metadata { overflow-wrap: anywhere; padding: 12px 16px; background: #edf0e7; font-size: 13px; line-height: 1.7; }
.review-metadata p { white-space: pre-wrap; }
.review-metadata summary { min-height: 44px; align-content: center; cursor: pointer; }
.review-grade-list { margin: 20px 0; border-top: 2px solid #697853; }
.review-grade-link { width: 100%; display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 10px 12px; min-height: 48px; background: var(--paper); border: 0; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; line-height: 1.5; }
.review-grade-link strong { flex: none; color: #435537; font-size: 17px; }
.review-section { margin: 24px 0; border: 1px solid var(--line); background: var(--paper); }
.review-section > h2 { padding: 16px; margin: 0; background: #e5e9de; font-size: 17px; }
.review-row { padding: 16px; border-top: 1px solid var(--line); }
.review-heading { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.review-heading h3 { font-size: 16px; margin: 10px 0; }
.review-edit { flex: none; min-height: 44px; }
.review-grade { font-weight: 700; color: #435537; margin: 4px 0 14px; }
.review-grade.missing { color: var(--error); }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; margin: 6px 0 0; }
.review-statement { font-size: 13px; line-height: 1.6; margin: 5px 0; overflow-wrap: anywhere; }
.review-row > .eyebrow { display: block; margin-top: 16px; }
#review-actions { flex-wrap: wrap; }
.submission-success p { margin: 8px 0 16px; }
.submission-success .next-person-name { margin: 8px 0 0; font-size: 13px; }

/* Word selection uses individual touch targets, not fragile native text handles. */
.word-editor { max-height: calc(90dvh - 8px); overflow-y: auto; overscroll-behavior: contain; }
.word-editor .word-help { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.word-selection-tools { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.word-selection-tools .text-button { font-size: 12px; padding: 8px 0; }
#word-tokens { display: flex; flex-wrap: wrap; gap: 7px; }
.word-token { position: relative; min-width: 44px; min-height: 46px; padding: 9px 12px; border: 2px solid #c7cebd; border-radius: 3px; background: #fafbf7; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; max-width: 100%; }
.word-token.bold { font-weight: 700; }
.word-token.strike { text-decoration: line-through; text-decoration-thickness: 2px; }
.word-token.selected { border-color: #526a38; background: #e2ead6; }
.word-token.selected::after { content: "✓"; position: absolute; top: 0; right: 3px; font-size: 10px; color: #344a24; text-decoration: none; }
.word-token:focus-visible { outline-offset: 2px; }
.word-editor .word-selection-info { min-height: 36px; margin: 12px 0 16px; color: #435537; font-size: 12px; line-height: 1.5; }
.word-preview { border-left: 3px solid #96a580; background: #f0f3e9; padding: 12px 14px; }
.word-preview .eyebrow { font-size: 10px; margin-bottom: 6px; }
.word-preview p { font-size: 14px; line-height: 1.7; color: var(--ink); margin: 0; }
.word-editor-actions { position: sticky; bottom: -28px; background: var(--paper); padding: 12px 0 28px; margin-bottom: -28px; }
.word-editor-actions .mark-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0 0 8px; }
.word-editor-actions .mark-choice { padding: 10px 6px; font-size: 13px; min-height: 46px; }
.word-save-row { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0 0 8px; }
#word-save-status { font-size: 11px; color: #435537; flex: 1; }
#word-save-status.save-error { color: var(--error); }
.word-save-row .text-button { font-size: 11px; color: var(--error); }
.transfer-statement .word-copy-hint { font-size: 12px; line-height: 1.7; color: var(--ink); background: #edf1e5; padding: 8px 10px; margin-top: 8px; }

@media (max-width: 640px) {
  .topbar-inner { min-height: 68px; padding: 12px 16px; }
  .brand { gap: 10px; }
  .brand-mark { width: 34px; height: 36px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .brand-name { font-size: 20px; }
  .brand-caption { display: block; font-size: 8px; letter-spacing: .04em; }
  .form-number { display: none; }
  .page-heading { padding-left: 14px; margin-bottom: 24px; }
  h1 { font-size: 32px; }
  .count { font-size: 12px; margin-top: 1px; line-height: 26px; }
  .login-page h1 { font-size: 36px; }
  .login-page { padding-top: 34px; }
  .assessment-heading { padding-left: 12px; margin-bottom: 16px; }
  .assessment-heading h1 { font-size: 28px; margin: 8px 0 10px; }
  .assessment-page .back-link { margin-bottom: 8px; }
  .assessment-page .form-progress { margin: 16px 0 8px; }
  .person-meta { gap: 9px; }
  .person-row { gap: 10px; padding: 18px 10px; grid-template-columns: 34px minmax(0, 1fr) auto; }
  .person-avatar { width: 34px; height: 40px; font-size: 12px; }
  .person-info h3 { font-size: 14px; }
  .person-info p { font-size: 11px; }
  .person-status .badge { font-size: 9px; }
  .progress-caption { font-size: 10px; }
  .list-summary { font-size: 10px; }
  .setup-panel { padding: 0 12px; }
  .setup-panel > summary { gap: 8px; }
  .setup-panel summary .muted { font-size: 10px; }
  .qual-section > summary { padding: 12px 10px; gap: 9px; font-size: 14px; line-height: 1.4; }
  .section-letter { width: 26px; height: 28px; font-size: 15px; }
  .section-progress { font-size: 10px; }
  .criterion { padding: 20px 14px; }
  .criterion h2 { font-size: 19px; }
  .criterion-heading { padding-bottom: 10px; margin-bottom: 12px; }
  .statement { font-size: 14px; gap: 8px; }
  .mark-label { min-width: 45px; max-width: 65px; font-size: 9px; }
  .grade-option span { min-height: 54px; }
  .text-field { padding: 20px 14px; }
  .view-switch button { font-size: 12px; padding: 10px; }
  .save-dock-inner { padding: 12px 16px; }
  .save-dock-inner .save-info { flex: 1 1 65%; }
  .save-dock-inner .step-navigation { flex: 1 1 auto; }
  .step-navigation #next-point { flex: 1; }
  .form-guide { display: flex; margin-bottom: 4px; }
  .form-guide > span { display: none; }
  .form-guide .text-button { display: block; padding: 0; text-align: left; }
  .word-editor { padding: 22px 18px; }
  .word-editor-actions { bottom: -22px; padding-bottom: 22px; margin-bottom: -22px; }
  .word-selection-tools { gap: 2px 10px; }
  .word-selection-tools .text-button { font-size: 11px; }
  .word-token { font-size: 14px; padding: 9px 10px; }
}
