/* ==========================================================================
   Pitching Intelligence OS - Next-Gen Sports Tech & Biomechanics Design System
   Aesthetics: Deep Slate Glassmorphism, Floating Docks, Precision Neon Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Deep Dark Tech SaaS */
  --bg-base: #07090e;
  --bg-surface: #0d121d;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-panel: rgba(13, 18, 30, 0.88);
  --bg-input: rgba(5, 8, 15, 0.65);

  /* Borders & Glassmorphism */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-glow: rgba(56, 189, 248, 0.4);

  /* Curated Vivid Accents */
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #ffffff;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar - High Contrast & Clearly Visible */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.6) rgba(10, 15, 26, 0.85);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 15, 26, 0.85);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.6);
  border: 1.5px solid rgba(10, 15, 26, 0.9);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-panel:hover {
  border-color: var(--border-medium);
}

/* ==========================================================================
   Header & Brand Session Navigation
   ========================================================================== */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-close-viewer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn-close-viewer:hover {
  background: rgba(239, 71, 111, 0.18);
  border-color: rgba(239, 71, 111, 0.5);
  color: #ff4d6d;
  box-shadow: 0 0 12px rgba(239, 71, 111, 0.3);
  transform: translateY(-1px);
}

.btn-close-viewer i,
.btn-close-viewer svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f2fe 0%, #3b82f6 50%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--primary-glow);
  flex-shrink: 0;
}

.brand-badge-icon i,
.brand-badge-icon svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 2.4px;
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-info .brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-version-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.70rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-emerald 2s infinite;
}

@keyframes pulse-emerald {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Quick Actions & Navigation Panel (Unified with Upload Card Style)
   ========================================================================== */
.quick-nav-card {
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.85) 0%, rgba(13, 18, 30, 0.85) 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-intro-banner {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  line-height: 1.5;
  padding: 2px 4px 4px;
  letter-spacing: -0.015em;
}

.nav-actions-row-top {
  display: flex;
  gap: 8px;
  width: 100%;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.nav-btn.btn-half {
  flex: 1 1 50%;
  width: 50%;
}

.nav-btn.btn-full {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.90rem;
  font-weight: 800;
}

.nav-btn.highlight {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(59, 130, 246, 0.15));
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--primary);
}

.nav-btn.highlight:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(59, 130, 246, 0.25));
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.nav-btn.sample-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.nav-btn.sample-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Application Workspace Layout
   ========================================================================== */
.workspace-container {
  max-width: 1440px;
  width: 96%;
  margin: 12px auto 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ==========================================================================
   Large File Selection & Calibration Bar
   ========================================================================== */
.large-upload-card {
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.85) 0%, rgba(13, 18, 30, 0.85) 100%);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.video-guideline-banner {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0 2px 2px;
  font-size: 0.83rem;
  color: #cbd5e1;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  letter-spacing: -0.01em;
}

.video-guideline-banner strong {
  color: #38bdf8;
  font-weight: 700;
}

.video-guideline-banner .guideline-icon {
  width: 16px;
  height: 16px;
  stroke: #38bdf8;
  flex-shrink: 0;
  margin-top: 3px;
}

