/* ============================================================================
   my-world · p4 · the city · screen chrome                               p4-chrome.css
   ADAPTED FROM P3 v2 (an earlier internal version):
   the top bar, the search, the popovers, the pulse panel, the windows and their
   chip tray, the tool rail and the phone sheets keep P3 v2's rules with the
   ids renamed (Orbits -> Floors, the sky chart -> the City map, .p3win ->
   .p4win) and a 17-slot rail. Day and night use the page tokens (index.html).
   ========================================================================== */

/* ---- top bar ---- */
#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; }
#top > #searchbox { width: min(560px, max(300px, calc(100vw - 20px - 24px - 2 * 470px))); }
#tb-left { min-width: 0; display: flex; align-items: center; gap: 10px; }
#brand { min-width: 0; overflow: hidden; flex: 0 1 auto; }
#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; }
/* video round (owner, 2026-10-31): the brand is never cut ('Cities Cityscape · P4' whole at 1,440 px); the sub line takes
   the brand's width without widening it (width 0, min-width 100%), so the search field gives way instead */
#brand { flex: 0 0 auto; } #brand .sub { width: 0; min-width: 100%; }
#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; }
.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-lens.on { border-color: var(--kafka-in); }
#simtoggle-slot { display: flex; }
#simtoggle-slot .mw-sim-pill { box-sizing: border-box; width: 46px; 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 '; }
#btn-search, #btn-tools { display: none; }
#btn-fly[aria-pressed="true"], #btn-walk[aria-pressed="true"], #btn-drone[aria-pressed="true"] { color: var(--bg); border-color: var(--http); background: var(--http); }
#btn-fly[aria-pressed="true"] .st8, #btn-walk[aria-pressed="true"] .st8, #btn-drone[aria-pressed="true"] .st8 { color: var(--bg); }
#btn-more { width: 28px; }
#btn-floors { 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); cursor: pointer; }
#btn-floors .ic { font: 700 16px/1 var(--body); color: var(--accent); }
#btn-floors .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-floors .st8 .s { display: none; }
#btn-floors[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
#btn-floors[aria-pressed="true"] .ic { color: var(--bg); }
#btn-floors[aria-pressed="true"] .st8 { color: var(--ink); }
#btn-floors.has-hidden .st8 { border-color: var(--warn); border-style: dashed; }

/* ---- search: wide, centred, above every overlay (top bar 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,16,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); }

/* ---- popovers ---- */
.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,16,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); }
.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-k { font: 700 10px/1 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: .05em; width: 30px; flex: 0 0 auto; }
#lens-body { display: flex; flex-direction: column; gap: 6px; }
.lens-row { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.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-note { margin: 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); }
.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); }
#more-pop { width: 280px; 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 kbd { font: 600 10px var(--mono); } #more-pop hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; width: 100%; }

/* ---- bars ---- */
#flightbar, #followbar { position: fixed; z-index: 44; left: 50%; transform: translateX(-50%); bottom: 64px; 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; }
#flightbar b, #followbar b { font: 700 11px var(--mono); letter-spacing: .05em; }
#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; max-width: 70vw; }
#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, #journey .j-next { color: var(--ink-2); }
body.p4-fp #stage canvas { cursor: crosshair; }

