:root {
  --navy: #0f1d34;
  --navy-2: #172947;
  --ink: #111b2e;
  --muted: #5d687a;
  --paper: #f7f8f5;
  --bg: #f7f8f5;
  --white: #ffffff;
  --line: #dce1e7;
  --coral: #ff675c;
  --coral-dark: #e94e45;
  --aqua: #73e4e1;
  --lime: #c8ff4d;
  --green: #176663;
  --pale-green: #eaf9f8;
  --amber: #9a6108;
  --red: #b42318;
  --shadow: 0 24px 70px rgba(15,29,52,.14);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size: 16px; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; }
.site-header { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.brand { text-decoration: none; }
.header-link,.back-link,.text-link { font-weight: 750; text-decoration: none; }
.page-shell { max-width: 1200px; margin: 0 auto; padding: 42px 24px 52px; }
.hero,.results-top { display: flex; justify-content: space-between; gap: 42px; align-items: center; margin: 16px 0 34px; }
.hero h1,.results-top h1,.status-intro h1 { line-height: 1.03; margin: 6px 0 17px; max-width: 780px; }
.lead,.status-intro>p:not(.eyebrow),.results-top p { max-width: 750px; font-size: 17px; }
.eyebrow { margin: 0; font-size: 12px; }
.hero-note { max-width: 290px; padding: 22px; font-size: 14px; }
.card { margin: 20px 0; padding: 27px; background: var(--white); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.section-heading h2,.section-heading h3 { margin: 0; font-size: 23px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pill,.status { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.form-card { padding: 30px; }
.search-form { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.search-form label,.filters label { color: var(--navy); font-size: 14px; font-weight: 750; }
label span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
input,select { width: 100%; margin-top: 7px; padding: 11px 12px; color: var(--ink); font: inherit; outline: none; }
.wide { grid-column: span 3; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px; }
.check input { width: auto; margin: 3px 0 0; }
.check span { margin: 0; font-size: 12px; }
.check strong { color: var(--navy); font-size: 14px; }
.demo-check { background: #fff9e8; }
.form-actions { display: flex; align-items: center; gap: 20px; }
.form-actions p { margin: 0; color: var(--muted); font-size: 13px; }
.notice-grid { display: grid; grid-template-columns: repeat(3,1fr); margin: 28px 0; }
.notice-grid span { display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.notice-grid h3 { margin: 13px 0 5px; color: var(--navy); }
.notice-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.alert { margin: 18px 0; padding: 14px 16px; font-size: 14px; }
.alert.error { color: var(--red); background: #fff1f0; border-color: #f4c7c3; }
.empty { padding: 30px; color: var(--muted); text-align: center; border-radius: 12px; }
.hidden { display: none!important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { color: #607484; font-size: 12px; letter-spacing: .2px; text-transform: uppercase; }
th,td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { color: var(--muted); font-size: 12px; }
.status-card { max-width: 950px; }
.status-intro { margin: 16px 0 26px; }
.stage-line { display: flex; align-items: center; justify-content: space-between; }
.stage-line h2 { margin: 8px 0 0; color: var(--navy); }
#percentage { font-size: 25px; }
.progress { width: 100%; margin: 20px 0; border-radius: 99px; }
.progress div { width: 0; height: 100%; border-radius: inherit; transition: width .4s; }
.metric-grid,.summary-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.metric-grid>div,.summary-cards article { padding: 16px; border-radius: 10px; }
.metric-grid small,.summary-cards small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-grid strong { display: block; margin-top: 3px; color: var(--navy); font-size: 27px; }
.log-section { margin-top: 25px; }
#live-log { height: 320px; margin: 0; padding: 17px; overflow: auto; color: #d8ebf3; border-radius: 12px; font: 12px ui-monospace,SFMono-Regular,Menlo,monospace; white-space: pre-wrap; }
.results-top { align-items: flex-end; }
.results-top h1 { margin-bottom: 7px; font-size: 41px; }
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.export-actions a,.actions>a { padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 750; text-decoration: none; }
.summary-cards { grid-template-columns: repeat(5,1fr); }
.summary-cards strong { display: block; margin-top: 7px; color: var(--navy); font-size: 27px; letter-spacing: -.5px; }
.summary-cards em { margin-left: 3px; color: var(--muted); font-size: 13px; font-style: normal; }
.map-frame { width: 100%; height: 560px; background: #eff4f4; }
.filters { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin: 5px 0 20px; }
.filters label { font-size: 12px; }
.filters input,.filters select { padding: 9px; font-size: 13px; }
.filter-search { grid-column: span 2; }
.score { display: inline-grid; place-items: center; min-width: 33px; height: 29px; border-radius: 7px; }
.band { padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.band.high { color: #147044; background: #e8f6ef; }
.band.medium { color: #8b5b05; background: #fff3da; }
.band.review { color: #56636e; background: #edf1f3; }
.actions { min-width: 135px; }
.actions>a { display: block; margin-bottom: 5px; padding: 5px; text-align: center; }
.actions details { color: var(--muted); font-size: 12px; }
.actions ul { width: 240px; margin: 5px 0; padding-left: 16px; }
.methodology li { margin: 9px 0; color: #526676; }
footer { padding: 25px max(24px,calc((100vw - 1200px)/2)); font-size: 12px; line-height: 1.55; }

a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; color: var(--navy); background: var(--white); border-radius: 9px; transform: translateY(-160%); text-decoration: none; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 78px; height: auto; padding: 0 max(24px,calc((100vw - 1200px)/2));
  color: var(--white); background: rgba(15,29,52,.98); border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 9px 30px rgba(15,29,52,.12); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--white); font-size: 17px; font-weight: 950; letter-spacing: -.03em; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--navy); background: var(--coral); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 1rem; }
.brand-copy small { margin-top: 5px; color: var(--aqua); font-size: .68rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.header-nav { gap: 20px; }
.header-link { color: rgba(255,255,255,.72); transition: color .18s ease; }
.header-link:hover { color: var(--white); }
.admin-module-link { color: var(--navy); background: var(--lime); }
.admin-module-link:hover { color: var(--navy); background: var(--white); }
.logout-form button { color: var(--aqua); }

.page-shell { max-width: 1200px; padding-top: 46px; }
.hero { position: relative; isolation: isolate; min-height: 280px; padding: 38px; overflow: hidden; border: 2px solid var(--navy); border-radius: var(--radius); background: var(--aqua); box-shadow: 12px 12px 0 var(--navy); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 330px; aspect-ratio: 1; right: -90px; top: -130px; border: 1px solid rgba(15,29,52,.18); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,.13),0 0 0 96px rgba(255,255,255,.1); }
.hero h1,.results-top h1,.status-intro h1,.review-top h1 { color: var(--navy); font-weight: 950; letter-spacing: -.045em; }
.hero h1 { font-size: clamp(2.65rem,5vw,4.9rem); max-width: 720px; }
.lead,.status-intro>p:not(.eyebrow),.results-top p { color: #31465a; line-height: 1.62; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--coral-dark); font-weight: 900; letter-spacing: .13em; }
.eyebrow::before { content: ""; width: 24px; height: 3px; background: currentColor; }
.hero-note { position: relative; color: var(--ink); background: var(--white); border: 2px solid var(--navy); border-radius: 16px; box-shadow: 8px 8px 0 var(--navy); }
.hero-note strong { color: var(--coral-dark); }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 42px rgba(15,29,52,.07); }
.form-card { border: 2px solid var(--navy); box-shadow: 10px 10px 0 var(--navy); }
.section-heading h2,.section-heading h3 { color: var(--navy); font-weight: 950; letter-spacing: -.035em; }
.pill { color: var(--navy); background: var(--lime); border: 1px solid var(--navy); }

input, select, textarea { min-height: 48px; border: 1px solid #c5cdd7; border-radius: 10px; background: var(--white); transition: border-color .18s ease, box-shadow .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(115,228,225,.5); }
input[type="checkbox"],input[type="radio"] { min-height: auto; accent-color: var(--coral-dark); }
.check { border-color: var(--line); background: #fbfcfa; }
.check:has(input:checked) { border-color: var(--navy); background: #eaf9f8; box-shadow: 0 0 0 2px rgba(115,228,225,.24); }

.primary { min-height: 50px; padding: 0 21px; color: var(--navy); background: var(--coral); border: 2px solid var(--navy); border-radius: 10px; box-shadow: 6px 6px 0 var(--navy); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary:hover { color: var(--navy); background: #ff7a70; box-shadow: 3px 3px 0 var(--navy); transform: translate(2px,2px); }
.secondary { color: var(--navy); border: 2px solid var(--navy); background: var(--white); }
.back-link,.text-link,.actions summary { color: var(--coral-dark); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.notice-grid { gap: 18px; }
.notice-grid article { padding: 22px; border: 2px solid var(--navy); border-radius: 16px; background: var(--white); }
.notice-grid article:nth-child(2) { background: #eaf9f8; }
.notice-grid article:nth-child(3) { background: #f3ffd5; }
.notice-grid span { width: 31px; height: 31px; color: var(--navy); background: var(--coral); border: 1px solid var(--navy); }
.notice-grid h3 { font-weight: 900; letter-spacing: -.025em; }

.alert { border-radius: 10px; border-width: 1px; border-style: solid; }
.alert.demo { color: #634900; background: #f6ffd9; border-color: #bddc62; }
.empty { background: var(--white); border: 2px dashed #bac3ce; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; }
table { background: var(--white); }
th { color: var(--white); background: var(--navy); }
tbody tr:nth-child(even) { background: #fafbf8; }
tbody tr:hover { background: #eaf9f8; }
.status.complete { color: #164c49; background: var(--aqua); }
.status.running { color: var(--navy); background: var(--lime); }

#percentage { color: var(--coral-dark); font-weight: 950; }
.progress { height: 12px; background: #e6e9ed; }
.progress div { background: linear-gradient(90deg,var(--coral),var(--lime)); }
.metric-grid>div,.summary-cards article { background: #f7f8f5; border: 1px solid var(--line); }
.summary-cards article:nth-child(2n) { background: #eaf9f8; }
.score { color: var(--navy); background: var(--lime); }
.export-actions a,.actions>a { color: var(--navy); border: 1px solid var(--navy); background: var(--white); }
.export-actions a:hover,.actions>a:hover { background: var(--aqua); }
.map-frame { border: 2px solid var(--navy); border-radius: 16px; }
#live-log,.json-view,.roof-figure,.debug-image-grid img { background: var(--navy); }

.review-callout { background: var(--aqua); border: 2px solid var(--navy); }
.review-callout .eyebrow { color: var(--navy); }
.review-nav a { color: var(--navy); border: 1px solid var(--navy); }
.review-nav a:hover { background: var(--aqua); }
.image-switcher button.active { color: var(--navy); background: var(--coral); border-color: var(--navy); }
.distribution-row i { background: var(--coral); }
.responsible { background: #fff6dc; border-color: #e9c96e; }

footer { color: rgba(255,255,255,.68); background: var(--navy); border-top: 7px solid var(--coral); }
footer strong { color: var(--white); }

@media(max-width:1000px) {
  .site-header { padding: 13px 20px; flex-wrap: wrap; gap: 10px 18px; }
  .header-nav { order: 3; width: 100%; padding: 2px 0 4px; overflow-x: auto; scrollbar-width: thin; }
  .header-nav .header-link { display: inline-flex; flex: 0 0 auto; }
}
@media(max-width:800px) {
  .hero,.results-top { display: block; }
  .hero-note { max-width: none; margin-top: 21px; }
  .search-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .notice-grid,.metric-grid,.summary-cards { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2,1fr); }
  .filter-search { grid-column: span 2; }
  .form-actions { display: block; }
  .form-actions p { margin-top: 11px; }
  .export-actions { justify-content: flex-start; margin-top: 17px; }
  .map-frame { height: 460px; }
  .card { padding: 19px; }
  .page-shell { padding-top: 26px; }
  .hero { padding: 28px 23px; box-shadow: 7px 7px 0 var(--navy); }
  .hero h1 { font-size: clamp(2.35rem,11vw,3.4rem); }
  .form-card { box-shadow: 6px 6px 0 var(--navy); }
}
@media(max-width:480px) {
  .brand-copy small { display: block; }
  .header-link { display: inline-flex; }
  .brand-mark { width: 35px; height: 35px; }
  .hero { margin-top: 8px; }
  .filters { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
}