.large-file-btn {
  flex: 1;
  min-width: 280px;
  background: rgba(5, 8, 15, 0.6);
  border: 1.5px dashed rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.large-file-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.file-btn-icon,
.file-btn-icon svg {
  width: 38px;
  height: 38px;
  stroke: var(--primary);
  stroke-width: 2.2px;
  filter: drop-shadow(0 0 10px var(--primary-glow));
  flex-shrink: 0;
}

.file-btn-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-btn-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.file-btn-guide {
  font-size: 0.82rem;
  font-weight: 600;
  color: #7dd3fc;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.pitcher-height-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(5, 8, 15, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  width: 100%;
  flex: 1 1 100%;
}

.pitcher-height-setting .height-input-field {
  width: 68px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
}

.height-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.phase-pill-card.pkh .phase-name { color: var(--primary); }
.phase-pill-card.fp .phase-name  { color: var(--accent-emerald); }
.phase-pill-card.br .phase-name  { color: var(--accent-rose); }

/* Input Control Dock */
.input-control-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.file-input-wrapper {
  flex: 2;
  min-width: 240px;
}

.file-input-custom {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.file-input-custom:focus {
  outline: none;
  border-color: var(--primary);
}

.height-input-wrapper {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 10px;
}

.height-label-mini {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 8px;
  white-space: nowrap;
}

.height-input-field {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  padding: 5px 2px;
}

.height-input-field:focus {
  outline: none;
}

.height-unit-tag {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.btn-sample-dock {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sample-dock:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-bright);
}

.btn-analyze-dock {
  background: linear-gradient(135deg, #00f2fe 0%, #3b82f6 100%);
  border: none;
  color: #050811;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-analyze-dock:hover {
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.6);
  transform: translateY(-1px);
}

/* ==========================================================================
   2-Column Studio Grid: Left Visualizer Stage | Right Intelligence Panel
   ========================================================================== */
.studio-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

/* Left Column: Visualizer Stage */
.stage-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.viewport-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewport-modes {
  display: flex;
  gap: 4px;
}

.btn-mode-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.btn-mode-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* Canvas & Video Viewport */
.video-canvas-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #04060a;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

#pitchVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#skeletonCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Empty Viewport Placeholder (Reserved for Ads / Clean State) */
.video-placeholder {
  position: absolute;
  inset: 0;
  background: #04060a;
  z-index: 5;
  transition: opacity 0.3s;
}

.video-placeholder.hidden {
  display: none;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: 12px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.90rem;
  font-weight: 600;
  color: var(--primary);
}

/* NLE Precision Playback Controller */
.playback-controller-card {
  margin-top: 10px;
  background: rgba(5, 8, 15, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  letter-spacing: -0.02em;
}

/* Event Jump Bar */
.event-jump-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 100%;
}

.btn-event-jump {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-bright);
  padding: 12px 6px;
  min-height: 56px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
  min-width: 0;
  overflow: hidden;
  user-select: none;
}

.btn-event-jump .jump-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 100%;
  line-height: 1.2;
}

.btn-event-jump:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-event-jump .event-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.90rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-event-jump.pkh .event-name {
  color: #00f2fe; /* High-contrast Neon Cyan */
}

.btn-event-jump.fp .event-name {
  color: #ffd166; /* Matching Graph FP Yellow/Gold */
}

.btn-event-jump.br .event-name {
  color: #ff4d6d; /* High-contrast Vibrant Coral/Rose */
}