/* ---- the pulse panel ---- */
#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(.p4-sim) #pulsedock { display: none; }
#pulsedock.dragging { box-shadow: 0 18px 44px rgba(9,16,45,.38); opacity: .96; }
#pp-head, #fl-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); }
#pp-head { background: repeating-linear-gradient(135deg, var(--simhatch) 0 8px, transparent 8px 16px); }
#pp-head:active, #fl-head:active { cursor: grabbing; }
#pp-head:focus-visible, #fl-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.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 { position: static !important; transform: none !important; 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, #fl-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, #fl-head button:hover { border-color: var(--accent); }
#pp-body { display: flex; flex-direction: column; gap: 3px; padding: 0 0 7px; }
#simclock-slot .mw-sim-clock { position: static !important; 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; gap: 4px; }
#simclock-slot .mw-sim-clock select { display: none; }
.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; } .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-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); }
.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); }
#pb-play[aria-pressed="true"] { background: var(--warn); color: #fff; border-color: var(--warn); }
.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; }
#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 .l2 { display: block; margin-top: 2px; font-size: 9.5px; }
.simw { color: var(--warn); font-weight: 700; letter-spacing: .04em; } :root[data-theme="day"] .simw { color: #8a5100; }
#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-ic { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; font: 700 12px/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; }
#pulsedock.collapsed { width: auto; max-width: 460px; }
#pulsedock.collapsed #pp-body, #pulsedock.collapsed #pp-dock { display: none; }
#pulsedock.collapsed #pp-head { border-bottom: 0; gap: 5px; }
#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; }

/* ---- the Floors window ---- */
#floorsdock { position: fixed; z-index: 79; right: 360px; bottom: 80px; width: 330px; box-sizing: border-box; display: flex; flex-direction: column; border-left: 3px solid var(--accent); max-height: calc(100vh - 170px); overflow: hidden; }
#floorsdock[hidden] { display: none; }
#fl-head b { font: 700 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
#fl-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); }
#floorsdock.collapsed { width: auto; max-width: 440px; } #floorsdock.collapsed #fl-body, #floorsdock.collapsed #fl-dock { display: none; } #floorsdock.collapsed #fl-head { border-bottom: 0; }
#fl-body { overflow: auto; min-height: 0; padding: 6px 8px 7px; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.fl-presets { display: flex; flex-wrap: wrap; gap: 3px; }
.fl-presets button, .fl-cam button, .fl-last 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 6px; white-space: nowrap; }
.fl-presets button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.fl-presets button:disabled, .fl-cam button:disabled, .fl-ctl button:disabled, .fl-eye:disabled { opacity: .45; cursor: not-allowed; }
.fl-cam { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .fl-cb { font: 500 10.5px/1.3 var(--body); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.fl-layers { width: 100%; border-collapse: collapse; } .fl-layers td { padding: 2px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fl-layers tr.off .fl-nm { opacity: .55; }
.fl-nm b { display: block; font: 700 11.5px/1.2 var(--body); color: var(--ink); white-space: nowrap; } .fl-nm small { display: block; font: 500 9.5px/1.25 var(--mono); color: var(--ink-2); }
.fl-eye, .fl-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); }
.fl-eye[aria-pressed="false"] { color: var(--ink-3); border-style: dashed; }
.fl-ctl { white-space: nowrap; text-align: right; } .fl-v { display: inline-block; min-width: 74px; text-align: center; font: 700 10.5px/22px var(--mono); color: var(--ink); vertical-align: middle; }
.fl-row { display: flex; align-items: center; gap: 6px; } .fl-k { font: 700 10px/1 var(--mono); color: var(--ink); text-transform: uppercase; letter-spacing: .05em; width: 58px; }
.fl-row input[type="range"] { flex: 1 1 120px; accent-color: var(--accent); } .fl-row output { font: 700 11px var(--mono); color: var(--ink); width: 44px; text-align: right; }
.fl-last, .fl-foot, .fl-lock, .fl-par { margin: 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-2); } .fl-last b, .fl-foot b, .fl-par b { color: var(--ink); }
.fl-last { padding: 4px 6px; border-left: 3px solid var(--line-2); background: var(--chip-bg); }
.fl-foot { border-top: 1px solid var(--line); padding-top: 5px; color: var(--ink-3); }
.fl-lock { padding: 5px 7px; font-weight: 600; color: var(--ink); border: 1px dashed var(--warn); background: repeating-linear-gradient(135deg, var(--simhatch) 0 5px, var(--chip-bg) 5px 10px); }
.fl-par { padding: 5px 7px; color: var(--ink); border-left: 3px solid var(--ink); background: var(--chip-bg); }
.tp-floors { margin: 4px 0; font-size: 11px; color: var(--warn); } .tp-floors button { 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; }

