:root {
  --navy: #16365f;
  --navy-dark: #0b2545;
  --blue: #005ea8;
  --blue-light: #e7f4ff;
  --ink: #1b1b1b;
  --muted: #565c65;
  --border: #a9aeb1;
  --surface: #f7f9fb;
  --white: #fff;
  --success: #2e8540;
  --success-bg: #ecf7ed;
  --warning: #8b6100;
  --warning-bg: #fff6d7;
  --error: #b50909;
  --error-bg: #fdf0f0;
  --focus: #ffbe2e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
}

* { box-sizing: border-box; }

body { margin: 0; line-height: 1.55; }

button, input, select { font: inherit; }

button, input[type="file"] { min-height: 42px; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--white);
  color: var(--navy-dark);
}

.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  color: var(--white);
  background: var(--navy-dark);
  border-bottom: 6px solid var(--blue);
}

.header-inner {
  max-width: 1280px;
  margin: auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 .2rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-title { margin: 0; font-size: 1.2rem; font-weight: 750; }
.site-title a { color: inherit; text-decoration: none; }

.decision-support {
  padding: .35rem .65rem;
  border: 1px solid #8fb8de;
  border-radius: .25rem;
  font-size: .85rem;
  white-space: nowrap;
}

.mock-banner {
  padding: .65rem 1rem;
  text-align: center;
  font-weight: 700;
  color: #3d2c00;
  background: var(--warning-bg);
  border-bottom: 1px solid #e6c74c;
}

.page-shell { max-width: 1280px; margin: auto; padding: 1.75rem 1.25rem 3rem; }

.intro { max-width: 760px; }

.intro h1 { margin: .2rem 0 .55rem; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; color: var(--navy-dark); }
.intro p:last-child { color: var(--muted); font-size: 1rem; }

.advisory, .batch-advisory {
  margin: 1.25rem 0 0;
  padding: .9rem 1rem;
  color: #3d2c00;
  background: var(--warning-bg);
  border-left: 6px solid #e5a000;
}

.batch-advisory { margin-bottom: 1.25rem; color: var(--muted); }

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0 1.25rem;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem .85rem;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: .3rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.mode-button.active { color: var(--white); background: var(--navy); }

.review-form { display: grid; gap: 1.25rem; }

.form-card, .result-region, .batch-progress {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--white);
  border: 1px solid #dfe1e2;
  border-radius: .4rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 7%);
}

.step-heading { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.step-heading h2, .step-heading p { margin: 0; }
.step-heading p { color: var(--muted); }

.step-number {
  flex: 0 0 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--navy);
  border-radius: 50%;
  font-weight: 800;
}

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field-grid .field { margin: 0; }
.full-width { grid-column: 1 / -1; }

label { font-weight: 750; }
.optional, .hint { color: var(--muted); font-weight: 400; font-size: .9rem; }

input:not([type="file"]), select {
  width: 100%;
  padding: .65rem .75rem;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #71767a;
  border-radius: .2rem;
}

.capacity-input { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: .65rem; }

.upload-area {
  padding: 1rem;
  background: var(--blue-light);
  border: 2px dashed var(--blue);
  border-radius: .35rem;
}

.upload-area label { display: block; margin-bottom: .55rem; }
.hint { margin: .5rem 0 0; }
.file-list { margin: .7rem 0 0; }

.primary-button, .secondary-button {
  padding: .65rem 1rem;
  border-radius: .25rem;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  justify-self: start;
  color: var(--white);
  background: var(--blue);
  border: 2px solid var(--blue);
}
.mode-card .primary-button { display: inline-flex; align-items: center; text-decoration: none; }

