:root {
  --navy: #0D1B30; --navy-mid: #1F3A5F; --gold: #C9A961; --gold-soft: #f3ead6;
  --bg: #F5F8FB; --card: #ffffff; --ink: #142235; --muted: #5b6b80; --line: #dde4ec;
  --ok: #1f7a4d; --warn: #9a6a00; --bad: #a23b3b; --chip: #eef2f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1626; --card: #12233b; --ink: #e8eef6; --muted: #9fb0c6; --line: #24395a;
    --chip: #1b3050; --gold-soft: #3a3220;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Aptos', 'Inter', 'Calibri', system-ui, sans-serif; background: var(--bg);
  color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
a.link, .content a:not(.btn):not(.card-link) { color: #2a5d9f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .content a:not(.btn):not(.card-link) { color: #8fb8ee; } }

.topbar { background: radial-gradient(ellipse 100% 140% at 15% -10%, rgba(45,78,125,.6) 0%, transparent 60%), var(--navy);
  color: #F5F8FB; border-bottom: 3px solid var(--gold); }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar img { height: 34px; }
.brand { font-weight: 600; letter-spacing: .3px; }
.brand small { display: block; color: var(--gold); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 500; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button { color: #dfe7f1; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px;
  background: none; border: 0; cursor: pointer; font: inherit; }
.nav a:hover, .nav a.on, .nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.staff { color: var(--gold); }

.content { max-width: 1320px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 26px; font-weight: 600; margin: 4px 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.eyebrow { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.search-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .cols-2, .search-layout { grid-template-columns: 1fr; } }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--card); }
.flash.error { border-color: var(--bad); color: var(--bad); }
.flash.ok { border-color: var(--ok); }

form.filters label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card);
  color: var(--ink); font: inherit; font-size: 14px; }
textarea { min-height: 70px; }
.checks { display: grid; gap: 2px; font-size: 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--navy-mid);
  background: var(--navy); color: #fff; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-mid); }
.btn.gold { background: var(--gold); border-color: #b39350; color: var(--navy); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }

.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.proj { display: block; text-decoration: none; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.proj:hover { background: var(--chip); }
.proj:last-child { border-bottom: 0; }
.proj .t { font-weight: 600; font-size: 15.5px; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; color: var(--ink); white-space: nowrap; }
.chip.stage-pre_construction, .chip.stage-tender { background: #fde8b0; color: #5a4000; }
.chip.stage-on_site, .chip.stage-awarded { background: #cdebd9; color: #11462b; }
.chip.stage-approved, .chip.stage-outline_approved, .chip.stage-detailed_planning { background: #d7e6fa; color: #173c6d; }
.chip.stage-refused { background: #f3d6d6; color: #6d1f1f; }
.chip.gold { background: var(--gold-soft); color: inherit; border: 1px solid var(--gold); }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; border-radius: 6px; font-weight: 700; font-size: 13px; background: var(--chip); }
.score.hot { background: var(--gold); color: var(--navy); }

#map { height: 340px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 14px; z-index: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.hero { background: radial-gradient(ellipse 140% 70% at 90% 110%, rgba(58,98,152,0.55) 0%, transparent 55%), radial-gradient(ellipse 100% 60% at 15% -10%, rgba(45,78,125,0.45) 0%, transparent 60%), var(--navy);
  color: #F5F8FB; border-radius: 14px; padding: 40px 32px; }
.hero h1 { font-size: 34px; max-width: 760px; }
.hero p { color: #c9d5e4; max-width: 680px; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 26px; }
.stat { border: 1px solid rgba(201,169,97,.5); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 26px; color: var(--gold); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.auth-card { max-width: 440px; margin: 30px auto; }
.confidence-medium { opacity: .85; }
.confidence-low { opacity: .7; font-style: italic; }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.row > .btn { flex: 0 0 auto; }
@media (max-width: 640px) { .brand small { display: none; } .topbar img { height: 28px; } .hero { padding: 26px 18px; } .hero h1 { font-size: 26px; } }
.logo-link { flex: 0 0 auto; }
.brand { white-space: nowrap; }
form.filters .checks label { display: flex; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.row > .score, .row > .chip { flex: 0 0 auto; }
.results-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.results-tools input[type=text] { width: 170px; }
.filters-toggle { cursor: pointer; font-weight: 600; list-style: none; }
.filters-toggle::-webkit-details-marker { display: none; }
@media (min-width: 900px) { .filters-toggle { display: none; } }
@media (max-width: 899px) { .filters-toggle::after { content: " ▾"; color: var(--gold); } }
.score-box { flex: 0 0 auto; text-align: right; white-space: nowrap; }
h1 { overflow-wrap: anywhere; }
