/* Colours: FlashFloodBreaker blue (#174390) and green (#3CA346) from the project logo, with warm accents for passes and tips.
   Layout: Canva-like shell. Icon rail, white plan panel, map as a rounded canvas with a floating toolbar.
   On phones the rail disappears and the panel becomes a bottom sheet over a full-screen map.
   Tokens match the Figma file "FreeDronePlane – App design", page "v2 · Friendly". */
:root {
  --fog: #F2F5F8;
  --paper: #FFFFFF;
  --ink: #14223D;
  --muted: #5D6A7E;
  --line: #DFE5EE;
  --lake: #174390; --lake-50: #E9EFF9; --lake-700: #0F2E66;
  --sun: #F2A900; --sun-50: #FFF5D6; --sun-700: #8F6300;
  --coral: #EE6446; --coral-50: #FDEBE6; --coral-700: #B23E24;
  --meadow: #3CA346; --meadow-50: #E7F5E9; --meadow-700: #23772E;
  --ffb-blue: #174390; --ffb-green: #3CA346; --ffb-go: #2F9A3D;
  --ffb-map: #2459C8; /* the brand blue, a little brighter so lines stay visible on aerial photos */
  --ffb-grad: linear-gradient(90deg, #174390 0%, #2F7FB0 55%, #3CA346 100%);
  --lilac: #8A6BDB; --lilac-50: #F0EBFB; --lilac-700: #5B3FB0;
  --shadow: 0 2px 10px rgba(20, 34, 61, .08), 0 10px 28px rgba(23, 67, 144, .08);
  --shadow-up: 0 -8px 30px rgba(20, 34, 61, .16);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --rail-w: 80px;
  --panel-w: 384px;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* The app fills the window and never scrolls as a whole; only the panel and lists scroll. */
html, body { height: 100%; }
html { overflow: hidden; }
body {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--fog);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 2px; }
h1, h2 { margin: 0; text-wrap: balance; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.art-svg { display: block; }
.spacer { flex: 1; }
.hand { font: 700 21px/1 var(--hand); color: var(--coral-700); }
.sub { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid transparent; font: 700 15px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--lake); color: #fff; box-shadow: 0 2px 8px rgba(23, 67, 144, .25); }
/* The main "go" actions in the green of the FlashFloodBreaker website buttons. */
.btn.go { background: var(--ffb-go); color: #fff; box-shadow: 0 2px 8px rgba(47, 154, 61, .28); }
.btn.go:hover { background: var(--meadow-700); }
.btn.primary:hover { background: var(--lake-700); }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--fog); }
.btn.soft { background: var(--lake-50); color: var(--lake-700); }
.btn.soft:hover { background: #DCE5F5; }
.btn.small { min-height: 34px; padding: 5px 13px; font-size: 13.5px; }
.btn.danger { color: var(--coral-700); }
.btn.active { background: var(--lake-50); color: var(--lake-700); border-color: var(--lake); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input, .file-link input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-link { position: relative; display: inline-block; color: var(--lake-700); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow: hidden; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: 700 13.5px var(--font); cursor: pointer; }
.chip-btn:hover { background: var(--fog); }

input[type="text"], input[type="search"], input[type="number"], select, .select {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: 600 15px var(--font);
}
input:focus, select:focus { outline: 3px solid var(--lake-50); border-color: var(--lake); }
input::placeholder { color: var(--muted); font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fields label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.fields .full { grid-column: 1 / -1; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding-block: calc(10px + env(safe-area-inset-top, 0px)) 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  background: var(--paper); z-index: 1200; position: relative;
}
/* A thin blue-to-green rule under the top bar, like the line in the FlashFloodBreaker logo. */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ffb-grad); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: 800 20px var(--font); white-space: nowrap; }
.brand img { display: block; }
/* The two colours of the FlashFloodBreaker logo: Interreg blue and the project green. */
.brand-name { color: var(--ffb-green); letter-spacing: -.01em; }
.brand-ffb { color: var(--ffb-blue); font-weight: 900; }
.plan-name { min-width: 0; }
.plan-name input { width: clamp(180px, 26vw, 360px); min-height: 38px; border-radius: 999px; background: var(--fog); border-color: transparent; font-weight: 700; padding: 6px 16px; }
.plan-name input:hover { border-color: var(--line); }
.save-state { color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
#btnPlansTop { display: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) var(--panel-w) 1fr; min-height: 0; }
.shell.home-mode { grid-template-columns: var(--rail-w) 1fr; }
.rail {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border-right: 1px solid var(--line); z-index: 900;
}
.rail-spacer { flex: 1; }
.rail-item {
  width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px; border: 0; border-radius: 14px; background: transparent; color: var(--muted);
  font: 700 11.5px var(--font); cursor: pointer;
}
.rail-item:hover { background: var(--fog); color: var(--ink); }
.rail-item.active { background: var(--lake-50); color: var(--lake); box-shadow: inset 3px 0 0 var(--ffb-green); }

/* ---------- The three steps: 1 Drone, 2 Plan, 3 Fly ---------- */
.rail-item { position: relative; }
.rail-no { position: absolute; top: 4px; right: 8px; width: 17px; height: 17px; border-radius: 50%; background: var(--sun-50); color: var(--sun-700); font: 800 10.5px/17px var(--font); text-align: center; }
.rail-item.active .rail-no { background: var(--ffb-go); color: #fff; }
.title-no { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; background: var(--ffb-go); color: #fff; font-size: 16px; vertical-align: 3px; }
.next-btn { align-self: stretch; padding: 13px 18px; font-size: 15.5px; }

/* The Plan page in four folding steps; the line on the right says where each one stands. */
.step { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 0 14px; }
.step > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 0; cursor: pointer; }
.step > summary::-webkit-details-marker { display: none; }
.step > summary::after { content: ''; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -4px 4px 0 2px; flex: none; transition: transform .15s; }
.step[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.step-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.step[data-step="where"] .step-no { background: var(--lake-50); color: var(--lake-700); }
.step[data-step="what"] .step-no { background: var(--sun-50); color: var(--sun-700); }
.step[data-step="safety"] .step-no { background: var(--coral-50); color: var(--coral-700); }
.step[data-step="check"] .step-no { background: var(--meadow-50); color: var(--meadow-700); }
.step-name { font-size: 16.5px; font-weight: 800; }
.step-meta { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; }
.step-meta.done { color: var(--meadow-700); }
.step-meta.todo { color: var(--sun-700); }
.step-meta.warn { color: var(--sun-700); }
.step-meta.bad { color: var(--coral-700); }
.step-body { display: flex; flex-direction: column; gap: 12px; padding: 0 0 16px; }
.step-body h2 { font-size: 15px; font-weight: 800; white-space: nowrap; }
.step-body .block-head { flex-wrap: wrap; row-gap: 4px; }

/* Smaller folding parts inside a step or page (camera details, fences). */
.fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary { flex-wrap: wrap; row-gap: 2px; }
.fold > summary h2 { font-size: 15px; font-weight: 800; white-space: nowrap; }
.fold > summary .subtle { font-size: 12.5px; }
.fold > summary::after { content: '+'; margin-left: auto; font-weight: 800; color: var(--muted); }
.fold[open] > summary::after { content: '–'; }
.fold-body { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--line); z-index: 1000; }
.sheet-handle, .sheet-top { display: none; }
/* position: relative keeps hidden screen-reader labels (.sr) inside the scrolling panel; without it they sat
   2000 px down the page and let the browser scroll the whole app out of view. */
.panel-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.view { padding: 22px 20px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; }
.view-title h1 { font-size: 24px; font-weight: 800; }
.view-title .sub { margin-top: 3px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block h2 { font-size: 16.5px; font-weight: 800; }
.block-head { display: flex; align-items: center; gap: 10px; }
.meta { margin: 0; font-size: 14px; }
.meta.subtle { color: var(--muted); font-size: 13px; }
.meta b { font-weight: 800; }
.card { border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; }

/* Summary tiles */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: 18px; padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile svg { width: 22px; height: 22px; }
.tile .v { font-size: 21px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.t-lake { background: var(--lake-50); } .t-lake svg { color: var(--lake-700); }
.t-sun { background: var(--sun-50); } .t-sun svg { color: var(--sun-700); }
.t-coral { background: var(--coral-50); } .t-coral svg { color: var(--coral-700); }
.t-meadow { background: var(--meadow-50); } .t-meadow svg { color: var(--meadow-700); }

.batteries { display: flex; flex-direction: column; gap: 10px; }
.batteries h3 { margin: 0; font-size: 15px; font-weight: 800; }
.batt { display: flex; flex-direction: column; gap: 5px; }
.batt .line { font-size: 13.5px; color: var(--muted); }
.batt .line b { color: var(--ink); font-weight: 800; }
.batteries .meta { margin: 0; font-size: 13px; }
.batt-set { display: flex; gap: 10px; flex-wrap: wrap; }
.batt-set label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--muted); flex: 1 1 120px; }
.batt-set input { width: 100%; }
.track { display: flex; gap: 3px; height: 10px; border-radius: 6px; background: var(--fog); overflow: hidden; }
.track span { display: block; height: 100%; border-radius: 6px; }
.batt.over .line { color: var(--coral-700); }

/* Safe heights */
.heights { display: flex; flex-direction: column; gap: 9px; position: relative; }
.heights h3 { margin: 0; font-size: 15px; font-weight: 800; }
.h-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper);
  color: var(--lake-700); font: italic 800 14px Georgia, serif; line-height: 1; cursor: pointer; flex: none;
  display: grid; place-items: center;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--lake-50); border-color: var(--lake); }
.h-pop {
  position: absolute; top: 46px; right: 12px; left: 12px; z-index: 20;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px rgba(30, 41, 51, .16);
  padding: 4px 14px; font-size: 12.5px; line-height: 1.45; color: var(--ink);
}
.h-pop p { margin: 9px 0; }
.h-pop b { font-weight: 800; }
.h-status { margin: 0; }
.h-status:empty { display: none; }
.hright { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.linkbtn.tiny { font-size: 12px; padding: 3px 5px; }
.h-mode { display: flex; gap: 4px; padding: 3px; background: var(--fog); border-radius: 999px; }
.h-mode button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 7px 10px; font: 700 13px var(--font); color: var(--muted); cursor: pointer; }
.h-mode button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(30, 41, 51, .14); }
.hwait { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--fog); border-radius: 999px; padding: 4px 10px; }
.edge-row { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.edge-row input { width: 64px; min-height: 34px; padding: 4px 8px; margin: 0 4px; }
.hrow { display: flex; align-items: center; gap: 10px; }
.hrow .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.htext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.htext b { font-size: 14px; font-weight: 800; }
.htext span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hok { font-size: 12.5px; font-weight: 800; color: var(--meadow-700); background: var(--meadow-50); border-radius: 999px; padding: 4px 11px; }
.hfoot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13.5px; font-weight: 600; }
.hfoot input[type="number"] { width: 64px; min-height: 34px; padding: 4px 8px; display: inline-block; margin: 0 4px; }
.hauto { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.hauto input { width: 17px; height: 17px; accent-color: var(--lake); margin: 0; }
.pass-safe { font-size: 13px; font-weight: 700; }
.pass-safe:empty { display: none; }
.pass-safe.ok { color: var(--meadow-700); }
.pass-safe.bad { color: var(--coral-700); }
.pass-safe.muted { color: var(--muted); font-weight: 600; }

/* Search */
.search { position: relative; display: flex; gap: 8px; align-items: center; }
.search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; height: 19px; }
.search input { padding-left: 38px; border-radius: 999px; }
.results { list-style: none; margin: 0; padding: 4px; border: 1.5px solid var(--line); border-radius: 16px; }
.results button { width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 9px 11px; font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.results button:hover { background: var(--fog); }
.results .dist { display: block; margin-top: 2px; font-weight: 500; font-size: 12.5px; color: var(--muted); }

/* Pass cards */
.passes { display: flex; flex-direction: column; gap: 10px; }
.pass { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); }
.pass.off { opacity: .6; }
.pass-main { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; }
.badge { width: 60px; height: 60px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.badge svg { width: 54px; height: 54px; stroke: none; }
.pass-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pass-title { font-size: 15.5px; font-weight: 800; }
.pass-detail { font-size: 13.5px; color: var(--muted); }
.pass-meta { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: 12px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked { background: var(--lake); }
.switch input:checked::after { transform: translateX(16px); }
.pass details { border-top: 1.5px solid var(--fog); }
.pass summary { list-style: none; cursor: pointer; padding: 9px 16px; font-size: 13.5px; font-weight: 700; color: var(--lake-700); }
.pass summary::-webkit-details-marker { display: none; }
.pass summary::before { content: "Change settings"; }
.pass details[open] summary::before { content: "Hide settings"; }
.pass .fields { padding: 2px 16px 12px; }
.pass-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 14px; }
.pass-pick { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); }
.add-row { display: flex; gap: 8px; }
.add-pass {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; border-radius: 16px; border: 1.5px dashed rgba(102, 113, 128, .5); background: transparent;
  color: var(--lake-700); font: 700 14px var(--font); cursor: pointer;
}
.add-pass svg { width: 18px; height: 18px; }
.add-pass:hover { background: var(--lake-50); border-color: var(--lake); }
.block-head .hand { white-space: nowrap; }
.pill-select { flex: none; }
.pill-select select { min-height: 34px; padding: 5px 30px 5px 13px; border-radius: 999px; border: 0; background-color: var(--lake-50); color: var(--lake-700); font: 700 13.5px var(--font); width: auto; }

