/* =================================================================
   AMR-01 // CONTROL STUDIO — MULTI-THEME DESIGN SYSTEM
   Curated, eye-friendly color palettes with live switching support.
   ================================================================= */

/* === DEFAULT THEME: NORDIC SLATE (Eye-Care Soft Dark) === */
:root,
[data-theme="nordic-slate"] {
    --bg-primary: #11151f;
    --bg-secondary: #181e2c;
    --bg-tertiary: #202738;
    --bg-sidebar: #0e121b;
    --bg-topbar: rgba(17, 21, 31, 0.88);
    --bg-card: #181e2c;
    --bg-card-hover: #21293b;
    --bg-viewport: #0c0f17;
    --bg-toast: #1b2232;

    --border: #283147;
    --border-subtle: #20283a;
    --border-hover: #3b4866;

    --accent: #3b82f6;
    --accent-bright: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.16);
    --gauge-mid: #38bdf8;
    --gauge-end: #2dd4bf;

    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.14);

    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.14);

    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.14);

    --text-primary: #e6edf3;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --grid-dot: rgba(148, 163, 184, 0.07);
    --chart-grid: rgba(148, 163, 184, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    --shadow-glow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* === THEME 2: TOKYO NIGHT (Deep Indigo & Soft Lavender) === */
[data-theme="tokyo-night"] {
    --bg-primary: #16161e;
    --bg-secondary: #1a1b26;
    --bg-tertiary: #24283b;
    --bg-sidebar: #13141c;
    --bg-topbar: rgba(22, 22, 30, 0.88);
    --bg-card: #1a1b26;
    --bg-card-hover: #24283b;
    --bg-viewport: #111218;
    --bg-toast: #1f2335;

    --border: #292e42;
    --border-subtle: #222638;
    --border-hover: #414868;

    --accent: #7aa2f7;
    --accent-bright: #89ddff;
    --accent-glow: rgba(122, 162, 247, 0.16);
    --gauge-mid: #7dcfff;
    --gauge-end: #bb9af7;

    --success: #73daca;
    --success-dim: rgba(115, 218, 202, 0.14);

    --warning: #e0af68;
    --warning-dim: rgba(224, 175, 104, 0.14);

    --danger: #f7768e;
    --danger-dim: rgba(247, 118, 142, 0.14);

    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;

    --grid-dot: rgba(154, 165, 206, 0.07);
    --chart-grid: rgba(154, 165, 206, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
    --shadow-glow: 0 1px 0 rgba(192, 202, 245, 0.05) inset;
}

/* === THEME 3: CATPPUCCIN MOCHA (Warm Cozy Dark) === */
[data-theme="catppuccin-mocha"] {
    --bg-primary: #181825;
    --bg-secondary: #1e1e2e;
    --bg-tertiary: #29293d;
    --bg-sidebar: #11111b;
    --bg-topbar: rgba(24, 24, 37, 0.88);
    --bg-card: #1e1e2e;
    --bg-card-hover: #2a2b3d;
    --bg-viewport: #11111b;
    --bg-toast: #242436;

    --border: #313244;
    --border-subtle: #262736;
    --border-hover: #45475a;

    --accent: #89b4fa;
    --accent-bright: #b4befe;
    --accent-glow: rgba(137, 180, 250, 0.16);
    --gauge-mid: #94e2d5;
    --gauge-end: #cba6f7;

    --success: #a6e3a1;
    --success-dim: rgba(166, 227, 161, 0.14);

    --warning: #fab387;
    --warning-dim: rgba(250, 179, 135, 0.14);

    --danger: #f38ba8;
    --danger-dim: rgba(243, 139, 168, 0.14);

    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --text-muted: #6c7086;

    --grid-dot: rgba(205, 214, 244, 0.06);
    --chart-grid: rgba(205, 214, 244, 0.07);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
    --shadow-glow: 0 1px 0 rgba(205, 214, 244, 0.05) inset;
}

/* === THEME 4: EMERALD FOREST (Calm Botanical Pine) === */
[data-theme="emerald-forest"] {
    --bg-primary: #0d1514;
    --bg-secondary: #13201e;
    --bg-tertiary: #1a2c29;
    --bg-sidebar: #09100f;
    --bg-topbar: rgba(13, 21, 20, 0.88);
    --bg-card: #13201e;
    --bg-card-hover: #1c2f2c;
    --bg-viewport: #080e0d;
    --bg-toast: #172724;

    --border: #233b36;
    --border-subtle: #1b2e2a;
    --border-hover: #31544d;

    --accent: #10b981;
    --accent-bright: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.16);
    --gauge-mid: #34d399;
    --gauge-end: #38bdf8;

    --success: #2dd4bf;
    --success-dim: rgba(45, 212, 191, 0.14);

    --warning: #fbbf24;
    --warning-dim: rgba(251, 191, 36, 0.14);

    --danger: #f87171;
    --danger-dim: rgba(248, 113, 113, 0.14);

    --text-primary: #ecfdf5;
    --text-secondary: #99b8b1;
    --text-muted: #5c7d76;

    --grid-dot: rgba(52, 211, 153, 0.06);
    --chart-grid: rgba(52, 211, 153, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 1px 0 rgba(236, 253, 245, 0.05) inset;
}

/* === THEME 5: TACTICAL AMBER (Avionics Gunmetal & Gold) === */
[data-theme="tactical-amber"] {
    --bg-primary: #121311;
    --bg-secondary: #191b18;
    --bg-tertiary: #222520;
    --bg-sidebar: #0d0e0c;
    --bg-topbar: rgba(18, 19, 17, 0.9);
    --bg-card: #191b18;
    --bg-card-hover: #242722;
    --bg-viewport: #0b0c0a;
    --bg-toast: #1f221d;

    --border: #2e322b;
    --border-subtle: #242722;
    --border-hover: #464c41;

    --accent: #f59e0b;
    --accent-bright: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.16);
    --gauge-mid: #fbbf24;
    --gauge-end: #10b981;

    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.14);

    --warning: #f97316;
    --warning-dim: rgba(249, 115, 22, 0.14);

    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.14);

    --text-primary: #f5f5f4;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;

    --grid-dot: rgba(245, 158, 11, 0.06);
    --chart-grid: rgba(245, 158, 11, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* === THEME 6: SWISS DAYLIGHT (Clean Industrial Light Mode) === */
[data-theme="swiss-daylight"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.92);
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-viewport: #0f172a;
    --bg-toast: #ffffff;

    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-hover: #cbd5e1;

    --accent: #2563eb;
    --accent-bright: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.1);
    --gauge-mid: #0ea5e9;
    --gauge-end: #10b981;

    --success: #059669;
    --success-dim: rgba(5, 150, 105, 0.12);

    --warning: #d97706;
    --warning-dim: rgba(217, 119, 6, 0.12);

    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.12);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --grid-dot: rgba(15, 23, 42, 0.06);
    --chart-grid: rgba(15, 23, 42, 0.07);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* === COMMON TOKENS === */
