:root {
  color-scheme: dark;
  --bg: #151915;
  --card: #1d221e;
  --edge: #333b31;
  --text: #f2f2e7;
  --muted: #b8bfb0;
  --accent: #efd494;
  --accent-ink: #252218;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; height: 100dvh; margin: 0; min-width: 300px; }
button, select, input, textarea { font: inherit; }
button, select, input:not([type="checkbox"]), textarea {
  border: 1px solid var(--edge);
  border-radius: 7px;
  color: var(--text);
  background: #252c25;
}
button { cursor: pointer; min-height: 37px; padding: 7px 12px; }
button:hover { border-color: #8f987f; background: #30382e; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, select:focus-visible, canvas:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
p { font-size: .85rem; line-height: 1.65; color: var(--muted); margin: 0 0 13px; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 1.16rem; letter-spacing: -.04em; margin-bottom: 7px; }
h3 { font-size: .94rem; margin-bottom: 8px; }
select { min-width: 0; min-height: 35px; padding: 4px 24px 4px 8px; font-size: .81rem; }
small { font-size: .76rem; }
body:has(#siteMenu[open]) { overflow: hidden; }
#siteMenu .close-btn { min-height: 36px; padding: 0; font-size: 1.3rem; }
.exam-header .site-header-inner { max-width: none; padding-inline: 24px; }
.exam-header .site-heading { text-align: left; }
.topActions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.connection, .iconButton { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .8rem; }
.iconButton { justify-content: center; width: 37px; padding: 0; }
.topActions svg { width: 17px; height: 17px; }
#connectionDot, #motorDot { width: 7px; height: 7px; background: #a9ad9d; border-radius: 50%; display: inline-block; flex: none; }
#connectionDot.connected, #motorDot.running { background: #acd892; box-shadow: 0 0 8px #acd89244; }

main { flex: 1; min-height: 0; padding: 12px 24px; display: grid; gap: 15px; grid-template-columns: minmax(0, 1fr) minmax(290px, 338px); grid-template-rows: minmax(0, 1fr); }
:fullscreen main { padding: 8px; gap: 10px; }
.examSidebar { display: flex; flex-direction: column; gap: 9px; min-width: 0; overflow: auto; overscroll-behavior-y: contain; }
.flightDeck, .panel { border: 1px solid var(--edge); border-radius: 13px; overflow: hidden; background: var(--card); }
.flightDeck { display: flex; flex-direction: column; min-height: 0; }
.viewport {
  --horizontal-frame: 1.2;
  position: relative;
  flex: 1;
  min-height: 0;
  background: linear-gradient(#7193b5 1%, #b4cbd7 46%, #7b855d 47%, #4f6139);
  isolation: isolate;
}
#field { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#field:active { cursor: grabbing; }
.altitudeReference { position: absolute; left: 13px; right: 13px; transform: translateY(-50%); display: flex; gap: 8px; align-items: center; pointer-events: none; color: #fff0c9; }
.altitudeReference::before { content: ""; flex: 1; border-top: 1px dashed #fff0c9; filter: drop-shadow(0 1px 1px #16201d); }
.altitudeReference span { padding: 3px 7px; border-radius: 4px; background: #1c251fe0; font-size: .72rem; white-space: nowrap; }
.sceneTop, .sceneBottom { position: absolute; left: 13px; right: 13px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.sceneTop { top: 13px; }
.sceneBottom { bottom: 12px; justify-content: flex-end; }
.sceneLabel { background: #1c251fe0; border: 1px solid #d8dec13a; color: #fcfcf0; padding: 6px 11px; border-radius: 5px; font-size: .76rem; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
button.sceneLabel { min-height: 32px; pointer-events: auto; }
.pilotViewControls, .leanControls { display: flex; gap: 4px; }
button.leanButton { width: 32px; padding-inline: 0; justify-content: center; touch-action: none; }
.deviationNotice { position: absolute; top: 45px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 26px); border-color: #f57774; background: #45191ef2; color: #ffaaa6; font-weight: 700; line-height: 1.4; text-align: center; white-space: normal; word-break: keep-all; pointer-events: none; }
.eye { color: var(--accent); }
.sceneMessage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; padding: 18px; background: #172019af; color: #fff; font-size: .9rem; }
.sceneMessage strong { font-size: 1.5rem; }
.sceneNotice { position: absolute; left: 50%; transform: translateX(-50%); top: 63px; padding: 8px 13px; border: 1px solid #f4d69e73; background: #282a21ee; border-radius: 6px; color: #fff0c9; max-width: 92%; width: max-content; font-size: .83rem; pointer-events: none; }
.callout {
  position: absolute;
  left: 50%;
  bottom: 69px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(84%, 31rem);
  padding: 9px 16px;
  border-radius: 12px;
  background: #18211aef;
  box-shadow: 0 2px 10px #0005;
  color: #fff0c9;
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.callout::after { content: ''; position: absolute; top: 100%; left: calc(50% - 6px); border: 6px solid transparent; border-top-color: #18211aef; }
.viewport:has(.touchControls:not([hidden])) .callout { bottom: calc(68px + clamp(74px, 14vw, 112px)); }
.instruments { position: absolute; bottom: 13px; left: 13px; display: flex; border: 1px solid #d8dec13a; background: #17201be8; border-radius: 7px; padding: 7px 4px; pointer-events: none; }
.instruments div { padding: 0 10px; border-right: 1px solid #aab19c33; }
.instruments div:last-child { border-right: 0; }
.instruments span, .instruments strong { display: block; }
.instruments span { color: #d6ddcc; font-size: .64rem; }
.instruments strong { font-size: .86rem; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deckbar { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 8px; min-height: 49px; padding: 5px 11px; font-size: .76rem; }
.deckActions, .deckState { display: flex; align-items: center; gap: 6px; }
.deckState { color: #d9ddcf; gap: 8px; white-space: nowrap; }
.deckDivider { display: inline-block; width: 1px; height: 13px; background: var(--edge); }
.deckActions button { min-height: 29px; padding: 3px 8px; background: transparent; font-size: .75rem; }
.deckActions button[aria-pressed="true"]:not(#soundToggle) { color: var(--accent); border-color: #827452; }
.flightGuide { flex: none; padding: 7px 9px 9px; border: 1px solid var(--edge); border-radius: 8px; background: var(--card); }
.flightGuideHeader { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.flightGuideHeader h2 { font-size: .74rem; margin: 0; }
.flightGuideHeader button { min-height: 29px; padding: 3px 9px; font-size: .71rem; }
.flightGuideContent { display: grid; gap: 7px; margin-top: 7px; }
.flightGuideSteps { display: grid; align-content: center; gap: 3px; min-width: 0; line-height: 1.35; word-break: keep-all; }
.flightGuideSteps strong { font-size: .88rem; color: var(--accent); }
.flightGuideSteps span { font-size: .7rem; color: var(--muted); }
.touchControls { position: absolute; inset: auto 15px 55px; display: flex; justify-content: space-between; pointer-events: none; }
.touchStick { --stick-x: 0%; --stick-y: 0%; pointer-events: auto; touch-action: none; position: relative; width: clamp(74px, 14vw, 112px); aspect-ratio: 1; border: 1px solid #eceddfae; border-radius: 50%; background: #16221d8e; }
.touchStick::before { content: ""; position: absolute; inset: 12%; border: 1px dashed #eceddf65; border-radius: 50%; }
.touchStick i { position: absolute; display: block; inset: 31%; border-radius: 50%; background: #e8dfc7; transform: translate(var(--stick-x), var(--stick-y)); }

.panel { flex: none; order: -1; }
.panelHead { padding: 11px 15px; display: flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 700; color: #e6dbbb; border-bottom: 1px solid var(--edge); min-height: 45px; }
.panelHead h2 { margin: 0 auto 0 0; font-size: inherit; letter-spacing: 0; }
[data-phase="intro"] .panelHead h2 { font-size: 1.15rem; }
#clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.smallButton { padding: 2px 7px; min-height: 25px; font-size: .71rem; }
.panelBody { padding: 17px 15px 15px; }
.modeCard { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 76px; width: 100%; margin: 13px 0; padding: 12px 14px; border-radius: 9px; text-align: left; }
.panelBody > .modeCard:first-child { margin-top: 0; }
.modeCard strong { font-size: 1.13rem; letter-spacing: -.04em; }
.modeArrow { flex: none; display: grid; place-items: center; width: 29px; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; font-size: 1rem; }
.freeFlightCard { min-height: 44px; margin-bottom: 0; padding-block: 7px; color: #d7f3ec; background: #23443e; border-color: #47766a; }
.freeFlightCard:hover { background: #2c554d; border-color: #679a8d; }
.freeFlightCard strong { font-size: .93rem; }
.freeFlightCard + .examCard { margin-top: 8px; }
.examCard { color: #282216; background: #efd494; border-color: #ebcb87; }
.examCard:hover { color: #282216; background: #ffe6aa; border-color: #ffe6aa; }
.flightOptions .briefOptions { margin-top: 9px; }
.briefOptions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.briefOptions label, .sectionLabel { display: grid; gap: 5px; font-size: .73rem; color: var(--muted); }
.sectionLabel { margin: 8px 0 12px; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: #e3c985; font-weight: 800; }
.primary:hover { background: #fae4ae; border-color: #fae4ae; }
.full { width: 100%; min-height: 42px; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; }
.miniHelp { margin-top: 12px; font-size: .76rem; color: var(--muted); }
summary { cursor: pointer; color: #dedfcf; }
.miniHelp p { margin: 7px 0 0; font-size: .75rem; }
kbd { font: .72rem ui-monospace, monospace; display: inline-block; border: 1px solid var(--edge); background: #32382d; border-radius: 3px; padding: 0 3px; margin-right: 2px; color: var(--text); }
.mapPanel { border-top: 1px solid var(--edge); padding: 12px 0 10px; }
.mapHeader, .mapLegend { padding-inline: 15px; }
.mapHeader { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.mapHeader h2 { font-size: .85rem; margin: 0 0 6px; }
.mapHeader span { font-size: .67rem; color: var(--muted); }
#courseMap, #flightMap { display: block; width: 100%; height: auto; border: 1px solid #343d32; border-radius: 7px; background: #222d24; }
#courseMap { border-inline: 0; border-radius: 0; }
#flightMap { max-width: 264px; justify-self: center; }
.mapLegend { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; font-size: .65rem; line-height: 1.4; }
.mapLegend i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; background: #efd494; border-radius: 2px; }
.mapLegend .emergencyKey { background: #dd8c75; }
.mapLegend .pilotKey { background: #a2cbe5; border-radius: 50%; }

.cue { display: block; color: var(--accent); margin: 10px 0; font-size: .88rem; font-weight: 700; line-height: 1.5; }
.stepGuide { padding: 9px 10px; border-left: 3px solid #70c9b5; border-radius: 4px; background: #17332d; color: #c7f7ec; font-size: .91rem; font-weight: 700; line-height: 1.55; word-break: keep-all; }
.statusLine { min-height: 20px; margin: 5px 0 0; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.meterLine { height: 4px; margin-top: 10px; border-radius: 5px; background: #3b4136; }
.meterLine > i { display: block; height: 100%; width: var(--progress, 0%); background: var(--accent); border-radius: inherit; }
.checkLine { display: flex; align-items: start; gap: 7px; padding: 7px 0; font-size: .81rem; color: #e0e1d3; line-height: 1.45; }
.checkLine input { margin: 2px 0 0; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.checklist { margin: 7px 0 11px; }
.logNotes { resize: vertical; display: block; width: 100%; padding: 8px; min-height: 62px; margin-bottom: 9px; font-size: .83rem; }
.feedback { background: #2d3328; border: 1px solid #444d40; border-radius: 6px; padding: 10px; margin: 10px 0; }
.feedback p { margin: 0; color: #e3e4d7; }
.answerButtons, .dialogButtons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.answerButtons button { flex: 1 0 84px; }
.examSequence { padding: 10px 15px 11px; border-top: 1px solid var(--edge); font-size: .76rem; }
.progressList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; margin: 7px 0 0; padding: 0; list-style-position: inside; }
.progressList li { padding: 3px 4px; border-radius: 4px; color: var(--muted); line-height: 1.35; word-break: keep-all; }
.progressList [aria-current="step"] { background: #373027; color: var(--accent); font-weight: 700; }
.statusBad { color: #f6ab94; }
.statusGood { color: #bcdda8; }
.reportSummary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.reportSummary > div { padding: 7px 9px; border: 1px solid var(--edge); border-radius: 6px; }
.reportSummary strong, .reportSummary span { display: block; }
.reportSummary span { color: var(--muted); font-size: .73rem; margin-bottom: 4px; }
.reportSummary strong { font-size: 1.02rem; }
.reviewRow { border-top: 1px solid var(--edge); padding: 8px 0; font-size: .8rem; }
.reviewRow summary { display: flex; justify-content: space-between; gap: 8px; line-height: 1.5; }
.reviewRow p { margin: 5px 0; font-size: .74rem; }
.reviewRow li { color: #dadfd0; padding-top: 4px; }
.reviewRow ul { padding-left: 17px; }
.formHint { margin: 7px 0; font-size: .75rem; }

dialog { width: min(94vw, 530px); max-height: calc(100dvh - 28px); padding: 16px; background: var(--card); color: var(--text); border: 1px solid #596050; border-radius: 12px; }
dialog::backdrop { background: #121712b8; }
.dialogHeader { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.dialogHeader h2 { margin: 0; }
#axisSettings { margin-top: 10px; }
#controllerDialog select { padding-right: 7px; }
#axisPresets button { font-size: .8rem; }
.axis-row { display: grid; align-items: center; grid-template-columns: minmax(130px, 1.6fr) minmax(20px, 1fr) 68px auto; gap: 6px; font-size: .76rem; min-height: 45px; }
.axisLabel { display: grid; gap: 2px; line-height: 1.25; word-break: keep-all; }
.axisLabel small { color: var(--muted); font-size: .69rem; }
.axis-row meter { width: 100%; }
.invert { white-space: nowrap; display: flex; gap: 3px; align-items: center; }
.invert input { accent-color: var(--accent); }

@media (max-width: 920px) {
  .exam-header .site-header-inner { padding-inline: 14px; }
  main { padding-inline: 14px; grid-template-columns: minmax(0, 1fr) minmax(250px, 292px); column-gap: 9px; }
}
@media (max-width: 690px) {
  body { height: auto; }
  .header.exam-header { min-height: 54px; }
  .exam-header .site-header-inner { gap: 8px; padding: 6px 9px; }
  .exam-header .site-menu-toggle { width: 38px; height: 38px; }
  .exam-header .site-heading a { font-size: .63rem; }
  .exam-header .site-heading h1 { font-size: .78rem; line-height: 1.25; white-space: normal; word-break: keep-all; }
  .connection svg { display: none; }
  .topActions { gap: 3px; }
  .connection { font-size: .68rem; padding: 3px 6px; min-height: 31px; }
  .iconButton { width: 29px; min-height: 31px; }
  main { display: block; padding: 7px; }
  .viewport { flex: none; height: max(218px, 51dvh); }
  [data-phase="intro"] .viewport { height: max(155px, 35dvh); }
  :fullscreen [data-phase="flight"] .viewport { height: max(218px, calc(100dvh - 112px)); }
  .flightDeck, .panel { border-radius: 9px; }
  .examSidebar { margin-top: 8px; overflow: visible; }
  .panel { order: 0; }
  .panelBody { padding: 13px 12px; }
  .panelHead { padding: 8px 12px; min-height: 36px; }
  .sceneTop, .sceneBottom { left: 7px; right: 7px; }
  .altitudeReference { left: 7px; right: 7px; }
  .sceneTop { top: 7px; }
  .sceneBottom { bottom: 7px; }
  .sceneLabel { padding: 4px 7px; font-size: .66rem; }
  button.sceneLabel { min-height: 25px; }
  button.leanButton { width: 28px; }
  .deviationNotice { top: 35px; max-width: calc(100% - 14px); font-size: .73rem; }
  .sceneNotice { top: 61px; }
  .instruments { left: 7px; bottom: 7px; padding: 4px 0; }
  .instruments div { padding-inline: 6px; }
  .instruments span { font-size: .55rem; }
  .instruments strong { font-size: .73rem; margin-top: 2px; }
  .callout { bottom: 56px; max-width: 92%; padding: 7px 11px; font-size: .82rem; }
  .deckbar { padding: 4px 6px; min-height: 39px; gap: 3px; font-size: .68rem; }
  .deckState { gap: 5px; }
  .deckActions { gap: 3px; }
  .deckActions button { padding: 3px 5px; font-size: .67rem; min-height: 26px; }
  .flightGuide { padding: 7px 9px; }
  .flightGuideContent { grid-template-columns: minmax(0, 1fr) minmax(0, 1.42fr); align-items: start; }
}
@media (max-height: 550px) and (orientation: landscape) and (min-width: 691px) {
  .header.exam-header { min-height: 52px; }
  .exam-header .site-header-inner { padding-block: 4px; }
  main { padding-block: 6px; grid-template-columns: minmax(0, 1fr) 250px; }
  .deckbar { min-height: 36px; }
}
