:root {
  --bg: #faf6ee;
  --surface: #fffdf8;
  --ink: #0f3d22;
  --ink-soft: #3d5a47;
  --line: #e3dccb;
  --lime: #8dc63f;
  --lime-soft: #e6f0c8;
  --p0: #f6e3a1;
  --p1: #f2c066;
  --p2: #ea8d45;
  --p3: #c8503c;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .4em; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 0 16px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 0; flex-wrap: wrap; }
.topbar .brand img { height: 44px; display: block; }
.topbar nav { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; padding-left: 22px; border-left: 1px solid var(--line); }
.topbar nav a { text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; font-weight: 500; }
.topbar nav a[aria-current="page"] { border-color: var(--lime); font-weight: 700; }
.topbar select, .btn-outline { font: inherit; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 12px; }
.btn-outline { text-decoration: none; font-weight: 600; display: inline-block; }

.eyebrow { font-size: .85rem; letter-spacing: .18em; font-weight: 700; text-transform: uppercase; margin: 14px 0 0; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin: .1em 0; }
.hero p.sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 1.15rem; }
.badge { background: var(--lime-soft); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 10px 18px; border-radius: 8px; font-size: .85rem; }
.badge[hidden] { display: none; }

.explorer { display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 14px; margin: 12px 0 26px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card h2 { font-size: 1.45rem; }
.layers label { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.layers label:has(input:checked) { background: var(--lime-soft); font-weight: 600; }
.layers input { accent-color: var(--ink); margin-left: auto; order: 2; width: 18px; height: 18px; }
.layers hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--ink); }
.meta-line { font-size: .9rem; color: var(--ink-soft); margin: 10px 10px; }
.note { background: var(--lime-soft); border-radius: 10px; padding: 12px 14px; font-weight: 600; margin-top: 14px; }

.mapbox { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-height: 560px; background: #f1ecdd; }
#map { position: absolute; inset: 0; }
.search { position: absolute; top: 14px; left: 14px; z-index: 2; width: min(340px, calc(100% - 90px)); }
.search input { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; background: var(--surface); }
.legend { position: absolute; left: 14px; bottom: 14px; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; margin-right: 5px; vertical-align: -3px; }
.chip { position: absolute; left: 14px; top: 62px; max-width: calc(100% - 90px); z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }

.sector h2 { font-size: 1.7rem; }
.sector .label { font-size: .8rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; margin: 0 0 4px; }
.pill { display: inline-block; color: #fff; font-weight: 700; padding: 5px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ink-soft); }
.pill.c0 { background: #8a6d12; } .pill.c1 { background: #9c5d0a; } .pill.c2 { background: #b4561a; } .pill.c3 { background: var(--p3); }
.bar { margin: 8px 0 12px; }
.bar span { display: block; font-weight: 600; margin-bottom: 3px; }
.bar .track { background: #e8e3d6; height: 10px; border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; }
.checks { list-style: none; padding: 0; margin: 0 0 14px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.checks li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #2f9d4e; color: #fff; text-align: center; font-size: .85rem; line-height: 22px; font-weight: 700; }
.checks li.none::before { content: "–"; background: #9a9a8c; }
.btn { display: block; background: var(--ink); color: #fff; text-align: center; text-decoration: none; font-weight: 700; padding: 14px; border-radius: 10px; }
.small { font-size: .85rem; color: var(--ink-soft); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 28px; }
.action { display: flex; gap: 16px; align-items: center; }
.action .ico { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--lime-soft); display: grid; place-items: center; font-size: 2rem; }
.action h3 { font-size: 1.3rem; margin: 0; }
.action p { margin: 2px 0 6px; color: var(--ink-soft); }

footer { border-top: 1px solid var(--line); padding: 16px 0 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }

main.page { max-width: 940px; margin: 0 auto; padding: 10px 16px 40px; }
main.page h1 { font-size: 2.4rem; }
main.page h2 { margin-top: 1.6em; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.demo-banner { margin: 10px 0; background: var(--lime-soft); padding: 10px 16px; border-radius: 10px; font-weight: 600; }

@media (max-width: 1100px) {
  .explorer { grid-template-columns: 1fr; }
  .mapbox { min-height: 480px; order: -1; }
  .actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.legend i.swatch-boundary { background: transparent; border: 3px solid #1d4ed8; height: 10px; width: 20px; border-radius: 2px; }
