/* 현재 보는 시점과 실제 LIVE 수신을 서로 다른 위치에서 읽는다. */
.map-mode-status {
  position: absolute; z-index: 10; top: 14px; left: var(--map-mode-center, 50%); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 5px; max-width: calc(100% - 24px);
  color: var(--mint); text-align: center; pointer-events: none;
  text-shadow: 0 1px 4px #000, 0 0 12px #07131a;
}
.map-mode-status > span { font-size: 12px; font-weight: 650; white-space: nowrap; }
.map-mode-live { display: inline-flex; align-items: center; min-height: 44px; margin: -14px -8px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: inherit; font-family: inherit; font-size: 12px; font-weight: 650; line-height: 1.35; text-shadow: inherit; cursor: pointer; pointer-events: auto; white-space: nowrap; }
.map-mode-live:hover { background: rgba(19, 43, 52, .7); }
.map-mode-live:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.map-mode-live > span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.map-mode-live time { color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.map-mode-live time:not([hidden])::before { content: ' · '; white-space: pre; }
.map-mode-status > time { color: #f0d28a; font: 600 15px/1.35 ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-mode-status small { max-width: 320px; color: #f0d28a; font-size: 11px; line-height: 1.4; }
.map-mode-status [hidden] { display: none !important; }
.map-mode-status[data-state="historical"] { color: #e6b94f; }
.map-mode-status[data-state="warn"] { color: var(--amber); }
.map-mode-status[data-state="error"] { color: var(--red); }
.map-mode-status[data-state="waiting"] { color: var(--muted); }
.map-mode-status[data-state="shift"] { color: var(--cyan); }

.auth-session-reception-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.auth-session-reception-dot[data-state="ok"] { background: var(--mint); }
.auth-session-reception-dot[data-state="warn"] { background: var(--amber); }
.auth-session-reception-dot[data-state="error"] { background: var(--red); }
.auth-session-reception-dot[data-state="shift"] { background: var(--cyan); }
.auth-session-owner-menu { width: min(280px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 10px; gap: 2px; background: var(--panel-scrim, #091923); }
.auth-session-owner-identity { display: flex; align-items: center; gap: 11px; padding: 8px 7px 15px; margin-bottom: 5px; }
.auth-session-owner-identity > div:last-child { display: grid; gap: 3px; }
.auth-session-owner-identity span { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.auth-session-owner-identity strong { font-size: 13px; }
#authSessionMenuAvatar { flex: 0 0 32px; }
#authSessionMenuAvatar .auth-session-label { display: none; }
#authSessionMenuAvatar .auth-session-avatar { width: 32px; height: 32px; }
.auth-session-owner-action { justify-content: space-between; min-height: 42px; border-color: transparent; border-radius: 6px; background: transparent; font-size: 12px; font-weight: 500; }
.auth-session-owner-action:not(.auth-session-owner-logout)::after { content: '›'; color: var(--muted); font-size: 18px; }
.auth-session-owner-action:hover { border-color: transparent; background: var(--panel-card-hover-bg, #103042); }
.auth-session-owner-logout { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; color: var(--muted); }
.auth-session-owner-logout:hover { border-top-color: var(--line); background: #2a191b; color: #ffe4df; }
#liveStatusPopover.is-embedded { position: static; width: auto; max-width: none; max-height: none; margin: 8px 0 2px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
#liveStatusPopover.is-embedded .live-status-heading { min-height: 30px; padding: 0 8px; border: 0; }
#liveStatusPopover.is-embedded .live-status-heading h2 { font-size: 12px; }
#liveStatusPopover.is-embedded .live-status-readouts { gap: 13px; padding: 12px 8px; font-size: 12px; }
#liveStatusPopover.is-embedded .live-status-source { padding: 0 8px 7px; border: 0; font-size: 11px; }
#liveStatusPopover.is-embedded .live-status-notice { margin: 0 8px 12px; font-size: 11px; }
#liveStatusPopover.is-embedded [data-live-status-close] { display: none !important; }

/* 기록 구간과 조작을 두 줄로 유지하고 추가 도구는 같은 팝업으로 모은다. */
.transport-bar {
  left: var(--map-player-center, 50%); width: var(--map-player-width, min(780px, calc(100% - 32px)));
  max-width: calc(100% - 24px); min-height: 0; padding: 7px 12px 10px;
  grid-template-columns: 40px minmax(0, 1fr) 120px auto 62px;
  grid-template-areas: 'timeline timeline timeline timeline timeline' 'play info speed more exit';
  gap: 1px 10px; border-radius: 9px; background: #0b1922f5;
}
.transport-bar button { height: 36px; font: inherit; }
.transport-bar .transport-play { width: 38px; height: 38px; border-color: transparent; background: transparent; color: var(--transport-accent); font-size: 20px; }
.transport-play:hover { border-color: var(--transport-border) !important; background: #211c11 !important; }
.transport-identity { grid-area: info; display: flex; align-items: center; gap: 18px; min-width: 0; }
.transport-info-headline { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.transport-info-headline strong { order: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: #f0d28a; }
.transport-info-headline small { order: 1; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 10px; }
.transport-position { color: var(--text); font: 500 11px/1.3 ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.transport-status-detail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.transport-bar .transport-speed-toggle { width: 120px; height: 36px; font: 600 11px ui-monospace, monospace; }
.transport-bar .transport-speed-toggle[data-automatic="true"] { border-color: #755d2d; background: #211c11; color: #f0d28a; }
.transport-more-toggle { grid-area: more; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; padding: 0 9px; font-size: 11px !important; color: var(--text) !important; background: transparent !important; border-color: var(--map-overlay-border) !important; letter-spacing: 0; }
.transport-more-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.transport-more-toggle[aria-expanded="true"] { border-color: var(--transport-accent) !important; color: #f0d28a !important; }
.transport-bar button.transport-exit { width: 62px; height: 36px; min-height: 36px; padding: 0 7px; font-size: 11px; white-space: nowrap; }
.transport-timeline-wrap { min-height: 24px; }
.transport-timeline { appearance: none; -webkit-appearance: none; display: block; height: 24px; margin: 0; padding: 0; background: transparent; cursor: pointer; touch-action: pan-x; }
.transport-timeline::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #e6b94f var(--transport-progress, 0%), #51616a var(--transport-progress, 0%)); }
.transport-timeline::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 1px solid #f2ce75; border-radius: 50%; background: #e6b94f; }
.transport-timeline::-moz-range-track { height: 4px; border-radius: 4px; background: #51616a; }
.transport-timeline::-moz-range-progress { height: 4px; background: #e6b94f; }
.transport-timeline::-moz-range-thumb { width: 12px; height: 12px; border: 1px solid #f2ce75; border-radius: 50%; background: #e6b94f; }
.transport-timeline:focus-visible { outline: 2px solid #f0d28a; outline-offset: 2px; border-radius: 4px; }
#transportActions { position: absolute; right: 76px; bottom: calc(100% + 8px); z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; width: 260px; max-width: calc(100vw - 40px); max-height: calc(100dvh - 190px); overflow-y: auto; padding: 10px; border: 1px solid var(--transport-border); border-radius: 9px; background: #0b1922fa; box-shadow: 0 14px 34px #000b; }
#transportActions[hidden] { display: none !important; }
#transportActions, #transportActions > * { grid-area: auto; }
.transport-options-heading { display: flex; align-items: center; justify-content: space-between; padding-left: 6px; }
.transport-options-heading strong { color: #f0d28a; font-size: 12px; }
.transport-bar #transportOptionsClose { width: 32px; height: 32px; padding: 0; background: transparent; border-color: transparent; color: var(--muted); font-size: 20px; }
.transport-option-label { display: block; padding: 10px 7px 4px; color: var(--transport-muted); font-size: 10px; font-weight: 500; }
#transportActions > button { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 38px; height: auto; padding: 9px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; }
#transportActions > button:hover { background: #182a33; }
#transportActions > button[aria-pressed="true"] { background: transparent; color: #f0d28a; }
#transportActions > button:disabled { opacity: .55; cursor: default; }
#transportActions .transport-auto-check { display: none; }
#transportActions > button[data-auto]::after { content: ''; margin-left: auto; flex: 0 0 25px; width: 25px; height: 14px; border: 1px solid #54616a; border-radius: 9px; background: radial-gradient(circle at 6px center, #8e9ca4 0 4px, transparent 4.5px); }
#transportActions > button[data-auto][aria-pressed="true"]::after { border-color: #e6b94f; background: radial-gradient(circle at 18px center, #0b1922 0 4px, transparent 4.5px), #e6b94f; }
#transportActions .transport-range { display: grid; gap: 4px; margin-top: 7px; padding: 0 7px 6px; border-top: 1px solid #9b762e50; color: var(--muted); font-size: 10px; }
#transportActions .transport-range .transport-option-label { padding-left: 0; }
.transport-jump-popover, .transport-speed-popover { max-height: calc(100dvh - 190px); overflow-y: auto; }
.transport-speed-popover { padding: 10px; }
.transport-bar .transport-speed-option { height: 36px; font-size: 11px; }
.transport-bar .transport-auto-speed { height: 40px; font-size: 11px; }
.transport-auto-speed small { font-size: 10px; }
.transport-popover-heading strong { font-size: 12px; }
.transport-popover-heading small { font-size: 10px; line-height: 1.5; }

@media (max-width: 1000px) {
  .map-mode-status { top: 64px; }
  .transport-more-toggle > span { display: none; }
  .transport-more-toggle { width: 38px; padding: 0; }
  .transport-identity { gap: 8px; }
}
@media (max-width: 600px) {
  .map-mode-status { top: 116px; gap: 4px; }
  .map-mode-status > span { font-size: 11px; }
  .map-mode-live { font-size: 11px; }
  .map-mode-status > time { font-size: 12px; }
  .map-mode-status small { font-size: 10px; }
  .auth-session-owner-menu { width: min(280px, calc(100vw - 16px)); }
  #authSessionButton { position: relative; }
  #authSessionButton .auth-session-reception-dot { position: absolute; right: 3px; bottom: 7px; border: 1px solid var(--map-overlay-bg-strong); }
  .transport-bar { width: calc(100% - 16px); max-width: calc(100% - 16px); padding: 3px 8px 6px; grid-template-columns: 44px minmax(0, 1fr) 96px 44px 50px; grid-template-areas: 'timeline timeline timeline timeline timeline' 'play info speed more exit'; gap: 0 4px; }
  .transport-identity { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
  .transport-info-headline strong { font-size: 11px; }
  .transport-info-headline small { display: none; }
  .transport-position { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
  .transport-bar .transport-play, .transport-bar .transport-more-toggle { width: 44px; height: 44px; min-height: 44px; }
  .transport-bar .transport-speed-toggle { width: 96px; height: 44px; padding: 0 15px 0 3px; font-size: 9px; }
  .transport-bar button.transport-exit { width: 50px; height: 44px; min-height: 44px; font-size: 10px; }
  .transport-timeline-wrap, .transport-timeline { min-height: 44px; height: 44px; }
  #transportActions { right: 0; max-width: calc(100vw - 40px); max-height: calc(100dvh - 200px); }
  #transportActions > button { min-height: 44px; }
  .transport-bar #transportOptionsClose { width: 44px; height: 44px; }
  .transport-speed-popover, .transport-jump-popover { max-height: calc(100dvh - 200px); }
  .transport-bar .transport-speed-option, .transport-bar .transport-auto-speed { min-height: 44px; }
}
@media (max-width: 360px) {
  .transport-bar { grid-template-areas: 'info info info info info' 'timeline timeline timeline timeline timeline' 'play speed speed more exit'; }
  .transport-identity { flex-direction: row; align-items: center; justify-content: space-between; min-height: 18px; }
  .transport-position { max-width: none; font-size: 10px; }
  .transport-bar .transport-speed-toggle { width: 100%; }
}
