/* Shared styles for static legal/info pages (privacy, data deletion, etc.) */

.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.legal-document {
  background: #ffffff;
  color: #2c3e50;
  line-height: 1.7;
  font-size: 1rem;
}

.legal-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.legal-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1f2937;
}

.legal-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.95rem;
}

.legal-meta dt {
  font-weight: 600;
  color: #4b5563;
}

.legal-meta dd {
  margin: 0;
  color: #374151;
}

.legal-document section {
  margin-bottom: 1.75rem;
}

.legal-document h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-document p {
  margin-bottom: 0.85rem;
}

.legal-document ul,
.legal-document ol {
  padding-left: 1.25rem;
  margin-bottom: 0.85rem;
}

.legal-document li {
  margin-bottom: 0.4rem;
}

.legal-document a {
  color: #0d6efd;
  text-decoration: none;
  word-break: break-all;
}

.legal-document a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .legal-header h1 {
    font-size: 1.5rem;
  }

  .legal-document h2 {
    font-size: 1.1rem;
  }

  .legal-meta {
    grid-template-columns: 1fr;
    gap: 0.1rem 0;
  }

  .legal-meta dt {
    margin-top: 0.4rem;
  }
}
/* 라이브 모니터: 아이패드 가로 화면을 기준으로 한 풀스크린 콘솔 레이아웃 */
.console-main {
  margin: 0;
  padding: 0;
}

/* 콘솔 화면에서는 페이지 전체가 고무줄처럼 당겨지지 않게 한다 */
html:has(.live-telemetry-page) {
  overscroll-behavior: none;
}

.live-telemetry-page {
  --live-ink: #111827;
  --live-muted: #4b5563;
  --live-border: #d5dbe5;
  --live-soft: #f3f5f8;
  --live-panel: #ffffff;
  --live-accent: #0a5fd6;
  --live-ok: #15803d;
  --live-warn: #b45309;
  --live-warn-soft: #fff4dc;
  --live-danger: #c81e1e;
  --live-danger-soft: #fde8e8;
  --live-touch: 44px;
  background: var(--live-soft);
  color: var(--live-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  /* 버튼을 빠르게 두 번 눌러도 화면이 확대되지 않게 한다 */
  touch-action: manipulation;
}

.live-telemetry-page button {
  -webkit-user-select: none;
  user-select: none;
}

/* Top bar */
.live-topbar {
  align-items: center;
  background: #111827;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 52px;
  padding: 4px 12px;
}

.live-topbar a {
  color: #e5e7eb;
  text-decoration: none;
}

.live-topbar-home,
.live-topbar-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
  min-height: var(--live-touch);
  padding: 0 10px;
  white-space: nowrap;
}

.live-topbar-home:active,
.live-topbar-link:active {
  background: rgba(255, 255, 255, 0.12);
}

.live-topbar-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.live-circuit-form {
  flex: 0 1 280px;
  margin: 0;
  min-width: 150px;
}

.live-circuit-form .form-select {
  font-size: 15px;
  min-height: var(--live-touch);
}

.live-conn {
  align-items: center;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}

