* { box-sizing: border-box; }
html, body, #cesiumContainer {
  width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
body { background: #0a0e14; color: #e8eef5; }

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 20, 0.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;
}
.start-card {
  background: #131a26; border: 1px solid #2a3648; border-radius: 16px;
  padding: 28px 32px; width: min(520px, 92vw); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.start-card.start-2col { width: min(1040px, 94vw); max-height: 95vh; padding: 20px 26px; }
.start-card.start-2col h1 { font-size: 23px; }
.start-card.start-2col .subtitle { margin-bottom: 10px; }
.start-card.start-2col .form-row { margin-bottom: 9px; }
.start-card.start-2col .note { margin-top: 8px; }
.start-card.start-2col .info-box { font-size: 11px; padding: 6px 8px; line-height: 1.5; }
.start-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; align-items: start; }
.start-cols > .start-col { min-width: 0; }
.start-col > .sec:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .start-card.start-2col { width: min(520px, 92vw); }
  .start-cols { grid-template-columns: 1fr; gap: 0; }
}
#titleScreen { align-items: stretch; justify-content: flex-start; padding: 0; }
#titleFx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.title-card {
  position: relative;
  align-self: center;
  width: min(360px, 86vw); margin-left: clamp(24px, 9vw, 130px);
  padding: 0;
}
.logo-mark.title-mark { width: 54px; height: 54px; display: block; margin: 0 0 14px; }
.title-card h1 { font-size: 46px; margin: 0 0 30px; letter-spacing: -.025em; line-height: 1; }

.title-menu { display: flex; flex-direction: column; align-items: stretch; }
.title-item {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 13px 14px 13px 20px; border: 0; background: none; cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
}
.title-item::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 20px;
  transform: translateY(-50%) scaleY(0); transform-origin: center;
}
.title-item.is-sel::before { transform: translateY(-50%) scaleY(1); }
.title-item[hidden] { display: none; }

.title-touch {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; align-items: start;
  margin: 20px 0 0; padding: 11px 13px; border-radius: var(--r-sm, 9px);
  font-size: 12.5px; line-height: 1.55; text-align: left;
}
.title-touch[hidden] { display: none; }
.title-touch .ico { width: 16px; height: 16px; margin-top: 2px; }
.title-touch b    { grid-column: 2; font-size: 13.5px; }
.title-touch span { grid-column: 2; }

#settingsPanel.over-title { z-index: 110; }
#settingsPanel.over-title .flight-only { display: none; }

.title-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px; pointer-events: none;
}
.title-foot > * { pointer-events: auto; }
.title-foot .help-lang { max-width: 46vw; }

@media (max-width: 860px) {
  #titleScreen { justify-content: center; }
  .title-card { margin-left: 0; text-align: center; width: min(340px, 86vw); }
  .logo-mark.title-mark { margin: 0 auto 14px; }
  .title-item { text-align: center; padding-left: 14px; }
  .title-item::before { display: none; }
}

.start-actions {
  display: flex; gap: 8px; align-items: stretch; margin-top: 8px;
  position: sticky; bottom: 0; z-index: 1;
  padding-top: 8px; margin-bottom: -2px;
}
.start-actions .btn-secondary { width: auto; flex: 0 0 auto; padding: 13px 18px; }
.start-actions .btn-primary { flex: 1 1 auto; margin-top: 0; }

.help-card { width: min(1060px, 95vw); max-height: 97vh; padding: 13px 20px;
  display: flex; flex-direction: column; overflow: hidden; }
