/* Manpower predictor — same tokens as planner/ and crossfilesbuildability/,
   self-contained for the same reason: standalone pages that share a stylesheet
   are pages one restyle can break. */

:root{--ink:#17201d;--muted:#65706b;--paper:#f4f1e9;--panel:#fffdfa;--line:#d9d5ca;--green:#1e604c;--lime:#b9d96b;--orange:#e87842;--red:#9c3527;--shadow:0 14px 35px #1a292012}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.5 Inter,Segoe UI,sans-serif}
header{padding:20px 4vw;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--ink);color:#fff}
h1,h2,p{margin-top:0}
h1{font:700 30px/1.15 Georgia,serif;margin:4px 0}
.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--lime)}
.privacy{padding:9px 14px;border:1px solid #ffffff38;border-radius:20px;font-size:13px}
.privacy span{display:inline-block;width:8px;height:8px;background:var(--lime);border-radius:50%;margin-right:7px}
[hidden]{display:none!important}
a{color:var(--green);font-weight:700}

main{max-width:1480px;margin:auto;padding:24px 4vw 70px}
.lede{max-width:900px;margin-bottom:20px}
.layout{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:22px;align-items:start}
.layout>*{min-width:0}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:22px;box-shadow:var(--shadow);margin-bottom:22px;min-width:0}
.panel h2{font:700 22px/1.25 Georgia,serif}
.panel-head{display:flex;justify-content:space-between;align-items:start;gap:12px;flex-wrap:wrap}
.hint{color:var(--muted);font-size:13px}