.btn-event-jump.pkh:hover { border-color: #00f2fe; }
.btn-event-jump.fp:hover  { border-color: #ffd166; }
.btn-event-jump.br:hover  { border-color: #ff4d6d; }

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex-wrap: nowrap;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  width: 34px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  user-select: none;
  flex-shrink: 0;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ctrl.primary-btn {
  background: var(--primary);
  color: #0b0c10;
  border-color: var(--primary);
  font-weight: 800;
}

.btn-ctrl.primary-btn:hover {
  background: #38bdf8;
  color: #04060a;
}

.speed-control-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.speed-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.speed-select {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
}

/* Timeline Scrubber & Time Bar (Bottom Row - Matching Elite 3D Viewer) */
.timeline-scrubber-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.timeline-scrubber {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.timeline-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.timeline-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.timeline-time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Right Column: Intelligence & KPI Hub */
.intelligence-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.kpi-dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

/* Speed Hero Widget */
.speed-hero-widget {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(13, 18, 30, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.speed-hero-widget::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-glow);
  filter: blur(25px);
  pointer-events: none;
}

.widget-label-top {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.speed-hero-widget .widget-label-top {
  width: 100%;
  text-align: left;
  align-self: flex-start;
}

.speed-metric-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
}

.speed-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-bright);
  text-shadow: 0 0 16px var(--primary-glow);
  line-height: 1;
}

.speed-unit {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.gain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-align: center;
  max-width: 100%;
}

/* Radar Score Widget */
.radar-score-widget {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(13, 18, 30, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.radar-score-widget::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-glow);
  filter: blur(25px);
  pointer-events: none;
}

.radar-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.radar-score-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: #00f2fe;
  text-shadow: 0 0 14px rgba(0, 242, 254, 0.45);
  line-height: 1;
}

.radar-canvas-wrap {
  width: 100%;
  max-width: 100%;
  height: 195px;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.radar-canvas-wrap canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 155px !important;
  display: block;
}

/* AI Coaching Briefing Box */
.ai-briefing-box {
  background: rgba(5, 8, 15, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ai-briefing-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-briefing-content {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}

/* ==========================================================================
   Tabbed Deep Analytics Hub (Kinetic Chart / Table / Drills)
   ========================================================================== */
.analytics-tab-hub {
  padding: 18px 22px;
}

.tab-nav-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.analytics-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 10px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  user-select: none;
}

.analytics-tab-btn .tab-icon,
.analytics-tab-btn .tab-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-muted);
  stroke-width: 2.2px;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.analytics-tab-btn .tab-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.analytics-tab-btn:hover .tab-text {
  color: var(--text-bright);
}

.analytics-tab-btn:hover .tab-icon,
.analytics-tab-btn:hover .tab-icon svg {
  stroke: var(--text-bright);
}

.analytics-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(59, 130, 246, 0.18));
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.analytics-tab-btn.active .tab-icon,
.analytics-tab-btn.active .tab-icon svg {
  stroke: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary));
  transform: scale(1.1);
}

.analytics-tab-btn.active .tab-text {
  color: #ffffff;
  font-weight: 800;
}

.tab-content-panel {
  display: none;
  min-height: 330px;
  animation: fadeIn 0.25s ease;
}

.tab-content-panel.active {
  display: block;
}

.kinetic-chart-legend-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.event-abbr-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: -0.01em;
}

.event-abbr-guide .event-guide-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.67rem;
}

.event-abbr-guide .event-guide-tag strong {
  font-size: 0.67rem;
  font-weight: 700;
}

.event-abbr-guide .event-guide-title {
  color: #64748b;
  font-weight: 600;
  font-size: 0.67rem;
}

.event-abbr-guide .event-guide-sep {
  color: rgba(255, 255, 255, 0.22);
  font-size: 0.65rem;
}