/* ---- windows: header drags, ▁ minimises to a chip, double-click docks, the corner resizes ---- */
.p4win { position: fixed; z-index: 60; display: flex; flex-direction: column; box-sizing: border-box; min-width: 220px; min-height: 120px; resize: both; overflow: hidden; }
.p4win[hidden] { display: none !important; }
.p4win.dragging { box-shadow: 0 18px 44px rgba(9,16,45,.38); opacity: .97; }
.p4win-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; }
.p4win-h:active { cursor: grabbing; } .p4win-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.p4win-h b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.p4win-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); }
.p4win-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; }
.p4win-h button:hover { border-color: var(--accent); } .p4win-h button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.p4win-h .lvl { display: inline-flex; } .p4win-h .lvl button { border-right-width: 0; min-width: 0; padding: 0 5px; font-weight: 600; } .p4win-h .lvl button:last-child { border-right-width: 1px; }
.p4win-b { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; scrollbar-width: thin; }
#win-map .p4win-b > canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
#win-matrix .p4win-b > canvas { display: block; cursor: pointer; }
#wintray { position: fixed; z-index: 58; left: 74px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(50vw - 330px); }
.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.tucked { border-style: dashed; } .wchip[data-win="toolpanel"] { border-color: var(--http); }

/* ---- the tool rail: 17 slots (A 1-6, B 7-12, C 13-17) ---- */
#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 - 140px); 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 7px/1 var(--mono); color: var(--warn); }
.slot.empty { border-style: dashed; 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; }
#toolpanel { font-size: 12px; color: var(--ink-2); } #toolpanel .p4win-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; }
.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; }
.treason { color: var(--warn); font-size: 11.5px; }

/* ---- HUD, detector ---- */
.hud-cap { margin: 8px 9px; font: 500 11px/1.45 var(--body); color: var(--ink-2); } .hud-cap b { color: var(--ink); }
.hud-centre { margin: 8px 8px 2px; padding: 6px 8px; border: 1px solid var(--line-2); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.hud-centre b { font: 700 14px var(--display); color: var(--ink); overflow-wrap: anywhere; } .hud-centre span { font: 10px var(--mono); color: var(--ink-2); }
.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.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; }
.det-cap { margin: 6px 9px; font: 500 10.5px/1.45 var(--body); color: var(--ink-2); } .det-cap b { color: var(--ink); } .det-cap.det-centric { border-left: 3px solid var(--accent); padding-left: 7px; 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[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); }
.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; }