:root {
    --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --radius: 10px;
    --radius-sm: 7px;
    --radius-xs: 5px;
    --transition: 0.18s cubic-bezier(0.2, 0, 0, 1);
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle engineering dot-grid on background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.text-emerald { color: var(--success) !important; }
.text-amber { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-accent { color: var(--accent-bright) !important; }

/* =================================================================
   STUDIO SIDEBAR (Desktop Left Rail)
   ================================================================= */
#app-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 216px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 105;
    flex-direction: column;
    padding: 14px 12px;
    user-select: none;
    transition: background-color 0.25s ease, border-color 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-brand:hover {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.sidebar-brand-mark {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -0.03em;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.15;
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.sidebar-group-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    padding: 0 10px;
    margin-bottom: 6px;
}

.sidebar-group-spaced {
    margin-top: 14px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    flex: 1;
}

.nav-item {
    position: relative;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item .nav-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex: 1;
}

.nav-item .nav-kbd {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-item:hover .nav-icon {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--text-primary);
    background: var(--accent-glow);
    border-color: rgba(59, 130, 246, 0.25);
}

.nav-item.active .nav-icon {
    color: var(--accent-bright);
}

.nav-item.active .nav-kbd {
    color: var(--accent-bright);
    opacity: 1;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-sys-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sys-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.sys-card-key {
    color: var(--text-muted);
}

.sys-card-val {
    color: var(--text-secondary);
    font-weight: 600;
}

.sidebar-estop-btn {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--danger-dim);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.sidebar-estop-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.sidebar-estop-btn:active {
    transform: scale(0.98);
}

.estop-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
}

.sidebar-estop-btn:hover .estop-dot {
    background: #fff;
}

/* =================================================================
   PRECISION TELEMETRY TOPBAR
   ================================================================= */
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    gap: 12px;
    transition: background-color 0.25s ease, border-color 0.2s ease;
}

.topbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.topbar-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    display: none;
}

.topbar-sep {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: none;
}

.topbar-text-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

#page-title {
    font-weight: 700;
    font-size: 0.96rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-subtext {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    display: none;
}

/* Live Telemetry Strip in Topbar */
.topbar-telemetry-strip {
    display: none;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}

.tele-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.tele-key {
    color: var(--text-muted);
    font-weight: 500;
}

.tele-val {
    color: var(--text-primary);
    font-weight: 600;
}

.tele-accent {
    color: var(--accent-bright);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-theme-btn {
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-theme-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.theme-dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.topbar-clock {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 9px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    display: none;
}

/* Connection Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    text-transform: uppercase;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-online {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-online .badge-dot {
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

.badge-offline {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-offline .badge-dot {
    background: var(--danger);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.topbar-estop-btn {
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(239, 68, 68, 0.5);
    background: var(--danger);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    display: none;
}

.topbar-estop-btn:hover {
    filter: brightness(1.1);
}

.topbar-estop-btn:active {
    transform: scale(0.96);
}

/* =================================================================
   MAIN CONTENT CONTAINER
   ================================================================= */
#app-content {
    position: relative;
    z-index: 1;
    padding: 68px 16px 28px;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
}

/* === APP ICON SYSTEM === */
.app-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* =================================================================
   VISUAL THEME PICKER CARDS (Config Page)
   ================================================================= */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 6px;
}

@media (min-width: 640px) {
    .theme-picker-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.theme-card {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    position: relative;
}

.theme-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.theme-card.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.theme-preview-box {
    height: 44px;
    border-radius: var(--radius-xs);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(128, 128, 128, 0.22);
    overflow: hidden;
}

.theme-preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-preview-dots {
    display: flex;
    gap: 4px;
}

.theme-preview-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.theme-preview-bar {
    height: 6px;
    width: 65%;
    border-radius: 3px;
}

.theme-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.theme-card-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-card-desc {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.theme-check-badge {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-card.active .theme-check-badge {
    display: inline-flex;
}

/* =================================================================
   HOME PAGE: MISSION & TELEMETRY OVERVIEW
   ================================================================= */
.studio-overview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.studio-title-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--accent-bright);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.studio-overview-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.studio-overview-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.studio-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 4-Card KPI Telemetry Strip */
.overview-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    box-shadow: var(--shadow-glow);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kpi-main {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.kpi-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

/* Main 2-Column Overview Layout */
.overview-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.studio-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.studio-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.studio-panel-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-panel-title .app-icon {
    color: var(--accent-bright);
}

.studio-panel-body {
    padding: 16px;
}

/* Module Directory Rows */
.module-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.module-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.module-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.module-row:active {
    transform: scale(0.99);
}

.module-index {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 4px 6px;
    border-radius: var(--radius-xs);
}

.module-icon-box {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
    background: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: var(--accent-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
    min-width: 0;
}

.module-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.module-desc {
    font-size: 0.73rem;
    color: var(--text-secondary);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-arrow {
    color: var(--text-muted);
    transition: var(--transition);
}

.module-row:hover .module-arrow {
    color: var(--text-primary);
    transform: translateX(2px);
}

/* =================================================================
   SUBPAGE & STUDIO GRID LAYOUTS
   ================================================================= */
.studio-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.page-section {
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-glow);
}

.panel + .panel {
    margin-top: 12px;
}

/* === MAP CONTAINER === */
.map-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-viewport);
    touch-action: none;
}

.map-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

.map-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 12px;
    padding: 5px 10px;
    background: var(--bg-topbar);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.map-legend span::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: middle;
}

.legend-pickup::before { background: var(--accent) !important; }
.legend-delivery::before { background: var(--success) !important; }
.legend-robot::before { background: var(--warning) !important; }

/* === TASK LIST === */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: var(--transition);
}

.task-item.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.task-item.completed {
    opacity: 0.55;
    border-color: var(--success);
}

.task-number {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-bright);
    flex-shrink: 0;
}

