/* ============================================================================
   my-world · p3 · screen chrome                                           p3-chrome.css
   ADAPTED FROM P2 v5 (an earlier internal version, read only):
   the top bar, the search, the popover and the pulse panel are P2 v5's with the
   ids renamed (Countries -> Sky). Appended: the linked-view windows, their
   chip tray, the tool rail of 12 slots and the phone bottom sheets.
   P2 v5's header follows.
   ----------------------------------------------------------------------------
   P2 v5 · screen chrome                                           p2-chrome.css
   The top bar in the style of P1 v2 after its review (title at the left, a wide
   centred search with a Filter button, compact icon toggles at the right), the
   Countries popover (the three country cards, hidden until used), and the one
   movable pulse panel (banner, simulated clock, CLOCK and MOTION log sliders,
   playback buttons, the sampling numbers). Day and night use the page tokens.
   ========================================================================== */

/* ---- the top bar: brand · search · icons, full width; the inspector and the tool rail start under it ---- */
#top { position: fixed; z-index: 85; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); height: 48px; box-sizing: border-box;
       display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 10px 5px 10px; }
/* centred search: both side columns are 1fr, the search takes what the icon block (--tb-side, measured by p3-app.js) leaves */
#top > #searchbox { width: min(620px, max(300px, calc(100vw - 20px - 20px - 24px - 2 * var(--tb-side, 440px)))); }
#brand { min-width: 0; overflow: hidden; }
#brand h1 { margin: 0; font: 700 18px/1.1 var(--display); color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#brand h1 span { color: var(--accent); }
#brand .sub { font: 10px/1.3 var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tb-icons { justify-self: end; display: flex; align-items: center; gap: 3px; }
#tb-icons .sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 3px; }

/* icon toggles: one footprint (an icon, a state word under it), a tooltip and an aria-label with the state */
.ibtn { width: 36px; height: 36px; padding: 3px 0 2px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; color: var(--ink); }
.ibtn .ic { font: 700 15px/1 var(--body); }
.ibtn .st8 { font: 600 8.5px/1 var(--mono); letter-spacing: .02em; text-transform: lowercase; max-width: 34px; overflow: hidden; color: var(--ink-2); }
.ibtn:hover .st8 { color: var(--ink); }
.ibtn[aria-pressed="true"] .st8, .ibtn[aria-expanded="true"] .st8 { color: var(--bg); }
.btn.ibtn[aria-expanded="true"] { color: var(--bg); border-color: var(--ink); background: var(--ink); }
#btn-fp[data-state="pick"] { background: var(--warn); border-color: var(--warn); color: #fff; }
#btn-fp[data-state="pick"] .st8 { color: #fff; }
#simtoggle-slot { display: flex; }
#simtoggle-slot .mw-sim-pill { box-sizing: border-box; width: 40px; height: 36px; padding: 3px 0 2px !important; display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 0 !important; box-shadow: none; white-space: nowrap; }
#simtoggle-slot .mw-sim-pill::before { content: '∿'; font: 700 16px/1 var(--body); color: var(--warn); }
#simtoggle-slot .mw-sim-pill i { display: none; }
#simtoggle-slot .mw-sim-pill span { font-size: 0 !important; line-height: 1; }
#simtoggle-slot .mw-sim-pill span b { font: 700 8.5px/1 var(--mono) !important; text-transform: uppercase; color: var(--ink); }
#simtoggle-slot .mw-sim-pill span b::before { content: 'sim '; }
#simtoggle-slot .mw-sim-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#btn-search { display: none; }

/* ---- search: wide, centred, strong contrast, the dropdown above every overlay (the top bar is z 85, the list z 90) ---- */
#searchbox { position: relative; min-width: 0; width: 100%; }
#search-row { display: flex; gap: 5px; }
#search { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 36px; font: 600 13px var(--body); padding: 0 11px 0 32px; color: var(--ink); border: 2px solid var(--accent); border-radius: 3px;
          background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.2' fill='none' stroke='%237c22e6' stroke-width='1.8'/%3E%3Cpath d='M9.2 9.2 L13 13' stroke='%237c22e6' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat 10px 50%; }
:root[data-theme="night"] #search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.2' fill='none' stroke='%23c78bff' stroke-width='1.8'/%3E%3Cpath d='M9.2 9.2 L13 13' stroke='%23c78bff' stroke-width='1.8'/%3E%3C/svg%3E"); }
#search::placeholder { color: var(--ink-2); opacity: 1; font-weight: 600; }
#search:focus, #search:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
#btn-filter { height: 36px; padding: 0 12px; font: 700 12px/1 var(--body); color: var(--ink); border: 2px solid var(--line-2); display: inline-flex; align-items: center; gap: 5px; }
#btn-filter[aria-pressed="true"] { color: var(--bg); border-color: var(--accent); background: var(--accent); }
#btn-filter .n { font: 700 10px/1 var(--mono); padding: 2px 4px; background: var(--bg); color: var(--ink); }
#search-results { position: absolute; z-index: 90; left: 0; right: 0; top: calc(100% + 5px); min-width: 380px; max-height: min(62vh, 520px); overflow: auto; margin: 0; padding: 0; list-style: none;
                  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 14px 34px rgba(9,15,45,.35); }
#search-results li { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px 7px 11px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; cursor: pointer; }
#search-results li b { font: 700 12.5px var(--body); color: var(--ink); word-break: break-word; }
#search-results li span { font: 500 10.5px var(--mono); color: var(--ink-2); }
#search-results li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-left-color: var(--accent); }
#search-results li:hover { background: var(--surface-2); }
#search-results li.sr-head { cursor: default; flex-direction: row; flex-wrap: wrap; gap: 2px 6px; padding: 6px 10px; background: var(--chip-bg); font: 500 10.5px/1.35 var(--mono); color: var(--ink-2); }
#search-results li.sr-head b { font: 700 10.5px var(--mono); }

