* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg-primary: #0a0a0f;
            --bg-card: rgba(255, 255, 255, 0.05);
            --text-primary:var(--c-text);
            --text-secondary: #a0a0b0;
            --accent: #6366f1;
            --accent-glow: rgba(99, 102, 241, 0.4);
            --success: #10b981;
            --error: #ef4444;
            --border: rgba(255, 255, 255, 0.1);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background:var(--bg-primary);
            color:var(--text-primary);
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* nav 바 아래 남은 영역을 채우는 무대 — globe/sidebar의 offset 부모 */
        .route-stage {
            position: relative;
            flex: 1 1 auto;
            min-height: 0;
        }

        #globe-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
        }

        .sidebar {
            position: absolute;
            top: 0;
            right: 0;
            width: 380px;
            height: 100%;
            background:rgba(10, 10, 15, 0.9);
            backdrop-filter: blur(20px);
            border-left: 1px solid var(--border);
            z-index: 10;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
        }

        .back-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color:var(--text-secondary);
            text-decoration: none;
            font-size: 0.85rem;
            margin-bottom: 1rem;
        }

        .back-btn:hover {
            color:var(--accent);
        }

        h1 {
            font-size: 1.5rem;
            font-weight: 700;
            background:linear-gradient(135deg, var(--accent), #a855f7);
            -webkit-background-clip: text;
            -webkit-text-fill-color:transparent;
            background-clip: text;
        }

        .subtitle {
            color:var(--text-secondary);
            font-size: 0.9rem;
            margin-top: 0.25rem;
        }

        .input-section {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
        }

        .input-group {
            margin-bottom: 1rem;
        }

        .input-group label {
            display: block;
            font-size: 0.8rem;
            color:var(--text-secondary);
            margin-bottom: 0.4rem;
        }

        input[type="text"],
        input[type="number"] {
            width: 100%;
            padding: 0.75rem 1rem;
            background:rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            color:var(--text-primary);
            font-size: 0.95rem;
        }

        input:focus {
            outline: none;
            border-color:var(--accent);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .trace-btn {
            width: 100%;
            padding: 0.875rem;
            background:linear-gradient(135deg, var(--accent), #8b5cf6);
            border: none;
            border-radius: 0.5rem;
            color:white;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
        }

        .trace-btn:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 8px 25px var(--accent-glow);
        }

        .trace-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color:white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 0.5rem;
        }

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

        .results-section {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

        .hop-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .hop-item {
            background:var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            padding: 0.75rem;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
        }

        .hop-item:hover {
            border-color:var(--accent);
            background:rgba(99, 102, 241, 0.1);
        }

        .hop-item.active {
            border-color:var(--accent);
            background:rgba(99, 102, 241, 0.15);
        }

        .hop-item.timeout {
            opacity: 0.5;
        }

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

        .hop-ttl {
            font-weight: 700;
            color:var(--accent);
            font-size: 0.9rem;
        }

        .hop-rtt {
            font-size: 0.8rem;
            color:var(--success);
            font-family: monospace;
        }

        .hop-rtt.timeout {
            color:var(--error);
        }

        .hop-host {
            font-size: 0.85rem;
            margin-top: 0.25rem;
            word-break: break-all;
        }

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

        .hop-coords {
            font-size: 0.7rem;
            color:var(--text-secondary);
            margin-top: 0.25rem;
        }

        .error-msg {
            background:rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 0.5rem;
            padding: 1rem;
            color:var(--error);
            text-align: center;
        }

        .loading-msg {
            text-align: center;
            color:var(--text-secondary);
            padding: 2rem;
        }

        .stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 1rem;
            font-size: 0.85rem;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .stat-value {
            color:var(--accent);
            font-weight: 600;
        }

        .options-section {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border);
            background:rgba(99, 102, 241, 0.05);
        }

        .options-title {
            font-size: 0.8rem;
            color:var(--text-secondary);
            margin-bottom: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .option-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0;
        }

        .option-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }

        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:rgba(255, 255, 255, 0.1);
            border-radius: 24px;
            transition: 0.3s;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background:white;
            border-radius: 50%;
            transition: 0.3s;
        }

        .toggle-switch input:checked+.toggle-slider {
            background:var(--accent);
        }

        .toggle-switch input:checked+.toggle-slider:before {
            transform: translateX(20px);
        }

        .target-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        /* 국가 툴팁 */
        #countryTooltip {
            position: fixed;
            pointer-events: none;
            background:rgba(0, 0, 0, 0.8);
            color:var(--c-text);
            padding: 6px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            display: none;
            z-index: 1000;
        }

        .target-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .target-row input[type="text"] {
            flex: 1;
        }

        .target-row input[type="color"] {
            width: 28px;
            height: 28px;
            padding: 0;
            border: none;
        }

        .remove-btn {
            background:rgba(239, 68, 68, 0.2);
            border: none;
            color:#ef4444;
            width: 24px;
            height: 24px;
            cursor: pointer;
        }

        .add-btn {
            background:rgba(99, 102, 241, 0.1);
            border: 1px dashed #6366f1;
            color:#6366f1;
            padding: 0.4rem;
            cursor: pointer;
        }

        /* RTT 그래프 섹션 */
        .rtt-graph-section {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            background:rgba(16, 185, 129, 0.05);
        }

        .rtt-graph-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }

        .rtt-graph-title {
            font-size: 0.8rem;
            color:var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .rtt-stats {
            display: flex;
            gap: 1rem;
            font-size: 0.75rem;
        }

        .rtt-stat {
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .rtt-stat-label {
            color:var(--text-secondary);
        }

        .rtt-stat-value {
            font-weight: 600;
        }

        .rtt-stat-value.avg {
            color:var(--accent);
        }

        .rtt-stat-value.max {
            color:var(--error);
        }

        .rtt-graph-container {
            position: relative;
            height: 120px;
            background:rgba(0, 0, 0, 0.2);
            border-radius: 0.5rem;
            padding: 0.5rem;
        }

        .rtt-graph-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            color:var(--text-secondary);
            font-size: 0.8rem;
        }

        .rtt-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .rtt-legend-item {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 0.7rem;
            color:var(--text-secondary);
        }

        .rtt-legend-color {
            width: 10px;
            height: 10px;
            border-radius: 2px;
        }

        /* 에러 및 성공 메시지 */
        .error-toast {
            background:rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.4);
            border-radius: 0.5rem;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            color:#fca5a5;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .success-toast {
            background:rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.4);
            border-radius: 0.5rem;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            color:#6ee7b7;
            font-size: 0.8rem;
        }

        /* 내보내기 버튼 */
        .export-section {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            display: none;
        }

        .export-btns {
            display: flex;
            gap: 0.5rem;
        }

        .export-btn {
            flex: 1;
            padding: 0.5rem;
            background:rgba(99, 102, 241, 0.1);
            border: 1px solid var(--accent);
            border-radius: 0.4rem;
            color:var(--accent);
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .export-btn:hover {
            background:rgba(99, 102, 241, 0.2);
        }

        /* RTT 이상치 표시 */
        .rtt-high {
            color:#f59e0b !important;
        }

        .rtt-critical {
            color:#ef4444 !important;
        }

        @media (max-width: 768px) {
            .sidebar {
                width: 100%;
                height: 60%;
                top: auto;
                bottom: 0;
                border-left: none;
                border-top: 1px solid var(--border);
                overflow-y: auto;
            }

            #globe-container {
                height: 40%;
            }

            .sidebar-header {
                padding: 0.75rem 1rem;
            }

            .sidebar-header h1 {
                font-size: 1.2rem;
            }

            .subtitle {
                font-size: 0.8rem;
            }

            .input-section {
                padding: 0.75rem 1rem;
            }

            .options-section {
                padding: 0.5rem 1rem;
            }

            .results-section {
                padding: 0.5rem;
            }

            .back-btn {
                margin-bottom: 0.5rem;
            }
        }
