/* Dovepass — UI v3 (CP58). Tokens and layout per docs/design/ui-v3-mockup-2026-10-05.html. */
:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #111827; --ink-2: #4b5563; --ink-3: #6b7280;
  --line: #e5e7eb; --brand: #2563eb; --brand-ink: #ffffff;
  --amber: #92400e; --amber-bg: #fffbeb; --amber-line: #fcd34d;
  --green: #166534; --green-bg: #f0fdf4; --green-line: #86efac;
  --red: #991b1b; --red-bg: #fef2f2; --red-line: #fca5a5;
  --r: 14px; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-pop: 0 6px 24px rgba(0,0,0,.14);
  --header-h: 56px;
  /* aliases for the legacy JS-driven content (icons etc.) */
  --go: var(--green); --cond: var(--amber); --nogo: var(--red); --info: var(--ink-2);
  --muted: var(--ink-3); --accent: var(--brand);
  --fs-small: 13px; --fs-label: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* class display rules must never resurrect hidden elements */
html, body { height: 100%; margin: 0; padding: 0; }
/* desktop: the page never scrolls — the answer column scrolls internally
   (the phone layout below needs the page scroll: map, side view, cards) */
@media (min-width: 901px) { html, body { overflow: hidden; } }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ---- */
header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s5);
  background: var(--card); border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; letter-spacing: -.01em; font-size: 17px; }
.h-sub { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: var(--s2); }
.h-right { display: flex; gap: var(--s2); align-items: center; }
.hbtn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; color: var(--ink-2); font-size: 13px; }
a.hbtn { text-decoration: none; cursor: pointer; display: inline-block; }
.hbtn-ghost { color: var(--ink-3); font-size: 12px; text-decoration: none; }
.hbtn-ghost:hover { text-decoration: underline; }
#editFlightBtn { display: none; } /* phone only */
#tripCard { display: none; } /* CP63: phone only — the compact trip card under the map */
/* CP62d: the rule line under an action step or a headline condition — the
   register source ("Rule: {source_title}", linked) or our own-margin line.
   Inside h1.vtitle and .step bodies alike (a span, display:block). */
.ruleline { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 3px; letter-spacing: normal; text-transform: none; }
.ruleline a { color: var(--brand); }
h1.vtitle .hline { display: block; }

/* ---- three-column app grid ---- */
main {
  display: grid;
  grid-template-columns: 320px 1fr 420px;
  grid-template-rows: minmax(0, 1fr); /* the answer column's content must never stretch the track */
  height: calc(100vh - var(--header-h));
  min-height: 0;
}
@media (min-width: 901px) and (max-width: 1279px) {
  main { grid-template-columns: 300px 1fr 360px; }
}

/* ---- left panel: Your flight ---- */
#controls {
  background: var(--card); border-right: 1px solid var(--line);
  padding: var(--s6) var(--s5); overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s5);
}
/* short windows (1280×800, 1024×640): compact the panel spacing so every
   control fits without page scroll (the mockup's spacing holds at 900 px) */