.live-status-dot {
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

.live-status-dot.is-live {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.live-status-dot.is-rewind {
  background: #60a5fa;
}

.live-status-dot.is-warn {
  background: #f59e0b;
}

.live-status-dot.is-error {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
}

.live-topbar-meta {
  align-items: center;
  display: inline-flex;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  gap: 10px;
  white-space: nowrap;
}

.live-count strong {
  font-size: 17px;
}

.live-mode-badge {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}

.live-mode-badge.is-live {
  background: #15803d;
  color: #fff;
}

.live-mode-badge.is-rewind {
  background: #1d4ed8;
  color: #fff;
}

.live-clock {
  font-size: 17px;
  font-weight: 700;
}

/* Banners */
.live-banner {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
  padding: 8px 14px;
}

.live-banner[hidden] {
  display: none;
}

.live-banner.is-warning {
  background: var(--live-warn-soft);
  border-bottom: 1px solid #f0d58a;
  color: #7a4a00;
}

.live-banner.is-danger {
  background: var(--live-danger);
  color: #fff;
}

.live-banner-action {
  background: #fff;
  border-radius: 8px;
  color: var(--live-danger);
  font-weight: 700;
  margin-left: auto;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.live-banner-action[hidden] {
  display: none;
}

/* Shell */
.live-shell {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 34vw, 440px);
  min-height: 0;
  padding: 12px;
}

.live-map-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.live-map-frame {
  background: var(--live-panel);
  border: 1px solid var(--live-border);
  border-radius: 10px;
  flex: 1 1 auto;
  min-height: 280px;
  overflow: hidden;
  position: relative;
}

.live-map-canvas {
  cursor: pointer;
  display: block;
  height: 100%;
  inset: 0;
  position: absolute;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
}

.live-map-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  left: 10px;
  position: absolute;
  top: 10px;
  z-index: 2;
}

.live-segmented {
  background: rgba(17, 24, 39, 0.86);
  border-radius: 10px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.live-segmented button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 800;
  min-height: var(--live-touch);
  min-width: 56px;
  padding: 0 12px;
}

.live-segmented button.is-active {
  background: #fff;
  color: var(--live-ink);
}

.live-segmented button:disabled {
  color: rgba(255, 255, 255, 0.38);
}

.live-map-button,
.live-step-button,
.live-live-button,
.live-action-button,
.live-icon-button {
  align-items: center;
  background: var(--live-panel);
  border: 1px solid #b6bfcc;
  border-radius: 10px;
  color: var(--live-ink);
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: var(--live-touch);
  min-width: var(--live-touch);
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.live-map-button[hidden],
.live-action-button[hidden] {
  display: none;
}

.live-map-button:active,
.live-step-button:active,
.live-action-button:active,
.live-icon-button:active {
  background: #e8eef8;
}

.live-action-button.is-primary {
  background: var(--live-ink);
  border-color: var(--live-ink);
  color: #fff;
}

.live-action-button.is-primary:active {
  background: #374151;
}

.live-action-button:disabled,
.live-action-button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.live-icon-button {
  padding: 0;
}

.live-map-legend {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--live-border);
  border-radius: 8px;
  bottom: 10px;
  color: var(--live-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  gap: 4px 12px;
  left: 10px;
  padding: 6px 10px;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.live-map-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.live-legend-swatch {
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #111827;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.live-legend-swatch.is-selected {
  background: #0a6cff;
}

.live-legend-swatch.is-private {
  background: #16a34a;
}

.live-legend-swatch.is-public {
  background: #f59e0b;
}

.live-map-empty {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--live-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  left: 50%;
  max-width: min(420px, calc(100% - 32px));
  padding: 20px 24px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.live-map-empty[hidden] {
  display: none;
}

.live-map-empty strong {
  font-size: 18px;
}

.live-map-empty span {
  color: var(--live-muted);
  font-size: 14px;
}

/* Time bar */
.live-timebar {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.live-step-button {
  font-variant-numeric: tabular-nums;
  padding: 0 10px;
}

.live-timebar-track {
  flex: 1 1 auto;
  min-width: 80px;
}

.live-range {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  display: block;
  height: var(--live-touch);
  margin: 0;
  width: 100%;
}

.live-range::-webkit-slider-runnable-track {
  background: #c3cad6;
  border-radius: 4px;
  height: 8px;
}

.live-range::-moz-range-track {
  background: #c3cad6;
  border-radius: 4px;
  height: 8px;
}

.live-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--live-accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.4);
  height: 30px;
  margin-top: -11px;
  width: 30px;
}

.live-range::-moz-range-thumb {
  background: var(--live-accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.4);
  height: 24px;
  width: 24px;
}

.live-timebar-labels {
  color: var(--live-muted);
  display: flex;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  justify-content: space-between;
  line-height: 1;
  margin-top: -8px;
  pointer-events: none;
}

.live-live-button.is-live {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

/* Side panel */
.live-side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.live-vehicles,
.live-dash,
.live-empty-state {
  background: var(--live-panel);
  border: 1px solid var(--live-border);
  border-radius: 10px;
}

/* 대시가 내용만큼 차지하고, 남는 높이는 차량 목록이 쓴다 */
.live-vehicles {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 112px;
  padding: 8px 10px 10px;
}

.live-panel-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.live-panel-header h2 {
  color: var(--live-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.live-vehicle-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.live-vehicle-row {
  align-items: center;
  background: #f7f9fc;
  border: 2px solid #e1e6ef;
  border-radius: 8px;
  color: var(--live-ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 52px;
  padding: 5px 10px 5px 6px;
  text-align: left;
  width: 100%;
}

.live-vehicle-row.is-selected {
  background: #e8f1ff;
  border-color: var(--live-accent);
}

.live-vehicle-row.is-lost {
  background: #f3f4f6;
}

.live-vehicle-number {
  align-items: center;
  background: var(--live-ink);
  border-radius: 6px;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  min-width: 46px;
  overflow: hidden;
  padding: 0 4px;
}

.live-vehicle-main {
  display: block;
  min-width: 0;
}

.live-vehicle-name,
.live-vehicle-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-vehicle-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.live-vehicle-meta {
  color: var(--live-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.live-fresh-badge[hidden] {
  display: none;
}

.live-vehicle-state,
.live-fresh-badge {
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  padding: 4px 9px;
  white-space: nowrap;
}

.live-fresh-badge.is-live {
  background: #dcfce7;
  color: #166534;
}

/* 정상 수신 중인 행은 글자 없이 초록 점만 표시 */
.live-vehicle-state.is-live {
  background: #22c55e;
  height: 10px;
  padding: 0;
  width: 10px;
}

.live-vehicle-state.is-delayed,
.live-fresh-badge.is-delayed {
  background: var(--live-warn-soft);
  color: #7a4a00;
}

.live-vehicle-state.is-lost,
.live-fresh-badge.is-lost {
  background: var(--live-danger);
  color: #fff;
}

/* Dashboard */
.live-dash {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

.live-dash-empty {
  align-items: center;
  color: var(--live-muted);
  display: flex;
  flex: 1 1 auto;
  font-size: 15px;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.live-dash-empty[hidden],
.live-dash-body[hidden],
.live-dash-detail[hidden],
.live-restricted[hidden],
.live-dash-alert[hidden],
.live-laps[hidden],
.live-lap-note[hidden] {
  display: none;
}

.live-dash-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-dash-header {
  align-items: center;
  display: flex;
  gap: 10px;
}

.live-dash-name {
  flex: 1 1 auto;
  font-size: 17px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dash-alert {
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 12px;
}

.live-dash-alert.is-delayed {
  background: var(--live-warn-soft);
  color: #7a4a00;
}

.live-dash-alert.is-lost {
  background: var(--live-danger);
  color: #fff;
}

.live-restricted {
  background: var(--live-warn-soft);
  border: 1px solid #f0d58a;
  border-radius: 8px;
  color: #664d03;
  font-size: 14px;
  padding: 12px;
}

.live-dash-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 끊긴 데이터는 마지막 값이 남아 있더라도 라이브처럼 보이지 않게 흐리게 표시 */
.live-dash-detail.is-stale .live-hero,
.live-dash-detail.is-stale .live-pedals,
.live-dash-detail.is-stale .live-laps,
.live-dash-detail.is-stale .live-health {
  opacity: 0.4;
}

.live-metric-label {
  color: var(--live-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-hero {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 1fr);
}

.live-hero-speed,
.live-hero-cell,
.live-metric,
.live-laps {
  background: #f7f9fc;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  padding: 6px 10px;
}

.live-hero-speed {
  align-content: center;
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  row-gap: 2px;
}

.live-hero-value {
  font-size: 52px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.live-hero-value.is-gear {
  display: block;
  font-size: 38px;
}

.live-hero-value.is-rpm {
  display: block;
  font-size: 26px;
  margin-top: 6px;
}

.live-hero-unit {
  color: var(--live-muted);
  font-size: 14px;
  font-weight: 700;
}

.live-pedals {
  display: grid;
  gap: 4px;
}

.live-bar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 58px minmax(0, 1fr) 64px;
}

.live-bar-track {
  background: #e3e8f0;
  border-radius: 5px;
  display: block;
  height: 16px;
  overflow: hidden;
  position: relative;
}

.live-bar-fill {
  border-radius: 5px;
  display: block;
  height: 100%;
  width: 0;
}

.live-bar.is-throttle .live-bar-fill {
  background: #16a34a;
}

.live-bar.is-brake .live-bar-fill {
  background: #dc2626;
}

.live-bar-track.is-centered::after {
  background: #6b7280;
  content: "";
  height: 100%;
  left: 50%;
  position: absolute;
  top: 0;
  width: 2px;
}

.live-bar.is-steering .live-bar-fill {
  background: var(--live-accent);
  left: 50%;
  position: absolute;
}

.live-bar-value {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.live-laps {
  display: grid;
  gap: 5px;
}

.live-lap-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-lap-value {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.live-lap-footer {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.live-lap-value.is-best {
  color: #6d28d9;
}

.live-lap-value.is-faster {
  color: var(--live-ok);
}

.live-lap-value.is-slower {
  color: var(--live-danger);
}

.live-sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-sectors:empty {
  display: none;
}

.live-sector {
  background: #e9edf3;
  border-radius: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 3px 8px;
}

.live-sector.is-best {
  background: #ede9fe;
  color: #5b21b6;
}

.live-sector.is-current {
  background: #dbeafe;
  color: #1e40af;
}

.live-lap-note {
  color: var(--live-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.live-health {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.live-metric {
  min-width: 0;
  padding: 5px 6px;
}

.live-metric-value {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.live-metric.is-warn {
  background: var(--live-warn-soft);
  border-color: #f0c35c;
}

.live-metric.is-warn .live-metric-value {
  color: var(--live-warn);
}

.live-metric.is-danger {
  background: var(--live-danger);
  border-color: var(--live-danger);
}

.live-metric.is-danger .live-metric-label,
.live-metric.is-danger .live-metric-value {
  color: #fff;
}

/* 대시가 스크롤되는 작은 화면에서도 리뷰 버튼은 항상 보이게 고정 */
.live-dashboard-actions {
  background: var(--live-panel);
  bottom: -8px;
  display: flex;
  gap: 8px;
  margin-bottom: -8px;
  padding-bottom: 8px;
  position: sticky;
}

.live-dashboard-actions .live-action-button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
}

.live-dashboard-actions .live-action-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Snapshot review overlay */
.live-review-panel {
  background: var(--live-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  inset: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
  position: fixed;
  z-index: 1040;
}

.live-review-panel[hidden] {
  display: none;
}

.live-review-header {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: space-between;
  min-height: 60px;
}

.live-review-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.live-review-heading strong {
  font-size: 18px;
}

.live-review-mode {
  background: #e5e7eb;
  border-radius: 999px;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
}

.live-review-status {
  color: var(--live-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.live-review-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.live-review-panel .review-workspace,
.live-review-panel .review-graphs {
  flex: 1 1 0;
  margin-top: 0;
  min-height: 190px;
}

.live-review-panel .live-review-workspace {
  grid-template-columns: minmax(0, 1fr) 230px;
}

.live-review-panel .review-track {
  min-height: 0;
}

.live-review-panel .review-track::before {
  display: none;
}

.live-review-panel .review-graph-panel {
  min-height: 0;
}

.live-review-panel .review-graph-canvas {
  min-height: 100px;
}

.live-review-panel .review-timeline-controls {
  flex: 0 0 auto;
  margin-top: 0;
}

.live-empty-state {
  margin: 24px auto;
  max-width: 480px;
  padding: 32px;
  text-align: center;
}

.live-empty-state h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

/* 넓은 화면(아이패드 가로 포함): 페이지 스크롤 없이 뷰포트에 고정 */
@media (min-width: 900px) {
  .live-telemetry-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
}

/* 세로가 짧은 화면(아이패드 mini 가로 등) */
@media (min-width: 900px) and (max-height: 700px) {
  .live-hero-value {
    font-size: 44px;
  }

  .live-hero-value.is-gear {
    font-size: 34px;
  }

  .live-hero-value.is-rpm {
    font-size: 22px;
  }
}

/* 세로 화면·좁은 화면: 지도, 대시보드, 차량 목록 순으로 쌓고 페이지를 스크롤 */
@media (max-width: 899px) {
  .live-topbar {
    flex-wrap: wrap;
  }

  .live-topbar-title {
    display: none;
  }

  .live-shell {
    display: flex;
    flex-direction: column;
  }

  .live-map-frame {
    flex: 0 0 auto;
    height: 46vh;
    min-height: 300px;
  }

  .live-side-panel {
    flex-direction: column-reverse;
  }

  .live-vehicles {
    flex: 0 0 auto;
  }

  .live-vehicle-list {
    overflow-y: visible;
  }

  .live-health {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .live-dash {
    overflow-y: visible;
  }

  .live-timebar {
    flex-wrap: wrap;
  }

  .live-timebar-track {
    flex: 1 1 100%;
    order: -1;
  }

  .live-review-panel .review-workspace,
  .live-review-panel .review-graphs {
    flex: 0 0 auto;
  }

  .live-review-panel .live-review-workspace {
    grid-template-columns: 1fr;
  }

  .live-review-panel .review-track {
    height: 320px;
  }

  .live-review-panel .review-graph-canvas {
    min-height: 180px;
  }

  .live-review-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
  }
}
.telemetry-review {
  --review-border: #d9dee5;
  --review-muted: #5f6b7a;
  --review-ink: #17202a;
  --review-panel: #ffffff;
  --review-soft: #f6f8fb;
  --review-best-lap: #1d5fd1;
  --review-best-sector: #1d5fd1;
  color: var(--review-ink);
}

.review-topbar {
  align-items: center;
  border-bottom: 1px solid var(--review-border);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.review-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.review-subtitle {
  color: var(--review-muted);
  font-size: 0.88rem;
}

.review-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.review-status {
  border: 1px solid var(--review-border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 9px;
}

.review-status-complete {
  background: #e7f6ee;
  border-color: #9bd1b5;
  color: #12633c;
}

.review-status-failed {
  background: #fdecec;
  border-color: #e9a8a8;
  color: #9b1c1c;
}

.review-workspace {
  display: grid;
  gap: 10px;
  grid-template-columns: 210px minmax(0, 1fr) 245px;
  min-height: 360px;
}

.review-laps,
.review-track,
.review-stats,
.review-graph-panel,
.review-video-panel {
  background: var(--review-panel);
  border: 1px solid var(--review-border);
  border-radius: 8px;
}

.review-laps,
.review-stats {
  overflow: hidden;
}

.review-laps {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.review-panel-title {
  background: var(--review-soft);
  border-bottom: 1px solid var(--review-border);
  color: var(--review-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 8px 10px;
  text-transform: uppercase;
}

.review-lap-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.review-optimal-lap {
  align-items: center;
  border-bottom: 1px solid var(--review-border);
  display: flex;
  font-size: 0.82rem;
  justify-content: space-between;
  padding: 8px 10px;
}

.review-optimal-lap span {
  color: var(--review-muted);
  font-weight: 700;
}

.review-optimal-lap strong {
  color: var(--review-best-sector);
  font-variant-numeric: tabular-nums;
}

.review-lap-button {
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--review-border);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  line-height: 1.15;
  min-height: 58px;
  padding: 9px 10px 10px;
  position: relative;
  text-align: left;
  width: 100%;
}

.review-lap-button.is-best-lap {
  border-color: #86aef3;
  padding-left: 25px;
}

.review-lap-button[role="button"] {
  cursor: pointer;
}

.review-lap-button:focus-visible,
.review-lap-sector:focus-visible {
  outline: 2px solid #77aadd;
  outline-offset: 2px;
}

.review-lap-button.is-active {
  background: #edf5ff;
  border-color: #77aadd;
}

.review-lap-button.is-invalid {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.review-lap-button.is-invalid.is-active {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.review-lap-best-icon {
  color: var(--review-best-lap);
  font-size: 0.86rem;
  left: 8px;
  line-height: 1;
  position: absolute;
  top: 8px;
}

.review-lap-main {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.review-lap-label {
  font-size: 0.84rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-lap-time,
.review-lap-sector-time {
  font-variant-numeric: tabular-nums;
}

.review-lap-time {
  flex: 0 0 auto;
}

.review-lap-time.is-best {
  color: var(--review-best-lap);
  font-weight: 800;
}

.review-lap-sector.is-best {
  color: var(--review-best-sector);
  font-weight: 800;
}

.review-lap-sectors {
  align-items: center;
  color: var(--review-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.69rem;
  gap: 3px 8px;
  justify-content: flex-end;
  line-height: 1.25;
  text-align: right;
}

.review-lap-sector {
  align-items: baseline;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 3px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.review-lap-sector:hover {
  color: var(--review-best-sector);
}

.review-lap-sector-label {
  font-weight: 700;
}

.review-track {
  min-height: 360px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

/* 4:3 비율은 패딩으로 잡는다. aspect-ratio와 min-height를 함께 쓰면 최소 폭(480px)이 강제되어
   컬럼이 그보다 좁을 때(아이패드 가로 등) 옆의 Stats 패널을 덮는다. */
.review-track::before {
  content: "";
  display: block;
  padding-top: 75%;
}

.review-track-mode {
  background: rgba(17, 24, 39, 0.72);
  border-radius: 999px;
  display: flex;
  gap: 2px;
  padding: 3px;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
}

.review-track-mode button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 6px 9px;
}

.review-track-mode button.is-active {
  background: #fff;
  color: #111827;
}

.review-track-canvas {
  cursor: grab;
  display: block;
  height: 100%;
  inset: 0;
  min-height: 0;
  position: absolute;
  touch-action: none;
  width: 100%;
}

.review-track-canvas:active {
  cursor: grabbing;
}

.review-stats dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  margin: 0;
  padding: 10px;
  row-gap: 8px;
}

.review-stats dt {
  color: var(--review-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.review-stats dd {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-graphs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.review-graph-panel,
.review-video-panel {
  display: flex;
  flex-direction: column;
  min-height: 224px;
  overflow: hidden;
}

.review-video-placeholder {
  background: #050505;
  flex: 1;
  min-height: 180px;
}

.review-graph-header {
  align-items: center;
  background: var(--review-soft);
  border-bottom: 1px solid var(--review-border);
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  padding: 6px 8px;
}

.review-graph-header strong {
  font-size: 0.86rem;
}

.review-graph-header details {
  position: relative;
}

.review-graph-header summary {
  cursor: pointer;
  font-size: 0.78rem;
  list-style: none;
}

.review-graph-header summary::-webkit-details-marker {
  display: none;
}

.review-channel-menu {
  background: #fff;
  border: 1px solid var(--review-border);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
  display: grid;
  gap: 5px;
  min-width: 170px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 24px;
  z-index: 10;
}

.review-channel-menu label {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  gap: 6px;
  white-space: nowrap;
}

.review-graph-legend {
  align-items: center;
  border-bottom: 1px solid var(--review-border);
  display: flex;
  gap: 10px;
  min-height: 31px;
  overflow-x: auto;
  padding: 5px 8px;
}

.review-graph-legend-item {
  align-items: center;
  color: #374151;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.76rem;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
}

.review-graph-legend-item input {
  height: 13px;
  margin: 0;
  width: 13px;
}

.review-graph-legend-swatch {
  border-radius: 2px;
  display: inline-block;
  height: 8px;
  width: 10px;
}

.review-graph-canvas {
  cursor: grab;
  display: block;
  flex: 1;
  min-height: 180px;
  touch-action: none;
  width: 100%;
}

.review-graph-canvas:active {
  cursor: grabbing;
}

.review-timeline-controls {
  align-items: center;
  background: var(--review-panel);
  border: 1px solid var(--review-border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
  padding: 9px 10px;
}

.review-progress-wrap {
  min-width: 0;
  padding-top: 21px;
  position: relative;
}

.review-progress-markers {
  bottom: 0;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

.review-progress-marker {
  background: #64748b;
  border-radius: 999px;
  display: block;
  font-size: 0;
  height: 12px;
  min-width: 0;
  padding: 0;
  position: absolute;
  top: 34px;
  transform: translate(-50%, -50%);
  width: 1px;
}

.review-progress-marker.is-sector {
  background: #64748b;
  opacity: 0.78;
}

.review-progress-marker.is-lap {
  background: #1f2937;
  height: 20px;
  width: 2px;
}

.review-progress-marker.is-lap::after {
  color: #1f2937;
  content: attr(data-label);
  font-size: 0.62rem;
  font-weight: 800;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: -15px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.review-progress-marker.is-lap.is-start::after {
  left: 0;
  transform: none;
}

.review-progress-marker.is-lap.is-end::after {
  left: auto;
  right: 0;
  transform: none;
}

.review-progress {
  accent-color: #1f6fb2;
  height: 26px;
  min-width: 0;
  width: 100%;
}

.review-progress-buttons {
  align-items: center;
  display: flex;
  gap: 6px;
}

.review-progress-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--review-border);
  border-radius: 999px;
  color: var(--review-ink);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 0;
  position: relative;
  touch-action: none;
  width: 32px;
}

.review-progress-button:active {
  background: #edf5ff;
  border-color: #77aadd;
}

.review-progress-button::before {
  content: "";
  display: block;
  height: 0;
  width: 0;
}

.review-progress-button[data-review-progress-step="back"]::before {
  border-bottom: 7px solid transparent;
  border-right: 11px solid #1f2937;
  border-top: 7px solid transparent;
  margin-left: -2px;
}

.review-progress-button[data-review-progress-step="forward"]::before {
  border-bottom: 7px solid transparent;
  border-left: 11px solid #1f2937;
  border-top: 7px solid transparent;
  margin-right: -2px;
}

.review-playback-speed {
  align-items: center;
  color: var(--review-muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 5px;
  margin-left: 4px;
  white-space: nowrap;
}

.review-playback-speed select {
  background: #fff;
  border: 1px solid var(--review-border);
  border-radius: 6px;
  color: var(--review-ink);
  font-size: 0.8rem;
  height: 32px;
  padding: 0 6px;
}

@media (min-width: 901px) {
  .review-laps {
    contain: size;
  }
}

/* 터치 기기: 조작 요소를 손가락 크기(44px)에 맞춘다 */
@media (pointer: coarse) {
  .review-track-mode button {
    font-size: 0.9rem;
    min-height: 44px;
    min-width: 52px;
  }

  .review-graph-header {
    min-height: 44px;
  }

  .review-graph-header summary {
    font-size: 0.9rem;
    margin: -6px -8px;
    padding: 12px 14px;
  }

  .review-channel-menu {
    top: 40px;
  }

  .review-channel-menu label {
    font-size: 0.9rem;
    min-height: 44px;
  }

  .review-channel-menu input,
  .review-graph-legend-item input {
    height: 22px;
    width: 22px;
  }

  .review-graph-legend {
    min-height: 44px;
  }

  .review-graph-legend-item {
    font-size: 0.85rem;
    min-height: 44px;
  }

  .review-lap-sector {
    padding: 8px 4px;
  }

  .review-progress {
    height: 44px;
  }

  .review-progress-marker {
    top: 43px;
  }

  .review-progress-button {
    height: 44px;
    min-width: 44px;
    width: 44px;
  }

  .review-playback-speed select {
    font-size: 0.95rem;
    height: 44px;
  }
}

@media (max-width: 900px) {
  .review-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }

  .review-graphs {
    grid-template-columns: 1fr;
  }

  .review-timeline-controls {
    grid-template-columns: 1fr;
  }

  .review-progress-buttons {
    justify-content: flex-end;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* 서킷 번호 배지 스타일 */
.circuit-id-badge {
  background-color: #335577 !important;
  color: white !important;
}

/* 서킷 타입 배지 스타일 */
.circuit-type-closed {
  background-color: #994222 !important;
  color: white !important;
}

.circuit-type-open {
  background-color: #0bbbd0 !important;
  color: white !important;
}

/* 서킷 인증 배지 스타일 */
.circuit-verified-badge {
  background-color: #198754 !important;
  color: white !important;
  width: 1.2em;
  height: 1.2em;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transform: translateY(-10%);
}

.circuit-verified-badge i {
  font-size: 0.8em !important;
}