/* ---------------------------------- inputs ---------------------------------- */
.inputs{position:sticky;top:12px}
fieldset{min-width:0;align-items:end;border:0;border-top:1px solid var(--line);margin:0 0 6px;padding:12px 0 6px;display:grid;grid-template-columns:1fr 1fr;gap:10px 12px}
fieldset:first-child{border-top:0;padding-top:0}
legend{font:700 15px Georgia,serif;padding:0 0 4px}
label{font-size:11px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
label small{display:block;font-weight:600;text-transform:none;letter-spacing:0}
input,select{display:block;width:100%;margin-top:5px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:14px}
.wide{grid-column:1/-1}
label.check{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--ink)}
label.check input{width:auto;margin:0}
.calc{margin:0;font-size:13px;color:var(--muted)}
.calc b{color:var(--ink);font:700 18px Georgia,serif;margin-left:6px}
.primary{border:0;border-radius:8px;background:var(--green);color:#fff;padding:10px 16px;font-weight:800;cursor:pointer}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.secondary{border:1px solid var(--green);border-radius:8px;background:#fff;color:var(--green);padding:10px 14px;font-weight:800;cursor:pointer}
.primary:disabled{opacity:.6;cursor:wait}
label.inline{display:flex;gap:8px;align-items:center}
label.inline select{width:auto;margin:0}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:4px 0 8px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.sw{display:inline-block;width:12px;height:12px;border-radius:3px}
.sw.direct{background:#2a78d6}
.sw.sub{background:#eb6834}
.sw.band{background:#ebe7dc}
.sw.cap{background:none;border-top:2px dashed var(--red);border-radius:0;height:0;width:14px}
.sw.actual{background:#4a3aa7;height:3px;border-radius:2px;width:16px}
.chart .cap-line{stroke:var(--red);stroke-width:1.5;stroke-dasharray:5 4}
.chart .cap-label{fill:var(--red);font-size:11px;font-weight:700}
.chart .actual{fill:none;stroke:#4a3aa7;stroke-width:2;stroke-linejoin:round}
.chart .actual-label{fill:#4a3aa7;font-size:11px;font-weight:700}
.fit-note{border-left:4px solid var(--green);background:#edf2e5;padding:10px 14px;margin:0 0 12px;border-radius:0 8px 8px 0;font-size:14px}
td.over{color:var(--red);font-weight:800}
td.under{color:#1c5cab;font-weight:800}
.chart{position:relative;width:100%;min-height:260px}
.chart svg{display:block;width:100%;height:auto}
.chart .grid{stroke:#e6e2d8;stroke-width:1}
.chart .axis{fill:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.chart .band{fill:#f1eee6}
.chart .band-label{fill:var(--muted);font-size:11px}
.chart .peak-label{fill:var(--ink);font-size:12px;font-weight:700}
.chart .peak-line{stroke:var(--ink);stroke-width:1;stroke-dasharray:3 3}
.chart .hit{fill:transparent;cursor:crosshair}
.chart .hover{fill:#17201d0f}
.tooltip{position:absolute;pointer-events:none;background:var(--ink);color:#fff;padding:8px 10px;border-radius:8px;font-size:12px;line-height:1.45;box-shadow:var(--shadow);z-index:5;white-space:nowrap}
.tooltip b{font-size:13px}
.tooltip i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px}
.panel.has-chart{position:relative}
.weekly-table{margin:6px 0 14px}
.weekly-table .table-wrap{max-height:320px;overflow:auto}
.link-button{border:0;background:none;padding:0;color:var(--green);font-weight:800;font-size:13px;text-decoration:underline;cursor:pointer}

/* ---------------------------------- results --------------------------------- */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{text-align:left;border-bottom:1px solid var(--line);padding:8px 9px;vertical-align:top}
th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}
td.num,th.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
td small,th small{display:block;color:var(--muted);font-weight:600;text-transform:none;letter-spacing:0}
#headline td.num{font:700 20px/1.2 Georgia,serif}
#headline tr.lead td.num{font-size:26px;color:var(--green)}
#trace td.formula{color:var(--muted);font-family:Consolas,monospace;font-size:12px}
.good{color:var(--green);font-weight:800}
.bad{color:var(--red);font-weight:800}
.warning{border-left:4px solid var(--orange);background:#fff1e8;padding:10px 14px;margin:0 0 12px;border-radius:0 8px 8px 0;font-size:14px}
.method ul,.method ol{padding-left:20px}
.method li{margin-bottom:8px}
details{border-top:1px solid var(--line);padding:10px 0}
summary{cursor:pointer;font-weight:800}

@media(max-width:900px){
  .layout{grid-template-columns:1fr}
  .inputs{position:static}
}
@media(max-width:480px){
  fieldset{grid-template-columns:1fr}
  h1{font-size:24px}
  #headline td.num{font-size:16px}
  #headline tr.lead td.num{font-size:20px}
}

/* A0 · the land steps, and the simulation panel. */
.land-step { display: block; margin: 3px 0; font-size: 12.5px; }
.land-step small { display: block; color: var(--muted); font-size: 11.5px; }
.mc-controls { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 13px; }
.mc-lead { margin: 4px 0 12px; font-size: 15px; }
.mc-table td, .mc-table th { font-size: 12.5px; }
.mc-table td small { color: var(--muted); }
#mc-out h3 { margin: 18px 0 4px; font-size: 13px; }

/* The histogram: one bar per bin, the three percentiles picked out. */
.mc-hist { display: flex; align-items: flex-end; gap: 1px; height: 130px; margin: 14px 0 2px; }
.mc-hist i { flex: 1 1 0; background: #c9d2c2; border-radius: 1px 1px 0 0; min-height: 1px; }
.mc-hist i.at-p10 { background: #55a868; }
.mc-hist i.at-p50 { background: #c44e52; }
.mc-hist i.at-p90 { background: #8172b2; }
.mc-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* The weekly headcount band: P10–P90 shaded, P50 through it. */
.mc-band { width: 100%; height: auto; margin: 12px 0 2px; }
.mc-band .mc-fill { fill: #c9d2c2; opacity: .55; }
.mc-band .mc-mid { fill: none; stroke: #c44e52; stroke-width: 1.6; }
.mc-band .mc-grid { stroke: #e3e6de; stroke-width: 1; }
.mc-band .mc-tick { font: 10px Inter, sans-serif; fill: var(--muted); }

/* The two weeks worth naming, side by side, because they answer different
   questions and a single "peak" statistic answers neither of them well. */
.mc-weeks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }
.mc-week { border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; }
.mc-week h4 { margin: 0; font-size: 12.5px; font-weight: 600; }
.mc-week-n { font-size: 21px; font-weight: 600; line-height: 1.15; }
.mc-week-n small { font-size: 12px; font-weight: 400; color: var(--muted); }
.mc-ask { color: var(--muted); font-size: 11.5px; margin: 5px 0 9px; }
.mc-drivers { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.mc-drivers li { display: grid; grid-template-columns: 1fr 40px; gap: 8px; align-items: center; margin: 4px 0; }
.mc-drivers em { display: block; height: 4px; margin-top: 2px; background: #c9d2c2; border-radius: 2px; }
.mc-drivers em.neg { background: #d8bfc0; }
.mc-drivers .num { font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 760px) { .mc-weeks { grid-template-columns: 1fr; } }

/* A0's basis lines, rendered from LAND_AREA_BASIS rather than written in markup. */
.basis { margin: 6px 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.basis-kind { display: inline-block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink); background: #eceee7;
  border-radius: 3px; padding: 1px 5px; margin-right: 4px; }
.basis-note { display: block; }
.basis a { color: inherit; }

/* "What to trust, and how far" — the provenance paragraph under the plain-words
   explanation. Set apart rather than left as one more bullet: it is the sentence
   that decides how much weight a reader should put on everything above it. */
.why-trust { margin: 14px 0 0; padding: 12px 14px; font-size: 13.5px; line-height: 1.55;
  border-left: 3px solid var(--line); background: #faf9f5; border-radius: 0 6px 6px 0; }

/* ------------------------- plain words, typology ---------------------------- */
.explain-toggle{margin:0 0 10px;padding:10px 12px;background:#edf2e5;border-radius:8px;text-transform:none;letter-spacing:0}
.help{font-size:12.5px;line-height:1.45;color:var(--ink);background:#f7f5ef;border-left:3px solid var(--lime);border-radius:0 8px 8px 0;padding:8px 10px;margin-top:-4px}
.help p{margin:0 0 4px}
.help .impact{color:var(--green);font-weight:700;margin:4px 0 0}
.inputs:not(.explaining) .help{display:none}
.typology-note{font-size:13px}
.typology-note ul{margin:4px 0 8px;padding-left:18px}
.typology-note li{margin-bottom:3px}
td.flag{color:var(--red);font-weight:800}

/* ------------------------- the figures behind the answer -------------------- */
#assumptions details{border-top:1px solid var(--line);padding:8px 0}
#assumptions summary{cursor:pointer;font-weight:800}
#assumptions summary .count{color:var(--orange);font-weight:700}
.col-help{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:4px 12px;font-size:12.5px;margin:6px 0 10px}
.col-help dt{font-weight:800}
.col-help dd{margin:0;color:var(--muted)}
.assumption-table td small{display:block;color:var(--muted);font-size:11.5px}
.assumption-table input{width:88px;margin:0 0 0 auto;padding:5px 7px;text-align:right;font-variant-numeric:tabular-nums}
.assumption-table input.typology,.mark.typology{background:#f3ecd4}
.assumption-table input.expert,.mark.expert{outline:2px solid var(--orange);outline-offset:-1px}
.mark{padding:0 4px;border-radius:4px}
.assumption-status{font-size:13px}
.warning-inline{color:var(--red)}
.assumption-focus{font-size:13px;background:#f7f5ef;border-radius:8px;padding:0 12px;margin:10px 0 0}
.assumption-focus:not(:empty){padding:10px 12px}

/* ------------------------------ compare scenarios --------------------------- */
#scenarios-panel{position:relative}
.scenario-save{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:6px 0 10px}
.scenario-save .grow{flex:1 1 240px}
.scenario-list{list-style:none;padding:0;margin:0 0 12px}
.scenario-list li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:6px 0;border-bottom:1px solid var(--line)}
.scenario-list label.check{text-transform:none;letter-spacing:0;font-size:13px}
.scenario-list small{color:var(--muted);flex:1 1 200px}
.scenario-list .sw{border:1px solid var(--line)}
.compare-table td small{display:block;color:var(--muted);font-size:11.5px}
.compare-table th .sw{vertical-align:-1px}
#statutory tr.group td{background:#f3f0e8;font-weight:800;font-size:12px}
#statutory td small{display:block;color:var(--muted);font-size:11.5px}
.chart .hover{pointer-events:none}

/* ----------------------- sections that open and close ----------------------- */
.panel-bar{display:flex;gap:14px;align-items:center;justify-content:flex-end;flex-wrap:wrap;margin:0 0 10px}
.panel-bar .hint{margin:0 auto 0 0}
.panel-toggle{all:unset;cursor:pointer;display:inline-flex;align-items:baseline;gap:8px;font:inherit;color:inherit}
.panel-toggle::before{content:"\25B8";display:inline-block;color:var(--green);font-size:.8em;transition:transform .15s;transform:rotate(90deg)}
.collapsed .panel-toggle::before{transform:none}
.panel-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px;border-radius:4px}
.panel.collapsed>:not(.panel-head):not(h2){display:none!important}
.panel.collapsed{padding-top:16px;padding-bottom:16px}
.panel.collapsed>h2,.panel.collapsed>.panel-head h2{margin:0}
.panel.collapsed>.panel-head{align-items:center}
fieldset.collapsed>:not(legend){display:none!important}
fieldset.collapsed{padding-bottom:0}
legend .panel-toggle::before{font-size:.75em}

/* ------------------------------- the live strip ----------------------------- */
.live-bar{position:sticky;top:0;z-index:6;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:0 0 12px;padding:8px 14px;background:var(--ink);color:#fff;border-radius:10px;box-shadow:var(--shadow);font-size:12.5px}
.live-bar:empty{display:none}
.live-label{color:var(--lime);font-weight:800;font-size:11px;letter-spacing:.08em;text-transform:uppercase}
.live-fig b{font:700 16px Georgia,serif;margin-right:3px}
.live-fig small{font-weight:800;margin-left:3px}
.live-fig small.up{color:#ffb38f}
.live-fig small.down{color:var(--lime)}
.live-fig.short b{color:#ffb38f}
.live-spark{margin-left:auto;background:#fffdfa;border-radius:4px;max-width:100%}

/* ------------------------------- quick check -------------------------------- */
.quick-headline{font-size:13px;color:var(--muted);align-self:center}
.quick-headline b{color:var(--ink);font:700 16px Georgia,serif}
.quick-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px 14px;margin:6px 0 14px}
.quick-controls select{margin-bottom:4px}
.quick-controls .pair{display:flex;gap:6px}
#quick-compare tr.biggest td{background:#fbf3e3}
#quick-compare td small{display:block;color:var(--muted);font-size:11.5px}
.quick-against{margin:10px 0 0}.quick-against summary{cursor:pointer;font-weight:800}
#quick-summary svg{display:block;width:100%;height:auto;margin:4px 0}
#quick-summary .grid{stroke:#e6e2d8}
#quick-summary .axis{fill:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
#quick-summary .summary-label{fill:var(--ink);font-size:12.5px;font-weight:700}
#quick-summary .summary-note{fill:var(--muted);font-size:10.5px}
#quick-summary .peak-label{fill:var(--ink);font-size:12px;font-weight:700}
.legend-line{font-size:12px;color:var(--muted);margin:0 0 8px}
.bar-key{display:inline-block;width:22px;height:8px;border-radius:4px;background:#2a78d6;opacity:.8;vertical-align:1px}
.dot-key{display:inline-block;width:10px;height:10px;border-radius:50%;background:#17201d;vertical-align:0}
.summary-table td small{display:block;color:var(--muted);font-size:11.5px}
.land-link-note{margin:4px 0 0;font-size:12px;color:var(--green);font-weight:700}.land-link-note.paused{color:var(--orange)}
#mc-variation input{width:74px;margin:0 0 0 auto;padding:5px 7px;text-align:right}
#mc-variation input.expert{outline:2px solid var(--orange);outline-offset:-1px}
#mc-variation input.invalid{outline:2px solid var(--red);background:#fbeaea}
#mc-variation td small{color:var(--muted);font-size:11.5px}
.mc-ranges{margin:8px 0 12px}
.mc-ranges summary{cursor:pointer;font-weight:800}