/* ---- fix round (QA 2026-10-25) ---- */
.phone-only { display: none !important; }
#simtoggle-slot .mw-sim-pill { width: 54px; }   /* D-26: "SIM OFF" fits */
body.p4-fp #lblnote, body.p4-following #lblnote { bottom: 104px; }   /* D-16: the bars no longer cover the label note */
#qualitychip { position: fixed; z-index: 46; right: 10px; bottom: 60px; max-width: 420px; padding: 5px 8px; font: 500 10.5px/1.4 var(--body); color: var(--ink); border-left: 3px solid var(--warn); }
#qualitychip[hidden] { display: none; }
#qualitychip b { font: 700 10px var(--mono); letter-spacing: .05em; color: var(--warn); }
#qualitychip button { font: 600 10.5px/1 var(--body); padding: 4px 7px; margin-left: 4px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; }
#toolsheet { position: fixed; z-index: 80; left: 8px; right: 8px; bottom: calc(160px + env(safe-area-inset-bottom, 0px)); max-height: min(62vh, 560px); overflow: auto; box-sizing: border-box; padding: 0 0 6px; }
#toolsheet[hidden] { display: none; }
#toolsheet .ts-h { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
#toolsheet .ts-h b { font: 700 14px var(--display); color: var(--ink); } #toolsheet .ts-h span { flex: 1; font: 500 10.5px var(--mono); color: var(--ink-2); }
#toolsheet .ts-h button { all: unset; box-sizing: border-box; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--ink); }
#toolsheet ul { list-style: none; margin: 0; padding: 4px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#toolsheet li button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
#toolsheet li button.on { border-color: var(--http); background: color-mix(in srgb, var(--http) 14%, var(--surface)); }
#toolsheet li button:disabled { opacity: .5; } #toolsheet .ic { font: 700 15px var(--body); width: 20px; text-align: center; }
#toolsheet .nm b { display: block; font: 700 12px/1.2 var(--body); } #toolsheet .nm small { display: block; font: 500 9.5px/1.25 var(--mono); color: var(--ink-2); }
.tp-sheet { margin: 0 0 4px; } .tp-sheet button { font: 600 11px/1 var(--body); min-height: 36px; padding: 0 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; }
.tp-pulse { margin: 4px 0; padding: 4px 7px; font-size: 11px; line-height: 1.4; color: var(--ink); border: 1px dashed var(--warn); background: repeating-linear-gradient(135deg, var(--simhatch) 0 5px, var(--chip-bg) 5px 10px); }
.tip-x { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
#pulsedock.collapsed #pp-collapse { transform: rotate(-90deg); }

/* ---- narrower desktops ---- */
@media (max-width: 1240px) { #brand .sub { display: none; } #btn-floors b { display: none; } }
@media (max-width: 1000px) and (min-width: 760px) { #brand h1 span { display: none; } #tb-icons .sep { display: none; } }

/* ---- phone ---- */
@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-left { flex: 0 0 auto; gap: 0; }
  #tb-icons { flex: 1 1 auto; justify-content: space-between; gap: 2px; }
  #btn-routes, #btn-views, #btn-fly, #btn-walk, #btn-drone, #tb-icons .sep, #flightbar { display: none !important; }
  .ibtn { width: 31px; height: 34px; } #simtoggle-slot .mw-sim-pill { width: 34px; height: 34px; }
  #btn-search, #btn-tools { display: inline-flex; }
  #btn-floors { width: 32px; height: 34px; padding: 1px 0 0; flex-direction: column; justify-content: center; gap: 2px; } #btn-floors b { display: none; } #btn-floors .ic { font-size: 14px; }
  #btn-floors .st8 { font-size: 7.5px; padding: 0; border: 0; background: none; } #btn-floors .st8 .w { display: none; } #btn-floors .st8 .s { display: inline; }
  #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); }
  .p4-search-open #searchbox { display: block; } #search { font-size: 16px; } #search-results { min-width: 0; max-height: calc(100vh - 300px); }
  .pop-wrap { position: static; } .pop { left: -1px; right: -1px; width: auto; top: calc(100% + 4px); } .pop::before { display: none; }
  #pulsedock { left: 8px !important; right: 8px; top: calc(58px + env(safe-area-inset-top, 0px)) !important; width: auto; max-width: none; }
  #pulsedock.collapsed { width: auto; max-width: none; }
  #pp-dock, #pp-head .grip, .pp-keys, .pp-cap { display: none; } #pp-head { cursor: default; }
  .pp-sl { grid-template-columns: 52px 1fr 42px; gap: 6px; padding: 1px 8px 0; } #pb-sampling .l2 { display: none; }
  .p4win.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(44vh, 380px) !important; resize: none; border-left: 0; border-right: 0; z-index: 70; }
  .p4win.phone .p4win-h { cursor: default; } .p4win.phone .p4win-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; }
  #floorsdock { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; width: auto; max-height: 44vh; z-index: 59; }
  #fl-dock, #fl-head .grip { display: none; }
  #followbar { bottom: 150px; max-width: calc(100vw - 16px); white-space: normal; }
  /* D-13: 44 px targets that fit 390 px: lens, brightness and help move into the ⋯ menu; the tray shows icons only */
  #top { height: 52px; }
  .ibtn, #simtoggle-slot .mw-sim-pill, #btn-floors { width: 44px !important; height: 44px !important; }
  #btn-lens, #btn-bright, #btn-help { display: none !important; }
  .phone-only { display: grid !important; }
  #more-pop button { min-height: 44px; }
  .wchip { width: 44px; height: 44px; padding: 0; justify-content: center; } .wchip .nm { display: none; }
  #wintray { flex-wrap: wrap; overflow: visible; bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important; }
  .p4win.phone { bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important; }
  .p4win.phone .p4win-h button, #toolpanel-close, #pp-head button, #fl-head button { min-width: 44px !important; height: 44px !important; }
  .mw-cambar { left: 8px !important; right: 8px; transform: none !important; justify-content: space-between; max-width: none !important; box-sizing: border-box; }
  .mw-cambar button { min-height: 44px; min-width: 44px; padding: 0 6px !important; }
  #qualitychip { left: 8px; right: 8px; bottom: 190px; max-width: none; }
  /* the folded pulse strip keeps its own summary, which still begins with SIMULATED */
  #pulsedock.collapsed #simbanner-slot { display: none; }
  #pulsedock.collapsed #pp-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- v3: the Height selector, the layers caption, Compare, the tool panel's Compare button, walk / fly hints ---- */
#btn-height { 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); cursor: pointer; }
#btn-height .ic { font: 700 15px/1 var(--body); color: var(--accent); }
#btn-height .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-height[aria-expanded="true"] { border-color: var(--accent); }
#height-pop { left: 0; right: auto; width: 360px; }
.hm-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 8px; border: 1px solid var(--line); background: var(--chip-bg); cursor: pointer; text-align: left; font: 500 11px/1.35 var(--body); color: var(--ink-2); }
.hm-row b { font: 700 12.5px var(--display); color: var(--ink); } .hm-row .prov { justify-self: end; align-self: start; }
.hm-row small { grid-column: 1 / -1; color: var(--ink-3); font-size: 10.5px; }
.hm-row[aria-pressed="true"] { border: 2px solid var(--accent); padding: 6px 7px; background: var(--surface); }
.hm-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-note { margin: 2px 0 0; font: 500 10.5px/1.4 var(--body); color: var(--ink-3); }
.hm-scale { display: inline-block; margin-left: 4px; font: 600 10px var(--mono); color: var(--accent); }
#layerscap { position: fixed; z-index: 46; left: 50%; transform: translateX(-50%); bottom: 64px; width: min(760px, calc(100vw - 120px)); box-sizing: border-box; padding: 8px 12px 8px; display: grid; gap: 3px; font: 500 12px/1.4 var(--body); color: var(--ink-2); border-left: 3px solid var(--accent); }
#layerscap[hidden] { display: none; }
#layerscap .lc-row { display: grid; grid-template-columns: 232px 1fr; gap: 8px; align-items: baseline; }
#layerscap .lc-row b { font: 700 12px var(--display); color: var(--ink); white-space: nowrap; }
#layerscap .lc-sky b { color: var(--http); } #layerscap .lc-under b { color: var(--kafka-in); }
#layerscap .lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; font: 500 10.5px var(--mono); color: var(--ink-3); }
#layerscap button { font: 700 11px/1 var(--body); padding: 6px 12px; color: var(--bg); background: var(--ink); border: 1px solid var(--ink); cursor: pointer; }
#win-compare { font-size: 12px; color: var(--ink-2); }
#compare-body { padding: 8px 12px 12px; }
#compare-body h4 { margin: 10px 0 4px; font: 600 10.5px/1.3 var(--mono); color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cmp-how, .cmp-note { margin: 4px 0; line-height: 1.45; } .cmp-note { color: var(--ink-3); font-size: 11px; }
.cmp-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.cmp-row button { font: 600 11px/1 var(--body); padding: 6px 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); cursor: pointer; }
.cmp-row button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.cmp-pick { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 5px; align-items: center; }
.cmp-pick select { min-width: 0; font: 500 11.5px var(--body); padding: 4px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.cmp-sky text { font: 500 8.5px var(--mono); fill: var(--ink-2); } .cmp-sky text.lab { font-weight: 700; fill: var(--ink); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 11px var(--body); } .cmp-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.cmp-t { width: 100%; border-collapse: collapse; font-size: 11px; } .cmp-t th, .cmp-t td { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .cmp-t th { font: 600 10px var(--mono); color: var(--ink-3); } .cmp-t td:first-child { color: var(--ink-3); white-space: nowrap; }
.tp-compare { margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font: 500 10.5px/1.35 var(--body); color: var(--ink-3); }
.tp-compare button { flex: 0 0 auto; font: 700 11px/1 var(--body); padding: 7px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--accent); cursor: pointer; }
#flightbar .fb-hint { color: var(--ink-2); }
@media (max-width: 1240px) { #btn-height b { display: none; } }
@media (max-width: 759px) {
  #btn-height { width: 44px !important; height: 44px !important; padding: 1px 0 0; flex-direction: column; justify-content: center; gap: 2px; } #btn-height b { display: none; } #btn-height .ic { font-size: 14px; }
  #btn-height .st8 { font-size: 7px; padding: 0; border: 0; background: none; max-width: 42px; overflow: hidden; text-overflow: ellipsis; }
  #height-pop { left: -1px; right: -1px; width: auto; }
  #layerscap { left: 8px; right: 8px; transform: none; width: auto; bottom: 150px; font-size: 11px; } #layerscap .lc-row { grid-template-columns: 1fr; gap: 0; } #layerscap .lc-foot span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .p4win { transition: none; } }

/* ---- fix round (QA, 2026-10-25) ---- */
:root { --radio: #c0126c; } [data-theme="night"] { --radio: #5ef0ff; }
/* D-02 / D-16: the layer ruler at the left edge of the free stage, outside the label budget, never under the pointer */
#layerruler { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 44; }
#layerruler[hidden] { display: none; }
#layerruler .lr-row { position: absolute; box-sizing: border-box; max-width: 300px; padding: 3px 9px 3px 8px; background: color-mix(in srgb, var(--surface) 90%, transparent); border-left: 3px solid var(--ink-2); font: 500 10px/1.3 var(--mono); color: var(--ink-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
#layerruler .lr-row b { display: block; font: 700 11.5px/1.3 var(--display); color: var(--ink); white-space: nowrap; }
#layerruler .lr-row span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#layerruler .lr-row::after { content: ''; position: absolute; left: 100%; top: 50%; width: 22px; border-top: 2px solid currentColor; opacity: .55; }
#layerruler .lr-long { width: 300px; padding: 5px 10px 6px 9px; } #layerruler .lr-long span { white-space: normal; font: 500 11px/1.4 var(--body); }
#layerruler .lr-sky { border-left-color: var(--radio); color: var(--radio); } #layerruler .lr-sky b { color: var(--radio); }
#layerruler .lr-under { border-left-color: var(--kafka-in); color: var(--kafka-in); } #layerruler .lr-under b { color: var(--kafka-in); }
#layerruler .lr-street { border-left-color: var(--ink); color: var(--ink-2); }
#layerruler .lr-row span, #layerruler .lr-long span { color: var(--ink-2); }
#layerscap.docked { left: 0; transform: none; bottom: auto; width: 300px; padding: 5px 8px 5px 9px; gap: 0; }
#layerscap.docked .lc-row { display: none; }
#layerscap.docked .lc-foot { margin: 0; } #layerscap.docked .lc-foot span { font-size: 10px; }
/* D-06: the runtime's Compare row stays reachable at the base of every tool panel (sticky footer of the panel's body) */
#toolpanel-body { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
#toolpanel-body > .tp-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 12px 12px; scrollbar-width: thin; }
#toolpanel-body > .tp-compare { flex: 0 0 auto; margin: 0; padding: 7px 12px 9px; background: var(--surface); box-shadow: 0 -6px 10px -8px rgba(0, 0, 0, .35); }
/* D-04: the flight's edge notice */
#flightbar .fb-edge { display: none; color: var(--warn, #b86a00); font-weight: 700; } .p4-fly-edge #flightbar .fb-edge { display: inline; }
/* D-08: 44 px targets inside the tool panel on the phone */
@media (max-width: 759px) {
  #toolpanel button, #toolpanel select, #toolpanel input[type="range"], #toolpanel [role="option"], #toolpanel [role="button"] { min-height: 44px; }
  #toolpanel button, #toolpanel [role="button"], #toolpanel select { min-width: 44px; }
  #toolpanel input[type="text"], #toolpanel input[type="search"], #toolpanel input[type="number"] { min-height: 44px; min-width: 44px; box-sizing: border-box; }
  #toolpanel input[type="checkbox"], #toolpanel input[type="radio"] { min-width: 44px; min-height: 44px; margin: 0 4px 0 0; }
  #toolpanel .tp-sheet button { min-height: 44px; padding: 0 12px; }
  #layerruler .lr-row { max-width: 200px; } #layerruler .lr-row span { display: none; }
}
