:root {
    --bg: #08111d;
    --surface: #0d1a2a;
    --surface-2: #112237;
    --line: rgba(158, 185, 216, .16);
    --text: #f1f5f9;
    --muted: #8ca0b8;
    --cyan: #4ed8e6;
    --cyan-dim: rgba(78, 216, 230, .14);
    --amber: #f2b15e;
    --green: #64d39b;
    --red: #ee7b80;
    --display: "Space Grotesk", sans-serif;
    --body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--body); }
body.light-mode { --bg: #eef3f7; --surface: #fff; --surface-2: #f5f8fb; --line: rgba(19, 45, 70, .14); --text: #13263a; --muted: #64798d; --cyan: #087f91; --cyan-dim: rgba(8, 127, 145, .1); }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--cyan); color: var(--cyan); font: 700 13px var(--display); letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 17px var(--display); letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.sync-label { font-size: 12px; }
.icon-button, .dashboard-link { border: 1px solid var(--line); background: var(--surface); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; font-size: 18px; }
.dashboard-link { padding: 8px 13px; color: var(--text); font-size: 13px; }
.dashboard-link span { color: var(--cyan); }
main { padding: 34px 0 70px; }
.hero-panel { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: stretch; }
.hero-copy { padding: 34px 0 34px 4px; }
.eyebrow, .section-kicker { color: var(--cyan); font: 600 11px var(--display); letter-spacing: .16em; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.pulse-dot, .status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(100, 211, 155, .12); }
h1, h2, h3, p { margin: 0; }
h1 { max-width: 730px; margin-top: 18px; font: 600 clamp(36px, 5vw, 64px)/1.04 var(--display); letter-spacing: -.055em; }
.hero-copy > p { max-width: 615px; margin-top: 22px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; gap: 10px; margin-top: 28px; }
.primary-action, .secondary-action { padding: 11px 15px; border: 1px solid var(--line); font-size: 13px; }
.primary-action { border-color: var(--cyan); background: var(--cyan); color: #05202a; font-weight: 700; }
.primary-action span { margin-left: 9px; }
.secondary-action { color: var(--muted); }
.route-preview { display: flex; flex-direction: column; justify-content: space-between; min-height: 268px; padding: 22px; border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface), var(--surface-2)); }
.route-title, .route-footer, .panel-heading, .chart-legend { display: flex; justify-content: space-between; align-items: center; }
.route-title { color: var(--muted); font-size: 12px; }
.live-label { color: var(--green); font: 600 10px var(--display); letter-spacing: .13em; }
.route-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 0; }
.route-node { min-width: 84px; color: var(--muted); text-align: center; }
.node-icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 8px; border: 1px solid var(--line); color: var(--muted); font: 600 14px var(--display); }
.active-node .node-icon { border-color: var(--cyan); background: var(--cyan-dim); color: var(--cyan); }
.route-node strong, .route-node small { display: block; }
.route-node strong { color: var(--text); font-size: 12px; }
.route-node small { overflow: hidden; max-width: 110px; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.route-arrow { color: var(--cyan); font-size: 20px; }
.route-footer { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 11px; }
.route-footer > span:first-child { display: flex; align-items: center; gap: 8px; }
#pingValue { color: var(--amber); font-family: var(--display); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.stat-block { min-height: 130px; padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.stat-label, .stat-note { display: block; color: var(--muted); }
.stat-label { font-size: 12px; }
.stat-block strong { display: block; margin: 13px 0 5px; font: 600 30px var(--display); letter-spacing: -.04em; }
.stat-note { font-size: 11px; }
.status-value { color: var(--red); font-size: 22px !important; }
.content-grid, .lower-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); background: var(--surface); }
.tunnels-panel, .health-panel, .chart-panel, .quick-panel { padding: 22px; }
.panel-heading { align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.panel-heading h2 { margin-top: 5px; font: 600 20px var(--display); letter-spacing: -.035em; }
.text-button { border: 0; background: transparent; color: var(--cyan); cursor: pointer; font-size: 12px; }
.text-button span { margin-right: 5px; font-size: 17px; vertical-align: -1px; }
.tunnels-list { display: grid; gap: 9px; }
.tunnel-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 15px; border: 1px solid var(--line); background: var(--surface-2); }
.tunnel-card:hover { border-color: var(--cyan); }
.tunnel-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.protocol-badge { display: grid; place-items: center; width: 45px; height: 28px; border: 1px solid rgba(78, 216, 230, .36); color: var(--cyan); font: 600 10px var(--display); }
.tunnel-details { min-width: 0; }
.tunnel-details h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px var(--display); }
.tunnel-address, .tunnel-local { overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 12px monospace; }
.tunnel-address { color: var(--cyan); cursor: pointer; }
.tunnel-traffic { min-width: 100px; text-align: right; color: var(--muted); font: 11px monospace; }
.traffic-up { color: var(--amber); }
.traffic-down { color: var(--green); margin-top: 3px; }
.empty-state { padding: 35px 12px 22px; color: var(--muted); text-align: center; }
.empty-mark { color: var(--cyan); font-size: 26px; }
.empty-state h3 { margin-top: 5px; color: var(--text); font: 600 16px var(--display); }
.empty-state p { max-width: 340px; margin: 7px auto 0; font-size: 12px; }
.health-score { padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.health-score strong { font: 600 48px var(--display); letter-spacing: -.08em; }
.health-score > span { color: var(--muted); }
.health-score small { display: block; margin-top: -4px; color: var(--green); font-size: 12px; }
.health-bars { padding-top: 20px; }
.health-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.health-row strong { color: var(--text); font: 500 12px var(--body); }
.health-row i { grid-column: 1 / -1; display: block; height: 4px; background: var(--line); }
.health-row b { display: block; width: 0; height: 100%; background: var(--cyan); transition: width .4s ease; }
.health-footnote { display: flex; gap: 9px; margin-top: 23px; color: var(--muted); font-size: 11px; }
.info-icon { display: grid; flex: 0 0 auto; place-items: center; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 50%; font-size: 10px; }
.chart-panel { min-height: 285px; }
.period-label { color: var(--muted); font: 10px var(--display); letter-spacing: .08em; }
#trafficChart { display: block; width: 100%; height: 190px; }
.chart-legend { justify-content: flex-start; gap: 17px; color: var(--muted); font-size: 11px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.legend-up { background: var(--amber); }.legend-down { background: var(--cyan); }.chart-total { margin-left: auto; }
.steps { display: grid; gap: 14px; margin: 23px 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 12px; }
.steps b { color: var(--cyan); font: 600 11px var(--display); }
code { padding: 2px 5px; background: var(--cyan-dim); color: var(--cyan); font: 11px monospace; }
.inline-link { display: inline-block; padding-top: 15px; border-top: 1px solid var(--line); color: var(--cyan); font-size: 12px; }
.inline-link span { margin-left: 7px; }
.security-panel { margin-top: 14px; padding: 22px; }
.security-toolbar { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 8px; }
.security-input, .security-button { min-height: 38px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 11px; font-size: 12px; }
.security-input::placeholder { color: var(--muted); }
.security-button { border-color: var(--cyan); background: var(--cyan); color: #05202a; cursor: pointer; font-weight: 700; }
.security-button.secondary { border-color: var(--line); background: transparent; color: var(--muted); }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 21px; }
.security-grid h3 { margin-bottom: 9px; font: 600 13px var(--display); }
.security-list { min-height: 58px; border-top: 1px solid var(--line); }
.security-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font: 11px monospace; }
.security-item strong { color: var(--text); font-weight: 500; }
.security-item button { border: 0; background: transparent; color: var(--red); cursor: pointer; font-size: 11px; }
.security-muted, .security-note { color: var(--muted); font-size: 11px; }
.security-note { display: flex; gap: 9px; margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.toast-container { position: fixed; right: 18px; bottom: 18px; z-index: 5; }.toast { padding: 11px 14px; border: 1px solid var(--cyan); background: var(--surface-2); color: var(--text); font-size: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
@media (max-width: 900px) { .hero-panel, .content-grid, .lower-grid { grid-template-columns: 1fr; } .route-preview { min-height: 230px; } }
@media (max-width: 650px) { .app-shell { width: min(100% - 28px, 1240px); } .topbar { height: 70px; } .sync-label { display: none; } .topbar-actions { gap: 9px; } .dashboard-link { padding: 7px 9px; } main { padding-top: 20px; } .hero-copy { padding: 20px 0; } h1 { font-size: 40px; } .hero-actions { flex-wrap: wrap; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .stat-block { min-height: 116px; padding: 14px; } .stat-block strong { font-size: 25px; } .route-line { gap: 2px; } .route-arrow { font-size: 16px; } .route-node { min-width: 65px; } .route-node small { max-width: 72px; } .tunnel-card { grid-template-columns: 1fr; gap: 10px; } .tunnel-traffic { text-align: left; } .security-toolbar, .security-grid { grid-template-columns: 1fr; } footer { flex-direction: column; gap: 6px; } }