.date-sel { display: flex; gap: 6px; margin-top: 6px; }
.date-sel[hidden] { display: none; }
.date-sel select { flex: 1 1 0; min-width: 0; }
.help-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -20px; padding: 10px 20px 2px; }
.help-card h2 { margin: 0 0 2px; font-size: 20px; }
#helpPanel { z-index: 120; }
.start-card h1 { margin: 0 0 4px; font-size: 26px; }
.subtitle { color: #8fa3bb; margin: 0 0 20px; font-size: 14px; }
.note { color: #7d8fa5; font-size: 12px; line-height: 1.6; margin-top: 14px; }
.hint { color: #7d8fa5; font-size: 11px; font-weight: normal; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #b9c8da; }
.form-row label.sub { font-weight: 500; font-size: 12px; margin: 0 0 4px 10px; color: #a8bace; }
.form-row input[type="text"], .form-row input[type="password"], .form-row select {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid #33415a;
  background: #0d1420; color: #e8eef5; font-size: 14px;
}
.form-row input[type="range"] { width: 100%; }
.form-row input.num-inline {
  width: 84px; padding: 3px 6px; margin: 0 2px; border-radius: 6px; border: 1px solid #33415a;
  background: #0d1420; color: #e8eef5; font-size: 13px; font-weight: 600; text-align: right;
}
.search-row { display: flex; gap: 8px; }
.search-row input, .search-row select { flex: 1; min-width: 0; }
.search-row button {
  padding: 9px 16px; border-radius: 8px; border: 1px solid #33415a;
  background: #1d2939; color: #e8eef5; cursor: pointer; font-size: 13px;
}
.search-row button:hover { background: #263449; }
.search-row .btn-secondary { width: auto; flex: none; }
#inpLicense { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }

#searchResults .result-item, #searchResults2 .result-item {
  padding: 8px 10px; margin-top: 4px; background: #0d1420; border: 1px solid #33415a;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
#searchResults .result-item:hover, #searchResults2 .result-item:hover { background: #1d2939; border-color: #4a90d9; }

.seg { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid #33415a; }
.seg button {
  flex: 1; padding: 9px 6px; background: #0d1420; color: #8fa3bb; border: none;
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.seg button.active { background: #2563b0; color: #fff; font-weight: 600; }

.btn-primary {
  width: 100%; padding: 13px; margin-top: 8px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #2563b0, #3b82d6); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:disabled { opacity: .5; cursor: wait; }

#hud { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#shutterFlash { position: fixed; inset: 0; background: #fff; opacity: 0; z-index: 45; pointer-events: none; }
#shutterFlash.on { animation: shutter .35s ease-out; }
@keyframes shutter { 0% { opacity: .85; } 100% { opacity: 0; } }
.chip-rec { background: rgba(190,30,30,.92); border-color: #ff6b6b; font-variant-numeric: tabular-nums; }
.chip-rec .rec-dot { animation: blink 1s steps(1) infinite; }
.icon-btn.icon-rec { background: rgba(190,30,30,.92); border-color: #ff6b6b; }
.chip-ghost { background: rgba(25,150,165,.9); border-color: #6fe3ee; font-variant-numeric: tabular-nums; }
.chip-nav { background: rgba(170,110,20,.9); border-color: #ffb020; font-variant-numeric: tabular-nums; }
#navPop { max-width: 300px; }
#navPop .fm-row.hint { display: block; line-height: 1.45; margin-top: 1px; }
.chip-course { background: rgba(20,120,150,.9); border-color: #4de6ff; font-variant-numeric: tabular-nums; }
#coursePop { max-width: 340px; }
#coursePop .fm-row.hint { display: block; line-height: 1.45; margin-top: 1px; }
#coursePop .fm-row { gap: 6px; }
#coursePop .fm-row .btn-secondary { width: auto; flex: none; }
#coursePop #cpName { flex: 1; min-width: 0; }
#coursePop #cpList { flex: 1; min-width: 0; }
#hud button { pointer-events: auto; }

#hudTop {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
}
.hud-group { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chip {
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: rgba(30,42,60,.85); border: 1px solid #3a4c66;
}
.chip-mode { background: rgba(37,99,176,.9); border-color: #4a90d9; }
.chip-click { cursor: pointer; pointer-events: auto; transition: filter .15s; }
.chip-click:hover { filter: brightness(1.4); }
.chip-arm { background: rgba(22,140,60,.9); border-color: #2ecc71; }
.chip-disarm { background: rgba(140,40,40,.9); border-color: #e05555; }
#hudFpsChip { font-variant-numeric: tabular-nums; }
#hudFpsChip { font-weight: 400; color: #cfe0f0; }
#hudFpsChip b { font-weight: 700; }
#hudFrameWorst { font-size: 10px; color: #8fa3bb; margin-left: 5px; }
#hudWeather {
  background: rgba(10,15,24,.6); padding: 4px 14px; border-radius: 20px;
  cursor: pointer; pointer-events: auto; transition: background .15s;
}
#hudWeather:hover { background: rgba(37,99,176,.55); }
.wx-edit { color: #8fa3bb; font-size: 11px; }

.icon-btn {
  background: rgba(30,42,60,.85); border: 1px solid #3a4c66; color: #e8eef5;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.fm-pop {
  position: absolute; top: 46px; left: 100px; z-index: 70; pointer-events: auto;
  background: rgba(13,20,32,.96); border: 1px solid #3a4c66; border-radius: 10px;
  padding: 10px 12px; min-width: 250px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 8px;
}
.fm-row { display: flex; align-items: center; gap: 10px; }
.fm-lbl { font-size: 12px; color: #b9c8da; font-weight: 600; min-width: 96px; }
.fm-pop .seg { flex: 1; }
.fm-pop .seg button { padding: 6px 4px; font-size: 12px; }
#ghostPop { min-width: 158px; padding: 6px 7px; gap: 5px; border-radius: 8px; }
#ghostPop .fm-lbl { min-width: 0; font-size: 11px; }
#ghostPop .fm-lbl .hint { font-weight: 400; }
.gp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gp-grid button { font-size: 11px; padding: 5px 3px; border-radius: 6px; }
.gp-grid button:disabled { opacity: .38; cursor: default; }
.gp-grid .gp-del { grid-column: 1 / -1; border-color: #6b3a44; color: #e59aa6; }
.fm-pop .btn-secondary .ico { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2.5px; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 700; line-height: 1.4;
  padding: 1px 7px; border-radius: 10px; margin-right: 7px; vertical-align: middle; letter-spacing: .3px;
}
.badge-fpv { background: rgba(255,140,60,.16); color: #ffb066; border: 1px solid rgba(255,140,60,.5); }
.badge-dji { background: rgba(90,170,255,.16); color: #8fd0ff; border: 1px solid rgba(90,170,255,.5); }
.badge-all { background: rgba(160,180,200,.12); color: #b9c8da; border: 1px solid rgba(160,180,200,.4); }
.grp { border: 1px solid; border-radius: 10px; padding: 10px 12px 2px; margin: 8px 0 12px; }
.grp-fpv { border-color: rgba(255,140,60,.45); background: rgba(255,140,60,.05); }
.grp-dji { border-color: rgba(90,170,255,.45); background: rgba(90,170,255,.05); }
.grp > .sec { margin-top: 0; }
.rate-graph { display: block; width: 100%; height: auto; margin-top: 6px; background: #0d1420; border: 1px solid #33415a; border-radius: 8px; }
.icon-btn:hover { background: rgba(58,76,102,.95); }

#compGuide { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#compGuide line { stroke: rgba(255,255,255,.32); stroke-width: 1; vector-effect: non-scaling-stroke; }
#compGuide line.diag { stroke: rgba(255,255,255,.18); }
#compGuide circle { fill: rgba(255,255,255,.75); stroke: rgba(0,0,0,.35); stroke-width: 1; }

#hudWarning {
  position: absolute; top: 34%; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 900; color: #ff5555; text-shadow: 0 0 12px rgba(0,0,0,.8);
  letter-spacing: 4px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: .25; } }

#hudAltWarn {
  position: absolute; left: 14px; top: 58px;
  display: flex; align-items: center; gap: 7px;
}
#hudAltWarn.lv-hit { animation: altBlink 1.4s ease-in-out infinite; }
@keyframes altBlink { 50% { opacity: .45; } }

#hudSticks {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px;
}
.stick-box {
  width: 64px; height: 64px; border: 1px solid #3a4c66; border-radius: 8px;
  background: rgba(10,15,24,.6); position: relative;
}
.stick-box::before, .stick-box::after {
  content: ""; position: absolute; background: rgba(58,76,102,.5);
}
.stick-box::before { left: 50%; top: 4px; bottom: 4px; width: 1px; }
.stick-box::after { top: 50%; left: 4px; right: 4px; height: 1px; }
.stick-dot {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #4a90d9; left: 26px; top: 26px; box-shadow: 0 0 6px rgba(74,144,217,.8);
}

body.touch-ui #btnRec, body.touch-ui #btnGhost, body.touch-ui #btnActors, body.touch-ui #btnNav,
body.touch-ui #hudRec, body.touch-ui #hudGhost, body.touch-ui #hudNav,
body.touch-ui #btnPhoto { display: none !important; }

#hudWarning.is-reset { pointer-events: auto; cursor: pointer; }
#hudWarning.is-reset:active { transform: translateX(-50%) scale(.97); }

body.touch-ui #hud.ui-hidden > #hudWarning { opacity: 1; }

body.touch-ui.sticks-off #hudSticks { display: none; }

body.touch-ui #cesiumContainer { touch-action: none; }

.tstick {
  position: absolute; width: 128px; height: 128px; margin: -64px 0 0 -64px;
  border-radius: 50%; pointer-events: none;
  z-index: 2;
}
.tstick[hidden] { display: none; }
.tstick-knob {
  position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  left: 50%; top: 50%; border-radius: 50%;
}

body.touch-ui #hud.ui-hidden > #hudSticks,
body.touch-ui #hud.ui-hidden > .tstick { opacity: 1; }

#hudInstruments {
  position: absolute; left: 14px; bottom: 40px;
  background: rgba(10,15,24,.62); padding: 6px 12px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 1px;
  font-variant-numeric: tabular-nums;
}
.inst-row { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.inst-ico { width: 13px; color: #8fa3bb; font-size: 12px; text-align: center; }
.inst-v  { font-size: 19px; font-weight: 700; min-width: 62px; text-align: right; }
.inst-v2 { font-size: 15px; font-weight: 700; min-width: 52px; text-align: right; color: #cfe0f0; }
.inst-v3 { font-size: 12px; font-weight: 700; min-width: 34px; text-align: right; color: #cfe0f0; }
.inst-u  { font-size: 10px; color: #8fa3bb; }
.inst-lbl { font-size: 10px; color: #8fa3bb; margin-left: 4px; }
.inst-sub { opacity: 0.82; margin-top: 1px; }

#gamepadStatus {
  position: absolute; bottom: 132px; left: 16px; font-size: 12px; color: #8fa3bb;
  background: rgba(10,15,24,.6); padding: 4px 10px; border-radius: 6px;
}

#miniWrap {
  --mini-alpha: 1;
  position: absolute; right: 12px; bottom: 34px; z-index: 55;
  width: 240px; height: 180px; pointer-events: none;
  border-radius: 10px; overflow: hidden;
  border: 1px solid #3a4c66;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  opacity: var(--mini-alpha);
}
#miniGoogle { width: 100%; height: 100%; display: block; }
#miniGoogle a,
#miniGoogle .gm-style-cc { pointer-events: auto; }
#miniOpacity {
  --mini-alpha: 1;
  position: absolute; right: 258px; bottom: 34px; z-index: 55;
  width: 18px; height: 180px; margin: 0; padding: 0;
  writing-mode: vertical-lr; direction: rtl;
  pointer-events: auto; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent;
}
#miniOpacity::-webkit-slider-runnable-track {
  width: 6px; height: 100%; border-radius: 3px;
  background: rgba(22, 32, 46, calc(.85 * var(--mini-alpha)));
  border: 1px solid rgba(90, 115, 150, var(--mini-alpha));
}
#miniOpacity::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  margin-left: -4px;
  background: #6ec8ff; border: 2px solid #0b1520;
  box-shadow: 0 0 4px rgba(0,0,0,.7);
}
#miniOpacity::-moz-range-track {
  width: 6px; height: 100%; border-radius: 3px;
  background: rgba(22, 32, 46, calc(.85 * var(--mini-alpha)));
  border: 1px solid rgba(90, 115, 150, var(--mini-alpha));
}
#miniOpacity::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #6ec8ff; border: 2px solid #0b1520;
  box-shadow: 0 0 4px rgba(0,0,0,.7);
}
#miniArrow {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 15px solid #e74c3c;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.9));
  pointer-events: none;
}
#miniZoom {
  position: absolute; right: 4px; top: 4px; z-index: 2;
  display: flex; flex-direction: column; gap: 3px;
}
#miniZoom button {
  width: 22px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1;
  color: #eaf2fb; background: rgba(10,15,24,.72);
  border: 1px solid #4a5f7d; border-radius: 5px;
  cursor: pointer; pointer-events: auto;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
#miniZoom button:hover { background: rgba(30,45,68,.9); border-color: #6d88ad; }
#miniZoom button.mz-off { opacity: .35; cursor: default; }

@media (max-width: 900px) {
  #miniWrap { width: 176px; height: 132px; right: 8px; bottom: 36px; }
  #miniOpacity { height: 132px; right: 190px; bottom: 36px; }
}

#shotHud {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%);
  background: rgba(10,15,24,.75); border: 1px solid #6ec8ff;
  padding: 7px 20px; border-radius: 22px; font-size: 15px; font-weight: 700;
  color: #eaf4ff; white-space: nowrap; text-align: center; max-width: 80vw;
}
#shotHud .shot-sub { font-size: 12px; font-weight: 500; opacity: .85; margin-top: 2px; }
#shotHud .shot-warn { color: #ffb347; }
#shotHud .shot-feed { font-size: 13px; font-weight: 600; color: #b9f0ff; margin-top: 2px; }
.shot-result {
  position: absolute; top: 110px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: rgba(10,15,24,.92); border: 1px solid #6ec8ff; border-radius: 14px;
  padding: 14px 22px; color: #eaf4ff; min-width: 340px; max-width: 90vw;
}
.shot-result h3 { margin: 0 0 8px; font-size: 17px; }
.shot-result .grade { font-size: 40px; font-weight: 800; color: #6ee6ff; margin-right: 10px; }
.shot-result .total { font-size: 26px; }
.shot-result table { width: 100%; font-size: 13px; border-collapse: collapse; margin-top: 6px; }
.shot-result td { padding: 2px 4px; }
.shot-result td:last-child { text-align: right; color: #b9f0ff; }
.shot-result .shot-sub { font-size: 12px; opacity: .85; margin-top: 8px; }
.shot-result .btns { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
#shotMarkers {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.icon-btn.icon-on { background: rgba(60,150,235,.85); border-color: #8fd0ff; }

#startCtrl { display: flex; flex-direction: column; gap: 6px; }
.sc-gp { font-size: 12px; color: #cfe0f0; background: rgba(30,42,60,.5);
  border: 1px solid #3a4c66; border-radius: 8px; padding: 5px 10px; }
.sc-gp.sc-ok { border-color: #4a8f5c; }
.sc-gp.sc-none { color: #8fa3bb; }
.sc-sticks { display: flex; gap: 18px; justify-content: center; }
.sc-cap { font-size: 11px; color: #cfe0f0; text-align: center; margin-top: 2px; line-height: 1.3; }
#startGpSlot #gpBlock > .form-row:last-child { margin-bottom: 0; }
#startGpSlot #gpInfo { font-size: 12px; }
#startCtrl .note { margin-top: 0; }

.wx-dial {
  position: relative; display: inline-block; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(10,15,24,.55); border: 1px solid #4a5f7d; vertical-align: middle;
  flex: 0 0 auto;
}
.wx-dial::before {
  content: ""; position: absolute; left: 50%; top: 1px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-bottom: 4.5px solid #9fb3c9;
}
.wx-rot {
  position: absolute; inset: 0; display: block;
}
.wx-rot::after {
  content: ""; position: absolute; left: 50%; top: 3.5px; width: 0; height: 0;
  transform: translateX(-50%);
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
  border-top: 10px solid var(--wx-wcol, #6fd3ff);
  filter: drop-shadow(0 0 2px rgba(0,0,0,.9));
}
.wx-wv { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--wx-wcol, #6fd3ff); min-width: 30px; text-align: right; }
.wx-wu { font-size: 10px; color: #8fa3bb; margin-left: 1px; }

#camGauge {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center;
  opacity: 0.95;
  pointer-events: auto; cursor: ns-resize; padding: 6px 10px; touch-action: none; user-select: none;
}
#camGauge:hover .cg-marker { transform: translateY(-7px) scale(1.25); }

@media (max-height: 520px) {
  #camGauge { top: 64px; transform: none; }
}
#zoomChip {
  position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  padding: 2px 6px; min-width: 38px; cursor: ns-resize; touch-action: none; user-select: none;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
#zoomMag { font-size: 13px; font-weight: 700; }
#zoomFov { font-size: 10px; }
@media (max-height: 520px) {
  #zoomChip { top: auto; bottom: 6px; left: auto; right: 100%; transform: none; }
}
#cgLabel {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; color: #eaf2fb;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  background: rgba(10,15,24,.6); padding: 1px 6px; border-radius: 8px;
}
.cg-track {
  width: 8px; height: 150px; border-radius: 4px;
  background: rgba(10,15,24,.72); border: 1px solid rgba(120,150,185,.75);
  position: relative;
}
.cg-zero {
  position: absolute; left: -4px; right: -4px; height: 1px;
  background: rgba(215,232,248,.9);
}
.cg-marker {
  position: absolute; left: -3px; width: 14px; height: 14px; border-radius: 50%;
  background: #4a90d9; border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 0 6px rgba(74,144,217,.95);
  transform: translateY(-7px);
}

.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 94vw); z-index: 90;
  background: #131a26ee; border-left: 1px solid #2a3648; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 8px; }
.panel-header h2 { margin: 0; font-size: 18px; }
.panel-tabs { display: flex; border-bottom: 1px solid #2a3648; padding: 0 12px; }
.tab {
  flex: 1; padding: 9px 4px; background: none; border: none; color: #8fa3bb;
  cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent;
}
.tab.active { color: #fff; border-bottom-color: #4a90d9; font-weight: 600; }
.tab-page { padding: 16px 18px; overflow-y: auto; flex: 1; }
.tab-page hr { border: none; border-top: 1px solid #2a3648; margin: 16px 0; }
.tab-page .sec { margin: 6px 0 10px; font-size: 12px; font-weight: 700; color: #7fb3e6;
  letter-spacing: .04em; text-transform: none; border-left: 3px solid #2563b0; padding-left: 8px; }
.tab-page .sec .hint { margin-left: 6px; }
.help-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 6px; padding: 0; border-radius: 50%;
  border: 1px solid #4a5f7d; background: #1b2636; color: #9fb7d4; font-size: 11px; font-weight: 700;
  line-height: 1; cursor: pointer; vertical-align: middle; }
.help-btn:hover, .help-btn.open { background: #2563b0; border-color: #4a90d9; color: #fff; }
.help-box { background: #141d2b; border: 1px solid #2a3a52; border-left: 3px solid #4a90d9;
  border-radius: 8px; padding: 9px 12px; margin-top: 8px; font-size: 12px; line-height: 1.6; color: #b9c8da; }
details.adv { margin: 4px 0 14px; border-top: 1px dashed #2a3648; padding-top: 8px; }
details.adv summary { cursor: pointer; font-size: 12px; color: #8fa5c0; user-select: none; padding: 4px 0; }
details.adv summary::marker { color: #4a90d9; }
details.adv[open] summary { color: #cfe0f3; margin-bottom: 10px; }
.info-box {
  background: #0d1420; border: 1px solid #33415a; border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: #b9c8da; line-height: 1.6;
}
.axis-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.axis-table td { padding: 4px 3px; }
.axis-meter { width: 22%; min-width: 64px; }
.axis-table td:last-child { white-space: nowrap; text-align: right; }
.axis-meter > div {
  height: 10px; background: #4a90d9; border-radius: 5px; width: 50%;
  position: relative; left: 0; transition: none;
}
.axis-meter { background: #0d1420; border: 1px solid #33415a; border-radius: 5px; overflow: hidden; }
.btn-assign, .btn-invert, .btn-clear {
  padding: 3px 6px; margin: 0 1px; border-radius: 6px; border: 1px solid #33415a;
  background: #1d2939; color: #e8eef5; cursor: pointer; font-size: 10px;
}
.btn-assign.listening { background: #b07d25; animation: blink 0.6s step-end infinite; }
.btn-invert.on { background: #2f6ea8; border-color: #5aa3e6; color: #fff; font-weight: 600; }
.btn-secondary {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid #3a4c66; background: #1b2636; color: #dbe6f3;
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-secondary:hover { background: #26354a; border-color: #5a739a; }
.btn-danger {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid #7a2b2b; background: #401a1a; color: #ffdede;
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-danger:hover { background: #5a2222; border-color: #a33; }
.btn-danger.confirm { background: #a33; border-color: #e05555; color: #fff; }
#assignStatus { font-size: 12px; color: #f1c40f; margin-top: 6px; min-height: 16px; }

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.help-g {
  background: #0f1622; border: 1px solid #263349; border-radius: 10px; padding: 9px 11px;
  min-width: 0;
}
.help-g2 { grid-column: span 2; }
.help-g h3 {
  margin: 0 0 8px; font-size: 13px; color: #6fb0f0; font-weight: 600; letter-spacing: .01em;
}
.help-g dl {
  margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 5px 10px;
  align-items: baseline;
}
.help-g dt { margin: 0; white-space: nowrap; }
.help-g dt kbd + kbd { margin-left: 2px; }
.help-g dd { margin: 0; font-size: 13px; color: #ccd8e6; line-height: 1.45; }
.help-g p, .help-g ol { margin: 0 0 6px; font-size: 13px; color: #ccd8e6; line-height: 1.6; }
.help-g ol { padding-left: 17px; margin-bottom: 0; }
.help-g p:last-child { margin-bottom: 0; }
.help-g .hint { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; }
.help-sub { color: #8fa3bb; font-size: 13px; margin: 0 0 9px; }
.help-head {
  position: relative; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: #131a26; margin: -13px -20px 0; padding: 13px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.help-head-txt { min-width: 0; }
.help-head-act { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-top: 2px; }
.help-lang {
  padding: 10px 12px; border-radius: 8px; border: 1px solid #33415a;
  background: #0d1420; color: #e8eef5; font-size: 13px; max-width: 180px;
}
.help-head .btn-primary { margin: 0; padding: 10px 20px; width: auto; flex: 0 0 auto; white-space: nowrap; }
.help-card .help-sub { margin-bottom: 0; }
@media (max-width: 900px) {
  .help-grid { grid-template-columns: repeat(2, 1fr); }
  .help-g2 { grid-column: span 2; }
}
@media (max-width: 560px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-g2 { grid-column: span 1; }
}
.help-shot {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 12px;
  align-items: start; margin-bottom: 10px;
}
.help-shot-img { position: relative; min-width: 0; }
.help-shot-img img { display: block; width: 100%; height: auto; border-radius: 10px; }
.hs-n {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  font-style: normal; font-weight: 700; font-size: 11px; line-height: 18px; text-align: center;
  transition: transform .12s;
}
.hs-n::after { content: attr(data-n); }
.help-shot-txt { min-width: 0; }
.help-shot-txt h3 { margin: 0 0 6px; font-size: 13px; }
.help-shot-legend {
  margin: 0; padding: 0; list-style: none; counter-reset: hs;
  display: grid; gap: 3px 12px; font-size: 12px; line-height: 1.4;
}
.help-shot-legend li {
  counter-increment: hs; position: relative; padding: 1px 4px 1px 29px; margin: 0 -4px;
  cursor: default; border-radius: 6px;
}
.help-shot-legend li::before {
  content: counter(hs); position: absolute; left: 4px; top: 1px; width: 18px; height: 18px; border-radius: 50%;
  font-weight: 700; font-size: 11px; line-height: 18px; text-align: center;
}
.help-shot-legend kbd { font-size: 10.5px; padding: 0 5px; }
.help-shot-txt .hint { display: block; margin-top: 8px; font-size: 11px; line-height: 1.5; }
@media (max-width: 900px) {
  .help-shot { grid-template-columns: 1fr; }
  .help-shot-legend { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .help-shot-legend { grid-template-columns: 1fr; }
}

kbd {
  background: #26324a; border: 1px solid #3a4c66; border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: inherit;
}

#loadingBar {
  position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 95;
  display: flex; align-items: center; gap: 10px;
  background: rgba(19,26,38,.95); border: 1px solid #2a3648;
  padding: 8px 18px; border-radius: 24px; font-size: 13px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid #33415a; border-top-color: #4a90d9;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); z-index: 96;
  background: rgba(19,26,38,.95); border: 1px solid #4a90d9; color: #e8eef5;
  padding: 10px 20px; border-radius: 10px; font-size: 13px; display: none; max-width: 80vw;
  white-space: pre-line; line-height: 1.6;
}

.cesium-viewer-bottom { z-index: 60 !important; }
.cesium-widget-credits { font-size: 10px !important; }

.cesium-credit-lightbox-overlay { z-index: 140 !important; }

#creditsPanel { z-index: 130; }
.credits-body { max-height: 60vh; overflow-y: auto; font-size: 13px; color: #b9c8da; line-height: 1.7; }
.credits-body h3 { font-size: 14px; color: #4a90d9; margin: 14px 0 6px; }
.credits-body ul { margin: 0; padding-left: 18px; }
.credits-body li { margin-bottom: 8px; }
.credits-body a { color: #6fb0ee; }
.cesium-widget-credits { color: #dbe6f2 !important; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
.cesium-widget-credits a { color: #dbe6f2 !important; }

#attribBar {
  position: fixed; left: 14px; top: 58px;
  font-size: 10px; color: rgba(230,240,250,.82);
  text-shadow: 0 1px 3px rgba(0,0,0,.95);
  pointer-events: auto; z-index: 58;
  max-width: 42vw; text-align: left; line-height: 1.35;
}
#attribBar a { color: rgba(230,240,250,.82); text-decoration: none; }
#attribBar a:hover { text-decoration: underline; }

.gp-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.gp-btn-row .btn-info { flex: 0 0 auto; }
.gp-btn-row select { flex: 1 1 140px; min-width: 0; }
#advGpButtons .note { margin: 6px 0 8px; }

#rateTable th { font-size: 10px; color: #8fa3bb; font-weight: normal; }
.rate-in {
  width: 46px; padding: 3px 4px; border-radius: 5px; border: 1px solid #33415a;
  background: #0d1420; color: #e8eef5; font-size: 12px; text-align: center;
}
.rate-max { font-size: 11px; color: #7bd88f; white-space: nowrap; }

#hud > * { transition: opacity .45s ease; }
#hud.ui-hidden > *:not(#attribBar) { opacity: 0 !important; }
#hud.ui-hidden > *:not(#attribBar),
#hud.ui-hidden > *:not(#attribBar) * { pointer-events: none !important; }
#hud.ui-hidden > #hudWarning,
#hud.ui-hidden > #hudAltWarn { animation: none !important; }
body.cursor-hidden,
body.cursor-hidden #cesiumContainer,
body.cursor-hidden canvas { cursor: none !important; }

#pauseOverlay { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 58; pointer-events: none; }
#pauseOverlay[hidden] { display: none; }
#pauseOverlay .pause-card { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#pauseOverlay .pause-card span { margin-left: 4px; }