.warnings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.warnings li { font-size: 14px; padding: 10px 13px; border-radius: 14px; background: var(--sun-50); }
.warnings li.ok { background: var(--meadow-50); }

/* Drone */
.drone-card { display: flex; flex-direction: column; gap: 8px; background: var(--fog); border: 0; }
.drone-card .app { font-weight: 800; font-size: 16px; }
.drone-card .price { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: 13.5px; }
.specs dt { color: var(--muted); font-weight: 600; }
.specs dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Fly */
.fly-head h1 { font-size: 22px; font-weight: 800; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; font-weight: 600; }
.steps .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.steps li:nth-child(4n+1) .num { background: var(--sun-50); color: var(--sun-700); }
.steps li:nth-child(4n+2) .num { background: var(--lake-50); color: var(--lake-700); }
.steps li:nth-child(4n+3) .num { background: var(--coral-50); color: var(--coral-700); }
.steps li:nth-child(4n+4) .num { background: var(--meadow-50); color: var(--meadow-700); }
.steps code { font-size: 12.5px; background: var(--fog); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.files { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 13px; border: 1.5px solid var(--line); border-radius: 16px; }
.file .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.file .ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file .ftext b { font-size: 14.5px; font-weight: 800; }
.file .ftext span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tip { border-radius: 16px; padding: 10px 14px 12px; background: var(--sun-50); font-size: 14px; font-weight: 600; }
.tip .hand { display: block; color: var(--sun-700); font-size: 22px; margin-bottom: 2px; }
.tip.coral { background: var(--coral-50); } .tip.coral .hand { color: var(--coral-700); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; font-weight: 600; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--lake); flex: none; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }

