:root {
  --canvas: #f3f6f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --line: #dce5e8;
  --line-soft: #eaf0f2;
  --text: #17282e;
  --muted: #687b82;
  --accent: #0d8177;
  --accent-soft: #e7f5f2;
  --good: #178b57;
  --warn: #d48216;
  --bad: #c83e49;
  --sidebar: #172229;
  --sidebar-line: #2b3941;
  --radius: 6px;
  --shadow: 0 12px 34px rgba(31, 51, 57, 0.07);
  --chart-grid: #e5edef;
  --chart-label: #819198;
  --button-text: #344a52;
  --note-text: #3d535b;
  --subtle-text: #87979d;
  --warning-soft: #fff4e4;
  --danger-soft: #fdecef;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101719;
    --surface: #182124;
    --surface-subtle: #202b2f;
    --line: #34454b;
    --line-soft: #29383d;
    --text: #e5eff0;
    --muted: #9aadb2;
    --accent: #55c9bd;
    --accent-soft: #173b3a;
    --good: #52c98a;
    --warn: #e5a04c;
    --bad: #f0717b;
    --sidebar: #0b1113;
    --sidebar-line: #263439;
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
    --chart-grid: #304146;
    --chart-label: #9aadb2;
    --button-text: #d9e7e9;
    --note-text: #c2d2d5;
    --subtle-text: #8fa4a9;
    --warning-soft: #3b2d1d;
    --danger-soft: #3b2227;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { min-width: 320px; margin: 0; color: var(--text); background: var(--canvas); font: 14px/1.5 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(13, 129, 119, 0.18); outline-offset: 1px; }

.login-page { overflow: hidden; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.35fr) minmax(360px, .65fr); background: var(--surface); }
.login-visual { position: relative; min-height: 100vh; overflow: hidden; background: #174b47; }
.login-visual::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 31, 34, .08), rgba(8, 31, 34, .62)); content: ""; }
.login-brand { position: absolute; z-index: 1; left: clamp(28px, 5vw, 72px); bottom: clamp(30px, 6vh, 68px); color: #fff; }
.login-brand strong { display: block; font-size: clamp(24px, 3vw, 38px); line-height: 1.15; }
.login-brand span { display: block; margin-top: 8px; color: rgba(255, 255, 255, .82); }
.login-brand small { display: block; margin-top: 10px; color: rgba(255, 255, 255, .68); font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 36px; background: var(--surface); }
.login-form { width: min(360px, 100%); }
.login-heading { margin-bottom: 28px; }
.login-heading h1 { margin: 0; font-size: 24px; }
.login-heading p { margin: 7px 0 0; color: var(--muted); }
.login-form .field { margin-bottom: 15px; }
.login-form .input { width: 100%; height: 42px; margin-top: 6px; }
.login-submit { width: 100%; min-height: 42px; margin-top: 4px; }

@media (max-width: 760px) {
  .login-page { overflow: auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 32vh; }
  .login-brand { left: 24px; bottom: 22px; }
  .login-panel { min-height: 68vh; padding: 28px 22px; align-items: start; }
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 204px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 12px; color: #e9f1f3; background: var(--sidebar); border-right: 1px solid var(--sidebar-line); }
.brand { padding: 4px 10px 22px; font-size: 16px; font-weight: 780; }
.brand small { display: block; margin-top: 3px; color: #91a3ab; font-size: 10px; font-weight: 520; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border-radius: 5px; color: #aebec4; text-decoration: none; font-weight: 650; }
.side-nav a.active, .side-nav a:hover { color: #7ce0d0; background: #25343b; }
.side-footer { margin-top: auto; padding: 12px 10px 0; color: #70848d; font-size: 10px; border-top: 1px solid var(--sidebar-line); }
.cloud-version { color: #a8b8be; font-variant-numeric: tabular-nums; }

.main { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(18px, 2.2vw, 42px); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.topbar-sub { margin-top: 3px; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.content { width: min(calc(100% - 48px), 1680px); margin: 0 auto; padding: 24px 0 36px; }

.btn { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--button-text); background: var(--surface); cursor: pointer; text-decoration: none; font-weight: 650; }
.btn:hover { border-color: #b9cacf; background: var(--surface-subtle); }
.btn-primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.btn-primary:hover { border-color: #096d65; background: #096d65; }
.btn-small { min-height: 28px; padding: 0 9px; font-size: 10px; }
.btn-danger-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 38%, var(--line)); background: transparent; }
.btn-danger-outline:hover { color: #fff; border-color: var(--bad); background: var(--bad); }
.btn-danger { color: #fff; border-color: var(--bad); background: var(--bad); }
.btn-danger:hover { border-color: #a92f3a; background: #a92f3a; }
.btn-text { min-height: 30px; padding: 0 6px; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-weight: 700; }
.btn:disabled { opacity: 0.55; cursor: default; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 16px 20px; border: 0; border-right: 1px solid var(--line); color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
.metric:hover { background: var(--surface-subtle); }
.metric:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(13, 129, 119, 0.22); outline-offset: -3px; }
.metric.active { box-shadow: inset 0 -3px 0 var(--accent); background: var(--accent-soft); }
.metric.warn.active { box-shadow: inset 0 -3px 0 var(--warn); background: var(--warning-soft); }
.metric:last-child { border-right: 0; }
.metric-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-weight: 850; }
.metric.warn .metric-mark { color: var(--warn); background: var(--warning-soft); }
.metric.bad .metric-mark { color: var(--bad); background: var(--danger-soft); }
.metric label { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 2px; font-size: 24px; line-height: 1.1; }
.metric small { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; }
.toolbar .grow { flex: 1 1 auto; }
.input, .select { height: 36px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface); padding: 0 10px; }
.input { width: min(320px, 100%); }
.input:focus, .select:focus { border-color: var(--accent); outline: 3px solid rgba(13, 129, 119, 0.10); }

.data-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-scroll { overflow: auto; }
.device-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.device-table th { height: 42px; padding: 0 12px; color: #64767d; background: var(--surface-subtle); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 11px; }
.device-table td { min-height: 52px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.device-table tr:last-child td { border-bottom: 0; }
.device-table tbody tr:hover td { background: var(--surface-subtle); }
.device-sn { font-weight: 760; white-space: nowrap; }
.note-cell { min-width: 190px; }
.note-value { display: inline-block; max-width: 210px; overflow: hidden; color: var(--note-text); text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.note-empty { color: #9aa9ae; }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: #9caaaf; content: ""; }
.status.online { color: var(--good); }
.status.online::before { background: var(--good); box-shadow: 0 0 0 3px rgba(23, 139, 87, 0.10); }
.status.offline { color: var(--warn); }
.status.offline::before { background: var(--warn); }
.check-field { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--text); }
.check-field input { width: 16px; height: 16px; margin: 0; }
.task-state { min-width: 140px; }
.task-state b { display: block; font-size: 12px; }
.task-state span { display: block; color: var(--muted); font-size: 10px; }
.signal { display: flex; align-items: flex-end; gap: 2px; white-space: nowrap; }
.signal-bars { height: 17px; display: flex; align-items: flex-end; gap: 2px; }
.signal-bars i { width: 3px; background: #c9d3d6; border-radius: 1px; }
.signal-bars i:nth-child(1) { height: 5px; }.signal-bars i:nth-child(2) { height: 8px; }.signal-bars i:nth-child(3) { height: 12px; }.signal-bars i:nth-child(4) { height: 16px; }
.signal.good i { background: var(--good); }.signal.mid i:nth-child(-n+3) { background: var(--warn); }.signal.weak i:first-child { background: var(--bad); }
.signal span { margin-left: 4px; color: var(--muted); font-size: 10px; }
.remaining { white-space: nowrap; }
.remaining b { display: block; color: var(--good); }
.remaining small { color: var(--muted); }
.remaining .auth-adjust { margin-top: 7px; min-height: 30px; padding: 0 10px; font-size: 11px; }
.remaining.warn b { color: var(--warn); }.remaining.bad b { color: var(--bad); }
.empty { padding: 54px 20px; color: var(--muted); text-align: center; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }

.detail-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-link { color: var(--accent); text-decoration: none; font-weight: 700; white-space: nowrap; }
.detail-title { min-width: 0; }
.detail-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary-item { min-height: 92px; padding: 17px 20px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item label { display: block; color: var(--muted); font-size: 12px; }
.summary-item strong { display: block; margin-top: 6px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.summary-item small { color: var(--muted); font-size: 12px; }
.summary-action { min-height: 30px; margin-top: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--accent); background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 700; }
.summary-action:hover { border-color: var(--accent); background: var(--accent-soft); }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.85fr); gap: 14px; margin-top: 14px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head span { color: var(--muted); font-size: 12px; }
.chart-body { height: 286px; padding: 16px 20px; }
.chart-body svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); }
.panel-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.range-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-subtle); }
.range-tabs button { min-height: 25px; padding: 0 8px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.range-tabs button.active { color: var(--accent); background: var(--surface); box-shadow: 0 1px 3px rgba(31, 51, 57, 0.10); font-weight: 750; }
.side-charts { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px; }
.compact-chart { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 16px; padding: 14px 16px; }
.ring { width: 86px; height: 86px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 780; }
.chart-copy strong { display: block; font-size: 15px; }.chart-copy span { color: var(--muted); font-size: 12px; }
.state-bars { display: grid; gap: 8px; padding: 12px 16px 15px; }
.state-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 36px; align-items: center; gap: 8px; }
.state-row label { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.state-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.state-track i { height: 100%; display: block; background: var(--accent); }
.state-row b { text-align: right; font-size: 10px; }

.cellular-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr); gap: 14px; margin-top: 14px; }
.cellular-panel { overflow: hidden; }
.network-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.network-kv > div { min-width: 0; min-height: 88px; padding: 16px 20px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.network-kv > div:nth-child(3n) { border-right: 0; }
.network-kv > div:nth-last-child(-n+3) { border-bottom: 0; }
.network-kv label, .quality-strip label { display: block; color: var(--muted); font-size: 12px; }
.network-kv strong { display: block; margin-top: 6px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.inline-action { min-height: 22px; margin-top: 3px; padding: 0; font-size: 10px; }
.location-body { min-height: 126px; display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.location-body strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.location-body span { margin-top: 5px; color: var(--muted); }
.location-body small { margin-top: 10px; color: var(--subtle-text); }
.quality-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.quality-strip > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line-soft); }
.quality-strip > div:last-child { border-right: 0; }
.quality-strip b { display: block; margin-top: 3px; font-size: 12px; white-space: nowrap; }
.timeline-panel { margin-top: 12px; }
.cell-timeline { height: 360px; overflow: auto; padding: 8px 20px 14px; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.map-grid .timeline-panel { margin-top: 0; }
.map-panel { min-width: 0; overflow: hidden; }
.cell-map { width: 100%; height: 360px; min-height: 300px; background: var(--surface-subtle); }
.leaflet-container { width: 100%; height: 100%; font: 12px/1.4 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; }
.leaflet-popup-content { margin: 9px 11px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; min-height: 64px; padding: 12px 0 12px 18px; border-left: 1px solid var(--line); }
.timeline-item::before { position: absolute; top: 17px; left: -5px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); content: ""; }
.timeline-item time { color: var(--muted); font-size: 10px; }
.timeline-main strong { display: block; font-size: 12px; }
.timeline-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.log-panel { margin-top: 12px; }
.log-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.log-toolbar .input { width: min(360px, 100%); }
.log-retention-summary { color: var(--muted); font-size: 11px; white-space: nowrap; }
.log-list { min-height: 260px; max-height: 430px; overflow: auto; }
.log-row { display: grid; grid-template-columns: 156px 62px minmax(0, 1fr); gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: #788a91; white-space: nowrap; }
.log-level { font-weight: 800; }.log-level.warn { color: var(--warn); }.log-level.error { color: var(--bad); }.log-level.info { color: var(--accent); }
.log-message { min-width: 0; overflow-wrap: anywhere; }
.load-more { padding: 10px; text-align: center; border-top: 1px solid var(--line-soft); }

.modal { width: min(430px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); box-shadow: 0 24px 70px rgba(19, 42, 47, 0.24); }
.modal::backdrop { background: rgba(14, 29, 34, 0.42); }
.modal-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; letter-spacing: .01em; }
.modal-body { padding: 20px 22px 22px; }
.field { display: block; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.field .input { width: 100%; margin-top: 5px; color: var(--text); }
.modal-error { min-height: 20px; color: var(--bad); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.authorization-current { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin-bottom: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-subtle); }
.authorization-current span { grid-row: 1 / 3; align-self: center; color: var(--muted); font-size: 10px; }
.authorization-current strong { font-size: 13px; }
.authorization-current small { color: var(--muted); font-size: 10px; }
.authorization-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 4px; }
.authorize-modal { width: min(560px, calc(100vw - 28px)); }
.authorize-modal .modal-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(190px, .75fr); gap: 4px 14px; }
.authorize-modal .authorization-current,
.authorize-modal .danger-callout,
.authorize-modal .authorization-presets,
.authorize-modal .modal-error,
.authorize-modal .modal-actions { grid-column: 1 / -1; }
.authorize-modal .field { margin-bottom: 9px; }
.authorize-modal #authorizePasswordField { grid-column: 1 / -1; }
.authorize-modal .modal-actions { margin-top: 5px; }
.authorize-modal .btn { min-height: 38px; }
.danger-callout { display: grid; gap: 5px; margin-bottom: 16px; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--bad) 34%, var(--line)); border-radius: 5px; color: var(--bad); background: var(--danger-soft); }
.danger-callout strong { font-size: 12px; }
.danger-callout span { color: var(--text); font-size: 11px; line-height: 1.55; }
.danger-confirm-input { font-family: "Cascadia Mono", Consolas, monospace; }
.ssh-modal { width: min(920px, calc(100vw - 28px)); }
.modal-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.ssh-connect, .ssh-input-row { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.ssh-connect .input { flex: 1 1 auto; width: auto; }
.ssh-output { height: min(58vh, 520px); min-height: 300px; overflow: hidden; margin: 0; padding: 10px 8px; color: #d7e5e8; background: #0b1117; }
.ssh-output .xterm, .ssh-output .xterm-screen { height: 100%; }
.ssh-output .xterm-viewport { scrollbar-color: #40515b #0b1117; }
.ssh-input-row { border-top: 1px solid #26343c; border-bottom: 0; background: #111b22; }
.ssh-input-row .input { flex: 1 1 auto; width: auto; color: #e8f3f4; background: #17232b; border-color: #31464f; }
.ssh-error { padding: 0 16px 10px; }

@media (min-width: 1400px) {
  .content { padding-top: 28px; }
  .summary-item { padding-left: 22px; padding-right: 22px; }
  .chart-grid, .cellular-grid, .map-grid { gap: 16px; }
  .chart-grid { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.75fr); }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .content { width: min(calc(100% - 32px), 1120px); }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-item:nth-child(3) { border-right: 0; }
  .summary-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .chart-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr); }
  .cellular-grid { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); }
}

@media (max-width: 1050px) {
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }.metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }.summary-item:nth-child(3) { border-right: 0; }.summary-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .chart-grid { grid-template-columns: 1fr; }.side-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .cellular-grid, .map-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 12px; flex-direction: row; align-items: center; gap: 12px; }
  .brand { padding: 0; font-size: 14px; }.brand small, .side-footer { display: none; }.side-nav { margin-left: auto; }.side-nav a { min-height: 34px; padding: 0 10px; }
  .topbar { height: auto; min-height: 62px; align-items: flex-start; padding: 12px 14px; }.top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .content { width: calc(100% - 24px); padding: 12px 0 20px; }
  .metric { min-height: 78px; padding: 12px; }.metric-mark { display: none; }.metric strong { font-size: 21px; }
  .toolbar, .log-toolbar { align-items: stretch; flex-wrap: wrap; }.toolbar .grow { display: none; }.toolbar .input, .toolbar .select, .log-toolbar .input, .log-toolbar .select { flex: 1 1 160px; width: auto; }
  .data-panel { border: 0; background: transparent; box-shadow: none; }.table-scroll { overflow: visible; }.device-table { min-width: 0; }.device-table thead { display: none; }.device-table, .device-table tbody { display: block; }.device-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-bottom: 9px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }.device-table td { min-height: 0; padding: 0; border: 0; }.device-table td:nth-child(1), .device-table td:nth-child(2), .device-table td:nth-child(5), .device-table td:nth-child(7) { grid-column: 1; }.device-table td:nth-child(3), .device-table td:nth-child(4), .device-table td:nth-child(6), .device-table td:nth-child(8) { grid-column: 2; text-align: right; }.device-table td:nth-child(9) { grid-column: 1 / -1; text-align: right; border-top: 1px solid var(--line-soft); padding-top: 8px; }.note-value { max-width: 180px; }
  .device-table td::before { display: block; margin-bottom: 2px; color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 600; }.device-table td:nth-child(1)::before, .device-table td:nth-child(9)::before { display: none; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }.summary-item { min-height: 68px; padding: 11px 12px; border-bottom: 1px solid var(--line); }.summary-item:nth-child(odd) { border-right: 1px solid var(--line); }.summary-item:nth-child(even) { border-right: 0; }.summary-item:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .side-charts { grid-template-columns: 1fr; }.chart-body { height: 220px; }
  .panel-tools { flex-wrap: wrap; gap: 5px; }.panel-tools > span { width: 100%; text-align: right; }
  .range-tabs button { min-height: 28px; }
  .cell-map { height: 260px; }
  .ssh-modal { width: calc(100vw - 20px); }
  .ssh-output { min-height: 0; height: calc(100vh - 260px); }
  .authorize-modal { width: calc(100vw - 20px); }
  .authorize-modal .modal-body { grid-template-columns: 1fr; padding: 16px; }
  .authorize-modal .modal-head { padding: 0 16px; }
  .map-grid { grid-template-columns: 1fr; }.cell-timeline { height: 280px; }.cell-map { height: 280px; }
  .network-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }.network-kv > div:nth-child(3n) { border-right: 1px solid var(--line-soft); }.network-kv > div:nth-child(even) { border-right: 0; }.network-kv > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line-soft); }.network-kv > div:nth-last-child(-n+2) { border-bottom: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
  .log-row { grid-template-columns: 1fr auto; gap: 4px 10px; }.log-message { grid-column: 1 / -1; }.log-time { white-space: normal; }
  .log-retention-summary { flex: 1 1 auto; text-align: right; }
}
