/* Reset & Root Variables */
:root {
    --bg-base: #0a0d14;
    --bg-surface: rgba(22, 27, 38, 0.75);
    --bg-card: rgba(30, 37, 51, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-active: rgba(0, 242, 254, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-accent: #00f2fe;
    --color-accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-accent-glow: 0 0 15px rgba(0, 242, 254, 0.4);
    
    --font-sans: 'Outfit', 'Noto Sans KR', sans-serif;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    --sidebar-width: 420px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Sidebar Layout & Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    margin-bottom: 8px;
}

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

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--color-accent);
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.6));
    transform: rotate(45deg);
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Card General Styling */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i, .card-title svg {
    width: 18px;
    height: 18px;
    color: var(--color-accent);
}

/* Location Inputs Card */
.search-card {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(10, 13, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    gap: 12px;
    transition: all 0.2s ease;
}

.input-group:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.input-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-prefix i, .input-prefix svg {
    width: 18px;
    height: 18px;
}

.input-prefix.origin i, .input-prefix.origin svg {
    color: var(--color-success);
}

.input-prefix.destination i, .input-prefix.destination svg {
    color: var(--color-danger);
}

.location-select {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.location-select option {
    background-color: #161b26;
    color: var(--text-primary);
    padding: 10px;
}

.input-connector {
    width: 2px;
    height: 14px;
    background: var(--border-color);
    margin-left: 22px;
    position: relative;
}

.input-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    border-left: 2px dashed rgba(255, 255, 255, 0.15);
}

.map-helper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.info-icon {
    width: 14px;
    height: 14px;
    color: var(--color-accent);
}

/* Routing Modes */
.mode-selector {
    display: flex;
    gap: 8px;
    background: rgba(10, 13, 20, 0.6);
    padding: 4px;
    border-radius: var(--border-radius-md);
    margin-bottom: 16px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-btn i, .mode-btn svg {
    width: 16px;
    height: 16px;
}

.mode-btn.active {
    background: var(--bg-card);
    color: var(--color-accent);
    border: 1px solid var(--border-color-active);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Custom Avoidance Checkboxes */
.custom-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.custom-filters.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.filter-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.filter-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease;
    user-select: none;
}

.filter-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.02);
}

.filter-checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    min-width: 18px;
    min-height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
}

.filter-checkbox-label input:checked ~ .checkbox-custom {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.checkbox-custom::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #0a0d14;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox-label input:checked ~ .checkbox-custom::after {
    display: block;
}

.filter-text {
    display: flex;
    flex-direction: column;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

/* Stats Dashboard Card */
.stats-card {
    display: flex;
    flex-direction: column;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: rgba(10, 13, 20, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.text-accent {
    color: var(--color-accent);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.school-warning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.school-warning-banner.safe {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--color-success);
}

.school-warning-banner.warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--color-warning);
    animation: pulse-border 2s infinite ease-in-out;
}

.banner-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.btn i, .btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--color-accent-gradient);
    border: none;
    color: #05070d;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35), var(--shadow-accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:active { transform: translateY(0); }

