:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233b;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #315fe8;
  --blue-dark: #2048bd;
  --muted: #63718a;
  --border: #dce4ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

.topbar {
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - 760px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand { color: var(--blue-dark); font-size: 1.2rem; font-weight: 750; text-decoration: none; }
.page-links { display: flex; gap: 16px; margin-left: auto; margin-right: 20px; }
.page-links a { color: #42516a; font-size: .92rem; text-decoration: none; }
.page-links a:hover { color: var(--blue-dark); }
.page-shell { width: min(100% - 32px, 760px); margin: 36px auto 72px; }
.intro { margin: 0 4px 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 5vw, 2.2rem); line-height: 1.15; }
h2 { margin-bottom: 18px; font-size: 1.25rem; }
h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.muted, .help-text { color: var(--muted); line-height: 1.55; }
.card { padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 12px 32px rgb(31 57 102 / 5%); }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { font-weight: 650; }
input[type="file"], input[type="password"], select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #bdc9db; border-radius: 12px; background: #fff; color: inherit; font: inherit; }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { min-height: 30px; margin-right: 10px; padding: 4px 10px; border: 0; border-radius: 8px; background: #eaf0ff; color: var(--blue-dark); font-weight: 650; }
.help-text { margin: -4px 0 4px; font-size: .92rem; }
.preflight { min-height: 48px; padding: 12px 14px; border: 1px dashed #b9c8dc; border-radius: 12px; background: #f8faff; color: #34435c; }
.preflight p { margin: 0; line-height: 1.5; }
.preflight p + p { margin-top: 4px; font-weight: 700; }
.cost-warning { padding: 14px; border: 1px solid #f1bf67; border-radius: 14px; background: #fff9ed; color: #62430f; line-height: 1.5; }
.cost-warning p { margin: 4px 0 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; line-height: 1.45; }
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: var(--blue); }
button { min-height: 46px; padding: 10px 16px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9bb5ff; outline-offset: 2px; }
.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover:not(:disabled) { background: var(--blue-dark); }
button:disabled { opacity: .48; cursor: not-allowed; }
.quiet-button { color: var(--blue-dark); background: #edf2ff; }
.form-message { min-height: 1.4em; margin: 0; color: #53627a; }
.form-message[data-state="error"] { color: #9a351e; }
.form-message[data-state="success"] { color: #207344; }
.form-message[data-state="warning"] { color: #8a5700; }
.error-message { padding: 10px 12px; border-radius: 10px; background: #fff0ed; color: #9a351e; }
.results-card { margin-top: 24px; }
.results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.finding-list { padding-left: 20px; }
.finding-list li { margin: 8px 0; line-height: 1.55; }
.evidence { margin: 5px 0 10px; padding-left: 12px; border-left: 3px solid #b8c8e8; color: #53627a; }
.review-needed, .incomplete-banner { padding: 12px 14px; border-radius: 12px; background: #fff2df; color: #724400; }
.completeness { padding: 14px; border-radius: 14px; background: #f1f5fb; }
.completeness p { margin: 4px 0; }
.login-page { display: grid; place-items: start center; padding: 12vh 16px 32px; }
.login-card { width: min(100%, 440px); }

@media (max-width: 600px) {
  .topbar { min-height: 58px; padding: 0 16px; }
  .page-links { gap: 10px; margin-right: 10px; }
  .page-links a { font-size: .82rem; }
  .page-shell { width: calc(100% - 24px); margin: 22px auto 40px; }
  .card { padding: 18px; border-radius: 16px; }
  .intro { margin-bottom: 18px; }
  .results-heading { flex-direction: column; }
  .download-actions { width: 100%; }
  .download-actions button { flex: 1 1 140px; }
  .login-page { padding-top: 8vh; }
}