.task-item.completed .task-number {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-route {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-status-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.task-remove {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.task-remove:hover, .task-remove:active {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.35);
    background: var(--danger-dim);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #052e16;
    font-weight: 700;
}

.btn-success:hover {
    filter: brightness(1.08);
}

.btn-danger {
    background: var(--danger-dim);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning-dim);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--warning);
}

.btn-warning:hover {
    background: var(--warning);
    color: #000;
}

.btn-outline, .btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover, .btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.74rem;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* === CAMERA VIEW === */
.camera-frame {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-viewport);
    position: relative;
}

.camera-frame img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 220px;
    object-fit: contain;
}

.camera-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.camera-badge {
    padding: 4px 9px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: #f87171;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rec-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse-dot 1s infinite;
}

/* === JOYSTICK === */
.joystick-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.joystick-canvas-wrap {
    position: relative;
    width: 240px;
    height: 240px;
}

.joystick-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.joystick-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.vel-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.vel-display .vel-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vel-display .vel-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

/* === KONFIRMASI PICKUP/DELIVERY === */
.confirm-card {
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid;
    background: var(--bg-card);
    animation: confirmFadeIn 0.25s ease;
}

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

.confirm-pickup {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-glow), var(--bg-card));
}

.confirm-delivery {
    border-color: var(--success);
    background: linear-gradient(180deg, var(--success-dim), var(--bg-card));
}