/* ---- the Countries chip and its popover (the three country cards, visibility, Parity, scale); hidden until used ---- */
#sky-wrap { position: relative; display: flex; }
#sky-pop { position: absolute; z-index: 92; right: 0; top: calc(100% + 9px); width: 304px; box-sizing: border-box; padding: 8px; display: flex; flex-direction: column; gap: 6px;
                 background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 14px 34px rgba(9,15,45,.32); font-size: 11.5px; color: var(--ink-2); }
#sky-pop[hidden] { display: none; }
#sky-pop::before { content: ''; position: absolute; right: 13px; top: -7px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.cp-head { display: flex; align-items: baseline; gap: 6px; }
.cp-head b { font: 700 13px var(--display); color: var(--ink); }
.cp-head span { flex: 1; font: 500 10px/1.3 var(--mono); color: var(--ink-2); }
.cp-head button, #cp-parity button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 11px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 5px 7px; }
.cp-head button:focus-visible, #cp-parity button:focus-visible, .cp-scale select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#sky-cards { display: flex; flex-direction: column; gap: 4px; }
.hud-c { display: flex; align-items: stretch; border: 1px solid var(--line-2); background: var(--surface); }
.hud-c.off { opacity: .62; }
.hud-c.stacked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hud-go { all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; font: 500 10px/1.3 var(--mono); color: var(--ink-2); }
.hud-go:hover { background: var(--surface-2); }
.hud-go b { font: 700 12.5px/1.2 var(--display); color: var(--ink); }
.hud-go b i { font: 500 10px var(--mono); color: var(--ink-2); font-style: normal; }
.hud-go:focus-visible, .hud-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hud-eye { all: unset; box-sizing: border-box; cursor: pointer; width: 34px; display: grid; place-items: center; border-left: 1px solid var(--line-2); color: var(--ink); font: 700 15px/1 var(--body); }
.hud-eye[aria-pressed="false"] { color: var(--ink-2); }
.hud-sim { color: var(--warn); white-space: normal; }
#cp-parity { display: flex; align-items: center; gap: 0; }
#cp-parity button { border-right-width: 0; padding: 6px 8px; }
#cp-parity button:last-child { border-right-width: 1px; }
#cp-parity button[aria-checked="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.cp-k { font: 700 10px/1 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: .05em; width: 52px; flex: 0 0 auto; }
.cp-scale { display: flex; align-items: center; }
.cp-scale select { flex: 1 1 auto; min-width: 0; font: 600 11px var(--mono); background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); padding: 4px; }

/* ---- round 2: the shard lens and brightness popovers (the Sky popover's look), the Kafka layer radio, the flight and follow bars ---- */
.pop-wrap { position: relative; display: flex; }
.pop { position: absolute; z-index: 92; right: 0; top: calc(100% + 9px); width: 318px; box-sizing: border-box; padding: 8px; display: flex; flex-direction: column; gap: 7px;
       background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 14px 34px rgba(9,15,45,.32); font-size: 11.5px; color: var(--ink-2); }
.pop[hidden] { display: none; }
.pop::before { content: ''; position: absolute; right: 13px; top: -7px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
#lens-body { display: flex; flex-direction: column; gap: 6px; }
.lens-row { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.lens-row .cp-k { width: 30px; }
.lens-row button { all: unset; box-sizing: border-box; cursor: pointer; min-width: 30px; text-align: center; font: 600 10.5px/1 var(--mono); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 5px 4px; }
.lens-row button.all { min-width: 44px; }
.lens-row button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.lens-row button:focus-visible, .cp-radio button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lens-note { margin: 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); }
.lens-note b { color: var(--ink); }
.cp-radio { display: flex; align-items: center; gap: 0; }
.cp-radio button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 11px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); border-right-width: 0; background: var(--surface); padding: 6px 8px; }
.cp-radio button:last-child { border-right-width: 1px; }
.cp-radio button[aria-checked="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.bp-row { display: flex; align-items: center; gap: 8px; }
.bp-row input[type="range"] { flex: 1 1 auto; accent-color: var(--accent); }
.bp-row output { font: 700 11px var(--mono); color: var(--ink); width: 38px; text-align: right; }
.bp-check { align-items: flex-start; font: 500 11px/1.35 var(--body); color: var(--ink-2); cursor: pointer; }
.bp-check b { color: var(--ink); }
.bp-note { margin: 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); }
#flightbar, #followbar { position: fixed; z-index: 44; left: 50%; transform: translateX(-50%); bottom: 116px; padding: 6px 11px; font: 500 11.5px/1.4 var(--body); color: var(--ink); border-left: 3px solid var(--http); white-space: nowrap; }
#flightbar[hidden], #followbar[hidden] { display: none; }
/* the journey caption of a follow (round-2 fix, QA2 #4): pinned at the top of the free sky */
#journey { position: fixed; z-index: 45; transform: translateX(-50%); padding: 6px 12px; font: 500 12.5px/1.45 var(--body); color: var(--ink); border-left: 3px solid var(--accent); text-align: center; pointer-events: none; box-sizing: border-box; }
#journey[hidden] { display: none; }
#journey b { font: 700 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
#journey .j-now { font-weight: 700; color: var(--accent); padding: 0 3px; border-bottom: 2px solid var(--accent); }
#journey .j-past { color: var(--ink-2); }
#journey .j-next { color: var(--ink-2); font-size: 11.5px; }
/* while following, the tools' sky banner folds to its tag (the pulse panel folds to its chip) */
body.p3-following #tb-banner { top: auto !important; bottom: 152px; font-size: 0; padding: 3px 4px; border-width: 1px; box-shadow: none; max-width: none !important; }
body.p3-following #tb-banner .k { font-size: 10px; margin-right: 0; }
#flightbar b, #followbar b { font: 700 11px var(--mono); letter-spacing: .05em; }
#btn-fly[aria-pressed="true"] { color: var(--bg); border-color: var(--http); background: var(--http); }
#btn-fly[aria-pressed="true"] .st8 { color: var(--bg); }

