/* 큐브로이드 디펜스 운용 시뮬레이터 — 화면 스타일 */

:root {
  --bg: #090f16;
  --panel: rgba(11, 20, 30, 0.84);
  --panel-solid: #0e1925;
  --panel-2: #132233;
  --line: rgba(145, 208, 235, 0.24);
  --line-2: rgba(227, 238, 248, 0.12);
  --accent: #91d0eb;
  --accent-2: #bfe5f5;
  --accent-ink: #06202e;
  --text: #e3eef8;
  --muted: #9fb6ca;
  --ok: #8fdcb0;
  --warn: #f2c46d;
  --danger: #f39a8c;
  --danger-bg: #b5473a;
  --radius: 12px;
  --font: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --num: "Space Grotesk", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: var(--num);
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --bar-h: 58px;
  --stick: 150px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; }
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 26px; height: 26px; }
.ic-xl { width: 44px; height: 44px; stroke-width: 1.4; }

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- 실물 영상 ---------- */
.video-layer { position: fixed; inset: 0; background: #05090e; display: flex; align-items: center; justify-content: center; }
.video-layer[hidden] { display: none; }
.video-layer img { width: 100%; height: 100%; object-fit: contain; }
.video-layer img:not([src]) { display: none; }
.video-empty { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); max-width: 420px; }
.video-empty b { color: var(--text); }
.video-layer.has-video .video-empty { display: none; }

