/* Backstage → Hangar: the control room (hangar.js). Look A "Flight Deck Radar": Backstage orange on near-black, a
   sweeping radar with the flock as blips in V formation, GANDER at the point; TOWER is the calmer split-flap board.
   Phone first (one column, 16 px gutter, 44 px+ targets); >= 1100 px gets missions | radar + chat | flight log.
   Motion is short and off with reduced motion. */
.hg { --ink: var(--accent); display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; font-variant-numeric: tabular-nums; }
.hg-loading { padding: 40px var(--gutter); text-align: center; }
.hg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #2a2218; border-radius: 14px;
  background: radial-gradient(120% 140% at 50% 0%, #17120c, #0b0c0e 70%); }
.hg-title { display: flex; align-items: center; gap: 8px; }
.hg-title b { font: 800 15px/1 var(--display); letter-spacing: .22em; color: var(--accent); }
.hg-pills { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; order: 3; }
.hg-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border-radius: 9px; border: 1px solid transparent;
  font: 600 12px/1.25 var(--mono); letter-spacing: .02em; color: var(--text); cursor: pointer; max-width: 100%; text-align: left; }
.hg-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.hg-pill.ok { background: #12301d; } .hg-pill.ok i { color: var(--live); }
.hg-pill.amb { background: #33290f; } .hg-pill.amb i { color: var(--amber); }
.hg-pill.bad { background: #351620; } .hg-pill.bad i { color: var(--down); animation: hg-blink 1s steps(2) infinite; }
.hg-ctrls { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; align-items: center; }
.hg-ctrls .btn.sm { min-height: 40px; }
.hg-ground { position: relative; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--down); color: #1a0308;
  font: 800 12px/1 var(--mono); letter-spacing: .14em; cursor: pointer; overflow: hidden; touch-action: none; }
.hg-ground b { position: relative; }
.hg-ring { position: absolute; inset: 0; background: #ffd1d9; transform-origin: left; transform: scaleX(0); }
.hg-ground.holding .hg-ring { transform: scaleX(1); transition: transform 1s linear; }

.hg-st { display: inline-block; padding: 3px 7px 2px; border-radius: 5px; font: 700 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.hg-st.amber { background: #33290f; color: var(--amber); } .hg-st.live { background: #12301d; color: #7dffb0; } .hg-st.down { background: #351620; color: #ff9bb0; }
.hg-st.blue { background: #18233f; color: #9bb8ff; } .hg-st.violet { background: #261b3d; color: #cdb4ff; } .hg-st.muted { background: #22252b; color: #aab1ba; }

.hg-body { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.hg-center { display: flex; flex-direction: column; gap: 12px; min-width: 0; order: -1; }
.hg-col, .hg-chat { border: 1px solid #3a2c1c; background: #0f0c09e6; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.hg-col .kicker, .hg-chat .kicker { margin: 4px 0 8px; }

/* radar */
.hg-radar { position: relative; height: clamp(320px, 62vw, 460px); border-radius: 14px; overflow: hidden; border: 1px solid #2a2218;
  background: radial-gradient(circle at 50% 45%, #17120c, #08090b 72%); }
.hg-scope { position: absolute; left: 50%; top: 50%; width: min(86%, 380px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid #f5821f55; background: repeating-radial-gradient(circle, transparent 0 30px, #f5821f22 31px 32px); }
.hg-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #f5821f66, transparent 24%); animation: hg-sweep 4s linear infinite; }
.hg-radar.grounded .hg-sweep { animation: none; opacity: .15; }
.hg-blip { position: absolute; transform: translate(-50%, 0); z-index: 2; display: flex; flex-direction: column; gap: 1px; max-width: 46%; min-height: 44px; padding: 5px 8px;
  border: 1px solid var(--ink); border-radius: 8px; background: #0c0a08ee; color: var(--text); font: 500 11px/1.3 var(--mono); text-align: left; cursor: pointer;
  transition: left .6s var(--ease), top .6s var(--ease), opacity .3s; box-shadow: 0 0 0 0 var(--ink); }
.hg-blip b { color: var(--ink); font-weight: 700; letter-spacing: .06em; }
.hg-blip span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-blip .hg-now { color: #d6dbe1; max-width: 26ch; }
.hg-blip:not(.idle) { animation: hg-ping 2.4s ease-out infinite; }
.hg-blip.idle { opacity: .45; border-style: dashed; }
.hg-blip.held { border-style: dotted; }
.hg-grounded { position: absolute; inset: auto 0 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 3; }
.hg-grounded b { font: 800 18px/1 var(--display); letter-spacing: .3em; color: var(--down); }
.hg-grounded span { font-size: 13px; color: var(--muted); }

/* tower */
.hg-tower { border: 1px solid #2a2a24; border-radius: 14px; background: #0b0b0a; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.hg-board { display: flex; flex-direction: column; }
.hg-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) minmax(0, 90px) auto; gap: 8px; align-items: center; min-height: 44px; padding: 4px 6px;
  border: 0; border-bottom: 1px solid #1d1d1a; background: none; color: var(--text); font: 500 12.5px/1.3 var(--mono); text-align: left; cursor: pointer; }
.hg-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-row.head { cursor: default; min-height: 28px; color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.hg-flap { background: #1a1a17; border-radius: 3px; padding: 3px 5px; color: var(--amber); letter-spacing: .1em; }
.hg-strip { display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px 44px 44px; gap: 8px; align-items: center; padding: 6px 8px; border-left: 4px solid var(--ink); background: #151511; font: 500 12px/1.3 var(--mono); }
.hg-strip b { color: var(--ink); }
.hg-meter { display: block; height: 5px; border-radius: 3px; background: #2a2218; overflow: hidden; }
.hg-meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .5s var(--ease); }

/* missions, chat, log */
.hg-mlist { display: flex; flex-direction: column; max-height: 300px; overflow: auto; }
.hg-mis { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 4px 2px; border: 0; border-bottom: 1px solid #221b13; background: none; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.hg-mis span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-tok { font: 700 15px/1.2 var(--mono); margin-bottom: 6px; }
.hg-chat { display: flex; flex-direction: column; gap: 8px; }
.hg-chat-l { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.hg-line b { font: 700 12px/1 var(--mono); }
.hg-line.gander b { color: var(--accent-2); } .hg-line.you { color: #c6ccd4; } .hg-line.system { color: var(--muted); font-size: 13px; }
.hg-ask { border: 1px solid #2c3b66; background: #121a30; border-radius: 10px; padding: 8px 10px; }
.hg-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hg-chat-f { display: flex; gap: 8px; }
.hg-chat-f .input { flex: 1; min-width: 0; }
.hg-loglist { max-height: 420px; overflow: auto; font: 500 12px/1.45 var(--mono); }
.hg-loglist p { padding: 3px 0; border-bottom: 1px dashed #221b13; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-loglist p.new { animation: hg-type .35s steps(12) both; }
.hg-loglist b { color: var(--accent-2); }
.hg-loglist .ok b { color: var(--live); } .hg-loglist .bad b { color: var(--down); } .hg-loglist .mission b { color: var(--blue); }

/* sheets */
.hg-sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hg-card { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.hg-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.hg-nums > div { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.hg-nums b { font: 700 17px/1.2 var(--mono); } .hg-nums span { font-size: 12px; color: var(--muted); }
.hg-step { font: 500 12.5px/1.4 var(--mono); color: #c6ccd4; overflow-wrap: anywhere; }
.hg-rep { font-size: 13.5px; } .hg-rep.pass b, .hg-rep.done b { color: var(--live); } .hg-rep.fail b, .hg-rep.stuck b { color: var(--down); }
.hg-pre { white-space: pre-wrap; font: 500 12px/1.45 var(--mono); background: var(--bg-2); border-radius: 10px; padding: 8px 10px; max-height: 240px; overflow: auto; }
.hg-bar { display: grid; grid-template-columns: 80px 1fr 56px; gap: 8px; align-items: center; font: 500 12px/1.3 var(--mono); margin: 3px 0; }
.hg-bar > i { height: 8px; background: #2a2218; border-radius: 4px; overflow: hidden; } .hg-bar > i > i { display: block; height: 100%; background: var(--accent); }
.hg-vrow { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.hg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hg-field { display: flex; flex-direction: column; gap: 4px; }
.hg-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.hg-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.hg-checks { display: flex; flex-wrap: wrap; gap: 0 16px; }

/* header light (every tab) */
.hg-hlight { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 600 12px/1 var(--body); cursor: pointer; }
.hg-hlight i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.hg-hlight[data-state="flying"] i { background: var(--live); } .hg-hlight[data-state="paused"] i { background: var(--amber); }
.hg-hlight[data-state="grounded"] i { background: var(--down); } .hg-hlight[data-state="none"] { display: none; }
@media (max-width: 520px) { .hg-hlight span { display: none; } }

@media (min-width: 1100px) {
  .hg-pills { flex: 1 1 auto; order: 0; }
  .hg-body { grid-template-columns: 230px minmax(0, 1fr) 260px; align-items: start; }
  .hg-center { order: 0; }
  .hg-radar { height: 480px; }
}
@keyframes hg-sweep { to { transform: rotate(360deg); } }
@keyframes hg-blink { 50% { opacity: .25; } }
@keyframes hg-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes hg-flap { from { transform: rotateX(90deg); } to { transform: none; } }
@keyframes hg-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .hg *, .hg *::before, .hg *::after { animation: none !important; transition: none !important; } }

/* Control room · Feedback · Errors (project 2) */
.hg-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.hg-seg-b { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 14px/1 var(--body); cursor: pointer; white-space: nowrap; }
.hg-seg-b.on { background: var(--surface-2); color: var(--text); }
.hg-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #140a00; font: 700 11.5px/1 var(--mono); }
.hg-inbox { display: flex; flex-direction: column; gap: 12px; }
.hg-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.hg-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 600 13px/1 var(--body); cursor: pointer; }
.hg-filter.on { border-color: var(--accent); color: var(--text); }
.hg-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .hg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hg-fb { border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hg-fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hg-fb-head b { font: 700 13px/1 var(--mono); }
.hg-fb-game { font: 600 13px/1 var(--body); color: var(--muted); }
.hg-fb-who { margin: 0; font-size: 13px; color: var(--muted); }
.hg-fb-text { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.hg-echo { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hg-echo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hg-echo p { margin: 0; }
.hg-echo-changes { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 2px; list-style: disc; }
.hg-q { border: 1px solid #2c3b66; background: #121a30; border-radius: 10px; padding: 8px 10px; }
.hg-q p { margin: 0; }
.hg-link { align-self: flex-start; border: 0; background: none; color: var(--accent-2); font: 600 13.5px/1.4 var(--body); padding: 2px 0; cursor: pointer; }
.hg-err-msg { margin: 0; font: 500 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.hg-sample { max-height: 280px; }
.hg-empty { border: 1px dashed var(--line-2); border-radius: 14px; padding: 24px; text-align: center; color: var(--muted); }
