:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #191c1f;
  --surface-2: #202428;
  --surface-3: #282d31;
  --line: #30363b;
  --line-soft: #282d31;
  --text: #f3f5f5;
  --muted: #9aa3a7;
  --dim: #737d82;
  --blue: #4c8dff;
  --cyan: #24c6b2;
  --green: #38c793;
  --amber: #e9a83b;
  --red: #ee626a;
  --sidebar: #151719;
  --shadow: 0 18px 48px rgb(0 0 0 / 0.22);
  --radius: 6px;
  --sidebar-width: 236px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #f7f8f8;
  --surface-3: #eceff0;
  --line: #dce1e3;
  --line-soft: #e8ebed;
  --text: #1b2023;
  --muted: #5f696e;
  --dim: #899297;
  --sidebar: #202427;
  --shadow: 0 14px 38px rgb(31 41 45 / 0.09);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; font-size: 14px; line-height: 1.5; letter-spacing: 0; }
button, input, select { color: inherit; font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
[hidden] { display: none !important; }

.eyebrow { margin: 0 0 5px; color: var(--dim); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--bg); }
.login-panel { width: min(380px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 5px; background: var(--cyan); color: #092d29; }
.login-panel .brand-mark { width: 44px; height: 44px; margin-bottom: 24px; }
.login-panel h1 { margin: 0; font-size: 25px; font-weight: 650; }
.login-status { display: flex; align-items: center; gap: 8px; margin: 8px 0 28px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgb(56 199 147 / 0.13); }
.login-panel form { display: grid; gap: 8px; }
.login-panel label, .field-label { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); padding: 0 12px; }
input::placeholder { color: var(--dim); }
input:hover, select:hover { border-color: var(--dim); }
input:focus, select:focus { border-color: var(--blue); }
.form-error { min-height: 20px; margin: 2px 0 0; color: var(--red); font-size: 12px; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); padding: 0 15px; color: var(--text); font-weight: 650; }
.button:hover { border-color: var(--dim); background: var(--surface-3); }
.button.primary { border-color: #3678e8; background: var(--blue); color: #fff; }
.button.primary:hover { background: #3c7fe8; }
.button.danger { border-color: rgb(238 98 106 / 0.5); background: rgb(238 98 106 / 0.11); color: var(--red); }
.button.danger:hover { background: rgb(238 98 106 / 0.18); }
.button.quiet { background: transparent; }
.button.wide { width: 100%; margin-top: 12px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); }
.icon-button:hover { color: var(--text); border-color: var(--dim); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: var(--sidebar-width); flex-direction: column; border-right: 1px solid #292e31; background: var(--sidebar); color: #e8eced; }
.brand { display: flex; height: 76px; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid #292e31; }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; color: #9aa4a8; font-size: 11px; }
.side-nav { display: grid; gap: 4px; padding: 18px 12px; }
.nav-item, .utility-button { display: flex; width: 100%; min-height: 43px; align-items: center; gap: 11px; border: 0; border-radius: 5px; background: transparent; padding: 0 12px; color: #9aa4a8; text-align: left; }
.nav-item:hover, .utility-button:hover { background: #202427; color: #f2f5f5; }
.nav-item.active { background: #262b2e; color: #fff; box-shadow: inset 3px 0 var(--cyan); }
.nav-item.active svg { color: var(--cyan); }
.sidebar-footer { display: grid; gap: 4px; margin-top: auto; padding: 12px; border-top: 1px solid #292e31; }

.main { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 30px 48px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 76px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: rgb(17 19 21 / 0.92); backdrop-filter: blur(12px); }
html[data-theme="light"] .topbar { background: rgb(242 244 245 / 0.92); }
.topbar h2 { margin: 0; font-size: 21px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.connection-badge { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 0 12px; color: var(--muted); font-size: 12px; }
.connection-badge.offline .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgb(238 98 106 / 0.13); }
.mobile-only, .bottom-nav, .more-menu { display: none; }

.view { display: none; padding-top: 24px; }
.view.active { display: block; }
.alert-banner { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; border: 1px solid rgb(233 168 59 / 0.35); border-radius: var(--radius); background: rgb(233 168 59 / 0.08); padding: 13px 15px; color: var(--amber); }
.alert-banner.error { border-color: rgb(238 98 106 / 0.35); background: rgb(238 98 106 / 0.08); color: var(--red); }
.alert-banner strong, .alert-banner span { display: block; }
.alert-banner span { margin-top: 2px; color: var(--muted); font-size: 12px; }

.vpn-strip { display: grid; grid-template-columns: 1.05fr 1.3fr 1.5fr 1.1fr auto; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 13px 16px; }
.vpn-strip > div { min-width: 0; }
.vpn-strip small, .status-facts span, .metric-card > span, .interface-grid span { display: block; color: var(--muted); font-size: 11px; }
.vpn-strip strong { display: block; margin-top: 2px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vpn-strip-state { display: flex; align-items: center; gap: 10px; }
.health-orb { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(56 199 147 / 0.12); }
.health-orb.warning { background: var(--amber); box-shadow: 0 0 0 4px rgb(233 168 59 / 0.12); }
.health-orb.error { background: var(--red); box-shadow: 0 0 0 4px rgb(238 98 106 / 0.12); }

.metric-grid { display: grid; gap: 12px; margin-top: 16px; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid.compact { margin-bottom: 16px; }
.live-telemetry-stage { position: relative; isolation: isolate; }
.live-telemetry-stage .metric-grid { position: relative; z-index: 2; }
.telemetry-grid-source, .telemetry-grid-output, .telemetry-grid-source-fill { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.telemetry-grid-source { opacity: 0; }
.telemetry-grid-source-fill { visibility: hidden; }
.telemetry-grid-output { opacity: 0; transition: opacity 240ms cubic-bezier(0.215, 0.61, 0.355, 1); }
.live-telemetry-stage.canvas-ready .telemetry-grid-output { opacity: 0.32; }
.metric-card { position: relative; min-width: 0; min-height: 126px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 17px; }
.metric-card strong { display: block; margin-top: 14px; overflow: hidden; font-size: 22px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; margin-top: 2px; color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-card, .status-facts strong, .interface-grid strong { font-variant-numeric: tabular-nums; }
.live-rate-card { overflow: hidden; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.live-rate-card::after { position: absolute; inset: auto 17px 0; height: 2px; background: var(--blue); content: ""; opacity: 0.55; transform: scaleX(0.28); transform-origin: left; transition: transform 320ms cubic-bezier(0.215, 0.61, 0.355, 1); }
.live-rate-card:nth-child(2)::after { background: var(--cyan); }
.live-rate-card:hover::after { transform: scaleX(1); }
.live-rate-value { font-variant-numeric: tabular-nums; }
.live-telemetry-meta { position: relative; z-index: 2; display: flex; min-height: 28px; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 0; color: var(--dim); font-size: 10px; }
.live-telemetry-meta span { white-space: nowrap; }
#liveSparkline { width: 180px; height: 26px; margin-left: auto; }
.live-telemetry-stage.stale #liveFreshness { color: var(--amber); }
.live-telemetry-stage.offline #liveFreshness { color: var(--red); }
.amicro-value-pulse { animation: amicro-value-pulse 260ms cubic-bezier(0.215, 0.61, 0.355, 1); }
.amicro-fade-in { animation: amicro-fade-in 320ms cubic-bezier(0.215, 0.61, 0.355, 1) both; }
.connection-badge:not(.offline) .status-dot, .login-status .status-dot { animation: amicro-pulse-dot 1.5s ease-out infinite; }
@keyframes amicro-fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes amicro-value-pulse { 0% { opacity: 0.72; transform: scale(0.985); } 100% { opacity: 1; transform: scale(1); } }
@keyframes amicro-pulse-dot { 0% { box-shadow: 0 0 0 0 rgb(56 199 147 / 0.32); } 100% { box-shadow: 0 0 0 7px rgb(56 199 147 / 0); } }
.metric-icon { position: absolute; top: 15px; right: 15px; display: grid; width: 31px; height: 31px; place-items: center; border-radius: 5px; }
.metric-icon.blue { background: rgb(76 141 255 / 0.12); color: var(--blue); }
.metric-icon.cyan { background: rgb(36 198 178 / 0.12); color: var(--cyan); }
.metric-icon.green { background: rgb(56 199 147 / 0.12); color: var(--green); }
.metric-icon.amber { background: rgb(233 168 59 / 0.12); color: var(--amber); }

.content-grid { display: grid; gap: 16px; margin-top: 16px; }
.content-grid.traffic-primary { grid-template-columns: 2fr 1fr; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { min-width: 0; }
.panel { min-width: 0; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content-grid > .panel { margin-top: 0; }
.panel-header { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); padding: 12px 16px; }
.panel-header h3 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.panel-tools { display: flex; align-items: center; gap: 13px; }
.panel-icon { color: var(--dim); }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; }
.legend-swatch.blue { background: var(--blue); }
.legend-swatch.cyan { background: var(--cyan); }
.chart-frame { position: relative; width: 100%; padding: 15px; }
.chart-frame.tall { height: 300px; }
.chart-frame.medium { height: 275px; }
.chart-frame.donut { width: 190px; height: 190px; flex: 0 0 190px; padding: 5px; }
.chart-frame canvas { width: 100% !important; height: 100% !important; }
.empty-state { display: grid; min-height: 120px; place-items: center; color: var(--dim); font-size: 12px; }

.comparison { display: grid; gap: 21px; padding: 22px 18px; }
.comparison > div > span { color: var(--muted); font-size: 11px; }
.comparison > div > strong { float: right; font-size: 13px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.comparison .progress-track { clear: both; margin-top: 8px; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width 180ms ease; }
.progress-track.muted span { background: var(--dim); }
.comparison-delta { border-top: 1px solid var(--line-soft); padding-top: 15px; }
.comparison-delta strong.positive { color: var(--green); }
.comparison-delta strong.negative { color: var(--amber); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); padding: 2px; }
.segmented button { min-height: 30px; border: 0; border-radius: 3px; background: transparent; padding: 0 11px; color: var(--muted); font-size: 11px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
.donut-layout { display: flex; min-height: 230px; align-items: center; gap: 18px; padding: 18px; }
.rank-list { display: grid; min-width: 0; flex: 1; gap: 11px; margin: 0; padding: 0; list-style: none; }
.rank-list li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.rank-list li i { width: 8px; height: 8px; border-radius: 2px; }
.rank-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list li b { font-size: 11px; font-weight: 600; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 38px; background: var(--surface-2); color: var(--dim); font-size: 10px; font-weight: 650; text-align: left; text-transform: uppercase; }
td, th { border-bottom: 1px solid var(--line-soft); padding: 9px 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(128 140 146 / 0.035); }
td { font-size: 12px; }
.cell-main { display: block; max-width: 250px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; margin-top: 2px; color: var(--dim); font-size: 10px; }
.empty-row { height: 100px; color: var(--dim); text-align: center; }

.status-hero { display: grid; grid-template-columns: 1.1fr 2fr; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-hero-main { display: flex; align-items: center; gap: 15px; padding: 22px; }
.status-hero-main > div > span { color: var(--dim); font-size: 10px; font-weight: 700; }
.status-hero-main h3 { margin: 3px 0 0; font-size: 21px; }
.status-hero-main p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.hero-icon { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 6px; background: rgb(56 199 147 / 0.12); color: var(--green); }
.hero-icon.warning { background: rgb(233 168 59 / 0.12); color: var(--amber); }
.hero-icon.error { background: rgb(238 98 106 / 0.12); color: var(--red); }
.status-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--line-soft); }
.status-facts div { min-width: 0; padding: 19px; border-right: 1px solid var(--line-soft); }
.status-facts div:last-child { border-right: 0; }
.status-facts strong { display: block; margin-top: 5px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.command-panel { padding-bottom: 16px; }
.command-panel > :not(.panel-header) { margin-right: 16px; margin-left: 16px; }
.command-panel > input, .command-panel > select, .command-panel > .button.wide { width: calc(100% - 32px); }
.command-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 16px; }
.command-panel input, .command-panel select { margin-top: 5px; }
.command-panel .field-label { display: block; margin-top: 12px; }
.badge { display: inline-flex; min-height: 25px; align-items: center; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; font-size: 10px; font-weight: 700; }
.badge.good { border-color: rgb(56 199 147 / 0.3); background: rgb(56 199 147 / 0.1); color: var(--green); }
.badge.warning { border-color: rgb(233 168 59 / 0.3); background: rgb(233 168 59 / 0.1); color: var(--amber); }
.badge.error { border-color: rgb(238 98 106 / 0.3); background: rgb(238 98 106 / 0.1); color: var(--red); }
.badge.neutral { color: var(--muted); }
.command-status-panel { padding-bottom: 14px; }
.command-status-panel .progress-track, .command-status-panel .command-meta { margin: 14px 16px 0; }
.command-progress span { background: var(--cyan); }
.command-meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 10px; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-progress { margin-top: 16px; border: 1px solid rgb(76 141 255 / 0.3); border-radius: var(--radius); background: rgb(76 141 255 / 0.07); padding: 14px 16px; }
.scan-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; }
.scan-progress span { color: var(--muted); font-size: 11px; }
.scan-progress .progress-track span { background: var(--blue); }
.compact-search { width: 230px; min-height: 36px; }
.node-table-wrap { max-height: 590px; }
.node-table { min-width: 900px; }
.node-table th, .node-table td { white-space: nowrap; }
.node-table th:first-child, .node-table td:first-child { width: 320px; }
.node-table thead { position: sticky; z-index: 2; top: 0; }
.node-table .button { min-height: 30px; padding: 0 10px; font-size: 10px; }
.quality-status { display: inline-flex; align-items: center; gap: 6px; }
.quality-status::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ""; }
.quality-status.failed { color: var(--red); }
.quality-status.failed::before { background: var(--red); }

.device-table input { min-width: 140px; min-height: 34px; }
.device-table { min-width: 980px; }
.device-table select { min-width: 92px; min-height: 34px; }
.device-table .button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.online-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgb(56 199 147 / 0.11); }

.health-checks { display: grid; gap: 0; padding: 4px 16px 12px; }
.health-check { display: flex; min-height: 45px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.health-check:last-child { border-bottom: 0; }
.health-check > span { display: flex; align-items: center; gap: 9px; }
.health-check i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.health-check i.ok { background: var(--green); }
.health-check b { color: var(--muted); font-size: 10px; }
.interface-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.interface-grid div { min-width: 0; padding: 18px; border-right: 1px solid var(--line-soft); }
.interface-grid div:last-child { border-right: 0; }
.interface-grid strong { display: block; margin-top: 6px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.event-timeline { padding: 8px 18px 18px; }
.event-item { display: grid; grid-template-columns: 9px 118px minmax(0, 1fr) auto; align-items: start; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 14px 0; }
.event-item:last-child { border-bottom: 0; }
.event-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.event-dot.warning { background: var(--amber); }
.event-dot.error { background: var(--red); }
.event-dot.info { background: var(--cyan); }
.event-time { color: var(--dim); font-size: 11px; }
.event-message { font-size: 12px; }
.event-kind { color: var(--dim); font-size: 10px; text-transform: uppercase; }

.dialog { width: min(420px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0; color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgb(0 0 0 / 0.62); }
.dialog form { padding: 24px; }
.dialog-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 5px; background: rgb(238 98 106 / 0.11); color: var(--red); }
.dialog h3 { margin: 17px 0 7px; font-size: 18px; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
.toast-region { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 5px; background: var(--surface); padding: 11px 13px; box-shadow: var(--shadow); font-size: 12px; }
.toast.error { border-left-color: var(--red); }

@media (max-width: 1100px) {
  :root { --sidebar-width: 210px; }
  .main { padding-right: 20px; padding-left: 20px; }
  .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid.traffic-primary { grid-template-columns: 1fr; }
  .status-hero { grid-template-columns: 1fr; }
  .status-facts { border-top: 1px solid var(--line-soft); border-left: 0; }
  .vpn-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vpn-strip .button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 14px 30px; }
  .topbar { min-height: 66px; }
  .topbar h2 { font-size: 18px; }
  .connection-badge { display: none; }
  .mobile-only { display: grid; }
  .view { padding-top: 16px; }
  .bottom-nav { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(62px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); padding: 6px 4px env(safe-area-inset-bottom); }
  .bottom-nav button { display: grid; min-width: 0; place-items: center; gap: 1px; border: 0; background: transparent; color: var(--dim); font-size: 9px; }
  .bottom-nav button.active { color: var(--cyan); }
  .bottom-nav svg { width: 19px; height: 19px; }
  .more-menu { position: fixed; z-index: 55; right: 10px; bottom: calc(68px + env(safe-area-inset-bottom)); display: grid; width: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .more-menu button { display: flex; min-height: 46px; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; padding: 0 14px; text-align: left; }
  .more-menu button:last-child { border-bottom: 0; }
  .vpn-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .vpn-strip > div:nth-child(4) { display: none; }
  .vpn-strip .button { grid-column: auto; }
  .metric-grid.four, .metric-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid.three .metric-card:last-child { grid-column: 1 / -1; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { margin-top: 13px; font-size: 18px; }
  .content-grid.equal { grid-template-columns: 1fr; }
  .chart-frame.tall { height: 245px; }
  .chart-frame.medium { height: 235px; }
  .donut-layout { align-items: flex-start; }
  .chart-frame.donut { width: 150px; height: 150px; flex-basis: 150px; }
  .status-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-facts div:nth-child(2) { border-right: 0; }
  .status-facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .page-toolbar { align-items: stretch; flex-direction: column; }
  .page-toolbar .segmented { display: grid; grid-template-columns: repeat(4, 1fr); }
  .responsive-header { align-items: stretch; flex-direction: column; }
  .panel-tools { align-items: flex-start; justify-content: space-between; }
  .live-telemetry-meta { align-items: flex-start; flex-wrap: wrap; }
  #liveSparkline { width: 100%; margin-left: 0; }
  .compact-search { width: 100%; }
  .interface-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interface-grid div:nth-child(2) { border-right: 0; }
  .interface-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .event-item { grid-template-columns: 9px minmax(0, 1fr) auto; }
  .event-time { grid-column: 2 / -1; }
}

@media (max-width: 430px) {
  .login-panel { padding: 26px 22px; }
  .vpn-strip { padding: 12px; }
  .vpn-strip .button { grid-column: 1 / -1; width: 100%; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 106px; }
  .metric-icon { top: 11px; right: 11px; width: 27px; height: 27px; }
  .panel-header { padding-right: 13px; padding-left: 13px; }
  .legend { gap: 7px; font-size: 9px; }
  .segmented button { padding: 0 7px; }
  .donut-layout { flex-direction: column; align-items: center; }
  .rank-list { width: 100%; }
  .status-hero-main { padding: 17px; }
  .status-facts div { padding: 14px; }
  .command-buttons { grid-template-columns: 1fr; }
  .toast-region { right: 12px; bottom: 78px; left: 12px; }
  .toast { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .telemetry-grid-output { display: none; }
}