/* ---------- Map canvas ---------- */
.canvas { position: relative; min-width: 0; min-height: 0; padding: 14px; }
.mapcard { position: relative; isolation: isolate; width: 100%; height: 100%; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: #DDE5D5; }
#map, .view3d { position: absolute; inset: 0; }
#map { background: #DDE5D5; }
.view3d { background: #EEF2E6; z-index: 500; touch-action: none; visibility: hidden; pointer-events: none; }
.view3d.show { visibility: visible; pointer-events: auto; }
.view3d canvas { display: block; }
.cesium-holder { position: absolute; inset: 0; }
.cesium-holder .cesium-viewer, .cesium-holder .cesium-widget { width: 100%; height: 100%; }
.view3d .legend3d { position: absolute; right: 14px; bottom: 14px; color: var(--ink); font: 700 12.5px var(--font); background: rgba(255, 255, 255, .92); padding: 7px 12px; border-radius: 999px; pointer-events: none; box-shadow: var(--shadow); max-width: calc(100% - 28px); }
.v3d-panel { position: absolute; z-index: 600; top: 72px; left: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); max-width: calc(100% - 28px); }
.v3d-label { font-weight: 800; font-size: 13.5px; padding: 0 6px 0 9px; }
.v3d-panel button { border: 0; border-radius: 999px; padding: 7px 13px; background: transparent; color: var(--muted); font: 700 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.v3d-panel button:hover:not(:disabled) { background: var(--fog); }
.v3d-panel button[aria-pressed="true"] { background: var(--meadow-50); color: var(--meadow-700); }
.v3d-panel button[data-l="power"][aria-pressed="true"] { background: var(--coral-50); color: var(--coral-700); }
.v3d-panel button:disabled { opacity: .45; cursor: not-allowed; }
.leaflet-container { font-family: var(--font); }
.leaflet-container.crosshair { cursor: crosshair; }
.map-toolbar {
  position: absolute; z-index: 800; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow);
  max-width: calc(100% - 28px); overflow-x: auto; scrollbar-width: none;
}
.map-toolbar::-webkit-scrollbar { display: none; }
.seg { display: flex; gap: 2px; }
.seg button, .tb-toggle { border: 0; background: transparent; color: var(--ink); border-radius: 999px; padding: 7px 14px; font: 700 13.5px var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover, .tb-toggle:hover { background: var(--fog); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tb-toggle svg { width: 18px; height: 18px; }
.tb-toggle[aria-pressed="false"] { color: var(--muted); }
.tb-toggle[aria-pressed="true"] { background: var(--lake-50); color: var(--lake-700); }
.tb-toggle.cad[aria-pressed="true"] { background: var(--coral-50); color: var(--coral-700); }
.tb-div { width: 1.5px; height: 22px; background: var(--line); flex: none; }
/* The legend only explains the map: taps and drags go through it to the markers underneath, and it never covers more than half the map. */
.legend { position: absolute; z-index: 700; left: 14px; bottom: 14px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 15px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; max-width: 270px; pointer-events: none; max-height: 50%; overflow: hidden; opacity: .94; }
.legend h3 { margin: 0 0 2px; font-size: 14px; font-weight: 800; }
.legend .row { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend .sq { width: 12px; height: 12px; border-radius: 3px; border: 1.5px dashed var(--ffb-map); background: rgba(36, 89, 200, .12); flex: none; }
.legend:empty { display: none; }
.fab { position: absolute; z-index: 700; right: 14px; bottom: 150px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.leaflet-bottom.leaflet-right { margin-bottom: 6px; }
.leaflet-control-zoom.leaflet-bar { border: 0 !important; border-radius: 999px !important; box-shadow: var(--shadow) !important; overflow: hidden; margin-right: 14px !important; }
.leaflet-control-zoom a { width: 44px !important; height: 40px !important; line-height: 40px !important; font: 700 20px var(--font) !important; color: var(--ink) !important; border: 0 !important; }
.leaflet-control-scale-line { border-radius: 6px; border: 2px solid var(--ink) !important; border-top: 0 !important; background: rgba(255, 255, 255, .85) !important; font: 700 11px var(--font) !important; }
.leaflet-control-attribution { font-size: 10px; border-radius: 8px 0 0 0; }
.drawbar {
  position: absolute; z-index: 850; left: 50%; transform: translateX(-50%); top: 72px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--paper); box-shadow: var(--shadow); border-radius: 18px; padding: 8px 10px; max-width: calc(100% - 28px);
}
#drawMsg { font-weight: 800; font-size: 14.5px; padding: 0 6px; }
/* Heights that cannot be flown: on the map while planning, under the tool bar on the right. */
.heightwarn { position: absolute; z-index: 820; top: 132px; right: 14px; width: min(360px, calc(100% - 120px)); background: var(--coral-50); color: var(--ink); border: 2px solid var(--coral); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 14px 10px; font-size: 13.5px; line-height: 1.45; }
.heightwarn[hidden] { display: none; }
.heightwarn.info { background: var(--paper); border-color: var(--fog); }
/* Folded: a small pill that leaves the map under it free; tap it to open the box again. */
.heightwarn.pill { width: auto; padding: 5px 12px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.heightwarn.pill .hw-open { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; color: var(--coral-700); cursor: pointer; }
.heightwarn.info .hw-head { color: var(--ink); }
.heightwarn.info .hw-ic { background: var(--lake); }
.legend .bar { width: 16px; height: 5px; border-radius: 3px; flex: none; }
.hw-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px; color: var(--coral-700); padding-right: 22px; }
.hw-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.hw-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 21px; line-height: 1; cursor: pointer; color: var(--coral-700); }
.heightwarn ul { margin: 6px 0 4px; padding-left: 18px; }
.heightwarn li { margin: 3px 0; }
.heightwarn .linkbtn { color: var(--coral-700); font-weight: 800; }

/* Map markers */
.vx { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--ffb-map); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.vx.sel { background: var(--lake); }
.mid { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .9); border: 2px solid var(--ffb-map); }
.startpin { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #fff; color: #fff; display: grid; place-items: center; font: 800 12px var(--font); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.takeoff { position: relative; width: 28px; height: 36px; }
.takeoff svg { width: 28px; height: 36px; stroke: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.handlabel { position: absolute; left: 30px; top: -2px; white-space: nowrap; font: 700 22px/1 var(--hand); color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 8px #fff; pointer-events: none; }
.startlabel { position: absolute; left: -46px; top: -6px; white-space: nowrap; font: 700 20px/1 var(--hand); color: var(--sun-700); text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 8px #fff; pointer-events: none; }
.cad-pane { mix-blend-mode: multiply; }
.mapcard.is3d .leaflet-control-zoom, .mapcard.is3d .leaflet-control-scale, .mapcard.is3d .fab, .mapcard.is3d .leaflet-control-attribution { display: none; }

/* ---------- Home ---------- */
.home { grid-column: 2 / -1; overflow-y: auto; padding: 28px clamp(16px, 3vw, 40px) 40px; display: flex; flex-direction: column; gap: 22px; }
.banner {
  display: flex; align-items: center; gap: 24px; padding: 26px 32px 46px; border-radius: 26px;
  background: linear-gradient(105deg, var(--lake-50) 0%, #EEF4F6 50%, var(--meadow-50) 100%);
  position: relative; overflow: hidden; flex: none;
}
/* Two soft flood waves along the bottom of the banner, blue then green. */
.banner::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 26' preserveAspectRatio='none'%3E%3Cpath d='M0 14c20-9 40-9 60 0s40 9 60 0 40-9 60 0 40 9 60 0' fill='none' stroke='%23174390' stroke-opacity='.18' stroke-width='3'/%3E%3Cpath d='M0 21c20-9 40-9 60 0s40 9 60 0 40-9 60 0 40 9 60 0' fill='none' stroke='%233CA346' stroke-opacity='.35' stroke-width='3'/%3E%3C/svg%3E") repeat-x left bottom / 240px 26px;
}
.banner-text, .banner-art { position: relative; z-index: 1; }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.banner h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; color: var(--ffb-blue); }
.banner p { margin: 0; color: var(--muted); font-size: 16px; font-weight: 600; max-width: 62ch; }
.banner-art { width: 260px; height: 140px; flex: none; stroke: none; }
.home-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.home-head h2 { font-size: 21px; font-weight: 800; }
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1180px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1500px) { .tb-toggle .long { display: none; } }
.tpl { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 14px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .12s; }
.tpl:hover { transform: translateY(-2px); }
.tpl .art { height: 118px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 4px; }
.tpl .art svg { width: 96px; height: 96px; stroke: none; }
.tpl b { font-size: 16px; font-weight: 800; padding: 0 4px; }
.tpl span { font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); border: 2px solid transparent; }
.plan-card.current { border-color: var(--lake); }
.plan-card .thumb { display: block; width: 100%; height: 126px; border-radius: 14px; border: 0; padding: 0; overflow: hidden; cursor: pointer; background: #EEF2E6; }
.plan-card .thumb svg { width: 100%; height: 100%; stroke: none; }
.plan-card .ptext { padding: 2px 6px 0; display: flex; flex-direction: column; gap: 1px; }
.plan-card .ptext b { font-size: 15.5px; font-weight: 800; }
.plan-card .ptext span { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-card .pacts { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 2px; }
.linkbtn { border: 0; background: none; padding: 4px 6px; border-radius: 8px; font: 700 13px var(--font); color: var(--lake-700); cursor: pointer; }
.linkbtn:hover { background: var(--lake-50); }
.linkbtn.danger { color: var(--coral-700); }
.linkbtn.danger:hover { background: var(--coral-50); }
.plan-empty { padding: 26px; border-radius: 20px; border: 1.5px dashed rgba(102, 113, 128, .5); color: var(--muted); font-weight: 600; text-align: center; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 34, 61, .42); z-index: 3000; display: grid; place-items: center; padding: 16px; }
.dialog { width: min(540px, 100%); max-height: calc(100% - 32px); overflow-y: auto; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 22px; font-weight: 800; }
.dialog textarea { width: 100%; min-height: 84px; font: 12px ui-monospace, Consolas, monospace; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; background: var(--fog); color: var(--ink); resize: vertical; }
/* ---------- Account ---------- */
#dialog[data-kind="account"] #dlgBody { display: flex; flex-direction: column; gap: 12px; }
#dialog[data-kind="account"] #dlgBody > p { margin: 0; }
.dialog a { color: var(--lake); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(60, 163, 70, .7); text-decoration-thickness: 2px; }
.dialog a:hover { color: var(--meadow-700); }
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 14px 4px 10px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: 700 14.5px var(--font); cursor: pointer; white-space: nowrap; max-width: 190px;
}
.acct-btn:hover { background: var(--fog); }
.acct-btn .acct-av { display: none; }
.acct-btn.in { padding: 3px 14px 3px 3px; }
.acct-btn.in .acct-av { display: grid; }
.acct-btn.in .acct-ic { display: none; }
.acct-text { overflow: hidden; text-overflow: ellipsis; }
.acct-av {
  place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--meadow-50); color: var(--meadow-700); font: 800 13px var(--font); letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px var(--meadow);
}
.acct-btn.busy .acct-av { box-shadow: inset 0 0 0 2px var(--lake); background: var(--lake-50); color: var(--lake-700); }
.acct-btn.warn .acct-av { box-shadow: inset 0 0 0 2px var(--sun); background: var(--sun-50); color: var(--sun-700); }
.acct-av.big { display: grid; width: 52px; height: 52px; font-size: 19px; }
.acct-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--fog); }
.acct-card b { display: block; font-size: 16.5px; font-weight: 800; }
.acct-card span { color: var(--muted); font-size: 14px; font-weight: 600; word-break: break-all; }
.acct-hero { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--lake-50); }
.acct-hero p { margin: 0; font-weight: 700; color: var(--lake-700); }
.big-ic { width: 40px; height: 40px; color: var(--lake); stroke-width: 1.6; }
/* Microsoft's sign-in button style: white, thin grey border, the four-square logo, Segoe UI. */
.ms-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; align-self: flex-start;
  min-height: 44px; padding: 0 16px; border: 1px solid #8C8C8C; border-radius: 4px; background: #FFFFFF; color: #5E5E5E;
  font: 600 15px "Segoe UI", system-ui, -apple-system, sans-serif; cursor: pointer;
}
.ms-btn:hover { background: #F3F3F3; }
.ms-logo { width: 21px; height: 21px; flex: none; }
.pill-code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--fog); padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.addr-row { display: flex; align-items: center; gap: 6px; margin-top: -6px; }
.tip .btn-row { margin-top: 8px; }

