/* Visual language: Quentin Technologies official style (design tokens, typography, buttons, cards, kickers, tags).
   Source: Quentin Technologies/QT_Off_Style.css. The tokens below keep the official names; the older short names are aliases.
   Status colours (good, warning, bad) and the map colours are not brand colours and keep their own values.
   Brand typefaces are hosted with the page (SIL Open Font License; licence texts sit next to the files). Latin subset. */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/source-serif-4-var.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/inter-var.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --bg: #0a0e14; --bg-alt: #0d1219; --surface: #111826; --surface-2: #141d2b;
  --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2f6; --text-dim: #9fb0c3; --text-faint: #6b7c91;
  --teal: #00f5c4; --blue: #00b8ff; --purple: #7c5cff;
  --accent-grad: linear-gradient(120deg, var(--teal), var(--blue));
  --radius: 10px; --radius-lg: 18px;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shadow-glow: 0 0 0 1px rgba(0, 245, 196, 0.12);
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --muted: var(--text-dim); --mono: var(--font-mono);
  --ok: #33c48d; --warn: #ffb020; --fault: #ff4757; --est: #ffb020; --route: #6b7c91;
  accent-color: var(--teal); color-scheme: dark;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
html, body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 13px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; overflow-x: hidden; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 14px; background: rgba(10, 14, 20, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20; }
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; min-width: 0; }
.sitelinks { display: inline-flex; align-items: baseline; gap: 12px; margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--border); white-space: nowrap; }
.sitelinks a { color: var(--text); font-size: 13px; text-decoration: none; }
.sitelinks a.all { color: var(--muted); }
.sitelinks a:hover, .sitelinks a:focus-visible { color: var(--teal); }
.brand .logo { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .02em; background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { color: var(--muted); margin-left: 8px; font-size: 13px; }
.statebox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.chip { font-family: var(--mono); font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-dim); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 500; margin-left: 4px; }
.chip.good b { color: #7ff0bf; } .chip.bad b { color: #ff9aa4; } .chip.warn b { color: #ffd27a; }
.tourbtn, .helptoggle { background: transparent; border: 1px solid var(--border-strong); color: var(--text); border-radius: 999px; padding: 1px 14px;
  font-family: var(--mono); font-size: 12px; cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.tourbtn:hover, .helptoggle:hover { border-color: var(--teal); color: var(--teal); }
.helptoggle { color: var(--muted); }
.helptoggle.on { border-color: rgba(0, 245, 196, 0.4); color: var(--teal); background: rgba(0, 245, 196, 0.08); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent-grad); color: #04140f; border: 1px solid transparent;
  padding: 5px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; box-shadow: 0 4px 16px -6px rgba(0, 245, 196, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -6px rgba(0, 245, 196, 0.45); }
.btn.ghost { background: rgba(255,255,255,0.02); color: var(--text); border-color: var(--border-strong); box-shadow: none; font-weight: 500; }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); box-shadow: none; }
.btn.small { padding: 2px 10px; font-size: 12px; }
.btn[disabled] { cursor: not-allowed; opacity: .45; transform: none; }