/* ---- the pulse panel: one movable panel (left/top set by p3-app.js; docked = top centre of the free band) ---- */
#pulsedock { position: fixed; z-index: 43; left: calc(50% - 220px); top: calc(66px + env(safe-area-inset-top, 0px)); width: 440px; box-sizing: border-box; display: flex; flex-direction: column; border-left: 3px solid var(--warn); }
:root:not(.p3-sim) #pulsedock { display: none; }
#pulsedock.dragging { box-shadow: 0 18px 44px rgba(9,15,45,.38); opacity: .96; }
#pp-head { display: flex; align-items: center; gap: 6px; padding: 4px 5px 4px 6px; cursor: grab; user-select: none; touch-action: none; border-bottom: 1px solid var(--line);
           background: repeating-linear-gradient(135deg, var(--simhatch) 0 8px, transparent 8px 16px); }
#pp-head:active { cursor: grabbing; }
#pp-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#pp-head .grip { width: 10px; height: 16px; flex: 0 0 auto; opacity: .7; background: radial-gradient(circle, var(--ink-2) 1.1px, transparent 1.4px) 0 0 / 5px 5px; }
#simbanner-slot { flex: 1 1 auto; min-width: 0; display: flex; pointer-events: none; }
#simbanner-slot .mw-sim-banner { margin: 0; padding: 2px 8px; box-shadow: none; justify-content: flex-start; text-align: left; font-size: 10.5px; letter-spacing: .05em; max-width: 100%; }
#simbanner-slot .mw-sim-banner small { flex-basis: 100%; min-width: 0; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pp-sum { display: none; font: 700 10.5px/1 var(--mono); color: var(--ink); white-space: nowrap; }
#pp-sum i { font-style: normal; color: var(--ink-2); font-weight: 500; }
#pp-head button { all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto; width: 26px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 12px var(--body); }
#pp-head button:hover { border-color: var(--accent); }
#pp-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#pulsedock[data-place="docked"] #pp-dock { opacity: .55; }
#pp-body { display: flex; flex-direction: column; gap: 3px; padding: 0 0 7px; }
/* the shared simulated clock lives inside the panel: play / pause, the UTC time, capture, the scrub with incident ticks */
#simclock-slot .mw-sim-clock { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; background: transparent; backdrop-filter: none; padding: 6px 10px 6px; gap: 4px; }
/* its speed select is replaced by the CLOCK slider below (play, scrub and capture stay) */
#simclock-slot .mw-sim-clock select { display: none; }
/* CLOCK and MOTION: label · log slider with ticks · current value */
.pp-sl { display: grid; grid-template-columns: 62px 1fr 50px; align-items: center; gap: 8px; padding: 2px 10px 0; }
.pp-sl label { display: flex; flex-direction: column; gap: 2px; cursor: default; }
.pp-sl label b { font: 700 11px/1 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: .06em; }
.pp-sl label small { font: 500 9.5px/1 var(--body); color: var(--ink-2); }
.pp-sl output { font: 700 15px/1 var(--mono); color: var(--ink); text-align: right; }
.pp-track { position: relative; padding-bottom: 13px; }
.pp-track input[type=range] { width: 100%; margin: 0; accent-color: var(--warn); cursor: pointer; }
#sl-motion { accent-color: var(--accent); }
.pp-track input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pp-ticks { position: absolute; left: 8px; right: 8px; bottom: 0; height: 12px; pointer-events: none; }
.pp-ticks .tk { position: absolute; top: 0; width: 1px; height: 3px; background: var(--ink-2); }
.pp-ticks .tk.lab { height: 4px; background: var(--ink); }
.pp-ticks .tk b { position: absolute; top: 4px; left: 0; transform: translateX(-50%); font: 500 8.5px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.pp-cap { margin: 0; padding: 1px 10px 0; font: 500 10px/1.35 var(--body); color: var(--ink-2); }
.pp-cap b { color: var(--ink); font-weight: 700; }
.pp-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 2px 10px 0; }
.pbb { all: unset; box-sizing: border-box; cursor: pointer; font: 600 11px/1 var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); padding: 6px 8px; min-width: 30px; text-align: center; }
.pbb:hover { border-color: var(--accent); }
.pbb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#pb-play[aria-pressed="true"] { background: var(--warn); color: #fff; border-color: var(--warn); }
:root[data-theme="night"] #pb-play[aria-pressed="true"] { color: #1a1206; }
.pp-keys { margin-left: auto; font: 500 9.5px/1.3 var(--mono); color: var(--ink-2); }
.pp-keys kbd { font-size: 9px; padding: 0 3px; }
#playback.paused #pb-play { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 40%, transparent); }
#pb-sampling { margin: 3px 10px 0; padding: 4px 6px; font: 500 10px/1.4 var(--mono); color: var(--ink-2); border-left: 3px solid var(--warn); background: repeating-linear-gradient(135deg, var(--simhatch) 0 6px, transparent 6px 12px); }
#pb-sampling b { color: var(--ink); }
#pb-sampling .simw { color: var(--warn); font-weight: 700; letter-spacing: .04em; }
:root[data-theme="day"] #pb-sampling .simw { color: #8a5100; }
#pb-sampling .l2 { display: block; margin-top: 2px; font-size: 9.5px; }
/* collapsed: the header only, a chip that still says SIMULATED and both speeds */
#pp-hint { padding: 4px 6px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(135deg, var(--simhatch) 0 5px, transparent 5px 10px); }
#pp-hint[hidden] { display: none; }
#pp-hint .pph-k { margin: 0; display: flex; align-items: center; gap: 7px; font: 500 11px/1.3 var(--body); color: var(--ink); }
#pp-hint .pph-k + .pph-k { margin-top: 4px; }
#pp-hint .pph-ic { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; font: 700 14px/1 var(--body); color: var(--bg); background: var(--warn); border-radius: 50%; }
#pp-hint .pph-k > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
#pp-hint b { display: block; font: 700 11.5px/1.25 var(--body); color: var(--ink); }
#pp-hint small { display: block; font: 500 10px/1.25 var(--mono); color: var(--ink-2); }
#pp-hint button { flex: 0 0 auto; font: 700 11px/1 var(--body); padding: 6px 9px; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); cursor: pointer; white-space: nowrap; }
#pp-hint button:hover { background: var(--accent); border-color: var(--accent); }
#pp-hint button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#pp-hint button:disabled { opacity: .45; cursor: not-allowed; }
#pulsedock.collapsed #pp-hint { border-top: 1px solid var(--line); border-bottom: 0; }
#pulsedock.collapsed { width: auto; max-width: 440px; }
#pulsedock.collapsed #pp-body { display: none; }
#pulsedock.collapsed #pp-head { border-bottom: 0; }
#pulsedock.collapsed #simbanner-slot { flex: 0 0 auto; }
#pulsedock.collapsed #simbanner-slot .mw-sim-banner { padding: 1px 6px; font-size: 9.5px; letter-spacing: 0; white-space: nowrap; flex-wrap: nowrap; }
#pulsedock.collapsed #simbanner-slot .mw-sim-banner small { display: none; }
#pulsedock.collapsed #pp-sum { display: inline; font-size: 10px; }
#pulsedock.collapsed #pp-head { gap: 5px; }
#pulsedock.collapsed #pp-dock { display: none; }