.toast {
  position: fixed; z-index: 3500; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 700; max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; pointer-events: none;
}
.toast button { pointer-events: auto; background: rgba(255, 255, 255, .14); border: 0; color: #fff; border-radius: 999px; padding: 5px 12px; font: 800 13px var(--font); cursor: pointer; }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .topbar { gap: 10px; }
  .brand span, .save-state, #btnShare, #btnFlyTop, #btnInstall { display: none; }
  #btnPlansTop { display: inline-flex; }
  .acct-text { display: none; }
  .acct-btn, .acct-btn.in { padding: 3px; min-height: 38px; min-width: 38px; justify-content: center; }
  .plan-name { flex: 1; min-width: 0; }
  .plan-name input { width: 100%; font-size: 14px; padding: 6px 12px; }
  .shell, .shell.home-mode { grid-template-columns: 1fr; position: relative; }
  .rail { display: none; }
  .canvas { position: absolute; inset: 0; padding: 0; }
  .mapcard { border-radius: 0; box-shadow: none; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; height: 52%;
    border-right: 0; border-radius: 26px 26px 0 0; box-shadow: var(--shadow-up); transition: height .22s ease;
  }
  .panel.collapsed { height: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .panel.expanded { height: 90%; }
  .sheet-handle { display: grid; place-items: center; border: 0; background: none; padding: 8px 0 4px; cursor: pointer; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 5px; background: var(--line); }
  .sheet-top { display: flex; flex-direction: column; gap: 10px; padding: 2px 14px 10px; }
  .sheet-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .schip { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 4px; border-radius: 14px; font-weight: 800; font-size: 14px; white-space: nowrap; }
  .schip svg { width: 18px; height: 18px; }
  .sheet-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fog); }
  .sheet-seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px; font: 800 14px var(--font); color: var(--muted); cursor: pointer; }
  .sheet-seg button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
  .view { padding: 6px 14px calc(24px + env(safe-area-inset-bottom, 0px)); }
  #view-plan .view-title, #summary { display: none; }
  .map-toolbar { top: 10px; left: 10px; right: 10px; transform: none; max-width: none; }
  .legend { display: none; }
  .v3d-panel { top: 62px; left: 10px; }
  .view3d .legend3d { display: none; }
  .fab { bottom: auto; top: 66px; right: 10px; }
  .leaflet-top.leaflet-right { margin-top: 112px; }
  .leaflet-bottom.leaflet-right .leaflet-control-zoom { display: none; }
  .drawbar { top: auto; bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
  .heightwarn { top: 64px; left: 10px; right: 10px; width: auto; }
  .heightwarn.pill { left: auto; right: 10px; }
  .home { grid-column: 1; padding: 16px 14px 32px; }
  .banner { flex-direction: column; align-items: flex-start; padding: 20px; }
  .banner-art { width: 200px; height: 108px; align-self: flex-end; }
}
@media (max-width: 420px) {
  .fields { grid-template-columns: 1fr 1fr; gap: 8px; }
  .schip { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- Drone zones ---------------- */
.k-prohibited { --zc: #D7263D; } .k-authorisation { --zc: #F07C1B; } .k-conditional { --zc: #E8B10E; } .k-free { --zc: #2F9A3D; }
.zdot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--zc); box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.18); vertical-align: -1px; margin-right: 5px; }
.zdot.faint { opacity: .4; }
.tb-toggle.zones .zdot { margin-right: 6px; }
.tb-toggle.zones[aria-pressed="false"] .zdot { background: #B9C2CF; }
.zkey { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 12.5px; color: var(--muted); }
.zverdict { margin: 0 0 6px; padding: 9px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--ink); background: #FBF4EC; background: color-mix(in srgb, var(--zc) 16%, white); border-left: 4px solid var(--zc); }
.zverdict.ok { --zc: #2F9A3D; }
.zladder { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.zladder span { background: var(--zc); }
.zladder-ticks { position: relative; height: 16px; font-size: 11.5px; color: var(--muted); }
.zladder-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.zladder-ticks span:first-child { left: 0; transform: none; }
.zladder-ticks span:last-child { right: 0; left: auto; transform: none; }
.zlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.zlist li { display: flex; gap: 6px; align-items: flex-start; }
.zlist li .zdot { margin-top: 3px; }
.subtle { color: var(--muted); }
.zone-label { background: rgba(255,255,255,.92); border: 1.5px solid var(--zc); border-radius: 8px; color: var(--ink); font: 700 11.5px var(--font); padding: 2px 6px; box-shadow: none; white-space: nowrap; }
.zone-label::before { display: none; }
.zones-far .zone-label { display: none; }
.zpop .leaflet-popup-content { margin: 12px 14px; font: 13.5px/1.4 var(--font); color: var(--ink); }
.zpop p { margin: 4px 0; }
.zitem { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.zitem .zdot { margin-top: 3px; }

/* ---------------- QGroundControl extras ---------------- */
.mstats { margin: 4px 2px 0; }
.profile h3 { margin: 0 0 6px; }
.prof { width: 100%; height: auto; display: block; font: 10.5px var(--font); fill: var(--muted); }
.rallypin { width: 26px; height: 26px; border-radius: 50%; background: #7B4FD6; color: #fff; font: 800 11px/26px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }

/* ---------------- QGroundControl tools ---------------- */
.qtools { position: absolute; z-index: 710; left: 12px; top: 76px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; }
.qtools button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 6px 4px; border: 0; border-radius: 11px; background: none; font: 700 11px var(--font); color: var(--ink); cursor: pointer; }
.qtools button:hover { background: var(--fog); }
.qtools .qi { font-size: 17px; line-height: 1; color: var(--ffb-map, #2459C8); }
.toolmenu { position: absolute; z-index: 720; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 230px; }
.toolmenu button { text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 10px; font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.toolmenu button:hover { background: var(--fog); }
.wpinfo { position: absolute; z-index: 715; left: 84px; right: 70px; top: 76px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 9px 36px 9px 13px; font-size: 13px; line-height: 1.45; }
.wpinfo-x { position: absolute; right: 6px; top: 4px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.wppin { width: 26px; height: 26px; border-radius: 50%; background: var(--pc); color: #fff; font: 800 12px/22px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.wppin.sel { outline: 3px solid #fff; box-shadow: 0 0 0 5px var(--pc); }
.roipin { width: 34px; height: 22px; border-radius: 11px; background: #14223D; color: #F2A900; font: 800 11px/18px var(--font); text-align: center; border: 2px solid #fff; }
.wplist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wprow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; }
.wprow.sel { border-color: var(--ffb-map, #2459C8); background: var(--fog); }
.wprow label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); gap: 2px; width: 92px; }
.wprow label input, .wprow label select { width: 100%; }
.wpnum { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font: 800 12px var(--font); cursor: pointer; }
.flist { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.flist li { display: flex; align-items: center; gap: 8px; }
.flist li .btn { margin-left: auto; }
.fdot { width: 12px; height: 12px; border-radius: 3px; }
.fdot.in { border: 2.5px solid #7B4FD6; }
.fdot.out { background: rgba(200,30,58,.3); border: 2.5px dashed #C81E3A; }
.rallypin.small { width: 22px; height: 22px; font-size: 10px; line-height: 18px; display: inline-block; }
@media (max-width: 760px) {
  .qtools { top: 112px; left: 8px; padding: 4px; }
  .qtools button { min-width: 46px; font-size: 10px; padding: 4px 2px; }
  .wpinfo { left: 64px; right: 8px; top: 112px; }
}

/* ---------------- FFB Flight app and team projects ---------------- */
/* Which app flies the drone (Fly page). */
.target-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fog); align-self: flex-start; }
.target-seg button { padding: 7px 14px; color: var(--muted); }
.target-seg button[aria-pressed="true"] { background: var(--paper); color: var(--lake-700); box-shadow: 0 1px 6px rgba(20, 34, 61, .12); }
.send-box { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 12px 14px; border-radius: 16px; background: var(--meadow-50); }
.send-box .send-pick { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--meadow-700); }
.send-box .send-text { flex: 1; min-width: 170px; font-size: 14px; font-weight: 700; color: var(--meadow-700); }
.send-box .send-note { flex-basis: 100%; }
/* Projects on the Plans page. */
.prj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.prj-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.prj-card .prj-art { display: grid; place-items: center; height: 96px; border: 0; border-radius: 14px; cursor: pointer; padding: 0; }
.prj-card .prj-art svg { width: 82px; height: 62px; }
.prj-card .ptext { padding: 2px 6px 0; display: flex; flex-direction: column; gap: 1px; }
.prj-card .ptext b { font-size: 15.5px; font-weight: 800; }
.prj-card .ptext span { font-size: 13px; color: var(--muted); font-weight: 600; }
.prj-card .pacts { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 2px; }
a.linkbtn { text-decoration: none; }
.plan-card .ptext .in-prj { color: var(--meadow-700); }
.plan-empty .btn, .plan-empty .linkbtn { margin-left: 6px; vertical-align: middle; }
.prj-detail { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.prj-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prj-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.prj-body { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 14px; align-items: start; }
.prj-left { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.prj-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prj-map { height: 320px; border-radius: 16px; overflow: hidden; background: #EEF2E6; }
.flight-list { display: flex; flex-direction: column; gap: 8px; }
.flight-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--paper); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.flight-row:hover { background: var(--fog); }
.flight-row.on { border-color: var(--lake); background: var(--lake-50); }
.flight-row .ftext { display: flex; flex-direction: column; min-width: 0; }
.flight-row .ftext b { font-size: 14.5px; font-weight: 800; }
.flight-row .ftext span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rdot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--muted); }
.rdot.r-done { background: var(--meadow); }
.rdot.r-stopped, .rdot.r-returned { background: var(--sun); }
.rdot.r-failed { background: var(--coral); }
.rdot.r-live { background: var(--lake); box-shadow: 0 0 0 3px var(--lake-50); }
.thumb-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-items: center; }
.thumb-strip .thumb { flex: none; display: block; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--fog); }
.thumb-strip .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-strip .thumb-more { flex: none; padding: 0 6px; }
/* Live previews sent during the flight, until the full photos arrive. */
.thumb-strip .thumb-label { flex: none; display: flex; flex-direction: column; justify-content: center; max-width: 140px; padding: 6px 10px; border-radius: 10px; background: var(--lake-50); color: var(--lake-700); font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.thumb-strip .thumb-label small { font-size: 12px; font-weight: 600; color: var(--muted); }
.thumb-strip .thumb.live { outline: 2px solid var(--lake-50); }
.pick-list { display: flex; flex-direction: column; gap: 2px; }
.dialog textarea.plain { font: 600 14px/1.4 var(--font); }
@media (max-width: 860px) {
  .prj-body { grid-template-columns: 1fr; }
  .prj-left { max-height: none; }
  .prj-map { height: 260px; }
}