.confirm-icon {
    margin-bottom: 10px;
    color: var(--accent-bright);
}

.confirm-delivery .confirm-icon {
    color: var(--success);
}

.confirm-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.confirm-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.45;
}

.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-confirm-pickup {
    background: var(--accent);
    color: #fff;
}

.btn-confirm-pickup:hover {
    filter: brightness(1.08);
}

.btn-confirm-delivery {
    background: var(--success);
    color: #052e16;
}

.btn-confirm-delivery:hover {
    filter: brightness(1.08);
}

/* === MONITORING CARDS === */
.monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.monitor-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.monitor-card .mon-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.monitor-card .mon-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
}

.mon-accent { color: var(--accent-bright); }
.mon-success { color: var(--success); }
.mon-warning { color: var(--warning); }
.mon-danger { color: var(--danger); }

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-idle {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-running {
    background: var(--accent-glow);
    color: var(--accent-bright);
    border: 1px solid var(--accent);
}

.status-paused {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.status-completed {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-failed, .status-cancelled {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* === PROGRESS BAR === */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--gauge-end));
    transition: width 0.4s ease;
}

/* === HISTORY TABLE === */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-weight: 600;
}

.history-table td {
    font-size: 0.78rem;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.history-table tr:hover td {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.76rem;
}

/* === SETTINGS === */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.setting-input {
    width: 88px;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* === INPUT FIELDS === */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.input-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

select.input-field {
    font-family: var(--font);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* === WAYPOINT SELECTOR CHIPS === */
.waypoint-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.wp-chip {
    padding: 5px 11px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    user-select: none;
}

.wp-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.wp-chip:active, .wp-chip.selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.wp-chip.type-delivery:active, .wp-chip.type-delivery.selected {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

/* === TOAST NOTIFICATION === */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 360px;
}

.toast {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slide-up 0.2s ease;
    border: 1px solid var(--border);
    background: var(--bg-toast);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-info, .toast-warning {
    border-left: 3px solid var(--accent);
}

@keyframes slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === MODAL DIALOG === */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.modal-header-line {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--accent-bright);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 3px;
}

#modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

#modal-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.5;
}

#modal-actions {
    display: flex;
    gap: 8px;
}

#modal-actions .btn {
    flex: 1;
}

/* === ARRIVAL CONFIRMATION MODAL (GLOBAL) === */
#arrival-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#arrival-modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
}

.arrival-box-pickup {
    border-top: 3px solid var(--accent) !important;
}

.arrival-box-delivery {
    border-top: 3px solid var(--success) !important;
}

.arrival-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrival-box-pickup .arrival-modal-icon {
    background: var(--accent-glow);
    color: var(--accent-bright);
    border: 1px solid var(--accent);
}

.arrival-box-delivery .arrival-modal-icon {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success);
}

.arrival-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.arrival-modal-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}

.arrival-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === TOP FLOATING BANNER (GLOBAL NOTIFICATION) === */
#global-mission-banner {
    position: fixed;
    top: 62px;
    left: 14px;
    right: 14px;
    max-width: 520px;
    margin: 0 auto;
    z-index: 95;
    background: var(--bg-toast);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.banner-pickup {
    border-left-color: var(--accent) !important;
}

.banner-delivery {
    border-left-color: var(--success) !important;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.banner-pickup .banner-icon { color: var(--accent-bright); }
.banner-delivery .banner-icon { color: var(--success); }

.banner-text-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.banner-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.banner-subtitle {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-muted);
}