.line-style-guide {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.line-style-guide .guide-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-style-guide .guide-line {
  display: inline-block;
  width: 16px;
  height: 2.5px;
  border-radius: 2px;
}

.line-style-guide .guide-line.solid {
  background: #f8fafc;
}

.line-style-guide .guide-line.dashed {
  background: repeating-linear-gradient(90deg, #94a3b8, #94a3b8 3px, transparent 3px, transparent 6px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.comparison-table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 44%;
  min-width: 140px;
}

.comparison-table .metric-val-user {
  color: #00f2fe;
  font-weight: 700;
  line-height: 1.35;
}

.comparison-table .metric-val-elite {
  color: #ffd166;
  font-weight: 600;
  line-height: 1.35;
}

.comparison-table .val-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.comparison-table .val-unit {
  font-size: 0.76rem;
  margin-left: 2px;
  color: inherit;
}

.comparison-table .val-extra {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-left: 3px;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

.status-pill.status-good, .status-pill.우수, .status-pill.최적, .status-pill.good, .status-pill.optimal {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.status-target, .status-pill.목표치, .status-pill.target {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.status-pill.status-warning, .status-pill.개선, .status-pill.주의, .status-pill.교정, .status-pill.warning, .status-pill.poor {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.status-pill.status-normal, .status-pill.보통, .status-pill.normal {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Coaching & Drill Cards */
.coaching-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.coaching-card {
  background: rgba(5, 8, 15, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.coaching-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-bright);
}

.gain-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.drill-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
}

.drill-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 2px;
}

.drill-guide {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Floating Action Dock (Downloads & Utilities)
   ========================================================================== */
.floating-action-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  background: rgba(13, 18, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.2);
  transition: var(--transition);
}

.action-download-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-dock-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  transition: var(--transition);
  flex: 1 1 0;
  min-width: 0;
  user-select: none;
  text-align: center;
}

.btn-dock-action .btn-action-icon,
.btn-dock-action .btn-action-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  stroke-width: 2.2px;
  transition: transform 0.2s ease;
}

.btn-dock-action .btn-action-text {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.btn-dock-action:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(59, 130, 246, 0.18));
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .action-download-row {
    flex-direction: column;
    gap: 8px;
  }
  .btn-dock-action {
    flex-direction: row;
    padding: 10px 14px;
    gap: 10px;
    justify-content: center;
  }
}

/* ==========================================================================
   Minimal Data Attribution Footer (Mandatory License Notice)
   ========================================================================== */
.app-minimal-footer {
  max-width: 1440px;
  width: 96%;
  margin: 0 auto 14px;
  padding: 4px 16px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.app-minimal-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  font-weight: 700;
  transition: color 0.15s ease;
}

.app-minimal-footer a:hover {
  color: var(--text-bright);
}

.app-minimal-footer strong {
  color: var(--text-muted);
  font-weight: 800;
}

/* ==========================================================================
   Modal Dialogs (About & System Info)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: modalScale 0.2s ease;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--accent-rose);
}

.modal-body {
  padding: 20px 22px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.86rem;
  line-height: 1.6;
}

.modal-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-highlight-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header.app-header {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .motion-sequence-strip {
    grid-template-columns: 1fr;
  }
  .kpi-dual-row {
    grid-template-columns: 1fr;
  }
  .input-control-dock {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 폰 가로 모드 (Landscape) 대응 */
@media (max-height: 520px) and (orientation: landscape) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .kpi-dual-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .comparison-table th,
  .comparison-table td {
    padding: 8px 4px;
    font-size: 0.76rem;
  }

  /* 폰 화면 분석 항목 측 폭 대폭 확보 */
  .comparison-table th:first-child,
  .comparison-table td:first-child {
    width: 48%;
    min-width: 135px;
    padding-right: 4px;
  }

  .comparison-table th:nth-child(2),
  .comparison-table td:nth-child(2),
  .comparison-table th:nth-child(3),
  .comparison-table td:nth-child(3) {
    width: 20%;
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
  }

  .comparison-table th:nth-child(4),
  .comparison-table td:nth-child(4) {
    width: 12%;
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
  }

  /* 폰에 한해서 단위를 숫자 아래에 줄바꿈 표시 */
  .comparison-table .val-unit {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-left: 0;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  .comparison-table .val-num {
    display: block;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .comparison-table .val-extra {
    display: block;
    font-size: 0.64rem;
    color: #94a3b8;
    margin-left: 0;
    line-height: 1.1;
  }
}

@media (max-width: 480px) {
  .playback-controller-card {
    padding: 8px 10px;
    gap: 6px;
  }
  .btn-event-jump {
    padding: 10px 4px;
    min-height: 50px;
    gap: 3px;
  }
  .btn-event-jump .jump-title {
    font-size: 0.78rem;
    letter-spacing: -0.025em;
  }
  .btn-event-jump .event-name {
    font-size: 0.88rem;
  }
  .playback-buttons {
    gap: 4px;
  }
  .btn-ctrl {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .speed-select {
    padding: 3px 5px;
    font-size: 0.72rem;
  }
  .timeline-scrubber-wrapper {
    padding: 4px 8px;
    gap: 6px;
  }
  .timeline-time-display {
    font-size: 0.72rem;
  }
}

/* Arm Slot Matching Banner */
.slot-match-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.4s ease-out;
}

.slot-match-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #f1f5f9;
}

.slot-match-icon {
  width: 20px;
  height: 20px;
  color: #38bdf8;
  flex-shrink: 0;
}

.slot-match-text {
  line-height: 1.4;
}

.slot-match-arrow {
  color: #38bdf8;
  font-weight: 700;
  margin: 0 4px;
}

.slot-match-detail {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-left: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Top Announcement Bar (상단 슬림 공지 띠배너)
   ========================================================================== */
.top-announcement-bar {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 40%, #0f172a 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 105;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease;
  overflow: hidden;
  max-height: 80px;
}

.top-announcement-bar.hidden {
  display: none !important;
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
  padding-right: 36px;
}

.announcement-badge {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.01em;
}

.announcement-text {
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: #0369a1;
  padding: 3px 11px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.announcement-link:hover {
  background: #f0f9ff;
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.announcement-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.desktop-text { display: inline; }
.mobile-text { display: none; }

@media (max-width: 768px) {
  .top-announcement-bar {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .announcement-inner {
    gap: 6px 8px;
    padding-right: 28px;
  }
  .announcement-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
  }
  .desktop-text { display: none !important; }
  .mobile-text { display: inline !important; }
  .announcement-link {
    font-size: 0.72rem;
    padding: 2px 7px;
  }
  .announcement-close {
    right: 6px;
    width: 22px;
    height: 22px;
  }
}

/* =========================================================================
   Global Expansion & Unit Conversion Styles (km/h ⇄ mph & KR ⇄ EN)
   ========================================================================= */
.speed-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  width: 100%;
}

.unit-toggle-pill {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.unit-pill-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.25;
}

.unit-pill-btn:hover {
  color: #ffffff;
}

.unit-pill-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.45);
}

.height-imperial-tag {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: -0.01em;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle-wrap {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 20px !important;
  padding: 3px !important;
  gap: 3px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.lang-btn {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.25 !important;
}

.lang-btn:hover {
  color: #ffffff !important;
}

.lang-btn.active {
  background: #00f2fe !important;
  color: #050b14 !important;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.5) !important;
}

/* ==========================================================================
   Google AdSense & In-House Sponsorship Placements
   ========================================================================== */

.ad-slot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  box-sizing: border-box;
}

.ad-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* 1. Loading In-Feed Ad Slot (300x250 square responsive inside loading overlay) */
.ad-slot-loading {
  margin-top: 14px;
  width: 100%;
  max-width: 320px;
}

.ad-slot-loading .ad-content-box {
  width: 300px;
  min-height: 180px;
  max-height: 220px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.ad-fallback-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  text-align: left;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  transition: transform 0.2s, border-color 0.2s;
}

.ad-fallback-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.5);
}

.ad-fallback-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-fallback-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.ad-fallback-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 10px;
  flex: 1;
}

.ad-fallback-btn {
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 2. Leaderboard Banner (728x90 desktop / 320x100 mobile) at bottom of results */
.ad-banner-section {
  width: 100%;
  max-width: 1440px;
  margin: 16px auto 8px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.ad-slot-leaderboard {
  width: 100%;
}

.ad-slot-leaderboard .ad-content-box {
  width: 100%;
  min-height: 84px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.ad-leaderboard-fallback {
  width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.ad-lb-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.ad-lb-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-lb-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.ad-lb-sub {
  font-size: 0.76rem;
  color: #94a3b8;
}

.ad-lb-cta {
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.ad-lb-cta:hover {
  background: #38bdf8;
  color: #070b12;
}

@media (max-width: 768px) {
  .ad-leaderboard-fallback {
    flex-direction: column;
    text-align: center;
    padding: 12px 14px;
    gap: 10px;
  }
  .ad-lb-info {
    text-align: center;
    align-items: center;
  }
  .ad-lb-title {
    font-size: 0.84rem;
  }
  .ad-lb-sub {
    font-size: 0.72rem;
  }
}



