/* app/app.css — same tokens as the PPP Feasibility Reviewer, so the tools read as one family. */
:root {
  --ink: #16242b;
  --muted: #5a6a72;
  --line: #dde3e7;
  --bg: #f4f6f7;
  --card: #ffffff;
  --accent: #0b475e;
  --accent-2: #0e6a86;
  --accent-soft: #e6f0f4;
  --good: #1d6b3f;   --good-soft: #e8f4ec;
  --warn: #8a6100;   --warn-soft: #fff6df;  --warn-line: #e9c96b;
  --bad: #a4262c;    --bad-soft: #fcecec;   --bad-line: #efb7b9;
  --info: #1f5f99;   --info-soft: #e9f1fa;
  --focus: #f0b429;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 36, 43, .06);
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
[hidden] { display: none !important; }

/* header, assurance, steps */
.app-header { background: var(--accent); color: #fff; padding: 12px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.app-header h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .2px; }
.app-header .tag { font-size: 12.5px; opacity: .85; }
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.header-info { margin-left: auto; font-size: 13px; opacity: .95; overflow-wrap: anywhere; }
.assurance { background: #eaf2f0; border-bottom: 1px solid var(--line); padding: 8px 24px; font-size: 13px; color: #224a40; }
.steps { position: sticky; top: 0; z-index: 5; background: #083848; box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.steps-list { list-style: none; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; max-width: 1240px; }
.step { background: none; border: 0; color: #c9dde4; font: inherit; font-size: 13.5px; padding: 11px 12px 10px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 7px; }
.step:hover:not(:disabled) { color: #fff; }
.step .n { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; font-size: 11.5px; background: rgba(255,255,255,.16); }
.step.done .n { background: #3f8f6b; color: #fff; }
.step.current { color: #fff; border-bottom-color: var(--focus); font-weight: 600; }
.step.current .n { background: var(--focus); color: #083848; font-weight: 700; }
.step:disabled { opacity: .45; cursor: not-allowed; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; outline: none; }
.step-heading { font-size: 20px; margin: 4px 0 6px; color: var(--accent); font-weight: 650; }
.step-heading:focus { outline: none; }
.step-intro { margin: 0 0 16px; color: var(--muted); max-width: 820px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
details.card > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: revert; }
details.card[open] > summary { margin-bottom: 10px; }
.card-title { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.lede { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.small { font-size: 13px; color: var(--muted); }
p { margin: 6px 0; }
.facts { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 16px; margin: 4px 0 0; }
.facts dt { font-weight: 600; color: var(--muted); font-size: 13.5px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

/* upload */
.drop { border: 2px dashed #9fb6c1; border-radius: 12px; background: var(--card); padding: 34px 20px; text-align: center; }
.drop.over { border-color: var(--accent-2); background: var(--accent-soft); }
.drop h3 { margin: 0 0 6px; color: var(--accent); font-size: 18px; }
.drop p { color: var(--muted); }
.progress { margin-top: 14px; font-weight: 600; color: var(--accent); }

/* fields and buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 8px 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.field { margin: 10px 0; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], select, textarea { font: inherit; font-size: 14px; border: 1px solid #b9c6cd; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 54px; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: #f8fafb; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* badges and notices */
.badge { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: #eef1f3; color: var(--muted); }
.notice { border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.notice.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.notice.bad { background: var(--bad-soft); border: 1px solid var(--bad-line); }
.notice.good { background: var(--good-soft); border: 1px solid #b7dcc4; }
.notice.info { background: var(--info-soft); border: 1px solid #c3d8ee; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }

/* lead rows */
.lead { border-top: 1px solid var(--line); padding: 10px 0; display: grid; grid-template-columns: 1fr 300px; gap: 12px; }
.lead:first-of-type { border-top: 0; }
.lead .where { font-weight: 600; }
.lead .what { color: var(--muted); font-size: 13.5px; }
.lead .decide { display: grid; gap: 6px; align-content: start; }
.pattern { font-family: var(--mono); font-size: 12px; background: #f3f6f8; border-radius: 4px; padding: 2px 6px; display: inline-block; margin: 2px 0; overflow-wrap: anywhere; }

/* methodology */
.method h3 { color: var(--accent); margin: 18px 0 6px; font-size: 16px; }
.method ul { margin: 6px 0 10px; padding-left: 20px; }
.method li { margin: 0 0 5px; }

.app-footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .wrap { padding: 16px 16px 32px; }
  .app-header, .assurance { padding-left: 16px; padding-right: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .lead { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}
@media print {
  .app-header, .assurance, .steps, .actions, .app-footer, .skip, .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* fields fill their column; the report's own headings match the page */
.field input[type=text] { width: 100%; }
.inline-fields input[type=text] { flex: 1 1 180px; min-width: 0; }
#report-body h2 { font-size: 17px; color: var(--accent); margin: 22px 0 8px; }
#report-body h2.card-title { margin-top: 0; }

/* AI review */
.pre { max-height: 340px; overflow: auto; white-space: pre-wrap; background: #f6f8f9; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 8px 0; }
.key-field { width: 100%; max-width: 520px; font-family: var(--mono); }
.field label input[type=checkbox] { margin-right: 6px; }