.banner-btn {
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-xs);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.banner-pickup .banner-btn {
    background: var(--accent);
    color: #fff;
}

.banner-delivery .banner-btn {
    background: var(--success);
    color: #052e16;
}

/* === EMERGENCY STOP (Teleop Page) === */
.estop-btn {
    width: 100%;
    max-width: 240px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--danger);
    border: 1px solid var(--danger);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.estop-btn:hover {
    filter: brightness(1.1);
}

.estop-btn:active {
    transform: scale(0.97);
}

.estop-btn svg {
    width: 18px;
    height: 18px;
}

/* =================================================================
   COCKPIT MONITORING DASHBOARD
   ================================================================= */
.cockpit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.cockpit-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.cockpit-header-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cockpit-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cockpit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.cockpit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 10px;
}

.cockpit-card-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cockpit-card-title .app-icon {
    color: var(--accent-bright);
}

/* === VIEWPORT WIDGET (Camera / Map / Dual) === */
.viewport-tabs {
    display: inline-flex;
    background: var(--bg-primary);
    padding: 2px;
    border-radius: var(--radius-xs);
    gap: 2px;
    border: 1px solid var(--border);
}

.viewport-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.viewport-tab-btn:hover {
    color: var(--text-primary);
}

.viewport-tab-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-bright);
    border-color: var(--border-hover);
}

.viewport-display {
    position: relative;
    width: 100%;
    height: 410px;
    background: var(--bg-viewport);
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 16px 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.viewport-view {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    display: none;
}

.viewport-view.active {
    display: block;
}

.viewport-split {
    display: none;
    width: 100%;
    height: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    position: absolute;
    inset: 0;
}

.viewport-split.active {
    display: grid;
}

.viewport-split-pane {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-viewport);
}

.cockpit-cam-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.viewport-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.viewport-hud-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-badge {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
}

.hud-badge-rec {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}

.hud-badge-human {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

.viewport-tools {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.tool-btn {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* === SPEEDOMETER & POSE CARD === */
.gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speed-gauge-wrap {
    position: relative;
    width: 220px;
    height: 132px;
    margin: 2px auto 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.speed-gauge-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    height: 132px;
}

.gauge-readout {
    position: relative;
    z-index: 2;
    text-align: center;
}

.gauge-val {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    line-height: 1;
}

.gauge-subtext {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.angular-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--accent-bright);
    font-weight: 600;
    margin-top: 5px;
}

.cockpit-pose-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.pose-cell {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px;
    text-align: center;
}

.pose-cell-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.pose-cell-val {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.pose-cell-accent { color: var(--text-primary); }
.pose-cell-warning { color: var(--accent-bright); }

.distance-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
    padding: 7px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.dist-item span {
    font-weight: 600;
    color: var(--text-primary);
}

.cockpit-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .cockpit-lower-grid {
        grid-template-columns: 1fr;
    }
}

.telemetry-chart-container {
    width: 100%;
    height: 120px;
    position: relative;
    margin: 6px 0;
}

#speed-history-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.telemetry-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.telemetry-meta b {
    color: var(--text-primary);
}

/* Quick Dispatch Grid */
.quick-dispatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.dispatch-chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.dispatch-chip:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.dispatch-chip .app-icon {
    color: var(--accent-bright);
    flex-shrink: 0;
}

/* Active Mission Controls in Cockpit */
.mission-mini-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mission-phase-badge {
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mission-phase-badge b {
    color: var(--accent-bright);
}

.cockpit-ctrl-row {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.cockpit-ctrl-row .btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 0.74rem;
}

/* System Nodes & Safety Panel */
.nodes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.node-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 7px 10px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.node-name {
    color: var(--text-secondary);
}

.node-status {
    font-weight: 600;
}

.node-status-ok {
    color: var(--success);
}

/* === MOBILE BOTTOM NAV === */
#mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    box-sizing: border-box;
    height: 58px;
    background: var(--bg-topbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 1000;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    gap: 6px;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#mobile-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.mobile-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    flex-shrink: 0 !important;
    font-size: 0.65rem;
    font-weight: 600;
    gap: 3px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item.active {
    color: var(--accent-bright);
    background: rgba(56, 189, 248, 0.08);
}

/* === UTILITY === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.gap-8 { gap: 8px; }
.flex-center { display: flex; align-items: center; justify-content: center; }

.page-enter {
    animation: page-in 0.18s ease-out;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

/* =================================================================
   RESPONSIVE BREAKPOINTS (STUDIO DESKTOP vs MOBILE OPERATOR)
   ================================================================= */
@media (min-width: 1024px) {
    body {
        padding-left: 216px;
    }

    #app-sidebar {
        display: flex;
    }

    #topbar {
        left: 216px;
        width: calc(100% - 216px);
        padding: 0 28px;
    }

    .topbar-breadcrumb,
    .topbar-sep,
    .topbar-subtext,
    .topbar-clock,
    .topbar-estop-btn {
        display: inline-flex;
    }

    .topbar-telemetry-strip {
        display: flex;
    }

    .topbar-right {
        margin-left: 0;
    }

    #app-content {
        max-width: 1560px;
        padding: 72px 28px 32px;
    }

    #global-mission-banner {
        left: 216px;
        right: 0;
    }

    #mobile-nav {
        display: none !important;
    }

    .overview-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .overview-main-grid {
        grid-template-columns: 1.35fr 1fr;
    }

    .studio-two-col {
        grid-template-columns: 1.25fr 1fr;
    }

    .cockpit-grid {
        display: grid;
        grid-template-columns: 1.55fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 1023px) {
    body {
        padding-left: 0;
    }

    #app-sidebar {
        display: none;
    }

    #topbar {
        left: 0;
        width: 100%;
    }

    #app-content {
        max-width: 720px;
        padding: 66px 14px 74px;
    }

    #mobile-nav {
        display: flex !important;
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
    }

    #toast-container {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 68px;
    }
}