/* ---------- 비행 화면 정보 ---------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.hud[hidden] { display: none; }
body:not(.mode-real) .real-only { display: none !important; }
body.mode-real .sim-only { display: none !important; }

.bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
  padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 12px calc(14px + var(--sal));
  background: linear-gradient(rgba(9, 15, 22, 0.88), rgba(9, 15, 22, 0.55) 70%, rgba(9, 15, 22, 0));
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 18px; width: auto; }
.brand-sub { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tele { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; flex: 1; min-width: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  white-space: nowrap;
  font-size: 12px;
}
.chip span { color: var(--muted); }
.chip b { font-family: var(--mono); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.chip .ic { width: 16px; height: 16px; color: var(--muted); }
#c-state b { font-family: var(--font); font-size: 13px; }
.chip.st-armed { border-color: rgba(242, 196, 109, 0.55); color: var(--warn); }
.chip.st-armed .ic { color: var(--warn); }
.chip.st-fly { border-color: rgba(145, 208, 235, 0.6); color: var(--accent); }
.chip.st-fly .ic { color: var(--accent); }
.chip.st-crash { border-color: rgba(243, 154, 140, 0.6); color: var(--danger); }
.chip.st-crash .ic { color: var(--danger); }
.chip.warn b, .chip.warn .ic { color: var(--warn); }
.chip.danger b, .chip.danger .ic { color: var(--danger); }
.chip.ok b, .chip.ok .ic { color: var(--ok); }
#c-link b { font-family: var(--font); font-size: 13px; }

.tools { display: flex; gap: 6px; flex: none; }
.icon-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn[hidden] { display: none; }

/* 임무 카드 */
.mission {
  position: absolute;
  top: calc(var(--bar-h) + 6px);
  left: calc(14px + var(--sal));
  z-index: 3;
  width: 330px;
  max-height: calc(100% - var(--bar-h) - 190px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
  padding: 14px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mission[hidden] { display: none; }
.m-head { display: flex; align-items: center; gap: 9px; }
.m-step {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.m-step:empty { display: none; }
.mission h2 { font-size: 17px; }
.m-text { margin-top: 8px; font-size: 14px; line-height: 1.6; }
.m-text b { color: var(--accent-2); }
.m-checks { display: grid; gap: 6px; margin-top: 10px; }
.m-checks:empty { display: none; }
.check-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  font-size: 13.5px;
  line-height: 1.4;
}
.check-btn .box {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--muted);
}
.check-btn .box .ic { width: 16px; height: 16px; stroke-width: 2.4; opacity: 0; }
.check-btn.on { border-color: rgba(143, 220, 176, 0.5); background: rgba(143, 220, 176, 0.08); }
.check-btn.on .box { background: var(--ok); border-color: var(--ok); color: #06261a; }
.check-btn.on .box .ic { opacity: 1; }
.m-prog { height: 7px; margin-top: 11px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.m-prog[hidden] { display: none; }
.m-prog-bar { height: 100%; width: 0; border-radius: 4px; background: var(--accent); }
.m-prog-bar.full { background: var(--ok); }
.m-list {
  display: grid;
  gap: 3px;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line-2);
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.m-list:empty { display: none; }
.m-list li { display: flex; align-items: center; gap: 8px; }
.m-list li .ic { width: 17px; height: 17px; }
.m-list li.done { color: var(--ok); }
.m-list li.cur { color: var(--text); font-weight: 600; }
.m-list li.cur .ic { color: var(--accent); }
.m-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.m-meta b { color: var(--text); font-family: var(--mono); }

/* 높이 눈금 */
.gauge {
  position: absolute;
  right: calc(18px + var(--sar));
  top: 50%;
  width: 46px;
  height: min(40vh, 300px);
  transform: translateY(-50%);
}
.g-track {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 22, 0.55);
}
.g-band { position: absolute; left: 0; right: 0; background: rgba(143, 220, 176, 0.35); border-radius: 4px; display: none; }
.g-band.on { display: block; }
.g-mark {
  position: absolute;
  left: -8px; right: -4px;
  height: 3px;
  margin-bottom: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(9, 15, 22, 0.7);
}
.g-lab { position: absolute; right: 18px; transform: translateY(50%); font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 기체 카메라 테두리 */
.fpv-frame { position: absolute; inset: calc(var(--bar-h) + 10px) 18% 22% 18%; }
.fpv-frame[hidden] { display: none; }
.fpv-frame .cn { position: absolute; width: 28px; height: 28px; border: 2px solid rgba(227, 238, 248, 0.6); }
.fpv-frame .tl { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.fpv-frame .tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.fpv-frame .bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.fpv-frame .br { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.fpv-tag { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 알림 */
.toast {
  position: absolute;
  left: 50%;
  top: 36%;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 22, 0.92);
  font-size: 14.5px;
  text-align: center;
  z-index: 4;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(143, 220, 176, 0.6); color: var(--ok); }
.toast.warn { border-color: rgba(242, 196, 109, 0.6); color: var(--warn); }
.toast.danger { border-color: rgba(243, 154, 140, 0.7); color: var(--danger); }

/* PC 키 안내 */
.keys {
  position: absolute;
  left: calc(14px + var(--sal));
  bottom: calc(14px + var(--sab));
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
}
.keys kbd { margin-right: 2px; font-size: 11px; min-width: 20px; padding: 0 5px; }
body.touch .keys { display: none; }

/* 시동 버튼 */
.arm {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--sab));
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  z-index: 2;
}
.arm .ic { stroke-width: 2.2; }
.arm kbd { color: var(--accent-ink); border-color: rgba(6, 32, 46, 0.35); background: rgba(255, 255, 255, 0.25); }
.arm.on { background: var(--warn); color: #2b1d02; }
.arm.on kbd { color: #2b1d02; border-color: rgba(43, 29, 2, 0.3); }
.arm.locked { background: #3a4a5a; color: var(--muted); }
body.touch .arm kbd { display: none; }

.btn-stop {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--danger-bg);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.btn-stop .ic { stroke-width: 2.2; }

/* 터치 스틱 */
.stick {
  position: absolute;
  bottom: 0;
  width: 44%;
  height: 52%;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
  display: none;
}
body.touch .stick { display: block; }
.stick.left { left: 0; }
.stick.right { right: 0; }
.stick .base {
  position: absolute;
  bottom: calc(22px + var(--sab));
  width: var(--stick);
  height: var(--stick);
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(9, 15, 22, 0.42);
}
.stick.left .base { left: calc(26px + var(--sal)); }
.stick.right .base { right: calc(26px + var(--sar)); }
.stick .knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--stick) * 0.38);
  height: calc(var(--stick) * 0.38);
  border-radius: 50%;
  background: rgba(145, 208, 235, 0.82);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
}
.stick.active .knob { background: var(--accent-2); }
.stick .lab { position: absolute; font-size: 11px; color: var(--muted); white-space: nowrap; }
.stick .lab.t { top: 7px; left: 50%; transform: translateX(-50%); }
.stick .lab.b { bottom: 7px; left: 50%; transform: translateX(-50%); }
.stick .lab.l { left: 8px; top: 50%; transform: translateY(-50%); }
.stick .lab.r { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- 덮개 화면 ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: rgba(9, 15, 22, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.screen[hidden] { display: none; }
.screen > * { margin: auto; }
.card {
  width: 100%;
  max-width: 460px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.card-wide { max-width: 680px; }
.card > * + * { margin-top: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.card-head h2 { flex: 1; font-size: 20px; color: var(--text); }
.card-head.danger { color: var(--danger); }
.card-head.ok { color: var(--ok); }
.card-head .close { margin-left: auto; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; }
.sub b { color: var(--text); }
.fine { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.fine .ic { width: 16px; height: 16px; margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn kbd { font-size: 11px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary kbd { color: var(--accent-ink); border-color: rgba(6, 32, 46, 0.3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.btn-col { display: grid; gap: 8px; padding-top: 4px; }
.card .btn-col .btn { width: 100%; }

/* 시작 화면 */
.menu { background: linear-gradient(90deg, rgba(9, 15, 22, 0.94) 0%, rgba(9, 15, 22, 0.8) 52%, rgba(9, 15, 22, 0.25) 100%); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu-in { width: 100%; max-width: 1080px; margin: auto; padding: 8px 4px; }
.menu-in > * { max-width: 560px; }
.menu-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; max-width: none !important; }
.menu-top img { height: 26px; width: auto; }
.tag { padding-left: 15px; border-left: 1px solid #4a6373; font: 500 13px var(--num); letter-spacing: 2px; color: var(--accent); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 6px 10px 6px 6px; border-radius: 8px; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.back-link .ic { width: 18px; height: 18px; }
.eyebrow { margin-top: 26px; font-size: 13px; color: var(--accent); letter-spacing: 0.04em; }
.menu h1 { margin-top: 6px; font-size: clamp(28px, 4.2vw, 42px); }
.lede { margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.modes { display: grid; gap: 10px; margin-top: 22px; }
.mode {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 25, 37, 0.92);
  text-align: left;
}
.mode:hover { border-color: var(--accent); }
.mode[hidden] { display: none; }
.mode .ic { grid-row: span 3; color: var(--accent); }
.mode-t { font-size: 17px; font-weight: 700; }
.mode-t em { margin-left: 6px; padding: 1px 7px; border-radius: 5px; border: 1px solid rgba(242, 196, 109, 0.5); color: var(--warn); font-size: 11px; font-style: normal; font-weight: 600; vertical-align: 2px; }
.mode-d { font-size: 13.5px; color: var(--muted); }
.mode-best { font-size: 12.5px; color: var(--ok); }
.mode-best[hidden] { display: none; }
.mode.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mode.primary .ic { color: var(--accent-ink); }
.mode.primary .mode-d { color: rgba(6, 32, 46, 0.78); }
.mode.primary .mode-best { color: #0d4a2b; }

.opts { display: grid; gap: 8px; margin-top: 18px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(14, 25, 37, 0.7); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .sw { flex: none; position: relative; width: 42px; height: 24px; margin-top: 2px; border-radius: 12px; background: #34475a; transition: background 0.15s; }
.toggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #dbe6ef; transition: transform 0.15s; }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .sw { outline: 3px solid var(--accent); outline-offset: 2px; }
.tt { display: grid; gap: 2px; }
.tt b { font-size: 14.5px; }
.tt small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.menu-links { margin-top: 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--accent); font-size: 14.5px; font-weight: 600; }
.note { display: none; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--warn); }
.fine { margin-top: 16px; }
.menu .fine { margin-top: 18px; }

/* 실물 연결 */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.steps b { color: var(--text); }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.field input {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a141e;
  font-family: var(--mono);
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}
.warn-box, .info-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; }
.warn-box { border: 1px solid rgba(242, 196, 109, 0.5); background: rgba(242, 196, 109, 0.08); color: var(--warn); }
.warn-box[hidden] { display: none; }
.info-box { border: 1px solid var(--line); background: rgba(145, 208, 235, 0.06); color: var(--muted); }
.info-box b { color: var(--text); }
.warn-box .ic, .info-box .ic { margin-top: 1px; }

/* 교육생 */
.trainee { margin-top: 18px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(14, 25, 37, 0.7); }
.trainee-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.trainee-head .ic { color: var(--accent); }
.trainee-head small { color: var(--muted); font-size: 12px; }
.trainee-fields { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: 8px; }
.trainee-fields .field input { min-height: 40px; font-family: var(--font); font-size: 15px; }
.trainee-warn { margin-top: 8px; font-size: 12.5px; color: var(--warn); }
.trainee-warn[hidden] { display: none; }
.rec-line { color: var(--ok); }
.rec-line[hidden] { display: none; }

/* 교관 기록 */
.card-xwide { max-width: 980px; }
.rec-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg-sm { grid-template-columns: auto auto; }
.seg-sm .seg-btn { padding: 7px 14px; }
#rec-filter { min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #0a141e; color: var(--text); }
.table-wrap { overflow-x: auto; touch-action: pan-x pan-y; }
.rec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rec-table th, .rec-table td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.rec-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.rec-table td.v { font-family: var(--mono); }
.rec-empty { padding: 16px 0; }
.pill.bad { color: var(--danger); background: rgba(243, 154, 140, 0.1); }
.btn-danger-line { border-color: rgba(243, 154, 140, 0.45); color: var(--danger); background: transparent; }

/* 인쇄(평가표·요약) */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; color: #000 !important; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; }
  .sheet { font-family: "Noto Sans KR", "Malgun Gothic", sans-serif; color: #000; font-size: 11pt; line-height: 1.5; }
  .sheet-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 4px; font-size: 9.5pt; }
  .sheet h1 { margin: 12px 0 10px; font-size: 16pt; text-align: center; }
  .sheet table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  .sheet th, .sheet td { border: 1px solid #000; padding: 5px 7px; text-align: left; vertical-align: middle; }
  .sheet th { background: #eee; font-weight: 600; white-space: nowrap; }
  .sheet-info th { width: 16%; }
  .sheet-total { margin: 10px 0; font-size: 12pt; }
  .sheet-note .lines i { display: block; height: 9mm; border-bottom: 1px solid #000; }
  .sheet-sign th { width: 20%; }
  .sheet-sign td { height: 12mm; }
  .sheet-sign .blank { display: inline-block; width: 30mm; border-bottom: 1px solid #000; margin: 0 4px; }
  .sheet-range { margin: 0 0 6px; }
  .sheet-foot { margin-top: 12px; font-size: 9pt; color: #333; }
}

/* 조종기 연결 */
.pad-status { font-weight: 600; color: var(--accent-2); }
#pad-setup.no-pad .pad-body { opacity: 0.45; pointer-events: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; }
.seg-btn small { color: var(--muted); font-size: 12px; }
.seg-btn.on { border-color: var(--accent); background: rgba(145, 208, 235, 0.12); }
.seg-btn.on b { color: var(--accent); }
.axes { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.axes th, .axes td { padding: 6px 4px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.axes th { color: var(--muted); font-weight: 500; font-size: 12px; }
.axes select { min-height: 34px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: #0a141e; color: var(--text); }
.info-box[hidden] { display: none; }
.axes input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.bar { position: relative; width: 120px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.35); }
.bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--accent); }
.pad-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.pad-k { min-width: 110px; color: var(--muted); }
.pad-row .sub { flex-basis: 100%; font-size: 12px; }
.radio { display: inline-flex; align-items: center; gap: 6px; }
.radio input { accent-color: var(--accent); width: 16px; height: 16px; }
.pad-row input[type="range"] { width: 160px; accent-color: var(--accent); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.on { border-color: var(--warn); color: var(--warn); }
.pad-msg { color: var(--warn); }
.chip[hidden] { display: none; }

/* 조작법 */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.help-grid h3, .h3-gap { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--accent); }
.h3-gap { margin-top: 18px !important; }
.keymap { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13.5px; }
.keymap td { padding: 5px 0; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.keymap td:first-child { width: 96px; white-space: nowrap; }
.stick-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stick-demo > div { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line-2); text-align: center; font-size: 13.5px; }
.stick-demo small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.sd { position: relative; width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--line); }
.sd::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--accent); }
.views { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.views b { color: var(--text); margin-right: 6px; }

/* 결과 */
.verdict { font-size: 15px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th, .result-table td { padding: 9px 6px; border-bottom: 1px solid var(--line-2); text-align: left; }
.result-table th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.result-table td.v { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.result-table td.r { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.pill.ok { color: var(--ok); background: rgba(143, 220, 176, 0.1); }
.pill.no { color: var(--warn); background: rgba(242, 196, 109, 0.1); }
.pill.na { color: var(--muted); }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.tips:empty { display: none; }

/* ---------- 휴대폰·작은 화면 ---------- */
@media (max-width: 860px) {
  .brand-sub, #view-label { display: none; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .trainee-fields { grid-template-columns: 1fr; }
  .bar { flex-wrap: wrap; row-gap: 8px; }
  .tools { margin-left: auto; }
  .tele { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .tele .opt { display: none; }
  .mission { left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); width: auto; max-height: calc(100% - var(--bar-h) - var(--stick) - 120px); padding: 12px 14px; }
  .m-list { display: none; }
  .gauge { display: none; }
  body.touch .arm { bottom: calc(var(--stick) + 34px + var(--sab)); }
  body.touch .toast { top: auto; bottom: calc(var(--stick) + 100px + var(--sab)); }
  .menu { background: rgba(9, 15, 22, 0.84); }
  .help-grid { grid-template-columns: 1fr; }
  .result-table td.r { white-space: normal; }
}
@media (max-height: 520px) {
  :root { --stick: 124px; }
  .bar { padding-top: calc(6px + var(--sat)); padding-bottom: 8px; }
  .tele .opt { display: none; }
  .chip { height: 30px; padding: 0 9px; }
  .icon-btn { height: 34px; min-width: 34px; }
  .mission { width: 270px; padding: 10px 12px; max-height: calc(100% - var(--bar-h) - var(--stick) - 34px); }
  .mission h2 { font-size: 15px; }
  .m-text { font-size: 13px; line-height: 1.5; margin-top: 5px; }
  .m-list { display: none; }
  .check-btn { min-height: 34px; padding: 4px 8px; font-size: 12.5px; }
  .gauge { top: calc(var(--bar-h) + 8px); transform: none; height: calc(100% - var(--bar-h) - var(--stick) - 56px); }
  .arm { height: 46px; padding: 0 18px; font-size: 15px; bottom: calc(12px + var(--sab)); }
  .stick .base { bottom: calc(14px + var(--sab)); }
  .keys { display: none; }
  .btn-stop { min-height: 42px; margin-top: 8px; }
  .mission.tall { max-height: calc(100% - var(--bar-h) - 74px); }
  .toast, body.touch .toast { top: auto; bottom: calc(68px + var(--sab)); max-width: min(400px, calc(100% - 2 * var(--stick) - 80px)); padding: 8px 12px; font-size: 13px; }
  .stick .lab { font-size: 10px; }
  .stick .lab.l { left: 4px; }
  .stick .lab.r { right: 4px; }
  .menu-in > * { max-width: 620px; }
  .eyebrow { margin-top: 14px; }
  .modes { grid-template-columns: repeat(3, 1fr); }
  .mode { grid-template-columns: 1fr; padding: 10px 12px; }
  .mode .ic { grid-row: auto; }
  .opts { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 520px) and (max-width: 640px) {
  .modes { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
}
body.touch .gauge { top: calc(var(--bar-h) + 8px); transform: none; height: min(calc(100% - var(--bar-h) - var(--stick) - 70px), 260px); }
@media (orientation: portrait) {
  body.touch .note.portrait-note { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