.primary-button:hover { background: #1a4480; border-color: #1a4480; }
.primary-button:disabled { opacity: .65; cursor: wait; }

.secondary-button {
  color: var(--blue);
  background: var(--white);
  border: 2px solid var(--blue);
}

.alert { padding: 1rem; border-left: 6px solid; }
.alert.error { color: #6f0d0d; background: var(--error-bg); border-color: var(--error); }
.hidden { display: none !important; }

.result-region { margin-top: 1.5rem; }
.result-header { padding: 1.2rem; border-left: 8px solid; }
.result-header h2, .result-header p { margin: 0; }
.result-header.match { background: var(--success-bg); border-color: var(--success); }
.result-header.attention { background: var(--error-bg); border-color: var(--error); }
.result-header.unable { background: var(--warning-bg); border-color: #e5a000; }

.result-meta { margin-top: .5rem !important; color: var(--muted); font-size: .88rem; }
.result-disclaimer { margin: 1.1rem 0 0; }
.check-list { display: grid; gap: .8rem; margin-top: 1.25rem; }
.check-card { padding: 1rem; border: 1px solid #dfe1e2; border-left-width: 6px; }
.check-card.match { border-left-color: var(--success); }
.check-card.review { border-left-color: #e5a000; }
.check-card.mismatch { border-left-color: var(--error); }
.check-card h3, .check-card p { margin: 0; }
.check-card dl { display: grid; grid-template-columns: 7rem 1fr; gap: .35rem .75rem; margin: .7rem 0 0; }
.check-card dt { font-weight: 750; }
.check-card dd { margin: 0; overflow-wrap: anywhere; }
.status-label { font-weight: 800; }
.match .status-label { color: var(--success); }
.review .status-label { color: var(--warning); }
.mismatch .status-label { color: var(--error); }
.check-guidance {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
}
.check-guidance p { margin: 0; }
.guidance-kicker { color: var(--navy); font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.guidance-summary { margin-top: .4rem !important; color: var(--muted); font-size: .92rem; }
.override-control { margin-top: 1.25rem; padding: 1rem; background: #f1f8fe; border: 1px solid #8fb8de; }
.override-control .secondary-button { width: auto; }
.override-control p { margin: 0; }
.override-note { margin-top: .55rem !important; color: var(--muted); font-size: .9rem; }
.override-confirmation { margin-bottom: .55rem !important; color: #1a4480; font-weight: 750; }
.override-control.compact { min-width: 12rem; margin: 0; padding: .65rem; }
.override-control.compact .override-button { width: 100%; padding: .55rem .65rem; font-size: .9rem; }
.override-control.compact .override-confirmation { font-size: .88rem; }
.print-individual { margin-top: 1.25rem; }

.text-link { color: var(--blue); font-weight: 750; }
.mode-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 13rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid #dfe1e2;
  border-top: 5px solid var(--navy);
  border-radius: .4rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 7%);
}
.mode-card h2, .mode-card p { margin: 0; }
.mode-card h2 { color: var(--navy-dark); font-size: 1.2rem; }
.mode-card p { margin-top: .6rem; color: var(--muted); }
.mode-card .primary-button { margin-top: auto; }
.batch-progress { margin-top: 1.5rem; }
.progress-copy h2, .progress-copy p { margin: 0; }
progress { width: 100%; height: 1rem; margin-top: 1rem; accent-color: var(--blue); }
.batch-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.batch-completion { margin-top: 1.5rem; padding: 1rem; background: #f1f8fe; border: 1px solid #8fb8de; }
.batch-completion h3, .batch-completion p { margin: 0; }
.batch-completion .secondary-button { display: inline-block; width: auto; margin-top: .85rem; text-decoration: none; }
.batch-retry { margin-top: .8rem; }
.batch-retry .secondary-button { width: auto; padding: .5rem .7rem; font-size: .9rem; }
.batch-retry-message { margin: .5rem 0 0; color: var(--error); font-size: .9rem; }
.table-scroll { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: fixed; }
th, td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--white); background: var(--navy); }
th:nth-child(1) { width: 11%; }
th:nth-child(2) { width: 14%; }
th:nth-child(3) { width: 44%; }
th:nth-child(4) { width: 23%; }
th:nth-child(5) { width: 8%; }
.issue-list { margin: 0; padding-left: 1.15rem; }
.issue-list li + li { margin-top: .45rem; }
.no-issues { margin: 0; color: var(--muted); }

footer { padding: 1.5rem; text-align: center; color: var(--muted); border-top: 1px solid #dfe1e2; }

@media (max-width: 700px) {
  :root { font-size: 16px; }
  .header-inner, .batch-result-heading { align-items: flex-start; flex-direction: column; }
  .field-grid, .mode-switcher, .mode-overview { grid-template-columns: 1fr; }
  .capacity-input { grid-template-columns: 1fr; }
  .check-card dl { grid-template-columns: 1fr; }
  .check-card dd { margin-bottom: .45rem; }
}

@media print {
  @page { margin: .45in; }
  :root { font-size: 11px; background: var(--white); }
  body { background: var(--white); }
  .site-header, .mock-banner, .intro, .mode-switcher, .mode-overview,
  #individual-form, #screen-form, #screen-progress, #compare-panel > .form-card, #compare-progress,
  #print-screen-results, #print-compare-results, footer,
  .print-individual,
  .batch-completion .secondary-button, .batch-retry {
    display: none !important;
  }
  .page-shell { max-width: none; padding: 0; }
  #individual-result, #screen-results, #compare-results { display: block !important; }
  .result-region { margin: 0; padding: 0; border: 0; box-shadow: none; }
  .batch-result-heading { display: block; }
  .batch-advisory { margin-top: .5rem; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; table-layout: auto; }
  th, td { padding: .4rem; overflow-wrap: break-word; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .batch-completion { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