/* the front door */
.demo { padding: 16px 16px 12px; background: radial-gradient(ellipse 60% 140% at 50% -40%, rgba(0, 245, 196, 0.06), transparent 70%), linear-gradient(var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--border); }
.demo-head h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.demo-head p { margin: 0 0 8px; color: var(--text-dim); font-size: 14px; max-width: 980px; }
.demo-head p.speednote { font-size: 13px; color: var(--text-faint); margin-bottom: 12px; }
.demo-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.demo-groups { display: flex; flex-wrap: nowrap; gap: 10px 18px; align-items: stretch; }
.dgroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 0; }
.dgroup-name { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.dgroup-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 8px; flex: 1; }
.dcard { text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 2px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition); }
.dcard:hover { border-top-color: var(--teal); background: var(--surface-2); }
.dcard.sel { border-color: rgba(0, 245, 196, 0.4); border-top-color: var(--teal); background: var(--surface-2); box-shadow: var(--shadow-glow); }
.dcard .dt { font-weight: 600; font-size: 14px; line-height: 1.25; letter-spacing: -0.01em; }
.dcard .dd { color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.dcard .dw { color: var(--text-faint); font-size: 12px; line-height: 1.4; }
.dcard .de { color: var(--text-dim); font-family: var(--mono); font-size: 12px; margin-top: auto; padding-top: 4px; }
.demo-controls { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.demo-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.demo-choice .muted { margin-right: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.seg, .wseg { background: rgba(255,255,255,0.02); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 14px; cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition); }
.seg:hover, .wseg:hover { border-color: var(--teal); color: var(--teal); }
.seg.sel, .wseg.sel { background: rgba(0, 245, 196, 0.12); border-color: var(--teal); color: var(--teal); font-weight: 600; }
.demo-buttons { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.demo-run { font-size: 15px; font-weight: 700; padding: 7px 24px; }
.selname { color: var(--text-dim); font-size: 13px; }
.demo-busy { flex-basis: 100%; background: #3a2d10; border: 1px solid #7a5a1c; color: #ffd98a; border-radius: var(--radius); padding: 6px 12px; font-size: 13px; }
.demo-run-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dr-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.dr-head h2 { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.dr-kicker { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 2px; }
.dr-phase { font-family: var(--mono); font-size: 12px; color: var(--text-dim); text-align: right; }
.dr-headright { display: flex; align-items: center; gap: 8px; }
.dr-prog { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.dr-prog i { display: block; height: 100%; background: var(--accent-grad); width: 0; transition: width .4s; }
.dr-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stg { font-family: var(--mono); font-size: 12px; padding: 2px 11px; border-radius: 999px; background: rgba(255,255,255,0.02); color: var(--text-dim); border: 1px solid var(--border); }
.stg.on { color: var(--text); border-color: rgba(0, 184, 255, 0.5); background: rgba(0, 184, 255, 0.1); }
.dr-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dr-split.has-map { grid-template-columns: minmax(0, 1fr) minmax(340px, 46%); align-items: start; }
.dr-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dr-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dr-map-slot, .dr-drone-slot { min-width: 0; }
.dr-result { border-radius: var(--radius); padding: 10px 16px; border: 1px solid; }
.dr-result b { font-size: 18px; display: block; }
.dr-result span { color: #cfdbe6; font-size: 14px; }
.dr-result.recovered { background: #0f2c20; border-color: #2a8c60; box-shadow: 0 0 0 1px rgba(42, 140, 96, .18); }
.dr-result.held { background: #112636; border-color: #2f7aa8; box-shadow: 0 0 0 1px rgba(47, 122, 168, .18); }
.dr-result.nothing { background: #2a2216; border-color: #8a6a2a; box-shadow: 0 0 0 1px rgba(138, 106, 42, .18); }
.dr-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kc { background: var(--surface-2); border: 1px solid var(--border); border-top: 2px solid var(--border); border-radius: var(--radius); padding: 8px 12px; transition: border-color var(--transition); }
.kc:hover { border-top-color: var(--teal); }
.kc b { display: block; font-size: 15px; font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
.kc span { font-size: 13px; color: var(--muted); }
.kc.good b { color: #7ff0bf; } .kc.bad b { color: #ff9aa4; }
.handover { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.handover h3 { margin: 0 0 6px; }
.handover dl { margin: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 3px 12px; font-size: 13px; }
.handover dt { color: var(--text-dim); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; padding-top: 1px; }
.handover dd { margin: 0; overflow-wrap: anywhere; }
.handover dd div + div { margin-top: 2px; }
h3 { margin: 10px 0 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h3 .copybtn { margin-left: 10px; text-transform: none; letter-spacing: 0; }
.dr-compare { font-size: 13px; color: var(--text-dim); border-top: 1px dashed var(--border-strong); padding-top: 8px; }
.dr-compare .ct { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dr-story { display: flex; flex-direction: column; gap: 3px; font-size: 13px; max-height: 34vh; overflow: auto; }
.sty { display: grid; grid-template-columns: 58px 88px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 2px 0; border-bottom: 1px solid var(--border); }
.sty .st { font-family: var(--mono); color: var(--text-dim); font-size: 12px; }
.sty .sg { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.sty .tx { overflow-wrap: anywhere; }
.sty.fault .sg { color: #ff8a95; } .sty.observed .sg { color: #7fc8ff; } .sty.concluded .sg { color: #c9b8ff; }
.sty.action .sg { color: #ffd27a; } .sty.outcome .sg { color: #7ff0bf; } .sty.autopilot .sg { color: var(--text-faint); }
.sty.autopilot .tx { color: var(--text-dim); }
.copybtn { padding: 2px 12px; font-size: 12px; line-height: 1.5; }

/* map and strips */
.mapbox { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mapbox svg { width: 100%; height: auto; display: block; }
.map-bg { fill: #0c121b; }
.map-grid { stroke: rgba(255,255,255,.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-gridtxt { fill: #6b7c91; font-family: var(--font-mono); font-size: 6px; }
.map-fence { fill: none; stroke: #ff6b78; stroke-width: 1.4; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.map-fencetxt { fill: #ff9aa4; font-family: var(--font-sans); font-size: 6.5px; }
.map-area { fill: rgba(0, 184, 255, .06); stroke: none; }
.map-route { fill: none; stroke: var(--route); stroke-width: 1.2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.map-wp { fill: #0c121b; stroke: var(--route); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-wptxt { fill: #9fb0c3; font-family: var(--font-mono); font-size: 5.2px; text-anchor: middle; dominant-baseline: central; }
.map-home { fill: #0c121b; stroke: #eef2f6; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.map-hometxt { fill: #eef2f6; font-family: var(--font-sans); font-size: 6.5px; font-weight: 600; }
.map-true { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-est { fill: none; stroke: var(--est); stroke-width: 1.4; stroke-dasharray: 2 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-gap { stroke: var(--est); stroke-width: 1; stroke-dasharray: 1 2; vector-effect: non-scaling-stroke; }
.map-quad-arm { stroke: #cfe9e3; stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-quad-rotor { fill: rgba(0, 245, 196, .22); stroke: var(--teal); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.map-quad-rotor.rear { fill: rgba(159, 176, 195, .16); stroke: #9fb0c3; }
.map-quad-body { fill: #0c121b; stroke: var(--teal); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.map-quad-nose { fill: var(--teal); stroke: #04140f; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-dot-est { fill: rgba(255,176,32,.16); stroke: var(--est); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-fault { stroke: #ff4757; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.map-clear { stroke: #9fb0c3; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.map-cmd { fill: #ffd27a; stroke: #0c121b; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-marktxt { fill: #eef2f6; font-family: var(--font-sans); font-size: 5.6px; paint-order: stroke; stroke: #0c121b; stroke-width: 1.6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-dim); }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 5px; }
.legend i.true { border-color: var(--teal); } .legend i.est { border-color: var(--est); border-top-style: dashed; }
.legend i.route { border-color: var(--route); border-top-style: dashed; border-top-width: 2px; }
.legend i.fence { border-color: #ff6b78; border-top-style: dashed; border-top-width: 2px; }
.legend i.fault { border: 0; width: auto; height: auto; color: #ff4757; font-style: normal; font-weight: 700; }
.legend i.fault::before { content: "\2715"; }
.legend i.cmd { border: 0; width: auto; height: auto; color: #ffd27a; font-style: normal; }
.legend i.cmd::before { content: "\25C6"; }
.strips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.strip { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; min-width: 0; }
.strip .sh { display: flex; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.strip .sh b { color: var(--text); font-weight: 500; }
.strip svg { width: 100%; height: 34px; }
.spark { fill: none; stroke: var(--blue); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark.pack { stroke: var(--ok); }
.spark-mark { stroke: rgba(255,71,87,.7); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }

/* the drone view */
.dronebox { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dronebox h3 { margin-top: 0; }
.dview { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #070b11; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dview canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.dview canvas:active { cursor: grabbing; }
.dhud { position: absolute; font-family: var(--mono); font-size: 12px; color: #cfe8ff; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 4px; pointer-events: none; max-width: calc(100% - 100px); }
.dhud.tl { top: 6px; left: 6px; } .dhud.bl { bottom: 6px; left: 6px; } .dhud.br { bottom: 6px; right: 6px; color: var(--text-faint); transition: opacity .6s; }
.dhud.gone { opacity: 0; } .dhud:empty { display: none; }
.dkey { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-dim); }
.dkey .dk { white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: #33c48d; border: 2px solid transparent; }
.dot.normal { background: #33c48d; } .dot.fault { background: transparent; border: 2px dashed #ff8c42; }
.dot.suspects { background: #ff5d5d; } .dot.concluded { background: #b48cff; } .dot.out { background: #5b6578; } .dot.lost { background: #f2b84b; }
.dparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 8px; }
.pc { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px; min-width: 0; font-size: 12px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; }
.pc b { font-weight: 600; white-space: nowrap; } .pc .ps { color: var(--text-dim); min-width: 0; }
.pc .dot { flex: none; align-self: center; margin-right: 2px; }
.pc.fault .dot { background: transparent; border: 2px dashed #ff8c42; } .pc.suspects .dot { background: #ff5d5d; } .pc.concluded .dot { background: #b48cff; }
.pc.out .dot { background: #5b6578; } .pc.lost .dot { background: #f2b84b; } .pc.normal .dot { background: #33c48d; }
.pc.ringed .dot { box-shadow: 0 0 0 2px #ff8c42; }
.pc.suspects { border-color: rgba(255, 93, 93, .5); } .pc.concluded { border-color: rgba(180, 140, 255, .5); } .pc.fault { border-color: rgba(255, 140, 66, .5); }
.pc.lost { border-color: rgba(242, 184, 75, .5); }

/* advanced */
.adv { margin: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.adv > summary { cursor: pointer; padding: 10px 16px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.adv-body { padding: 0 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.adv-body h3 { margin-top: 0; }
table.tele { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tele td { padding: 3px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tele td:first-child { color: var(--text-dim); }
table.tele td.v { font-family: var(--mono); text-align: right; white-space: nowrap; }
table.tele td.sp { width: 110px; }
table.tele td.sp svg { width: 100px; height: 20px; display: block; }
.advlist { display: flex; flex-direction: column; gap: 6px; }
.advitem { text-align: left; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; cursor: pointer; }
.advitem:hover { border-color: var(--teal); }
.advitem.sel { border-color: rgba(0, 245, 196, .5); box-shadow: var(--shadow-glow); }
.advitem .dt { font-weight: 600; } .advitem .dd { color: var(--text-dim); font-size: 12px; }
.foot { padding: 6px 16px 22px; color: var(--text-faint); font-size: 12px; max-width: 980px; }

/* hover help */
.helpbubble { position: fixed; z-index: 9999; max-width: 320px; pointer-events: none; background: rgba(17, 24, 38, .97); color: var(--text);
  border: 1px solid rgba(0, 245, 196, 0.4); border-radius: var(--radius); padding: 9px 12px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 6px 22px rgba(0,0,0,.55), var(--shadow-glow); font-weight: 400; letter-spacing: 0; text-transform: none; }
.helpbubble b { display: block; color: var(--teal); font-size: 13px; margin-bottom: 3px; }
.helpbubble p { margin: 0 0 5px; color: var(--text); } .helpbubble p:last-child { margin-bottom: 0; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: var(--radius); z-index: 60; font-size: 13px; max-width: calc(100vw - 24px); }
.toast.err { border-color: var(--fault); color: #ffc1c7; }

/* guided tour */
.tour { pointer-events: none; }
.tour-dim { position: fixed; inset: 0; z-index: 9000; background: rgba(10, 14, 20, .78); }
.tour-hole { position: fixed; z-index: 9000; border-radius: var(--radius); outline: 2px solid var(--teal); outline-offset: 0;
  box-shadow: 0 0 0 9999px rgba(10, 14, 20, .78), 0 0 18px 2px rgba(0, 245, 196, .35); transition: all .25s cubic-bezier(.4,0,.2,1); }
.tour-hole + .tour-hole { box-shadow: none; }
.tour:not(.nohole) .tour-dim { display: none; }
.tour.nohole .tour-dim { display: block; }
.tour-bubble { position: fixed; z-index: 9200; width: 400px; max-width: calc(100vw - 32px); pointer-events: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-top: 2px solid var(--teal); border-radius: var(--radius-lg); padding: 16px 18px 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6), var(--shadow-glow); outline: none; font-size: 14.5px; line-height: 1.5; }
.tour-bubble.center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 520px; }
.tour-count { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--blue); text-transform: uppercase; }
.tour-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; color: var(--text); margin: 4px 0 8px; }
.tour-text { margin: 0 0 12px; color: var(--text-dim); }
.tour-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tour-btns .btn { font-size: 13.5px; padding: 6px 16px; }
.tour-btns .skip { margin-left: auto; background: transparent; border: 1px solid transparent; color: var(--text-dim); text-decoration: underline; font-weight: 500; cursor: pointer; padding: 6px 4px; }
.tour-btns .skip:hover { color: var(--teal); }
.tourex { margin: 0 0 12px; padding: 9px 11px; border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 13px; background: var(--bg-alt); }
.tourex-tag { display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); font-weight: 500; margin-bottom: 4px; }
.tourex ol { margin: 0; padding-left: 0; list-style: none; } .tourex li { padding: 2px 0; } .tourex li b { color: var(--blue); margin-right: 6px; }
.tourex table { width: 100%; border-collapse: collapse; } .tourex td { padding: 2px 3px; } .tourex td:first-child { color: var(--text-dim); }
.tour-slot { min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
html.touring .toast { z-index: 9100; }

/* narrower windows */
@media (max-width: 1100px) {
  .dr-split.has-map { grid-template-columns: minmax(0, 1fr); }
  .dr-side { order: -1; }
  .dgroup-cards { grid-auto-flow: row; grid-template-columns: 1fr; }
  .dgroup { flex: 1 1 100%; }
  .demo-groups { flex-wrap: wrap; }
  .adv-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .dview { aspect-ratio: 4 / 3; }
  .dparts { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .demo { padding: 12px 12px 10px; }
  .demo-head h1 { font-size: 23px; }
  .sty { grid-template-columns: 54px 78px minmax(0, 1fr); }
  .handover dl { grid-template-columns: minmax(0, 1fr); }
  .handover dd { margin-bottom: 4px; }
  .strips { grid-template-columns: minmax(0, 1fr); }
  .statebox { margin-left: 0; }
  .adv { margin: 10px 12px; }
  .brand .sub { display: none; }
}
@media (max-width: 640px) {
  .tour-bubble, .tour-bubble.center { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; max-width: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 52vh; overflow: auto; border-width: 2px 0 0; border-top-color: var(--teal); padding-bottom: 12px; }
  .tour-title { font-size: 19px; margin: 2px 0 6px; }
  .tour-text { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { .tour-hole, .dr-prog i { transition: none; } }

/* sessions, the queue and the "are you still there?" question */
.sessbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.hidden { display: none; }
.queue-panel { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--blue); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.qp-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.qp-text { margin: 0; color: var(--text-dim); font-size: 14px; max-width: 900px; }
.qp-watch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qp-watch .muted { margin-right: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.wseg { font: inherit; }
#sess-note { margin-bottom: 10px; }
.idle-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 12, 0.72); }
.idle-box { background: var(--surface); border: 1px solid var(--border-strong); border-top: 2px solid var(--teal); border-radius: var(--radius-lg); padding: 18px 22px; max-width: 440px; width: 100%; }
.idle-box h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.idle-box p { margin: 0 0 14px; color: var(--text-dim); font-size: 15px; }
.idle-box b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.idle-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .idle-buttons .btn { flex: 1 1 100%; padding: 9px 14px; } .qp-title { font-size: 18px; } }

/* survey strips (tests flown from the owner's statement of intent), the timeline and the list of strips in the result */
.map-strip-band { fill: rgba(0, 184, 255, .05); stroke: none; }
.map-strip-line { stroke: var(--route); stroke-width: 1.6; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.map-striptxt { fill: #9fb0c3; font-family: var(--font-sans); font-size: 6px; }
.map-strip.part_flown .map-strip-band { fill: rgba(0, 245, 196, .08); }
.map-strip.part_flown .map-strip-line { stroke: var(--teal); stroke-dasharray: none; stroke-width: 1.6; }
.map-strip.flown .map-strip-band { fill: rgba(0, 245, 196, .16); }
.map-strip.flown .map-strip-line { stroke: var(--teal); stroke-dasharray: none; stroke-width: 2.6; }
.map-strip.flown .map-striptxt { fill: var(--teal); }
.map-strip.skipped .map-strip-band { fill: rgba(255, 176, 32, .10); }
.map-strip.skipped .map-strip-line { stroke: #ffb020; stroke-dasharray: 1 4; stroke-width: 2; }
.map-strip.skipped .map-striptxt { fill: #ffb020; }
.legend i.strip-flown { border-color: var(--teal); border-top-width: 3px; }
.legend i.strip-skipped { border-color: #ffb020; border-top-style: dotted; border-top-width: 3px; }
.legend .stripleg.hidden { display: none; }
.strip.wide { grid-column: 1 / -1; }
.strip.timeline.hidden { display: none; }
.strip .tl-base { stroke: rgba(255,255,255,.18); stroke-width: 1; vector-effect: non-scaling-stroke; }
.strip .tl-band { fill: rgba(255, 176, 32, .22); stroke: rgba(255, 176, 32, .7); stroke-width: 1; vector-effect: non-scaling-stroke; }
.strip .tl-bandtxt { fill: #ffd27a; font-family: var(--font-sans); font-size: 11px; }
.strip .tl-fault { stroke: #ff4757; stroke-width: 2; vector-effect: non-scaling-stroke; }
.strip .tl-cmd { stroke: #ffd27a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-band { fill: rgba(255, 176, 32, .18); stroke: none; }
.strip-list { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.strip-list h3 { margin: 0 0 6px; font-size: 14px; }
.sl-row { display: grid; grid-template-columns: 64px 150px 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.sl-row:first-of-type { border-top: 0; }
.sl-row .sl-state { font-weight: 600; }
.sl-row.flown .sl-state { color: var(--teal); }
.sl-row.skipped .sl-state { color: #ffb020; }
.sl-row.part_flown .sl-state, .sl-row.not_flown .sl-state { color: var(--text-dim); }
.sl-row .sl-text { color: var(--text-dim); }
@media (max-width: 600px) { .sl-row { grid-template-columns: 56px 1fr; } .sl-row .sl-text { grid-column: 1 / -1; } }