/* =================================================================
   VOICE AI ASSISTANT & MODAL STYLES
   ================================================================= */
.topbar-voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-voice-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(99, 102, 241, 0.28));
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

#voice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 12, 20, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

#voice-modal-overlay.hidden {
    display: none;
}

#voice-modal-box {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.voice-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.voice-status-pill.listening {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.voice-status-pill.processing {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.voice-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.voice-status-pill.listening .voice-status-dot {
    background: #ef4444;
    animation: pulse 1.2s infinite;
}

.voice-status-pill.processing .voice-status-dot {
    background: #38bdf8;
    animation: pulse 0.8s infinite;
}

.voice-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
}

.voice-close-btn:hover {
    color: var(--text-primary);
}

.voice-visualizer-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    position: relative;
}

.voice-mic-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.25));
    border: 2px solid #38bdf8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.voice-mic-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
}

.voice-mic-circle.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #f87171;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    animation: micRecordPulse 1.4s infinite alternate;
}

@keyframes micRecordPulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
    100% { transform: scale(1.08); box-shadow: 0 0 35px rgba(239, 68, 68, 0.7); }
}

.voice-transcript-card, .voice-response-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.voice-card-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.voice-user-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    min-height: 24px;
    line-height: 1.4;
}

.voice-response-card {
    border-left: 3px solid #38bdf8;
    background: rgba(56, 189, 248, 0.03);
}

.voice-robot-text {
    font-size: 0.92rem;
    color: #e2e8f0;
    min-height: 24px;
    line-height: 1.4;
    font-weight: 500;
}

.voice-modal-tips {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: center;
    padding-top: 4px;
}

/* ============ OPERATION MODE SWITCHER (REAL ROBOT vs SIMULASI) ============ */
.topbar-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.topbar-mode-btn .mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.topbar-mode-btn.mode-real {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.topbar-mode-btn.mode-real .mode-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.topbar-mode-btn.mode-real:hover {
    background: rgba(16, 185, 129, 0.24);
    border-color: #10b981;
}

.topbar-mode-btn.mode-sim {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
}

.topbar-mode-btn.mode-sim .mode-dot {
    background: #818cf8;
    box-shadow: 0 0 8px #818cf8;
}

.topbar-mode-btn.mode-sim:hover {
    background: rgba(99, 102, 241, 0.28);
    border-color: #818cf8;
}

.mode-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.mode-option-card {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-option-card:hover {
    border-color: var(--accent);
}

.mode-option-card.active-real {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.09);
}

.mode-option-card.active-sim {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.10);
}

.mode-option-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mode-option-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.map-toolbar-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.map-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .topbar-mode-btn {
        padding: 5px 8px;
        font-size: 0.65rem;
    }
    .mode-selector-grid {
        grid-template-columns: 1fr;
    }
}


