/* Explore Code Pilot (HOTBAR-36). Look: Energy Transition Simulator / site-world menu tokens (mod/menu-style.js). */
:root { --bg: #000; --panel: rgba(11, 14, 20, .86); --line: #2f343d; --sky: #9cdbff; --text: #fff; --dim: #a6adbb; --acc: #00ffff; --warn: #ffae00; --link: #66ccff; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
#pv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
a { color: var(--link); }
.pbtn { font: 12px ui-monospace, Menlo, monospace; color: var(--sky); background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  min-height: 44px; min-width: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.pbtn:active, .pbtn:hover { color: #fff; border-color: var(--acc); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
  background: linear-gradient(#000c, #0000); pointer-events: none; }
#hud > * { pointer-events: auto; }
.tape { position: relative; flex: 1 1 160px; min-width: 0; overflow: hidden; white-space: nowrap; text-align: center; color: var(--acc); border-bottom: 1px solid #00ffff55; padding: 2px 0; letter-spacing: .05em; }
.tape i { position: absolute; left: 50%; bottom: -1px; width: 0; height: 0; border: 5px solid transparent; border-bottom-color: var(--acc); transform: translateX(-50%); }
.read { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.read div { display: flex; gap: 6px; } .read dt { color: var(--dim); letter-spacing: .1em; } .read dd { margin: 0; color: #fff; white-space: nowrap; }
.read .wide dd { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#h-sat { border: 1px solid; border-radius: 3px; padding: 1px 6px; } #h-sat.ok { color: #00ff88; } #h-sat.off { color: var(--warn); }
.reticle { position: fixed; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 3; pointer-events: none;
  border: 1px solid #00ffff88; border-radius: 50%; }
.reticle::before, .reticle::after { content: ''; position: absolute; background: #00ffffaa; }
.reticle::before { left: -18px; right: -18px; top: 50%; height: 1px; } .reticle::after { top: -10px; bottom: -10px; left: 50%; width: 1px; }
#card { position: fixed; z-index: 6; left: 8px; right: 8px; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); max-height: 34vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; backdrop-filter: blur(3px); }
#card::before { content: ''; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border-top: 2px solid var(--acc); border-left: 2px solid var(--acc); }
#card.min > :not(h1):not(.cap) { display: none; }
#card h1 { font-size: 15px; margin: 2px 0; color: var(--acc); overflow-wrap: anywhere; }
.cap { margin: 0; font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.dim { color: var(--dim); }
#card p { margin: 4px 0; }
#c-files { margin: 4px 0; padding-left: 20px; }
#c-files li { margin: 4px 0; }
#c-files code { display: block; font-size: 10px; color: var(--sky); overflow-wrap: anywhere; opacity: .85; }
#note { position: fixed; z-index: 7; left: 50%; top: 64px; transform: translateX(-50%); max-width: min(92vw, 560px); background: #05070b; border: 1px solid var(--warn); color: #fff; padding: 8px 12px; border-radius: 4px; }
#joy { position: fixed; z-index: 6; left: 14px; bottom: calc(129px + 34vh); width: 112px; height: 112px; border-radius: 50%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(156, 219, 255, .4); touch-action: none; display: none; }
#knob { position: absolute; left: 36px; top: 36px; width: 40px; height: 40px; border-radius: 50%; background: rgba(156, 219, 255, .55); box-shadow: 0 0 10px #00ffff66; pointer-events: none; }
#pad { position: fixed; z-index: 6; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 6px; }
#pad .pbtn { padding: 0 2px; min-width: 0; font-size: 11px; }
#keys { display: none; position: fixed; z-index: 4; right: 10px; bottom: 26px; max-width: 520px; text-align: right; margin: 0; }
#credit { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; min-height: 20px; padding: 2px 8px calc(2px + env(safe-area-inset-bottom, 0px)); font-size: 10px; color: var(--dim); background: #000c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
@media (pointer: coarse) { #joy { display: block; } }
@media (min-width: 900px) {
  #card { left: 10px; right: auto; top: 70px; bottom: auto; width: 360px; max-height: calc(100vh - 160px); }
  #pad { left: auto; right: 10px; bottom: 60px; width: 470px; }
  #keys { display: block; bottom: 110px; }
  #joy { left: auto; right: 24px; bottom: 120px; }
  @media (pointer: coarse) { #keys { display: none; } }
}
@media (min-width: 900px) and (pointer: coarse) { #pad { bottom: 26px; } #joy { bottom: 100px; } }
/* ---- Pilot-200 W01 core (ALTIMETER-58): FAST button, HUD slots, panel dock, card extras, credits */
#p-fast { position: fixed; z-index: 6; right: 14px; bottom: calc(150px + 34vh); width: 64px; height: 64px; border-radius: 50%; font-weight: bold; letter-spacing: .04em; }
#p-fast[aria-pressed="true"] { color: #000; background: var(--acc); border-color: #fff; box-shadow: 0 0 14px #00ffffaa; }
#p-fast[data-level="3"] { background: var(--warn); box-shadow: 0 0 18px #ffae00cc; }
.p-hud { position: fixed; z-index: 6; display: flex; flex-direction: column; gap: 4px; pointer-events: none; box-sizing: border-box; }
.p-hud > * { pointer-events: auto; }
.p-hud-sub { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; max-width: 100%; box-sizing: border-box; }
.p-hud-status, .p-hud-top, .p-hud-bottom { left: 8px; right: 8px; align-items: center; }
.p-hud-status .p-hud-sub { background: none; border: 0; padding: 0; color: var(--dim); font-size: 11px; text-align: center; }
.p-hud-left { left: 8px; max-width: 44vw; align-items: flex-start; }
.p-hud-right { right: 8px; max-width: 44vw; align-items: flex-end; }
@media (max-width: 899px) { .p-hud-right { right: 86px; max-width: calc(100vw - 230px); } }   /* phones: keep right-slot buttons clear of FAST (UI review) */
/* phones: the stick and FAST sit just above the collapsed place card, below the top HUD stack (goto, modes, ticker,
   dark rows can grow it); the card, when opened for reading, may cover them until it is collapsed again. */
@media (max-width: 899px) { #joy, #p-fast { bottom: calc(212px + env(safe-area-inset-bottom, 0px)); } }
#p-tabs { position: fixed; z-index: 7; left: 6px; right: 6px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
#p-tabs::-webkit-scrollbar { display: none; }
#p-tabs:empty { display: none; }
#p-tabs .pbtn { flex: 0 0 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
@media (max-width: 899px) { #p-tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 28px; } }
#p-tabs .pbtn[aria-expanded="true"] { color: #000; background: var(--acc); border-color: #fff; }
body.p-has-tabs #card { bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
#p-sheet { position: fixed; z-index: 8; left: 6px; right: 6px; bottom: calc(128px + env(safe-area-inset-bottom, 0px)); max-height: 52vh; overflow: auto; overscroll-behavior: contain;
  background: rgba(11, 14, 20, .96); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px 10px; box-sizing: border-box; }
#p-sheet[hidden] { display: none; }
#p-sheet > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(11, 14, 20, .98); padding: 4px 0; }
#p-sheet h2 { margin: 0; font-size: 13px; color: var(--acc); letter-spacing: .06em; overflow-wrap: anywhere; }
@media (max-width: 899px) { body.p-panel-open #card { display: none; } }
#c-x:empty { display: none; }
#c-x .pbtn { margin-top: 6px; }
#credit { cursor: pointer; }
#credit.open { white-space: normal; max-height: 40vh; overflow: auto; }
@media (min-width: 900px) {
  #p-fast { right: 488px; bottom: 60px; width: 64px; height: 56px; border-radius: 6px; }
  #p-tabs { left: auto; right: 10px; top: 70px; bottom: auto; width: 470px; flex-wrap: wrap; overflow: visible; }
  #p-sheet { left: auto; right: 10px; top: 120px; bottom: 124px; width: 470px; max-height: none; }
  body.p-has-tabs #card { bottom: auto; }
  .p-hud-left, .p-hud-right { max-width: 340px; }
  .p-hud-left { left: 380px; }
  .p-hud-top, .p-hud-status, .p-hud-bottom { left: 380px; right: 490px; }
  body.p-has-tabs .p-hud-right { right: 490px; }
  body.p-panel-open #keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
