:root {
  --ink: #12263a; --mut: #64788c; --line: #e5ecf3; --bg: #f2f6fa;
  --brand: #0ea5a5; --brand2: #2563eb; --brand-d: #087272;
  --green: #16a34a; --amber: #f59e0b; --red: #e23b3b;
  --card: #ffffff; --shadow: 0 12px 40px rgba(16,40,64,.16);
  --r: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { color: var(--ink); background: var(--bg); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand2); }

/* ---------- map ---------- */
#map { position: fixed; inset: 0; z-index: 0; background: #dbe7ef; }
.leaflet-container { font-family: inherit; }

/* top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 9px; pointer-events: auto;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 8px 15px 8px 12px; box-shadow: var(--shadow);
  font-weight: 800; letter-spacing: .2px;
}
.brand .dot { width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); display: grid; place-items: center; color: #fff; font-size: 15px; }
.brand small { display: block; font-weight: 600; color: var(--mut); font-size: 10.5px; letter-spacing: .3px; }

.searchwrap { flex: 1; max-width: 460px; position: relative; pointer-events: auto; }
.searchwrap input {
  width: 100%; border: 0; border-radius: 999px; padding: 12px 16px; font-size: 15px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); box-shadow: var(--shadow); color: var(--ink);
}
.searchwrap input:focus { outline: 2px solid var(--brand); }
.results { position: absolute; top: 50px; left: 0; right: 0; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; max-height: 260px; overflow-y: auto; }
.results button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 11px 15px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.results button:hover { background: #f2f7fb; }

/* right tool rail */
.rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 500;
  display: flex; flex-direction: column; gap: 8px; }
.rail button { width: 44px; height: 44px; border-radius: 13px; border: 0; background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px); box-shadow: var(--shadow); font-size: 19px; display: grid; place-items: center; color: var(--ink); }
.rail button:hover { background: #fff; color: var(--brand); }
.rail button.active { background: var(--brand); color: #fff; }

/* ---------- big CTA ---------- */
.cta {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 500;
  display: flex; align-items: center; gap: 12px; border: 0; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  padding: 17px 30px; border-radius: 999px; font-size: 18px; font-weight: 800;
  box-shadow: 0 16px 44px rgba(37,99,235,.42); letter-spacing: .2px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 20px 52px rgba(37,99,235,.5); }
.cta .big { font-size: 22px; }
.cta small { display: block; font-weight: 600; opacity: .9; font-size: 11px; letter-spacing: .3px; }

/* ---------- pick banner ---------- */
.pickbar {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 500;
  width: min(560px, calc(100vw - 28px));
  background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px;
}
.pickbar h3 { margin: 0 0 3px; font-size: 16px; }
.pickbar p { margin: 0 0 12px; color: var(--mut); font-size: 13px; }
.pickrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.radiuswrap { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; }
.radiuswrap input[type=range] { flex: 1; accent-color: var(--brand); }
.radiuswrap b { min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: #eef3f8; border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--mut); }
.seg button.on { background: #fff; color: var(--brand-d); box-shadow: 0 2px 6px rgba(16,40,64,.12); }

.verdict { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.verdict.clear { background: #e7f7ee; color: var(--green); }
.verdict.caution { background: #fef3e0; color: #b9770c; }
.verdict.no-fly { background: #fde7e7; color: var(--red); }
.verdict .pulse { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.btn { border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 800; font-size: 15px; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; box-shadow: 0 8px 22px rgba(37,99,235,.32); }
.btn.primary:disabled { opacity: .45; box-shadow: none; }
.btn.ghost { background: #eef3f8; color: var(--ink); }
.btn.block { width: 100%; }

/* ---------- wizard sheet ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 900; background: rgba(16,32,50,.42); backdrop-filter: blur(2px); display: none; }
.sheet-scrim.open { display: block; }
.sheet {
  position: fixed; z-index: 901; left: 50%; bottom: 0; transform: translateX(-50%) translateY(100%);
  width: min(560px, 100vw); max-height: 92vh; background: var(--card);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet.open { transform: translateX(-50%) translateY(0); }
.sheet-head { padding: 16px 20px 8px; }
.dots { display: flex; gap: 6px; margin-bottom: 12px; }
.dots i { height: 5px; flex: 1; border-radius: 3px; background: var(--line); transition: background .2s; }
.dots i.on { background: var(--brand); }
.sheet-head h2 { margin: 2px 0 2px; font-size: 21px; }
.sheet-head p { margin: 0; color: var(--mut); font-size: 13.5px; }
.sheet-body { padding: 8px 20px 4px; overflow-y: auto; }
.sheet-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 10px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }

.field { margin: 12px 0; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { color: var(--mut); font-weight: 500; font-size: 11.5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--ink); background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 15px; font-weight: 700; font-size: 14px; color: var(--ink);
  display: flex; align-items: center; gap: 9px; transition: all .12s; }
.chip .em { font-size: 19px; }
.chip:hover { border-color: #cdd9e4; }
.chip.on { border-color: var(--brand); background: #e8f7f7; color: var(--brand-d); box-shadow: 0 4px 12px rgba(14,165,165,.18); }

/* ---------- result ---------- */
.result-hero { padding: 22px 20px; color: #fff; }
.result-hero.clear { background: linear-gradient(135deg, #16a34a, #0ea5a5); }
.result-hero.caution { background: linear-gradient(135deg, #f59e0b, #ea7317); }
.result-hero.no-fly { background: linear-gradient(135deg, #e23b3b, #b91c1c); }
.result-hero h2 { margin: 0 0 4px; font-size: 22px; }
.result-hero p { margin: 0; opacity: .95; font-size: 13.5px; }
.result-hero .ref { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.2); border-radius: 10px; padding: 6px 12px; font-weight: 800; letter-spacing: 2px; }

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.dl {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fff; font-weight: 700; font-size: 14px;
}
.dl:hover { border-color: var(--brand); background: #f4fbfb; }
.dl .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 16px; flex: none; }
.dl .ic.pdf { background: #d9534f; } .dl .ic.kmz { background: #2f8f4e; } .dl .ic.kml { background: #3a7bd5; }
.dl small { display: block; color: var(--mut); font-weight: 600; font-size: 11px; }

.clashlist { margin: 6px 0; }
.clashlist .z { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.clashlist .z b { color: var(--ink); } .clashlist .z .tag { flex: none; font-weight: 800; font-size: 10.5px; padding: 2px 7px; border-radius: 6px; }
.tag.no-fly { background: #fde7e7; color: var(--red); } .tag.caution { background: #fef3e0; color: #b9770c; }

.checklist { list-style: none; padding: 0; margin: 6px 0; }
.checklist li { padding: 8px 0 8px 26px; position: relative; font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--line); }
.checklist li::before { content: "\2610"; position: absolute; left: 2px; color: var(--brand); font-size: 16px; top: 6px; }

.callout { background: #f4f8fb; border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; font-size: 12.5px; color: var(--mut); margin: 10px 0; }
.callout b { color: var(--ink); }
.h3 { font-size: 13px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--mut); margin: 16px 0 4px; }

.disclaimer-bar {
  position: fixed; left: 14px; bottom: 14px; z-index: 400; max-width: 300px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-radius: 12px; box-shadow: var(--shadow);
  padding: 9px 12px; font-size: 10.5px; color: var(--mut);
}
.disclaimer-bar b { color: var(--amber); }

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .brand small { display: none; }
  .disclaimer-bar { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}
.hidden { display: none !important; }
