/* Standalone page reset (the artifact viewer used to provide this) */
html { box-sizing: border-box; height: 100%; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: aeronautical-chart workspace — framed chart on the left (top on phones), briefing panel beside it */
:root {
  --bg: #e6ecee;
  --surface: #f8fafa;
  --surface-2: #eef2f3;
  --ink: #12202a;
  --muted: #566872;
  --line: #c3cfd4;
  --water: #cddfe9;
  --land: #edf1e8;
  --land-dim: #dde3e0;
  --coast: #7f949e;
  --accent: #0b5ea8;
  --accent-ink: #ffffff;
  --red: #c8102e;
  --amber: #c97a00;
  --info: #7a3fa8;
  --ok: #24764a;
  --park: #2e7d32;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1418; --surface: #141e24; --surface-2: #1a262d; --ink: #e2eaed; --muted: #92a4ad;
    --line: #2a3a42; --water: #08141c; --land: #253439; --land-dim: #1b2529; --coast: #4f6872;
    --accent: #5aa9f0; --accent-ink: #06121c; --red: #ff5c70; --amber: #f0a836; --info: #bb8ce4; --ok: #5cc48a; --park: #6fcf75;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1418; --surface: #141e24; --surface-2: #1a262d; --ink: #e2eaed; --muted: #92a4ad;
  --line: #2a3a42; --water: #08141c; --land: #253439; --land-dim: #1b2529; --coast: #4f6872;
  --accent: #5aa9f0; --accent-ink: #06121c; --red: #ff5c70; --amber: #f0a836; --info: #bb8ce4; --ok: #5cc48a; --park: #6fcf75;
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
* { box-sizing: border-box; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px;
}

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 12px; min-width: 0; position: relative; z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 8px; flex: none; }
.brand h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .01em; line-height: 1; text-wrap: balance; }
.brand .tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; }
.search { position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; height: 42px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 12px; font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.btn {
  height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn svg { width: 18px; height: 18px; flex: none; }
.results {
  position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; max-height: 340px; overflow-y: auto;
}
.results button {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; padding: 10px 12px; cursor: pointer;
}
.results button:last-child { border-bottom: 0; }
.results button:hover, .results button.active { background: var(--surface-2); }
.results .sub { color: var(--muted); font-size: 13px; }
.results .cc { font-family: var(--font-mono); font-size: 12px; color: var(--muted); align-self: center; }
.note-inline { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 8px; padding: 10px 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }

/* ---------- main split ---------- */
main { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 12px; min-height: 0; }
.mapwrap { position: relative; min-height: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--water); }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.mapctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mapctl button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.mapctl button svg { width: 18px; height: 18px; }
.legend {
  position: absolute; left: 10px; bottom: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; max-width: calc(100% - 20px);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.red { background: repeating-linear-gradient(135deg, var(--red) 0 2px, color-mix(in srgb, var(--red) 30%, transparent) 2px 5px); }
.sw.amber { background: color-mix(in srgb, var(--amber) 45%, transparent); border: 1px solid var(--amber); }
.sw.park { border: 1.5px dashed var(--park); background: color-mix(in srgb, var(--park) 12%, transparent); }
.sw.info { background: color-mix(in srgb, var(--info) 30%, transparent); border: 1px dashed var(--info); }
.scalebar { position: absolute; right: 10px; bottom: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: right; }
.scalebar i { display: block; height: 4px; border: 1px solid var(--muted); border-top: 0; margin-top: 2px; margin-left: auto; }

/* ---------- panel ---------- */
.panel { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 12px 8px 10px; cursor: pointer; font-family: var(--font-display);
  font-weight: 600; font-size: 17px; letter-spacing: .02em; color: var(--muted); border-bottom: 3px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pane { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.pane > * { flex-shrink: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.coords { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.coords b { color: var(--ink); font-weight: 500; }

.verdict { border-radius: 10px; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-left-width: 6px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.verdict.red { border-left-color: var(--red); }
.verdict.amber { border-left-color: var(--amber); }
.verdict.info { border-left-color: var(--info); }
.verdict.ok { border-left-color: var(--ok); }
.verdict.none { border-left-color: var(--muted); }
.verdict h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.05; text-wrap: balance; }
.verdict p { margin: 0; }
.pill { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; color: #fff; }
.pill.red { background: var(--red); } .pill.amber { background: var(--amber); } .pill.info { background: var(--info); } .pill.ok { background: var(--ok); } .pill.none { background: var(--muted); }
:root[data-theme="dark"] .pill { color: #0b1217; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill { color: #0b1217; } }

.hits { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hit { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.hit:last-child { border-bottom: 0; }
.hit .bar6 { align-self: stretch; }
.hit .bar6.red { background: var(--red); } .hit .bar6.amber { background: var(--amber); } .hit .bar6.info { background: var(--info); }
.hit strong { display: block; font-weight: 600; }
.hit .sub { color: var(--muted); font-size: 13.5px; }
.hit .d { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.list li::marker { color: var(--muted); }
.near { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.near div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.near span:last-child { font-family: var(--font-mono); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.linkbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.linkbtn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-weight: 600; font-size: 14px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact > div { min-width: 0; }
.contact .lbl { font-size: 13px; color: var(--muted); }
.contact .val { font-family: var(--font-mono); font-size: 13.5px; overflow-wrap: anywhere; user-select: all; }
.copy { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 9px; font-size: 13px; cursor: pointer; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
details summary { cursor: pointer; font-weight: 600; }

form.permit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
form.permit label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
form.permit .full { grid-column: 1 / -1; }
form.permit input, form.permit select, form.permit textarea { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 8px 10px; font-size: 15px; color: var(--ink); min-width: 0; width: 100%; }
textarea#ptext { width: 100%; min-height: 260px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 10px; resize: vertical; color: var(--ink); }

/* ---------- places ---------- */
.placebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.inline select { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 6px 8px; }
.inline input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.status { margin: 0; font-size: 14px; color: var(--muted); }
.status.warn { color: var(--ink); border-left: 3px solid var(--amber); padding-left: 10px; }
.plist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pcard:last-child { border-bottom: 0; }
.pcard:hover { background: var(--surface-2); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.thumb.ph { display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--muted); }
.pbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pbody .sub { color: var(--muted); font-size: 13.5px; }
.pdesc { font-size: 14px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pill.park { background: var(--park); }
.pdetail { display: flex; flex-direction: column; gap: 10px; }
.pdetail img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; }
.pdetail h3 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; text-wrap: balance; }
.pdetail p { margin: 6px 0 0; }
.parknote { border-left: 3px solid var(--park); padding-left: 10px; font-size: 14px; }
.attrib { position: absolute; left: 10px; top: 10px; font-size: 10.5px; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 1px 6px; border-radius: 4px; }
.attrib a { color: inherit; }
.tabs button { font-size: 16px; padding-inline: 4px; }

@media (max-width: 820px) {
  #app { gap: 8px; padding-block: 8px; }
  main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, 48%) minmax(0, 1fr); gap: 8px; }
  .brand .tag { display: none; }
  .brand h1 { font-size: 21px; }
  .btn .lbl { display: none; }
  .legend { font-size: 11.5px; padding: 5px 8px; gap: 4px 10px; }
  .scalebar { display: none; }
}
@media (max-width: 460px) {
  .brand h1 { display: none; }
  .bar { gap: 8px; }
  form.permit { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