/* round 2: three more icons (lens, brightness, flight) would squeeze the centred search under 480 px at 1440, so on a desktop
   Parity (C, the Sky popover), the tour (G, the help dialog) and the legend (K, its chip in the tray) leave the bar */
@media (min-width: 760px) { #btn-parity, #btn-tour, #btn-legend { display: none; } }
/* round-2 fix (QA2 #12): on desktop Parity, the tour and the Legend live in the ⋯ menu; the phone keeps its own buttons */
@media (max-width: 759px) { #more-wrap { display: none; } }
#btn-more { width: 28px; }   /* narrower than the other icons: the centred search keeps >= 480 px at 1440 */
#more-pop { width: 260px; gap: 2px; padding: 5px; }
#more-pop button { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; text-align: left; padding: 6px 7px; border: 1px solid transparent; background: none; color: var(--ink); font: 500 11.5px/1.35 var(--body); cursor: pointer; }
#more-pop button:hover, #more-pop button:focus-visible { border-color: var(--line-2); background: var(--chip-bg); }
#more-pop .ic { font-size: 14px; text-align: center; } #more-pop .mt b { font-weight: 700; } #more-pop kbd { font: 600 10px var(--mono); }
/* ---- narrower desktops ---- */
@media (max-width: 1240px) { #brand .sub { display: none; } }
@media (max-width: 1000px) and (min-width: 760px) { #brand h1 span { display: none; } #top { gap: 8px; } #tb-icons .sep { display: none; } }

/* ---- phone: icons only in the bar; the search opens under it; the popover and the pulse panel are full width ---- */
@media (max-width: 759px) {
  #top { left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); height: 44px; display: flex; gap: 3px; padding: 4px 5px; }
  #brand { display: none; }
  #tb-icons { flex: 1 1 auto; justify-content: space-between; gap: 2px; }
  #btn-tour, #btn-routes, #tb-icons .sep { display: none; }
  .ibtn { width: 32px; height: 34px; } #simtoggle-slot .mw-sim-pill { width: 36px; height: 34px; }
  #btn-search { display: inline-flex; }
  #top > #searchbox { width: auto; }
  #searchbox { display: none; position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); width: auto; padding: 6px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--accent); }
  .p3-search-open #searchbox { display: block; }
  #search { font-size: 16px; }
  #search-results { position: absolute; left: 0; right: 0; min-width: 0; max-height: calc(100vh - 300px); }
  #sky-wrap { position: static; }
  #sky-pop { position: absolute; left: -1px; right: -1px; width: auto; top: calc(100% + 4px); }
  #sky-pop::before { display: none; }
  #btn-fly, #flightbar, #btn-parity { display: none !important; }   /* no keyboard on a phone; Parity stays in the Sky popover */
  .pop-wrap { position: static; } .pop { left: -1px; right: -1px; width: auto; top: calc(100% + 4px); } .pop::before { display: none; }
  #followbar { bottom: 150px; max-width: calc(100vw - 16px); white-space: normal; }
  #pulsedock { left: 8px !important; right: 8px; top: calc(58px + env(safe-area-inset-top, 0px)) !important; width: auto; max-width: none; border-left-width: 3px; }
  #pulsedock.collapsed { width: auto; max-width: none; }
  #pp-dock, #pp-head .grip, .pp-keys, .pp-cap { display: none; }
  #pp-head { cursor: default; }
  #simclock-slot .mw-sim-clock { padding: 4px 8px; }
  .pp-sl { grid-template-columns: 52px 1fr 42px; gap: 6px; padding: 1px 8px 0; }
  #pb-sampling { margin: 2px 8px 0; }
  #pb-sampling .l2 { display: none; }
  .pp-btns { padding: 2px 8px 0; }
}

/* ============================ P3 v2 additions ============================ */
/* ---- linked-view windows: header to drag, ▁ minimises to a chip, double-click docks, corner resizes ---- */
.p3win { position: fixed; z-index: 60; display: flex; flex-direction: column; box-sizing: border-box; min-width: 220px; min-height: 120px; resize: both; overflow: hidden; }
.p3win[hidden] { display: none !important; }
.p3win.dragging { box-shadow: 0 18px 44px rgba(9,15,45,.38); opacity: .97; }
.p3win-h { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 4px 5px 4px 8px; border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; font: 600 10.5px var(--mono); color: var(--ink-2); letter-spacing: .05em; text-transform: uppercase; }
.p3win-h:active { cursor: grabbing; }
.p3win-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.p3win-h .grip { width: 10px; height: 16px; flex: 0 0 auto; opacity: .7; background: radial-gradient(circle, var(--ink-2) 1.1px, transparent 1.4px) 0 0 / 5px 5px; }
.p3win-h b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.p3win-h .info { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-2); }
.p3win-h button { all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto; height: 22px; min-width: 24px; padding: 0 5px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 10px var(--mono); text-transform: none; }
.p3win-h button:hover { border-color: var(--accent); }
.p3win-h button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.p3win-h button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.p3win-h .lvl { display: inline-flex; gap: 0; }
.p3win-h .lvl button { border-right-width: 0; min-width: 0; padding: 0 5px; font-weight: 600; }
.p3win-h .lvl button:last-child { border-right-width: 1px; }
.p3win-b { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; scrollbar-width: thin; }
.p3win-b > canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
/* the tray of minimised windows (chips), bottom left */
#wintray { position: fixed; z-index: 58; left: 10px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(50vw - 270px); }
.wchip { all: unset; box-sizing: border-box; cursor: pointer; height: 30px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--panel-shadow); }
.wchip[hidden] { display: none; }
.wchip .ic { font: 700 13px var(--body); color: var(--accent); }
.wchip:hover { border-color: var(--accent); }
.wchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the tool rail: 12 slots, 1-6 tools-a, 7-12 tools-b */
#toolbar { position: fixed; z-index: 57; left: 10px; top: calc(66px + env(safe-area-inset-top, 0px)); width: 56px; padding: 5px 4px; display: flex; flex-direction: column; gap: 3px; max-height: calc(100vh - 150px); overflow: auto; scrollbar-width: none; }
#toolbar h2 { margin: 0 0 2px; font: 600 9px/1.2 var(--mono); color: var(--ink-2); letter-spacing: .05em; text-align: center; text-transform: uppercase; }
#toolbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.slot { all: unset; box-sizing: border-box; width: 48px; height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); position: relative; }
.slot .ic { font: 700 12px/1 var(--body); } .slot .nm { font: 500 7.5px/1.1 var(--mono); max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.slot .pz { position: absolute; top: 1px; right: 2px; font: 700 6.5px/1 var(--mono); color: var(--warn); }
.slot.empty { border-style: dashed; cursor: default; background: transparent; }
.slot.empty .ic, .slot.empty .nm { color: var(--ink-2); }
.slot.on { border-color: var(--http); background: color-mix(in srgb, var(--http) 14%, var(--surface)); }
.slot.open { outline: 1px solid var(--ink); } .slot.blocked { opacity: .6; }
.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* the tool panel: a window (fix round); its body scrolls, the header drags, ▁ tucks it into a chip, ✕ closes */
#toolpanel { font-size: 12px; color: var(--ink-2); }
#toolpanel .p3win-h b { font: 700 12.5px/1.2 var(--display); text-transform: none; letter-spacing: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
#toolpanel-body { padding: 8px 12px 12px; }
#toolpanel-close { font-size: 11px !important; }
.wchip.tucked { border-style: dashed; }
.wchip.tucked .nm::after { content: ' \2913'; font-weight: 700; color: var(--http); }
.wchip[data-win="toolpanel"] { border-color: var(--http); }
/* the tool list (phone sheet, and the panel before a tool is chosen there) */
.tp-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.tp-list button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; min-height: 46px; padding: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-align: center; }
.tp-list button .ic { font: 700 15px/1 var(--body); } .tp-list button .nm { font: 600 10.5px/1.2 var(--body); }
.tp-list button.on { border-color: var(--http); background: color-mix(in srgb, var(--http) 14%, var(--surface)); }
.tp-list button:disabled { opacity: .5; border-style: dashed; cursor: default; }
.tp-back { all: unset; cursor: pointer; font: 600 11px var(--body); color: var(--accent); margin: 0 0 4px; }
.tdesc { margin: 6px 0; line-height: 1.45; } .tbtns { display: flex; gap: 6px; margin: 6px 0; }
.tbtns button { font: 600 11px/1 var(--body); padding: 6px 9px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; }
.tbtns button:disabled { opacity: .45; cursor: not-allowed; }
.treason { color: var(--warn); font-size: 11.5px; } .terror { color: var(--bad); font-size: 11.5px; }

/* ---- the HUD (ego view), the detector, the matrix ---- */
.hud-cap, .hud-note { margin: 6px 8px 2px; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); }
.hud-cap b { color: var(--ink); } .hud-note { color: var(--warn); }
svg.hud { display: block; margin: 2px auto 6px; font-family: var(--mono); }
svg.hud .hk { font: 700 9px var(--mono); fill: var(--ink-2); letter-spacing: .04em; }
svg.hud .hg { font: 700 9.5px var(--mono); fill: var(--accent); }
svg.hud .hn { font: 700 11px var(--display); fill: var(--ink); }
svg.hud .hsub { font: 500 8.5px var(--mono); fill: var(--ink-2); }
svg.hud .hc { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; }
svg.hud .hc.ring { stroke: var(--accent); stroke-width: 4; fill: none; }
svg.hud .hs { fill: var(--accent); stroke: var(--ink); stroke-width: .6; }
svg.hud .hcell, .hud-centre svg .hcell { fill: var(--accent); stroke: var(--ink); stroke-width: .7; stroke-linejoin: round; cursor: pointer; }
svg.hud .hcell.nc, .hud-centre svg .hcell.nc { fill: var(--chip-bg); fill-opacity: 1; stroke: var(--ink-2); stroke-dasharray: 2 1.5; }
svg.hud .hcell:hover { stroke-width: 1.6; }
svg.hud .hn-under { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
svg.hud .fl { fill: none; stroke-width: 1.4; opacity: .7; }
svg.hud .fp { stroke: var(--kafka-out); } svg.hud .fc { stroke: var(--kafka-in); } svg.hud .fh { stroke: var(--http); stroke-dasharray: 4 3; } svg.hud .fb { stroke: var(--ink-2); stroke-width: 1.2; } svg.hud .fg { stroke: var(--ink-3); stroke-dasharray: 2 3; }
svg.hud .hr { cursor: pointer; } svg.hud .hr rect { fill: var(--chip-bg); stroke: var(--line-2); stroke-width: 1; }
svg.hud .hr text { font: 600 10px var(--mono); fill: var(--ink); } svg.hud .hr .hrs { font-weight: 500; fill: var(--ink-2); font-size: 8.5px; }
svg.hud .hr:hover rect, svg.hud .hr:focus rect { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1.5; }
svg.hud .hr:focus { outline: none; } svg.hud .hr:focus-visible rect { stroke: var(--accent); stroke-width: 2.5; }
svg.hud .hr.sel rect { stroke: var(--ink); stroke-width: 2; } svg.hud .hr.dimr { opacity: .35; }
svg.hud .hr.ghost rect { fill: none; stroke: var(--ink-3); stroke-dasharray: 3 2; } svg.hud .hr.ghost text { fill: var(--ink-2); font-style: italic; }
svg.hud .hr.both rect { fill: var(--surface); stroke: var(--ink-2); }
/* the stacked HUD (below 560 px): full-width rows per direction, the star between them; nothing overlaps */
.hud-st { padding: 0 8px 10px; }
.hud-st h4 { margin: 8px 0 3px; font: 700 9.5px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.hud-st ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hud-st li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 6px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); background: var(--chip-bg); font-size: 11px; cursor: pointer; }
.hud-st li b { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; } .hud-st li span { flex: 0 0 auto; max-width: 48%; color: var(--ink-2); font: 10px var(--mono); text-align: right; overflow-wrap: anywhere; }
.hud-st li:hover, .hud-st li:focus-visible { border-color: var(--accent); outline: none; } .hud-st li.sel { border-color: var(--ink); } .hud-st li.dimr { opacity: .4; }
.hud-st li.hg-row { cursor: default; background: none; border: 0; padding: 4px 2px 0; font: 700 9.5px var(--mono); color: var(--accent); }
.hud-st li.ghost { cursor: default; border-style: dashed; background: none; } .hud-st li.ghost b { color: var(--ink-2); font-style: italic; font-weight: 500; }
.hud-centre { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; margin: 8px 0 2px; padding: 4px 6px; border: 1px solid var(--line-2); background: var(--surface); }
.hud-centre svg { grid-row: span 2; } .hud-centre svg .hc { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; } .hud-centre svg .hs { fill: var(--accent); stroke: var(--ink); stroke-width: .6; }
.hud-centre b { font: 700 14px var(--display); color: var(--ink); align-self: end; overflow-wrap: anywhere; } .hud-centre span { font: 10px var(--mono); color: var(--ink-2); align-self: start; }
.hud-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 8px 8px; }
.hud-cols h4 { margin: 6px 0 4px; font: 700 9.5px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.hud-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hud-cols li { display: flex; justify-content: space-between; gap: 6px; padding: 3px 6px; border: 1px solid var(--line); background: var(--chip-bg); cursor: pointer; font-size: 11px; }
.hud-cols li b { color: var(--ink); font-weight: 600; word-break: break-word; } .hud-cols li span { color: var(--ink-2); font: 10px var(--mono); white-space: nowrap; }
.hud-cols li:hover, .hud-cols li:focus-visible { border-color: var(--accent); outline: none; }
.simw { color: var(--warn); font-weight: 700; letter-spacing: .04em; }
:root[data-theme="day"] .simw { color: #8a5100; }
.det-cap { margin: 6px 9px; font: 500 10.5px/1.45 var(--body); color: var(--ink-2); } .det-cap b { color: var(--ink); }
.findings { list-style: none; margin: 0; padding: 0 6px 4px; display: grid; gap: 3px; }
.finding button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 20px 1fr auto; gap: 1px 6px; align-items: baseline; padding: 5px 7px; border: 1px solid var(--line); border-left: 3px solid var(--ink-3); background: var(--chip-bg); }
.finding[data-sev="warn"] button { border-left-color: var(--warn); }
.finding button:hover { border-color: var(--accent); } .finding button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.finding button[aria-expanded="true"] { border-color: var(--ink); background: var(--surface-2); }
.finding .g { font: 700 13px var(--body); color: var(--ink); grid-row: span 2; }
.finding .t { font: 700 12px var(--display); color: var(--ink); } .finding .m { font: 700 10.5px var(--mono); color: var(--ink); }
.finding .tag { grid-column: 2 / 4; font: 500 9px var(--mono); color: var(--ink-2); } .finding .tag .new { color: var(--accent); font-weight: 700; }
.fdetail { padding: 4px 8px 6px; font-size: 11px; line-height: 1.45; color: var(--ink-2); border: 1px solid var(--line); border-top: 0; }
.fdetail p { margin: 3px 0; } .fdetail ul { margin: 3px 0; padding-left: 16px; font: 10px/1.4 var(--mono); color: var(--ink); }
.fdetail .ev { font: 9.5px var(--mono); color: var(--ink-2); }
.det-h { margin: 8px 9px 4px; font: 700 9.5px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.cross { list-style: none; margin: 0 6px 8px; padding: 0; display: grid; gap: 2px; font-size: 10.5px; color: var(--ink-2); }
.cross li { display: grid; grid-template-columns: 16px 1fr; gap: 4px; } .cross b { color: var(--ink); }
.cross .ok .mk { color: var(--ok); font-weight: 700; } .cross .mismatch .mk { color: var(--bad); font-weight: 700; } .cross .mk { color: var(--ink-2); }

/* ---- phone: windows are bottom sheets, one at a time; chips sit in a row above the camera bar ---- */
@media (max-width: 759px) {
  .p3win.phone { left: 0 !important; right: 0 !important; top: auto !important; bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; height: min(46vh, 400px) !important; resize: none; border-left: 0; border-right: 0; z-index: 70; }
  .p3win.phone .p3win-h { cursor: default; }
  .p3win.phone .p3win-h .grip { display: none; }
  #wintray { left: 6px; right: 6px; max-width: none; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .wchip { height: 32px; padding: 0 8px; flex: 0 0 auto; }
  #toolbar { display: none !important; }
  .wchip[data-win="toolpanel"] { order: -1; }
}
.det-cap.det-centric { border-left: 3px solid var(--accent); padding-left: 7px; color: var(--ink); }

/* ============================ round 3: Orbits ============================ */
/* the top-bar button sits left of the centred search, beside the brand (the icon block keeps its width, so the search
   stays centred and as wide as before at 1440 and 1280) */
#tb-left { min-width: 0; display: flex; align-items: center; gap: 10px; }
#tb-left #brand { flex: 0 1 auto; min-width: 0; }
#btn-orbits { flex: 0 0 auto; height: 36px; padding: 0 8px 0 7px; display: inline-flex; align-items: center; gap: 5px; font: 700 12px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); }
#btn-orbits .ic { font: 700 16px/1 var(--body); color: var(--accent); }
#btn-orbits .st8 { font: 600 9px/1 var(--mono); color: var(--ink-2); padding: 2px 4px; background: var(--chip-bg); border: 1px solid var(--line); white-space: nowrap; }
#btn-orbits[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
#btn-orbits[aria-pressed="true"] .ic { color: var(--bg); }
#btn-orbits[aria-pressed="true"] .st8 { color: var(--ink); }
#btn-orbits .st8 .s { display: none; }
#btn-orbits.has-hidden .st8 { border-color: var(--warn); border-style: dashed; }
.orb-last { margin: 0; padding: 4px 6px; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); border-left: 3px solid var(--line-2); background: var(--chip-bg); }
.orb-last b { color: var(--ink); }
.orb-last button { font: 600 10.5px/1 var(--body); padding: 3px 6px; margin-left: 4px; background: var(--surface); color: var(--ink); border: 1px solid var(--accent); cursor: pointer; }
.orb-last button:disabled { opacity: .45; cursor: not-allowed; }
#orbitsdock { position: fixed; z-index: 42; left: auto; right: 360px; bottom: 80px; width: 300px; box-sizing: border-box; display: flex; flex-direction: column; border-left: 3px solid var(--accent); max-height: calc(100vh - 170px); overflow: hidden; }
#orbitsdock.more { width: 336px; }
#orbitsdock[hidden] { display: none; }
#orbitsdock.dragging { box-shadow: 0 18px 44px rgba(9,15,45,.38); opacity: .96; }
#orb-head { display: flex; align-items: center; gap: 6px; padding: 4px 5px 4px 6px; cursor: grab; user-select: none; touch-action: none; border-bottom: 1px solid var(--line); }
#orb-head:active { cursor: grabbing; }
#orb-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#orb-head .grip { width: 10px; height: 16px; flex: 0 0 auto; opacity: .7; background: radial-gradient(circle, var(--ink-2) 1.1px, transparent 1.4px) 0 0 / 5px 5px; }
#orb-head b { font: 700 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
#orb-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 10.5px/1.2 var(--mono); color: var(--ink-2); }
#orb-head button { all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto; width: 26px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 12px var(--body); }
#orb-head button:hover { border-color: var(--accent); }
#orb-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#orbitsdock[data-place="docked"] #orb-dock { opacity: .55; }
#orbitsdock.collapsed { width: auto; max-width: 440px; }
#orbitsdock.collapsed #orb-body, #orbitsdock.collapsed #orb-dock { display: none; }
#orbitsdock.collapsed #orb-head { border-bottom: 0; }
#orb-body { overflow: auto; min-height: 0; padding: 5px 7px 6px; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
#orb-body button, #orb-body select { font-family: var(--body); }
#orb-body button:focus-visible, #orb-body select:focus-visible, #orb-body input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.orb-presets { display: flex; flex-wrap: wrap; gap: 3px; }
.orb-presets button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 10.5px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 5px 5px; white-space: nowrap; }
#orbitsdock:not(.more) .orb-presets { flex-wrap: nowrap; justify-content: space-between; }
.orb-cam { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.orb-cam button, .orb-morebar button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 10.5px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 4px 6px; white-space: nowrap; }
.orb-cam button:disabled, .orb-morebar button:disabled { opacity: .45; cursor: not-allowed; }
.orb-morebar { display: flex; align-items: center; gap: 8px; font: 500 10px/1.2 var(--mono); color: var(--ink-2); position: sticky; bottom: -6px; margin: 0 -7px -6px; padding: 4px 7px 5px; background: var(--surface); border-top: 1px solid var(--line); }
.orb-morebar button[aria-expanded="true"] { border-color: var(--accent); }
.orb-v { display: inline-block; width: 44px; text-align: center; font: 700 10.5px/24px var(--mono); color: var(--ink); vertical-align: middle; }
.orb-presets button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.orb-presets button:disabled { opacity: .45; cursor: not-allowed; }
.orb-presets .orb-save { border-style: dashed; color: var(--ink-2); }
.orb-layers { width: 100%; border-collapse: collapse; }
.orb-layers td { padding: 2px 2px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#orbitsdock.more .orb-layers td { padding: 3px 2px; }
.orb-layers tr.off .orb-nm { opacity: .55; }
.orb-nm b { display: block; font: 700 11.5px/1.2 var(--body); color: var(--ink); white-space: nowrap; }
.orb-nm small { display: block; font: 500 9.5px/1.25 var(--mono); color: var(--ink-2); }
.orb-eye, .orb-ctl button { all: unset; box-sizing: border-box; cursor: pointer; width: 24px; height: 22px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 700 12px var(--body); }
.orb-eye[aria-pressed="false"] { color: var(--ink-3); border-style: dashed; }
.orb-ctl { white-space: nowrap; text-align: right; }
.orb-ctl select { width: auto; min-width: 84px; height: 24px; box-sizing: border-box; margin: 0 2px; font: 600 10.5px var(--mono); background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); vertical-align: middle; }
.orb-ctl button:disabled, .orb-eye:disabled, .orb-ctl select:disabled { opacity: .45; cursor: not-allowed; }
.orb-stack-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 500 10.5px/1.3 var(--mono); color: var(--ink-2); }
.orb-stack-h b { color: var(--ink); }
.orb-add { display: flex; gap: 2px; margin-left: auto; }
.orb-add button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 10px/1 var(--mono); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 4px 5px; }
.orb-add button:disabled { opacity: .4; cursor: not-allowed; }
.orb-stack { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); max-height: 196px; overflow: auto; }
.orb-stack li { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-bottom: 1px dotted var(--line); min-height: 20px; }
.orb-stack li.plane { background: var(--chip-bg); border-left: 3px solid var(--accent); margin-left: -2px; }
.orb-stack li.empty .o { color: var(--ink-3); }
.orb-stack .o { flex: 0 0 52px; font: 700 10px/1 var(--mono); color: var(--ink); }
.orb-stack .ch { display: flex; flex-wrap: wrap; gap: 3px; }
.orb-stack .ch i { font: 500 9.5px var(--mono); color: var(--ink-3); }
.orb-stack .chip { all: unset; box-sizing: border-box; cursor: pointer; font: 600 10px/1 var(--body); color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); padding: 3px 5px; }
.orb-stack .chip.lk { cursor: default; border-style: dashed; }
.orb-stack .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.orb-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.orb-row > .orb-k { font: 700 10px/1 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: .05em; width: 72px; }
.orb-row input[type="range"] { flex: 1 1 120px; accent-color: var(--accent); }
.orb-row output { font: 700 11px var(--mono); color: var(--ink); width: 44px; text-align: right; }
.orb-row select { flex: 1 1 100px; min-width: 0; height: 24px; font: 600 10.5px var(--mono); background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.orb-cb { font: 500 10.5px/1.3 var(--body); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.orb-note, .orb-foot { margin: 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); }
.orb-note b, .orb-foot b { color: var(--ink); }
.orb-foot { border-top: 1px solid var(--line); padding-top: 5px; color: var(--ink-3); }
.orb-lock { margin: 0; padding: 5px 7px; font: 600 11px/1.4 var(--body); color: var(--ink); border: 1px dashed var(--warn); background: repeating-linear-gradient(135deg, var(--simhatch) 0 5px, var(--chip-bg) 5px 10px); }
.orb-par { margin: 0; padding: 5px 7px; font: 500 11px/1.4 var(--body); color: var(--ink); border-left: 3px solid var(--ink); background: var(--chip-bg); }
.orb-par button, #sky-kafka-note button, .tp-orbits button, .ins-lens button[data-act="orbits-open"], .ins-lens button[data-act="orbits-show"] { font: 600 10.5px/1 var(--body); padding: 3px 6px; margin-left: 4px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; }
#orbitsdock.locked #orb-head { background: repeating-linear-gradient(135deg, var(--simhatch) 0 5px, transparent 5px 10px); }
#sky-kafka-note { margin: -2px 0 0; }
#sky-kafka button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 1240px) { #btn-orbits b { display: none; } }
@media (max-width: 759px) {
  #tb-left { flex: 0 0 auto; gap: 0; }
  #btn-orbits { width: 32px; height: 34px; padding: 1px 0 0; flex-direction: column; justify-content: center; gap: 2px; }
  #btn-orbits .ic { font-size: 14px; }
  #btn-orbits .st8 { font-size: 8px; padding: 0; border: 0; background: none; }
  #btn-orbits .st8 .w { display: none; }
  #btn-orbits .st8 .s { display: inline; }
  /* above the chip tray (92 px + its chips) and the instrument line, under the sky */
  #orbitsdock { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; width: auto; max-width: none; max-height: 44vh; z-index: 59; }
  #btn-orbits[aria-pressed="true"] .st8 { color: var(--bg); }
  #orbitsdock.collapsed { width: auto; max-width: none; left: auto !important; }
  #orb-dock, #orb-head .grip { display: none; }
  #orb-head { cursor: default; }
}
