:root {
  color-scheme: dark;
  --ink: #f7f9f5;
  --muted: #9da9a2;
  --panel: rgba(15, 23, 21, .88);
  --line: rgba(217, 239, 226, .13);
  --green: #b9f24a;
  --mint: #62e6b5;
  --red: #ff6b6b;
  --bg: #07100e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 70% -20%, rgba(86,186,146,.14), transparent 38%),
    linear-gradient(180deg, #091310 0, var(--bg) 55%);
}
button, input { font: inherit; }
button { min-height: 44px; }
.topbar {
  height: 76px; padding: 0 clamp(20px,4vw,64px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line);
  background: rgba(7,16,14,.82); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; color: #08110e;
  background: var(--green); border-radius: 11px; font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.boundary {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12px;
}
.boundary span, .status-dot {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  box-shadow: 0 0 12px var(--green);
}
main { width: min(1540px,100%); margin: auto; padding: 0 clamp(16px,4vw,64px) 42px; }
.hero {
  min-height: 330px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px;
  align-items: end; padding: 70px 0 46px;
}
.eyebrow {
  margin: 0 0 10px; color: var(--green); text-transform: uppercase;
  letter-spacing: .16em; font-size: 11px; font-weight: 800;
}
h1 { font-size: clamp(42px,6vw,82px); line-height: .95; letter-spacing: -.065em; margin: 0; }
h1 em { color: var(--green); font-style: normal; }
.lede { max-width: 680px; margin: 26px 0 0; color: var(--muted); font-size: clamp(16px,2vw,20px); line-height: 1.6; }
.facts { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.facts div { padding: 22px 18px; border-right: 1px solid var(--line); background: rgba(255,255,255,.018); }
.facts div:last-child { border: 0; }
.facts dt, legend, .context dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.facts dd { margin: 8px 0 0; font-weight: 750; }
.workspace { display: grid; grid-template-columns: 245px minmax(520px,1fr) 260px; gap: 14px; min-height: 630px; }
.panel, .viewer-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.panel { padding: 22px; }
.panel h2 { margin: 4px 0 8px; font-size: 20px; letter-spacing: -.03em; }
.panel-heading > p:last-child, .privacy-note, .context-foot { color: var(--muted); font-size: 12px; line-height: 1.55; }
fieldset { border: 0; padding: 0; margin: 28px 0; }
legend { margin-bottom: 10px; }
fieldset label {
  min-height: 46px; display: grid; grid-template-columns: 22px 1fr auto;
  align-items: center; gap: 8px; border-bottom: 1px solid var(--line); cursor: pointer;
}
fieldset input { accent-color: var(--green); width: 17px; height: 17px; }
fieldset b { color: var(--muted); font-size: 11px; }
.focus-button {
  width: 100%; border: 1px solid rgba(255,107,107,.32); border-radius: 12px;
  color: #ffd8d8; background: rgba(255,107,107,.08); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750;
}
.focus-button:hover, .focus-button:focus-visible { background: rgba(255,107,107,.16); outline: 2px solid var(--red); outline-offset: 2px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.privacy-note { margin-top: 22px; }
.viewer-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.viewer-toolbar {
  min-height: 70px; padding: 12px 18px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line);
}
.viewer-toolbar > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.viewer-toolbar small { grid-column: 2; color: var(--muted); margin-top: 3px; }
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-controls button {
  border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.04);
  color: var(--ink); padding: 0 14px; cursor: pointer; min-width: 44px;
}
.zoom-controls button:hover, .zoom-controls button:focus-visible { border-color: var(--green); outline: none; }
.zoom-controls output { min-width: 52px; text-align: center; color: var(--muted); font-size: 12px; }
.canvas-wrap { position: relative; overflow: hidden; background: #0a1210; min-height: 520px; }
#floorplan { width: 100%; height: 100%; min-height: 520px; display: block; }
.canvas-bg { fill: #0b1512; }
.grid-line { fill: none; stroke: rgba(185,242,74,.045); stroke-width: 1; }
.zone { fill: rgba(98,230,181,.055); stroke: #38564b; stroke-width: 3; transition: .2s; }
.zone:hover, .zone:focus { fill: rgba(98,230,181,.12); stroke: var(--mint); outline: none; }
.zone.severity-medium { stroke: #8c7043; }
.zone-label { fill: #bec9c3; font-size: 18px; font-weight: 700; pointer-events: none; }
.marker-core { fill: var(--red); stroke: #fff; stroke-width: 3; }
.marker-halo { fill: rgba(255,107,107,.13); stroke: rgba(255,107,107,.42); stroke-width: 2; }
.marker-control .marker-core { fill: var(--green); }
.marker-control .marker-halo { fill: rgba(185,242,74,.12); stroke: rgba(185,242,74,.35); }
.marker-label { fill: #fff; font-size: 15px; font-weight: 750; paint-order: stroke; stroke: #08110f; stroke-width: 5; }
.marker.focused .marker-halo { filter: url(#glow); stroke-width: 5; }
.layer[hidden] { display: none; }
.scale { position: absolute; bottom: 16px; left: 18px; color: var(--muted); font-size: 10px; }
.scale span { display: block; width: 84px; border-top: 2px solid var(--muted); margin-bottom: 5px; }
.context-icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin: 22px 0 16px;
  background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.3);
  color: var(--red); border-radius: 14px; font-size: 24px; font-weight: 900;
}
.severity { display: inline-block; color: #ffd0d0; background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.25); border-radius: 999px; padding: 5px 9px; font-size: 10px; text-transform: uppercase; }
.context dl { margin: 28px 0; }
.context dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.context dd { margin: 5px 0 0; font-size: 13px; word-break: break-word; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px clamp(20px,4vw,64px); color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 220px 1fr; }
  .context { grid-column: 1/-1; display: grid; grid-template-columns: auto 1fr 1fr; gap: 18px; }
  .context dl { grid-column: 3; grid-row: 1/span 4; margin: 0; }
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 16px; }
  .boundary { font-size: 0; padding: 11px; }
  main { padding-inline: 12px; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 42px 6px 28px; gap: 28px; }
  h1 { font-size: clamp(39px,12vw,58px); }
  .facts div { padding: 16px 10px; }
  .facts dd { font-size: 12px; }
  .workspace { grid-template-columns: 1fr; min-height: 0; }
  .controls { order: 2; }
  .viewer-card { order: 1; }
  .context { order: 3; display: block; }
  .viewer-toolbar { align-items: flex-start; gap: 12px; }
  .zoom-controls { flex-wrap: wrap; justify-content: flex-end; }
  .zoom-controls output { order: -1; width: 100%; text-align: right; }
  .canvas-wrap, #floorplan { min-height: 390px; }
  footer { flex-direction: column; }
}
@media (max-width: 460px) {
  .brand small { display: none; }
  .panel { padding: 18px; }
  .viewer-toolbar { padding: 12px; }
  .zoom-controls button { padding: 0 12px; }
  .canvas-wrap, #floorplan { min-height: 350px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { position: static; }
  .hero { min-height: auto; padding: 28px 0; grid-template-columns: 1fr 1fr; }
  h1 { font-size: 42px; }
  .lede { font-size: 14px; margin-top: 14px; }
  .workspace { grid-template-columns: 180px minmax(0,1fr); }
  .context { grid-column: 1/-1; }
  .canvas-wrap, #floorplan { min-height: 360px; }
}
