/* The work view's tools (round 2): the slim belt, the verb menu, the meter that
   stows and its test point dots, and the power panel. New rules live here, not in hangar.css.
   (js/work/hud.js, manualui.js, meterhud.js, testpoints.js, power.js) */

/* ---- the belt: compact ---- */
.wk-belt { gap: 5px; padding: 5px; border-radius: 12px; }
.wk-tool, .wk-hint, .wk-belt .wk-prints, .wk-belt .wk-power { width: 62px; height: 56px; padding: 5px 3px 3px; gap: 1px; }
.wk-tool { width: 84px; }
.wk-tool-n { font-size: 12px; line-height: 1.05; }
.wk-ic { width: 22px; height: 22px; }
.wk-hint span, .wk-belt .wk-prints span, .wk-belt .wk-power span { margin-top: 12px; font-size: 12.5px; }
.wk-tool[hidden], .wk-belt .wk-prints[hidden] { display: none; }
.wk-belt .wk-power { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--paper, #eef1f4); background: var(--ink-2, #161a21); border: 2px solid #2c323c; border-radius: 10px; cursor: pointer; }
.wk-belt .wk-power:hover { background: #1a1f27; border-color: #4a5260; }
.wk-belt .wk-power:focus-visible { outline: 3px solid var(--focus, #f2c230); outline-offset: 2px; }
.wk-belt .wk-power kbd { position: absolute; top: 4px; left: 5px; font-size: 11px; padding: 0 4px; }
.wk-belt .wk-power[aria-pressed="true"] { background: #2a2414; border-color: #e0b44c; }
.wk-belt .wk-power .wk-ic { margin-top: 10px; }
.wk-belt .wk-power span { margin-top: 0; }
.wk-hand { margin: 0; padding: 5px 10px; border-radius: 8px; background: #2a2414; border: 1.5px solid #e0b44c; font: 600 13px/1.3 var(--body); color: #fff7dc; }

/* ---- the verb menu: what a hand does to a nut or a terminal ---- */
.wk-menu { position: absolute; left: 0; top: 0; z-index: 4; min-width: 250px; max-width: 330px; padding: 6px; border-radius: 12px; background: rgba(10,11,13,.97); color: var(--paper, #eef1f4);
  border: 1.5px solid #4a5260; box-shadow: 0 12px 34px rgba(0,0,0,.5); pointer-events: auto; }
.wk-menu[hidden] { display: none; }
.wk-menu-h { margin: 2px 8px 6px; font: 600 12px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--paper-2, #b8c0cb); }
.wk-menu-it { display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 8px; width: 100%; min-height: 44px; padding: 5px 10px; text-align: left; color: var(--paper, #eef1f4);
  background: transparent; border: 2px solid transparent; border-radius: 8px; }
.wk-menu-it:hover:not(.off), .wk-menu-it:focus-visible { background: #2a2414; border-color: #e0b44c; }
.wk-menu-it kbd { font-size: 11px; text-align: center; padding: 0 4px; }
.wk-menu-l { font: 600 16px/1.25 var(--body); }
.wk-menu-d { grid-column: 2; font: 500 12.5px/1.3 var(--body); color: #b8c0cb; }
.wk-menu-it.off .wk-menu-l { color: #8c95a1; }
.wk-menu-it.off .wk-menu-d { color: #9aa3ae; }
.wk-menu-it.off kbd { opacity: .55; }

/* ---- the meter that stows, and its dots ---- */
.dmm-stow, .dmm-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; font: 600 14px var(--body); color: var(--paper, #eef1f4);
  background: rgba(10,11,13,.92); border: 2px solid #3a414c; border-radius: 8px; cursor: pointer; }
.dmm-stow:hover, .dmm-chip:hover { background: #1b2029; border-color: #5a6472; }
.dmm-stow kbd, .dmm-chip kbd { font: 500 12px var(--mono); background: var(--paper, #eef1f4); color: var(--ink, #0e1014); padding: 0 5px; border-radius: 4px; }
.dmm-chip { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); pointer-events: auto; z-index: 1; border-left: 6px solid #e2a92e; }
.dmm-chip[hidden] { display: none; }
/* seated in the cockpit with the meter put away: the key hints sit above its chip, not under it */
body:not(:has(.dmm:not([hidden]))):has(.dmm-chip:not([hidden])) .cockpit-strip { bottom: calc(64px + env(safe-area-inset-bottom)); }
.dmm-chip-i { color: #e2a92e; font-size: 16px; }
.dmm-probe-cell { position: relative; display: flex; }
.dmm-probe-cell .dmm-probe { flex: 1; padding-right: 50px; }
.dmm-lift { position: absolute; right: 4px; top: 4px; min-height: 30px; padding: 0 9px; font: 600 12px var(--body); color: var(--paper, #eef1f4); background: #20252d; border: 1.5px solid #4a5260; border-radius: 6px; cursor: pointer; }
.dmm-lift:hover { border-color: #e0b44c; }
.dmm-lift[hidden] { display: none; }
.dmm-pick { margin: 6px 2px 0; font: 600 13px/1.3 var(--body); color: #ffe9a8; text-shadow: 0 1px 3px #000; }
.dmm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.dmm-ground, .dmm-usual { min-height: 38px; padding: 4px 8px; font: 600 12.5px/1.25 var(--body); color: var(--paper, #eef1f4); background: rgba(10,11,13,.92); border: 2px solid #3a414c; border-radius: 8px; cursor: pointer; }
.dmm-ground { border-left: 6px solid #5a5f66; }
.dmm-ground:hover, .dmm-usual:hover { border-color: #e0b44c; }
.dmm-leads { margin-top: 6px; }
.dmm-leads .dmm-lead { min-height: 36px; font-size: 12px; }
/* the meter, compact so the column fits under the job bar and the buttons at the top right */
.dmm { width: 220px; }
.dmm-face { width: 220px; }
.dmm-probes { grid-template-columns: minmax(0, 1fr); gap: 4px; margin-top: 6px; min-width: 0; }
.dmm-probe-cell { min-width: 0; }
.dmm-probe { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 42px; padding: 3px 58px 3px 8px; min-width: 0; width: 100%; overflow: hidden; }
.dmm-probe-k { font-size: 10.5px; }
.dmm-probe-at { -webkit-line-clamp: 1; min-width: 0; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; display: block; font-size: 12.5px; }
.dmm-lift { top: 6px; min-height: 30px; }
.dmm-pick { margin: 4px 2px 0; font-size: 12.5px; line-height: 1.3; }
.dmm-quick { margin-top: 4px; }
.dmm-ground, .dmm-usual { min-height: 34px; font-size: 12px; }
.dmm-leads { margin-top: 4px; gap: 4px; }
.dmm-leads .dmm-lead { min-height: 32px; padding: 3px 6px; font-size: 11.5px; }
.dmm-foot { margin-top: 4px; justify-content: space-between; gap: 6px; }
.dmm-logbtn { min-height: 34px; }
.dmm-stow { min-height: 34px; padding: 0 10px; }

.wk-tps { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.wk-tps[hidden] { display: none; }
.wk-tp { --tp: 14px; position: absolute; left: calc(var(--tp) / -2 - 2px); top: calc(var(--tp) / -2 - 2px); width: calc(var(--tp) + 4px); height: calc(var(--tp) + 4px); padding: 0; border-radius: 50%; background: transparent; border: 0; pointer-events: none; }
.wk-tp::before { content: ''; position: absolute; left: 2px; top: 2px; width: var(--tp); height: var(--tp); border-radius: 50%; background: #ffd24a; border: 2px solid #15120a; box-sizing: border-box; box-shadow: 0 0 0 1.5px rgba(255,210,74,.7), 0 1px 4px rgba(0,0,0,.6); }
.wk-tp.hot::before, .wk-tp:focus-visible::before { background: #fff; box-shadow: 0 0 0 3px #ffd24a, 0 1px 6px rgba(0,0,0,.7); }
.wk-tp.hot, .wk-tp:focus-visible { z-index: 3; }
.wk-tp:focus-visible { outline: none; }
.wk-tp.red::before { background: #d6342a; border-color: #fff; }
.wk-tp.black::before { background: #101113; border-color: #fff; }
.wk-tp-n { position: absolute; left: calc(var(--tp) + 10px); top: -6px; display: none; padding: 4px 9px; border-radius: 8px; background: rgba(10,11,13,.94); color: #fff7dc; border: 1.5px solid #ffc72c;
  font: 600 13px/1.3 var(--body); white-space: nowrap; pointer-events: none; z-index: 2; }
.wk-tp-lead { position: absolute; left: calc(var(--tp) / 2 + 2px); top: calc(var(--tp) / 2 + 1px); height: 2px; background: #ffd24a; box-shadow: 0 0 0 1px rgba(21,18,10,.8); transform-origin: 0 50%; pointer-events: none; z-index: -1; }
.wk-tp-lead[hidden] { display: none; }
.wk-tp-lead::after { content: ''; position: absolute; right: -3px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #ffd24a; border: 1.5px solid #15120a; box-sizing: border-box; }
.wk-tp.hot .wk-tp-n, .wk-tp:focus-visible .wk-tp-n { display: block; }
@media (max-width: 900px) { .dmm-chip { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* ---- the power panel ---- */
.pw { position: absolute; z-index: 6; left: calc(16px + env(safe-area-inset-left)); top: calc(var(--notes-bottom, 76px) + 6px); width: min(612px, calc(100vw - 260px)); max-height: calc(100vh - var(--notes-bottom, 76px) - 108px); overflow: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; pointer-events: auto; color: var(--paper, #eef1f4); background: rgba(10,11,13,.95);
  border-radius: 12px; border-top: 5px solid #e0b44c; box-shadow: 0 10px 34px rgba(0,0,0,.45); }
.pw[hidden] { display: none; }
.pw button { font-family: var(--body, system-ui); cursor: pointer; }
.pw button:focus-visible { outline: 3px solid var(--focus, #f2c230); outline-offset: 2px; }
.pw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-title { margin: 0; display: flex; flex-direction: column; }
.pw-over { font: 600 11px/1.3 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: #e0b44c; }
.pw-name { font: 700 18px/1.2 var(--head, system-ui); }
.pw-close { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--body); color: var(--paper, #eef1f4); background: #161a21; border: 2px solid #3a414c; border-radius: 8px; }
.pw-close:hover { border-color: #5a6472; }
.pw-close kbd { font: 500 12px var(--mono, monospace); background: var(--paper, #eef1f4); color: #0e1014; padding: 0 5px; border-radius: 4px; }
.pw-h { display: block; margin: 0 0 5px; font: 700 11px var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--paper-2, #b8c0cb); }
.pw-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pw-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pw-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pw-g { display: flex; flex-direction: column; gap: 0; padding: 3px 7px; background: #12151a; border: 1.5px solid #272c35; border-radius: 8px; }
.pw-gl { font: 500 11px/1.2 var(--body); color: #aab3bf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-gv { font: 700 15px/1.25 var(--mono, monospace); color: #e9f3e1; white-space: nowrap; }
.pw-gv.chg { color: #d9f2c4; }
.pw-gv.dis { color: #ffc982; }
.pw-master { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pw-master .pw-h { margin: 0 4px 0 0; width: 54px; }
.pw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pw-rk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 34px; padding: 3px 3px; color: var(--paper, #eef1f4); background: #161a21; border: 2px solid #2c323c; border-radius: 8px; }
.pw-rk.big { flex: 1; min-height: 40px; }
.pw-rk-l { font: 700 12px/1.15 var(--body); text-align: center; letter-spacing: .02em; }
.pw-rk-s { font: 700 11px var(--mono, monospace); color: #8e98a5; }
.pw-rk:hover { border-color: #4a5260; }
.pw-rk.on { background: #1d3a25; border-color: #5fc27c; }
.pw-rk.on .pw-rk-s { color: #b9f0c8; }
.pw-stby { margin-top: 0; }
.pw-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pw-segb { min-height: 32px; font: 700 13px var(--body); color: var(--paper, #eef1f4); background: #161a21; border: 2px solid #2c323c; border-radius: 8px; }
.pw-segb:hover { border-color: #4a5260; }
.pw-segb.on { background: #1d3a25; border-color: #5fc27c; }
.pw-bgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.pw-b { display: flex; gap: 3px; min-width: 0; }
.pw-b .pw-bb { flex: 1; min-width: 0; }
.pw-bb { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; min-height: 28px; padding: 0 8px; text-align: left; color: var(--paper, #eef1f4); background: #161a21; border: 2px solid #2c323c; border-radius: 8px; }
.pw-bb:hover { border-color: #4a5260; }
.pw-bl { font: 700 12px/1.1 var(--body); }
.pw-ba { font: 500 11px/1.1 var(--mono, monospace); color: #9aa3ae; text-align: right; }
.pw-bs { grid-column: 1 / 3; font: 700 10px/1.1 var(--mono, monospace); color: #9be0ad; }
.pw-bb.out { background: #2a1d1a; border-color: #8a4a3c; }
.pw-bb.out .pw-bs { color: #ffb09c; }
.pw-bb.tripped { border-color: #ff7a5c; box-shadow: 0 0 0 2px rgba(255,122,92,.35); }
.pw-tps { display: flex; flex-direction: column; gap: 2px; width: 44px; flex: none; }
.pw-b { min-height: 28px; }
.pw-tps[hidden] { display: none; }
.pw-tp { flex: 1; min-height: 0; padding: 0 2px; font: 700 9px/1 var(--mono, monospace); color: #15120a; background: #ffd24a; border: 1.5px solid #15120a; border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(255,210,74,.6); }
.pw-tp:hover { background: #fff; }
.pw-tp.red { background: #d6342a; color: #fff; border-color: #fff; }
.pw-tp.black { background: #101113; color: #fff; border-color: #fff; }
.pw-tp-l { pointer-events: none; }
.pw-gpu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pw-gb { min-height: 32px; padding: 0 6px; font: 600 13px var(--body); color: var(--paper, #eef1f4); background: #161a21; border: 2px solid #2c323c; border-radius: 8px; }
.pw-gb:hover { border-color: #4a5260; }
.pw-gb.on { background: #1d3a25; border-color: #5fc27c; }
.pw-gpu-n { margin: 5px 2px 0; font: 500 12.5px/1.3 var(--body); color: #cfd6df; }
/* the prints drawer stands aside for the power panel */
body.working:has(#powerPanel:not([hidden])) .pd { left: calc(644px + env(safe-area-inset-left)); width: clamp(300px, calc(100vw - 644px - 260px), 700px); }
@media (max-width: 1100px) { .pw { width: min(420px, calc(100vw - 32px)); z-index: 41; max-height: none; } .pw-body { grid-template-columns: 1fr; } body.working:has(#powerPanel:not([hidden])) .pd { left: calc(16px + env(safe-area-inset-left)); width: clamp(380px, 52vw, 760px); } }
@media (max-height: 760px) { .pw { gap: 6px; padding-bottom: 8px; } }

/* the bags make room for the power panel: between it and the meter */
body.working:has(#powerPanel:not([hidden])) .wk-dock { left: calc(50% + 190px); width: 400px; }
@media (max-width: 1100px) { body.working:has(#powerPanel:not([hidden])) .wk-dock { left: 50%; } }