@media (max-height: 849px) and (min-width: 901px) {
  #controls { gap: var(--s4); padding-top: var(--s4); padding-bottom: var(--s4); }
}
.panel-title { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.fld { position: relative; }
.fld > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: var(--s1); }
.box { display: flex; align-items: center; gap: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.inwrap.box { padding: 0 12px; height: 42px; }
.inwrap.box input { flex: 1; min-width: 0; border: 0; outline: none; padding: 0; background: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.a { background: #16a34a; } .dot.b { background: #dc2626; }
.inx { border: 0; background: none; color: var(--ink-3); font-weight: 700; padding: 4px 6px; flex: none; }
.swap { align-self: flex-end; border: 0; background: none; font-size: 16px; color: var(--brand); padding: 0 var(--s2); height: 20px; margin: calc(-1 * var(--s3)) 0; }
.selbtn { width: 100%; text-align: left; }
.sub { font-size: 13px; color: var(--ink-3); margin-top: var(--s1); }
.info { border: 0; background: none; color: var(--brand); padding: 0 2px; }
#payloadRow { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
#batteryRow { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
#batteryRow select { flex: 1; min-width: 0; height: 32px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--s2); background: #fff; }
.inlinelbl { font-size: var(--fs-small); color: var(--ink-3); }
.inlineinp { width: 90px; height: 32px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--s2); }
.hint { font-size: var(--fs-small); color: var(--ink-3); margin: var(--s1) 0; }
.pill { display: inline-block; background: #312e5b; color: #fff; border-radius: 999px; padding: 1px var(--s2); font-size: var(--fs-small); margin-top: var(--s1); }

.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segbtn { padding: 8px; border: 0; background: #fff; color: var(--ink-2); font-size: 14px; text-align: center; }
.segbtn.on { background: #eff6ff; color: var(--brand); font-weight: 600; }
button.more { font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; width: 100%;
  border: 0; border-top: 1px solid var(--line); background: none; padding: var(--s4) 0 0; }
button.secondary { width: 100%; height: 36px; background: #fff; border: 1px solid var(--line); border-radius: var(--s2); color: var(--ink); }
button.ghost { background: none; border: 1px solid var(--line); border-radius: var(--s2); color: var(--ink); }
button.mini { font-size: var(--fs-small); padding: 2px var(--s2); height: auto; }
.runwrap { margin-top: auto; padding-top: var(--s2); }
#run {
  width: 100%; background: var(--brand); color: var(--brand-ink); border: 0;
  border-radius: 12px; padding: 14px; font-weight: 600; font-size: 16px;
}
#run:disabled { background: #aab4c4; cursor: not-allowed; }
#exampleSmall { margin-top: var(--s1); }
.msg { color: var(--red); font-size: var(--fs-small); margin-top: var(--s1); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } * { transition: none !important; } }

/* ---- centre column: map over the docked side view ---- */
.center { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
#map { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#dock.profile {
  flex: none; height: 250px; background: var(--card); border-top: 1px solid var(--line);
  padding: var(--s3) var(--s5) var(--s4); display: flex; flex-direction: column;
}
#dock .ph { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); flex: none; }
#dock .ph b { font-size: 14px; }
#dock .ph span { font-size: 12px; color: var(--ink-3); }
#profilePanel { flex: 1; min-height: 0; position: relative; }
#profilePanel canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
#dockCursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
#dock .readout { font-size: 13px; color: var(--ink-2); min-height: 20px; flex: none; }
#dock .readout b { color: var(--ink); }

/* map overlays */
.map-hint {
  /* CP58b: sits BELOW the map chip — it used to overlap it at result zooms,
     and its tail ("…see buildings") peeked out from behind the chip, reading
     as a second ghost chip (the CP58 review's "chip drawn twice"). */
  position: absolute; top: calc(var(--s4) + 40px); left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.92); padding: var(--s1) var(--s3); border-radius: 999px;
  font-size: var(--fs-small); color: var(--ink-3); z-index: 5; pointer-events: none;
}
.chip-map {
  position: absolute; top: var(--s4); left: var(--s4); z-index: 6;
  background: rgba(255,255,255,.95); border-radius: 999px; box-shadow: var(--shadow);
  padding: 6px 14px; font-size: 13px; color: var(--ink-2);
  /* one line, ellipsized (full text rides the title) so it can never wrap
     into the hint below on narrow screens */
  max-width: calc(100% - 2 * var(--s4)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legend {
  position: absolute; left: var(--s4); bottom: var(--s4); z-index: 6;
  background: rgba(255,255,255,.95); border-radius: 12px; box-shadow: var(--shadow);
  padding: var(--s3) var(--s4); font-size: 13px; display: grid; gap: 6px;
}
.legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }
.legend i.lg-route { background: var(--brand); }
.legend i.lg-site { background: #86b07a; height: 3px; }
.legend i.lg-mom { background: var(--ink); width: 10px; height: 10px; border-radius: 50%; }
.wps-toggle { display: flex; gap: 8px; align-items: center; margin: var(--s2) 0; cursor: pointer; }
.toast {
  position: absolute; top: var(--s3); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--s2);
  font-size: var(--fs-small); z-index: 30; box-shadow: var(--shadow-pop); max-width: 80%;
}

/* ---- right column: the answer cards ---- */
#answer { background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto; }
.ans-state { min-height: 100%; }
.ans-body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 var(--s3); font-size: 15px; }
.idlecard { margin: var(--s5); }
.idlecard h2, .progresscard h2 { margin: 0 0 var(--s2); font-size: 17px; }
.idlecard p { color: var(--ink-2); margin: 0 0 var(--s3); }
.idlecard .idle-phone { display: none; } /* CP62: the phone wording (the phone block above shows it) */

/* verdict card */
.verdict { position: relative; }
.verdict .vlabel { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.verdict h1.vtitle { margin: var(--s3) 0 var(--s1); font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.verdict p.why { margin: 0; color: var(--ink-2); }
.verdict .why:not(.open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.verdict .morebtn { border: 0; background: none; color: var(--brand); padding: 0; font-size: var(--fs-small); }
.verdict .copylink { position: absolute; top: var(--s2); right: var(--s2); border: 0; background: none; font-size: 16px; }
.v-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.v-amber .vlabel { background: #fde68a; color: var(--amber); }
.v-green { background: var(--green-bg); border-color: var(--green-line); }
.v-green .vlabel { background: #bbf7d0; color: var(--green); }
.v-red { background: var(--red-bg); border-color: var(--red-line); }
.v-red .vlabel { background: #fecaca; color: var(--red); }
.v-cant { background: #f9fafb; border-color: var(--line); }
.v-cant .vlabel { background: #e5e7eb; color: var(--ink-2); }
#copyRow { margin-top: var(--s2); }
#copyRow input { width: 70%; height: 30px; border: 1px solid var(--line); border-radius: var(--s2); padding: 0 var(--s2); }
#copyCustom { position: fixed; z-index: 60; }

/* action card: numbered steps + the permission tick */
.step { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); align-items: start; }
.step + .step, .step + .perm-entry, .perm-entry + .step { margin-top: var(--s4); }
.num { width: 28px; height: 28px; border-radius: 50%; background: #eff6ff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.step p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.step .who { font-weight: 600; color: var(--ink); }
.step .icon { font-weight: 700; margin-right: 4px; }
.step .icon.WARN { color: var(--amber); }
.step .icon.FAIL { color: var(--red); }
.step .icon.INFO { color: var(--ink-2); }
.step.clickable { cursor: pointer; border-radius: 10px; margin-left: calc(-1 * var(--s2)); margin-right: calc(-1 * var(--s2)); padding: var(--s2); }
.step.clickable:hover { background: #f3f4f6; }
.steplink { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; font-size: 15px; text-align: left; }
.steplink.on { color: var(--green); }
/* CP57c/CP58 (D20): the written-permission entries, inside the action card */
.perm-entry { }
.perm-entry .perm-lead { font-weight: 600; }
.perm-entry .perm-how { font-size: 14px; color: var(--ink-2); margin: var(--s1) 0; }
.perm-entry .perm-how a { color: var(--brand); }
/* CP61 (Part C): the legal reference is a small link under the plain how-to */
.perm-entry .perm-src { font-size: 12px; white-space: nowrap; }
.tick { margin-top: var(--s3); display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; font-size: 14px; }
.tick input { width: 20px; height: 20px; accent-color: #16a34a; flex: none; }
.tick.on { border-color: var(--green-line); background: var(--green-bg); }
.perm-note { font-size: 14px; color: var(--ink-2); margin-top: var(--s3); }

/* your flight stats */
#flightStats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); }
#flightStats .stat .k { font-size: 12px; color: var(--ink-3); }
#flightStats .stat .v { font-size: 17px; font-weight: 600; }

/* what happens along the way (numbered moments) */
.ev { display: grid; grid-template-columns: 26px 1fr auto; gap: var(--s3); align-items: start; padding: var(--s2); margin: 0 calc(-1 * var(--s2)); border-radius: 10px; cursor: pointer; }
.ev:hover, .ev.on { background: #f3f4f6; }
.evn { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ev .t { font-size: 14px; color: var(--ink); }
.ev .d { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* good to know */
.know ul { margin: 0; padding-left: 18px; }
.know li { margin: 0 0 var(--s3); color: var(--ink-2); font-size: 14px; }
.know li:last-child { margin-bottom: 0; }

/* downloads */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.dl button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; font-size: 14px; color: var(--ink); }
.dl button:disabled { color: #9ca3af; background: #f9fafb; cursor: not-allowed; }
.dlnote { font-size: 13px; color: var(--ink-3); margin-top: var(--s2); white-space: pre-wrap; }

/* folded cards */
details.card { padding: var(--s5); }
details.card summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; font-size: 15px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "+"; color: var(--ink-3); font-weight: 400; }
details[open].card summary::after { content: "−"; }
details.card .inner { margin-top: var(--s4); font-size: 14px; color: var(--ink-2); display: grid; gap: var(--s3); }
.why-row { display: flex; justify-content: space-between; gap: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.why-row:first-child { border-top: 0; padding-top: 0; }
.why-row .src { color: var(--ink-3); font-size: 13px; text-align: right; flex: none; max-width: 40%; }
.why-row .icon { font-weight: 700; margin-right: 6px; flex: none; }
.why-row .icon.PASS { color: var(--green); }
.why-row .icon.WARN { color: var(--amber); }
.why-row .icon.FAIL { color: var(--red); }
.why-row .icon.INFO { color: var(--ink-2); }
.why-row .w { flex: 1; }
.rulessum { font-size: 14px; color: var(--ink-2); }
.note { font-size: 12px; color: var(--ink-3); text-align: center; padding: var(--s2) 0 var(--s4); }
.stale-note { background: #fff; border: 1px solid var(--amber-line); border-radius: var(--s2); padding: var(--s1) var(--s2); font-size: var(--fs-small); color: var(--amber); }
.dimmed { opacity: 0.5; }

/* checks groups (inside Technical details) */
.techinner { position: relative; } /* CP58: anchor the visually-hidden heading inside the scroll chain — absolute against the root it extends the page's scroll area */
.check-group { border: 1px solid var(--line); border-radius: var(--s2); }
.check-group > summary { padding: var(--s2) var(--s3); cursor: pointer; font-weight: 600; font-size: 14px; display: block; }
.check-group > summary::after { content: none; }
.group-body { padding: 0 var(--s3) var(--s2); }
.check { border-top: 1px solid var(--line); padding: var(--s2) 0; }
.check .rowline { display: flex; gap: var(--s2); align-items: baseline; }
.check .icon { flex: 0 0 1.1em; font-weight: 700; }
.check .icon.PASS { color: var(--green); }
.check .icon.WARN { color: var(--amber); }
.check .icon.FAIL { color: var(--red); }
.check .icon.INFO { color: var(--ink-2); }
.check .plain { flex: 1; }
.check details { margin-top: var(--s1); border: 0; padding: 0; box-shadow: none; background: none; }
.check details summary { font-size: var(--fs-small); color: var(--brand); cursor: pointer; display: block; font-weight: 400; }
.check details summary::after { content: none; }
.check .tech { font-size: var(--fs-small); color: var(--ink-3); white-space: pre-wrap; margin-top: var(--s1); }
.check .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-small); color: var(--ink-3); }
.profcanvas { width: 100%; height: 220px; border: 1px solid var(--line); border-radius: var(--s2); }
#optSummary.stats { font-size: var(--fs-small); margin-top: var(--s2); display: block; }
#optSummary .row { display: flex; justify-content: space-between; padding: 2px 0; gap: var(--s4); }
#optSummary .row span:last-child { font-weight: 600; text-align: right; }
#optSummary details { border: 0; box-shadow: none; padding: 0; background: none; }
#optSummary details summary { font-size: var(--fs-small); color: var(--brand); display: block; font-weight: 400; }
#optSummary details summary::after { content: none; }
.bvlos { color: var(--amber); font-size: var(--fs-small); margin-top: var(--s2); }
.footer-meta { font-size: var(--fs-small); color: var(--ink-3); }
.feedback-btn {
  display: block; padding: var(--s2) var(--s4); text-align: center;
  border: 1px solid var(--line); border-radius: var(--s2); text-decoration: none; color: var(--ink);
  margin-top: var(--s3);
}
.feedback-btn:hover { background: #f0f2f6; }

/* progress step list */
.steplist { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.steplist li { padding: var(--s1) 0; color: var(--ink-3); font-size: 14px; }
.steplist li.done { color: var(--ink); }
.steplist li.run { color: var(--brand); }
.steplist .ico { display: inline-block; width: 1.2em; }

/* ---- CP52: key-value tech tables, close-building list, map labels, NA line ---- */
.techtable { border-collapse: collapse; width: 100%; margin: var(--s1) 0; font-size: var(--fs-small); table-layout: fixed; }
.techtable td { padding: 2px var(--s2) 2px 0; vertical-align: top; border-bottom: 1px solid #eef1f5; overflow-wrap: anywhere; }
.techtable td.k { color: var(--ink-3); white-space: nowrap; width: 1%; padding-right: var(--s3); }
.techtable td.stale { color: var(--amber); font-weight: 600; }
.technotes { margin: var(--s1) 0 var(--s1) var(--s4); padding: 0; font-size: var(--fs-small); color: var(--ink-3); }
.technotes li { margin: 2px 0; }
.dt-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: var(--s3) 0 var(--s1); }
/* CP58 (bug 2 fix): the titled Details tables live in the narrow card column —
   stack every row (key above value) so no cell can ever overlap its neighbour
   at any window width. */
.techtable.dt, .techtable.dt tbody, .techtable.dt tr { display: block; width: 100%; }
.techtable.dt tr { border-bottom: 1px solid var(--line); padding: var(--s1) 0; }
.techtable.dt td { display: block; width: 100%; padding: 0 0 0 var(--s3); border-bottom: 0; }
.techtable.dt td.k { padding-left: 0; font-weight: 600; color: var(--ink-2); white-space: normal; }
.closelist { margin: var(--s1) 0 var(--s1) 20px; }
.closelist-head { font-size: var(--fs-small); color: var(--ink-3); margin-bottom: 2px; }
.closeb { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 2px 0; font-size: var(--fs-small); color: var(--brand); }
.closeb:hover { text-decoration: underline; }
.map-label { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.closeb-label { color: #9a6a00; border-color: #9a6a00; }
.na-line { margin-top: var(--s2); font-size: var(--fs-small); color: var(--ink-3); border: 0; box-shadow: none; padding: 0; background: none; }
.na-line summary { font-size: var(--fs-small); color: var(--ink-3); display: block; font-weight: 400; }
.na-line summary::after { content: none; }
#momentsMore { font-size: var(--fs-small); color: var(--ink-3); }

/* ---- popovers + modals ---- */
.pop {
  position: fixed; z-index: 50; background: #fff; border-radius: var(--r);
  box-shadow: var(--shadow-pop); padding: var(--s3);
  transition: opacity 150ms ease, transform 150ms ease;
  max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain;
}
.pop#dronePop { width: 300px; }
.poplist { max-height: 280px; overflow-y: auto; margin-top: var(--s2); }
.poplist .grp { font-weight: 700; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: var(--s2) var(--s1) var(--s1); }
.poplist button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: var(--s2) var(--s1); border-radius: var(--s1); }
.poplist button:hover, .poplist button.active { background: #eef4ff; }
.pop.specs { width: 340px; font-size: var(--fs-small); color: var(--ink-3); white-space: pre-wrap; }
.pop#tripPop { width: 300px; }
.pop#tripPop label { display: block; margin: var(--s2) 0; font-size: var(--fs-small); color: var(--ink-3); }
.pop#tripPop input[type="number"] { width: 90px; height: 32px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--s2); }
.pop#tripPop input[type="datetime-local"] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: var(--s2); padding: 0 var(--s2); }
.pop#tripPop hr { border: 0; border-top: 1px solid var(--line); margin: var(--s2) 0; }
.pop#tripPop .row { display: flex; align-items: center; gap: var(--s2); color: var(--ink); font-size: 14px; flex-wrap: wrap; }
.pop#tripPop .row input { width: auto; height: auto; }
.pop#tripPop details summary { cursor: pointer; font-size: var(--fs-small); color: var(--brand); }
.pop-sec-title { font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: var(--s1); }
#droneFilter { width: 100%; height: 36px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--s2); }
.sugg {
  position: absolute; z-index: 60; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--s2);
  box-shadow: var(--shadow-pop); max-height: 220px; overflow-y: auto;
}
.sugg button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: var(--s2) var(--s3); font-size: 14px; }
.sugg button:hover, .sugg button.active { background: #eef4ff; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(20,26,38,0.45); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--r); padding: var(--s4); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-box.narrow { max-width: 480px; }
.modal-box h2 { margin-top: 0; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s3); }
.cf-sec { border: 1px solid var(--line); border-radius: var(--s2); margin: var(--s2) 0; padding: 0 var(--s3) var(--s2); }
.cf-sec legend { font-size: var(--fs-small); font-weight: 600; color: var(--ink-3); padding: 0 var(--s1); }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); }
.cf-field { display: block; margin: var(--s1) 0 var(--s2); font-size: var(--fs-small); color: var(--ink-3); }
.cf-field input, .cf-field select { display: block; width: 100%; height: 32px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--s2); margin-top: 2px; background: #fff; }
.cf-field.cf-wide { grid-column: 1 / -1; }
.cf-use { display: block; margin-top: 2px; font-size: 11px; line-height: 1.3; color: var(--ink); }
.cf-find { display: block; font-size: 11px; line-height: 1.3; color: var(--ink-3); opacity: .85; }
.cf-conv { font-size: 11px; color: var(--ink-3); }
.cf-adv { margin: var(--s2) 0; }
.cf-adv > summary { cursor: pointer; font-size: var(--fs-small); color: var(--brand); }
.cf-hint { font-size: var(--fs-small); color: var(--ink-3); margin: var(--s2) 0; }
.cf-btns { display: flex; gap: var(--s2); margin-top: var(--s2); }
.cf-btns button { height: 36px; padding: 0 var(--s4); }
#cfSave { background: var(--brand); color: #fff; border: 0; border-radius: var(--s2); }
.custom-list { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s2); }
.custom-list .crow { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0; font-size: var(--fs-small); }
.custom-list .crow .name { flex: 1; }
#attestList label { display: flex; gap: var(--s2); align-items: center; font-size: 14px; margin: var(--s2) 0; }
#attestList label input { flex: 0 0 auto; width: 18px; height: 18px; }
#attestList .ref { margin-left: auto; }
#attestList .ref button { border: 0; background: none; color: var(--brand); padding: 0 2px; }

.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---- phone (≤ 900 px): one scrolling column — map, trip card, side view, then the answer ---- */
@media (max-width: 900px) {
  :root { --header-h: 44px; }
  header { padding: 0 var(--s3); }
  .h-sub { display: none; }
  #editFlightBtn { display: inline-block; }
  main { display: block; height: calc(100vh - var(--header-h)); overflow-y: auto; }
  #controls { display: none; }
  body.edit-flight #controls {
    display: flex; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    z-index: 40; border-right: 0;
  }
  .center { border-right: 0; display: block; }
  /* CP63: the map is shorter — the first screen must carry the map AND the
     trip card (from / to / drone / Check this flight) together */
  #map { height: clamp(210px, 32vh, 300px); }
  /* CP63: the compact trip card directly under the map (owner feedback
     2026-10-26). From/To/drone rows open the Edit-flight panel; Check this
     flight is exactly #run's handler (one run path, app.js). */
  #tripCard { display: block; padding: var(--s2) var(--s3) var(--s3); background: var(--card); border-bottom: 1px solid var(--line); }
  .tc-row {
    display: flex; align-items: baseline; gap: var(--s2); width: 100%;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    padding: 8px 12px; margin: 0 0 var(--s2); text-align: left; cursor: pointer;
  }
  .tc-lbl { flex: 0 0 44px; font-size: 12px; color: var(--ink-3); }
  .tc-val { flex: 1 1 auto; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tc-row.plain .tc-val { color: var(--ink-3); }
  .tc-run {
    width: 100%; padding: 12px; background: var(--brand); color: var(--brand-ink);
    border: 0; border-radius: 12px; font-weight: 600; font-size: 16px;
  }
  .tc-run:disabled { opacity: .5; }
  #dock.profile { height: 230px; padding: var(--s2) var(--s3) var(--s3); }
  #dock .ph span { display: none; }
  #answer { border-left: 0; overflow: visible; }
  .ans-state { min-height: 0; }
  /* CP62: exactly one idle-card text per layout (both wordings live in the
     markup; the desktop one never shows at this width) */
  .idlecard .idle-desktop { display: none; }
  .idlecard .idle-phone { display: block; }
}
