:root { --ink:#111827; --muted:#4b5563; --line:#d1d5db; --bg:#f8fafc; --accent:#e07a1f; --blue:#2563eb; --green:#059669; --red:#dc2626; }
* { box-sizing: border-box; }
[hidden] { display:none !important; }
html, body { margin:0; height:100%; font:17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
body { display:flex; flex-direction:column; }
.top { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 14px; background:#1f2937; color:#fff; position:relative; z-index:20; }
.brand { font-size:19px; white-space:nowrap; } .brand b { color:#fbbf24; }
.logo { display:inline-grid; place-items:center; width:32px; height:32px; border-radius:7px; background:var(--accent); font-weight:800; margin-right:6px; }
.beta { font-size:12px; background:#374151; padding:2px 8px; border-radius:10px; margin-left:6px; }
.top-actions { display:flex; gap:8px; min-width:0; }
.top button { background:#374151; border-color:#6b7280; color:#fff; min-height:44px; }
.proj-btn { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:#fbbf24 !important; color:#111 !important; border-color:#fbbf24 !important; font-weight:700; }
main { flex:1; display:flex; min-height:0; }
.panel { width:440px; min-width:340px; display:flex; flex-direction:column; border-right:1px solid var(--line); background:#fff; overflow:auto; }
.stephead { padding:12px 18px 6px; font-size:16px; color:var(--muted); border-bottom:3px solid var(--accent); } .stephead b { color:var(--ink); font-size:20px; margin-left:4px; }
.step { padding:12px 18px; flex:1; } .step h2 { font-size:22px; margin:2px 0 10px; } h3 { font-size:18px; margin:18px 0 6px; } h4 { font-size:16px; margin:12px 0 4px; }
.hint { color:var(--muted); font-size:15px; margin:4px 0 10px; } .big-hint { font-size:18px; }
label { display:block; margin:8px 0; font-weight:500; }
input:not([type=radio]):not([type=checkbox]), select { display:block; width:100%; min-height:46px; padding:8px 10px; margin-top:3px; border:1.5px solid #9ca3af; border-radius:8px; font:inherit; background:#fff; }
select[size] { height:auto; }
input[type=radio], input[type=checkbox] { width:22px; height:22px; vertical-align:-4px; margin-right:8px; accent-color:var(--accent); }
fieldset { border:1px solid var(--line); border-radius:10px; margin:10px 0; padding:6px 12px; } legend { font-weight:700; font-size:16px; padding:0 4px; }
.bigradio label { padding:6px 4px; font-size:17px; } .indent { margin-left:30px; } .grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; } .grid2 label { font-size:15px; }
.calc { font-size:19px; margin:10px 0; }
button { font:inherit; padding:8px 16px; border-radius:8px; border:1.5px solid #1f2937; background:#1f2937; color:#fff; cursor:pointer; min-height:44px; }
button.ghost { background:#fff; color:var(--ink); border-color:#9ca3af; } button:disabled { opacity:.45; cursor:default; }
button.big { min-height:54px; font-size:19px; font-weight:700; padding:10px 22px; }
button.danger { color:var(--red); border-color:#fca5a5; }
.row { display:flex; gap:10px; margin:10px 0; } .wrap { flex-wrap:wrap; }
.card { background:#f9fafb; border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin:10px 0; font-size:16px; }
.wizard-nav { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 18px; border-top:1px solid var(--line); position:sticky; bottom:0; background:#fff; z-index:3; }
.wizard-nav #step-status { font-size:16px; font-weight:600; color:#b45309; text-align:center; flex:1; }
.muted { color:var(--muted); } .ok { color:#047857; } .warn { color:#b45309; }
.banner { margin:8px 18px 0; padding:8px 12px; border-radius:8px; font-size:15px; }
.banner.info { background:#eff6ff; color:#1e3a8a; } .banner.warn { background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }
.mapwrap { flex:1; position:relative; min-width:0; } #map { position:absolute; inset:0; }
.map-tools { position:absolute; top:10px; left:10px; display:flex; gap:6px; z-index:2; } .map-tools button { background:#fff; color:var(--ink); border-color:#9ca3af; box-shadow:0 1px 3px #0002; }
.legend { position:absolute; left:10px; bottom:28px; background:#ffffffee; border-radius:10px; padding:8px 12px; font-size:15px; display:flex; flex-direction:column; gap:3px; z-index:2; box-shadow:0 1px 4px #0003; max-width:min(440px, 90%); }
.legend i { display:inline-block; width:24px; height:6px; margin-right:8px; vertical-align:middle; border-radius:2px; }
.legend i.dash { background:repeating-linear-gradient(90deg, var(--red) 0 5px, transparent 5px 9px); }
.legend i.dot { width:16px; height:16px; border-radius:50%; background:#f59e0b; border:3px solid #111827; }
.legend .lg-plant { font-weight:700; }
.tbl { width:100%; border-collapse:collapse; font-size:15px; margin:6px 0; } .tbl th, .tbl td { padding:5px 6px; border-bottom:1px solid var(--line); text-align:right; } .tbl th:first-child { text-align:left; font-weight:500; }
.tbl.big { font-size:16px; } .tbl td { white-space:nowrap; }
.tbl.haul { font-size:15px; table-layout:auto; } .tbl.haul th, .tbl.haul td { padding:4px 3px; } .tbl.haul thead th { font-size:12.5px; }
.tbl thead th { font-weight:700; color:var(--muted); font-size:14px; white-space:normal; vertical-align:bottom; } .tbl tr.total th, .tbl tr.total td { font-weight:800; border-top:2px solid var(--ink); }
.tbl tr.side th, .tbl tr.side td { font-weight:700; } .tbl tr.lane th, .tbl tr.lane td { color:var(--muted); font-size:14px; }
.tbl tr.nonstate th { color:var(--red); }
.tbl.assume td { white-space:normal; text-align:left; } .src { font-weight:700; } .src-router { color:var(--blue); } .src-you { color:#047857; } .src-default { color:#92400e; }
.sw { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
.barlbl { display:block; font-size:13px; color:var(--muted); margin-top:4px; } .bar { display:flex; height:22px; background:#f3f4f6; border-radius:6px; overflow:hidden; margin:6px 0; border:1px solid var(--line); } .bar span { display:block; height:100%; }
.keys { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:6px 0 4px; }
.key { background:#fff7e6; border:1.5px solid #fbbf24; border-radius:10px; padding:8px 10px; } .key small { display:block; font-size:13px; color:var(--muted); } .key b { display:block; font-size:24px; line-height:1.2; }
.answer { font-size:19px; background:#ecfdf5; border:1.5px solid #34d399; border-radius:10px; padding:10px 12px; margin:8px 0; }
.ntrucks input { max-width:160px; font-size:20px; font-weight:700; }
.seg { display:flex; gap:14px; } .seg label { margin:4px 0; }
.chosen { display:flex; gap:10px; align-items:center; margin:8px 18px 0; padding:8px 12px; border:2px solid #111827; border-radius:10px; background:#fff7e6; }
.chosen .pin { flex:none; width:22px; height:22px; border-radius:50%; background:#f59e0b; border:4px solid #111827; } .chosen small { display:block; font-size:13px; color:var(--muted); } .chosen b { font-size:18px; }
.more { margin:14px 0; } .more summary { font-weight:700; cursor:pointer; padding:6px 0; }
.checks { padding-left:0; list-style:none; } .checks li { margin:3px 0; font-size:15px; }
.fallback-map { background:#eef2ef; } .fallback-note { position:absolute; top:10px; right:10px; max-width:320px; background:#fffbeb; border:1px solid #fcd34d; color:#92400e; font-size:13px; padding:6px 9px; border-radius:6px; }
.factors { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; } .factors label { font-size:15px; }
dialog { border:none; border-radius:12px; width:min(640px, 94vw); max-height:92vh; box-shadow:0 10px 40px #0004; font-size:17px; }
.tabs { display:flex; flex-wrap:wrap; gap:4px; border-bottom:2px solid var(--line); margin-bottom:10px; }
.tabs button { background:#fff; color:var(--ink); border:1.5px solid var(--line); border-bottom:0; border-radius:8px 8px 0 0; font-weight:600; }
.tabs button.on { background:var(--accent); color:#fff; border-color:var(--accent); }
.foot { font-size:13px; color:var(--muted); padding:5px 14px; border-top:1px solid var(--line); background:#fff; }
/* screens: sign-in and landing cover the work area */
.screen { position:fixed; inset:56px 0 0 0; z-index:10; background:linear-gradient(160deg, #f8fafc, #fde9d2); overflow:auto; display:flex; align-items:flex-start; justify-content:center; padding:4vh 16px; }
.screen[hidden] { display:none; }
.screen-card { background:#fff; border-radius:16px; box-shadow:0 8px 30px #0002; padding:24px 28px; width:min(440px, 100%); }
.screen-card.wide { width:min(760px, 100%); } .screen-card h1 { font-size:30px; margin:0 0 8px; } .lead { font-size:20px; color:var(--muted); margin:0 0 18px; }
.screen-card button.big { width:100%; margin:8px 0; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
button.huge { min-height:120px; font-size:26px; font-weight:800; border-radius:14px; }
.recent { list-style:none; padding:0; } .recent li { padding:10px 4px; border-bottom:1px solid var(--line); }
button.link { background:none; border:0; padding:0; min-height:0; color:inherit; font:inherit; font-weight:700; text-decoration:underline; cursor:pointer; } .big-link { font-size:20px; color:var(--blue) !important; }
.big-warn { font-size:18px; }
.proj-pop { position:fixed; top:60px; right:12px; z-index:30; width:min(380px, 94vw); background:#fff; border-radius:12px; box-shadow:0 10px 40px #0004; padding:14px 16px; }
.proj-pop h3 { margin:0 0 6px; } .proj-pop dl { display:grid; grid-template-columns:auto 1fr; gap:2px 12px; margin:0 0 6px; font-size:16px; } .proj-pop dt { color:var(--muted); } .proj-pop dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
/* Sprint 2a: legend highlight, route tooltip, closest-plant list */
.legend [data-layer] { cursor:pointer; border-radius:4px; padding:1px 4px; margin:0 -4px; transition:opacity .15s; outline-offset:1px; }
.legend [data-layer]:hover, .legend [data-layer].on { background:#eef2ff; }
.legend [data-layer].on { font-weight:600; }
.legend [data-layer][aria-pressed="true"] { outline:1.5px solid #2563eb; }
.legend.has-hl [data-layer]:not(.on) { opacity:.45; }
.legend em { font-style:normal; color:#4b5563; margin-left:4px; font-weight:400; }
.legend small { font-size:12px; margin-top:2px; }
.map-tip { position:absolute; z-index:5; pointer-events:none; background:#111827f2; color:#fff; font-size:14px; line-height:1.45; padding:6px 9px; border-radius:6px; box-shadow:0 2px 8px #0004; max-width:300px; }
.map-tip hr { border:0; border-top:1px solid #ffffff40; margin:4px 0; }
.near { margin:4px 0 8px; padding-left:24px; } .near li { margin:3px 0; padding:6px 8px; border-radius:8px; font-size:17px; } .near li.sel { background:#fff7e6; outline:2px solid #fbbf24; }
.badge { display:inline-block; font-size:12px; font-weight:700; padding:1px 8px; border-radius:9px; background:#16a34a; color:#fff; vertical-align:1px; }
.badge.alt { background:#2563eb; } .badge.sel { background:#f59e0b; color:#111; }
.report { display:none; }
@media (max-width: 820px) {
  html, body { font-size:16px; height:auto; min-height:100%; }
  main { flex-direction:column; flex:none; } .panel { width:auto; min-width:0; max-height:none; flex:none; border-right:0; overflow:visible; } .mapwrap { height:46vh; flex:none; order:-1; }
  .top { padding:6px 8px; } .brand { font-size:15px; min-width:0; overflow:hidden; } .brand .beta, .brand .brand-name { display:none; } .logo { width:28px; height:28px; }
  .proj-btn { max-width:170px; flex-shrink:0; } .top-actions { flex-shrink:0; }
  .factors, .grid2 { grid-template-columns:1fr; }
  .screen { inset:48px 0 0 0; }
  .two { grid-template-columns:1fr; } button.huge { min-height:90px; font-size:22px; }
  .tbl.haul { font-size:13px; } .tbl.haul thead th { font-size:11px; } .tbl.haul th, .tbl.haul td { padding:3px 2px; }
  .legend { font-size:13px; bottom:8px; padding:5px 8px; } .legend small { display:none; } .top button { padding:6px 10px; } .tbl.big, .tbl { font-size:14px; } .tbl th, .tbl td { padding:4px 3px; }
  .keys { grid-template-columns:1fr 1fr; } .key b { font-size:20px; }
  .wizard-nav { position:sticky; }
}
/* one-page report: styled always, shown only in print (and in the test preview ?show=report) */
.report { display:none; font-size:11px; background:#fff; color:#111; }
.report h1 { font-size:18px; margin:0 0 2px; } .report h2 { font-size:13px; margin:8px 0 2px; border-bottom:1px solid #999; } .report h3 { font-size:11.5px; margin:4px 0 2px; }
.report .rmeta { margin:0 0 6px; } .report .tbl thead th { font-size:10px; }
.report .rkey { display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; } .report .rkey div { border:1px solid #999; border-radius:6px; padding:4px 6px; } .report .rkey small { display:block; color:#444; } .report .rkey b { display:block; font-size:14px; }
.report .side-times { display:inline-block; width:49%; vertical-align:top; }
.report .tbl, .report .tbl.big, .report .tbl.haul { font-size:9.5px; margin:1px 0; } .report .tbl th, .report .tbl td { padding:0 4px; line-height:1.3; } .report .tbl.haul thead th, .report .tbl thead th { font-size:9px; }
.report .tbl tr.lane th, .report .tbl tr.lane td { font-size:9px; }
.report .acols { column-count:2; column-gap:16px; font-size:9.5px; } .report .acols p { margin:0 0 1px; break-inside:avoid; } .report .side-times p, .report .rfoot { font-size:9px; }
.report .barlbl { font-size:8.5px; margin:0; } .report .bar { height:7px; margin:1px 0; -webkit-print-color-adjust:exact; print-color-adjust:exact; } .report .sw { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.report .answer { font-size:12px; padding:4px 8px; } .report p { margin:3px 0; }
body.print-preview > *:not(.report) { display:none !important; }
body.print-preview { display:block; height:auto; background:#fff; } body.print-preview .report { display:block; max-width:8in; margin:0 auto; padding:12mm; }
@media print {
  @page { size: letter; margin: 12mm; }
  body > *:not(.report) { display:none !important; }
  html, body { height:auto; background:#fff; display:block; }
  .report { display:block !important; }
}