.btn-success.nav-running {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-success.nav-running:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Turn-by-Turn Card */
.directions-card {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.directions-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.directions-list::-webkit-scrollbar {
    width: 4px;
}

.directions-list::-webkit-scrollbar-track {
    background: transparent;
}

.directions-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.direction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.direction-item.active {
    background: rgba(0, 242, 254, 0.06);
    border-color: var(--border-color-active);
    color: var(--text-primary);
}

.direction-item.active .direction-icon-wrapper {
    background: rgba(0, 242, 254, 0.15);
    color: var(--color-accent);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.direction-icon-wrapper {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.direction-icon-wrapper i, .direction-icon-wrapper svg {
    width: 14px;
    height: 14px;
}

.direction-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.direction-text {
    font-weight: 500;
}

.direction-distance {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Map Viewport Area */
.map-viewport {
    flex-grow: 1;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
}

/* HUD Overlay */
/* ── 내비 패널 공통 ──────────────────────────── */
.nav-panel {
    position: absolute;
    background: rgba(13, 17, 26, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color-active);
    box-shadow: 0 8px 28px rgba(0,0,0,0.55), 0 0 10px rgba(0,242,254,0.08);
    border-radius: 16px;
    z-index: 1001;
    animation: panel-pop 0.35s cubic-bezier(0.19,1,0.22,1);
}

@keyframes panel-pop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 방향 안내 패널 (좌측 수직 중앙) */
.nav-turn-panel {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 92px;
    padding: 14px 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.nav-turn-icon-wrap {
    width: 54px;
    height: 54px;
    background: var(--color-accent-gradient);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,242,254,0.35);
    flex-shrink: 0;
}

.nav-turn-icon-wrap i,
.nav-turn-icon-wrap svg {
    width: 30px;
    height: 30px;
    color: #05070d;
}

.nav-turn-dist {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* 속도 패널 (우측 상단 아이콘) */
.nav-speed-panel {
    right: 16px;
    top: 20px;
    width: 72px;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.nav-speed-val {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
    text-shadow: 0 0 10px rgba(0,242,254,0.3);
}

.nav-speed-unit {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Nav Mode: 사이드바 축소 ───────────────────── */
.sidebar.nav-mode .sidebar-header,
.sidebar.nav-mode .search-card,
.sidebar.nav-mode .stats-card,
.sidebar.nav-mode .directions-card { display: none !important; }
.sidebar.nav-mode { overflow: hidden; }
.sidebar.nav-mode .nav-bottom-bar { display: flex; }

/* ── Nav Bottom Bar ────────────────────────── */
.nav-bottom-bar {
    display: none;
    align-items: center;
    justify-content: space-around;
    padding: 18px 20px;
    background: rgba(22, 27, 38, 0.5);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin: 4px 0;
}

.nav-remain-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.nav-remain-icon {
    width: 22px;
    height: 22px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.nav-remain-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-remain-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.nav-remain-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-remain-sep {
    width: 1px;
    height: 44px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Animations */
@keyframes pulse-border {
    0%, 100% { border-color: rgba(245, 158, 11, 0.25); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
    50% { border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
}

@keyframes hud-slide-down {
    0% { transform: translateY(-40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Custom Leaflet Map styling (Dark map theme override) */
.leaflet-container {
    background-color: var(--bg-base) !important;
}

.leaflet-bar {
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-premium) !important;
}

.leaflet-bar a {
    background-color: #161b26 !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-bar a:hover {
    background-color: #1d2536 !important;
    color: var(--color-accent) !important;
}

/* Custom Popup Style */
.leaflet-popup-content-wrapper {
    background: #161b26 !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-md) !important;
    box-shadow: var(--shadow-premium) !important;
}

.leaflet-popup-tip {
    background: #161b26 !important;
    border: 1px solid var(--border-color) !important;
}

.popup-content-title {
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 4px;
}

/* Custom styles for Leaflet elements inside dark map */
.leaflet-tile-pane {
    filter: brightness(0.6) contrast(1.2) invert(0.9) hue-rotate(200deg) saturate(0.3);
}

/* Modal CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 13, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color-active);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-accent-glow);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: modal-scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-scale-up {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 28px;
    height: 28px;
}

.modal-icon.text-warning {
    color: var(--color-warning);
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4));
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-step {
    display: flex;
    gap: 16px;
    background: rgba(10, 13, 20, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
}

.step-num {
    background: var(--color-accent-gradient);
    color: #05070d;
    font-weight: 800;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-text strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.step-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-footer .btn {
    max-width: 120px;
    padding: 10px 24px;
}

/* Pulsing red dot for current location */
.pulse-red-dot {
    width: 16px;
    height: 16px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
    animation: pulse-red-anim 1.5s infinite ease-out;
    border: 2px solid #ffffff;
    display: block;
}

@keyframes pulse-red-anim {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Custom Suggestions Dropdown */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: rgba(22, 27, 38, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 242, 254, 0.1);
    z-index: 1010;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
}

.search-suggestions.hidden {
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    text-align: left;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.active {
    background: rgba(0, 242, 254, 0.15);
    color: var(--color-accent);
}

.suggestion-item i, .suggestion-item svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.suggestion-item:hover i, .suggestion-item:hover svg,
.suggestion-item.active i, .suggestion-item.active svg {
    color: var(--color-accent);
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.suggestion-title {
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.suggestion-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.suggestion-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.suggestion-loading .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.suggestion-no-results {
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ── Bottom-Sheet Drag Handle (mobile only) ───────────────── */
.sidebar-drag-handle { display: none; }

/* ── Floating Action Buttons (Settings, Real Navigation) ──── */
.fab-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none; /* 자식만 클릭 가능 */
}
.fab-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid rgba(0,242,254,0.35);
    background: rgba(13,17,26,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.fab-btn i, .fab-btn svg { width: 16px; height: 16px; }
.fab-btn:hover {
    background: rgba(0,242,254,0.12);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,242,254,0.25);
}
.fab-btn.nav-active {
    background: rgba(239,68,68,0.18);
    border-color: var(--color-danger);
    color: var(--color-danger);
    animation: nav-pulse 2s infinite;
}
@keyframes nav-pulse {
    0%,100% { box-shadow: 0 4px 16px rgba(239,68,68,0.3); }
    50% { box-shadow: 0 4px 24px rgba(239,68,68,0.6); }
}

/* ── Real-GPS Navigation User Marker ──────────────────────── */
.nav-user-dot {
    width: 20px; height: 20px;
    background: #00f2fe;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(0,242,254,0.3);
    animation: nav-user-pulse 2s infinite;
}
@keyframes nav-user-pulse {
    0%,100% { box-shadow: 0 0 0 4px rgba(0,242,254,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(0,242,254,0.1); }
}

/* ── Off-Route Warning Banner ─────────────────────────────── */
.off-route-banner {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239,68,68,0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1005;
    display: none;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: hud-slide-down 0.3s ease;
}

/* ── Mobile Bottom-Sheet Layout (≤768px) ──────────────────── */
@media (max-width: 768px) {
    .sidebar-header { display: none; }
    .sidebar-drag-handle {
        display: flex;
        justify-content: center;
        padding: 10px 0 6px;
        cursor: pointer;
        flex-shrink: 0;
    }
    .drag-line {
        width: 36px; height: 4px;
        background: rgba(255,255,255,0.2);
        border-radius: 2px;
    }

    .app-container {
        flex-direction: column;
        overflow: hidden;
    }
    .map-viewport {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        height: 100vh; height: 100dvh;
        z-index: 1;
    }
    .sidebar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        width: 100%;
        height: auto;
        max-height: 80dvh;
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-radius: 20px 20px 0 0;
        padding: 0 16px 24px;
        overflow-y: auto;
        z-index: 1000;
        transform: translateY(0);
        transition: none;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
        gap: 14px;
    }
    /* Collapsed (default) state: hide stats & directions until user expands */
    .sidebar .stats-card,
    .sidebar .directions-card {
        display: none !important;
    }
    .sidebar.mobile-expanded .stats-card.expanded-visible:not(.hidden),
    .sidebar.mobile-expanded .directions-card.expanded-visible:not(.hidden) {
        display: flex !important;
    }
    /* 모바일: 패널 소형화 */
    .nav-turn-panel { left: 10px; width: 80px; padding: 12px 8px 10px; gap: 8px; }
    .nav-turn-icon-wrap { width: 46px; height: 46px; border-radius: 11px; }
    .nav-turn-icon-wrap i, .nav-turn-icon-wrap svg { width: 26px; height: 26px; }
    .nav-turn-dist { font-size: 0.85rem; }
    .nav-speed-panel { right: 10px; top: 12px; width: 64px; padding: 8px 4px 6px; }
    .nav-speed-val { font-size: 1.6rem; }

    /* Nav mode: 모바일에서 사이드바 최소 높이만 유지 */
    .sidebar.nav-mode {
        max-height: none;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
    .sidebar.nav-mode .nav-bottom-bar { margin: 0; border-radius: 0; border: none; border-top: 1px solid var(--border-color); }

    /* FAB stack: bottom-right above the sheet so it stays reachable */
    .fab-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        z-index: 1001;
    }
    .fab-btn { padding: 9px 14px; font-size: 0.82rem; }

    /* Off-route banner aligned with mobile HUD */
    .off-route-banner { top: 90px; }
}
