  /* Network-controller style: light gray canvas, white cards, blue accent.
     System fonts only, so the page needs no network at all. */
  :root {
    color-scheme: light;
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --hover: #f1f3f5;
    --border: #e3e5e8;
    --border-strong: #d0d3d8;
    --text: #1f2226;
    --text-2: #4e545c;
    --muted: #7e858f;
    --blue: #006fff;
    --blue-hover: #005ee0;
    --blue-soft: rgba(0, 111, 255, 0.09);
    --green: #22a55b;
    --green-soft: rgba(34, 165, 91, 0.12);
    --amber: #e8940c;
    --amber-soft: rgba(232, 148, 12, 0.14);
    --red: #e0424b;
    --red-soft: rgba(224, 66, 75, 0.1);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-pop: 0 8px 28px rgba(16, 24, 40, 0.16);
    --term-bg: #16181b;
    --term-text: #d6dae0;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --radius: 6px;
    --sidebar: 56px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #131416; --surface: #1b1d20; --surface-2: #202226; --hover: #25282c;
      --border: #2a2d32; --border-strong: #3a3e45;
      --text: #e7e9ec; --text-2: #b3b8bf; --muted: #868d97;
      --blue: #3d8bff; --blue-hover: #5c9dff; --blue-soft: rgba(61, 139, 255, 0.14);
      --green: #36c26f; --green-soft: rgba(54, 194, 111, 0.14);
      --amber: #f0a52b; --amber-soft: rgba(240, 165, 43, 0.16);
      --red: #f0585f; --red-soft: rgba(240, 88, 95, 0.14);
      --shadow: none; --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.5);
      --term-bg: #0e0f11;
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #131416; --surface: #1b1d20; --surface-2: #202226; --hover: #25282c;
    --border: #2a2d32; --border-strong: #3a3e45;
    --text: #e7e9ec; --text-2: #b3b8bf; --muted: #868d97;
    --blue: #3d8bff; --blue-hover: #5c9dff; --blue-soft: rgba(61, 139, 255, 0.14);
    --green: #36c26f; --green-soft: rgba(54, 194, 111, 0.14);
    --amber: #f0a52b; --amber-soft: rgba(240, 165, 43, 0.16);
    --red: #f0585f; --red-soft: rgba(240, 88, 95, 0.14);
    --shadow: none; --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.5);
    --term-bg: #0e0f11;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    background: var(--bg); color: var(--text);
    font-family: var(--sans); font-size: 13px; line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }
  svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6;
          stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

  /* ---------- Shell layout: icon rail + main ---------- */
  .app { display: flex; min-height: 100vh; }
  .sidebar {
    width: var(--sidebar); flex-shrink: 0; background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 0; position: sticky; top: 0; height: 100vh;
  }
  .glyph {
    width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: #fff;
    display: grid; place-items: center; margin-bottom: 14px;
  }
  .glyph svg.i { width: 18px; height: 18px; stroke-width: 1.8; }
  .nav { display: flex; flex-direction: column; gap: 4px; align-items: center; }
  .tab {
    position: relative; width: 40px; height: 40px; border-radius: var(--radius);
    display: grid; place-items: center; background: none; border: none;
    color: var(--muted); cursor: pointer; transition: background .12s, color .12s;
  }
  .tab:hover { background: var(--hover); color: var(--text); }
  .tab.active { background: var(--blue-soft); color: var(--blue); }
  .tab .tip {
    position: absolute; left: 48px; top: 50%; transform: translateY(-50%);
    background: var(--text); color: var(--surface); font-size: 12px; white-space: nowrap;
    padding: 4px 8px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .12s;
    z-index: 5;
  }
  .tab:hover .tip { opacity: 1; }
  .tab .badge { position: absolute; top: 3px; right: 1px; margin: 0; }
  .sidebar .spacer { flex: 1; }

  .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar {
    height: 52px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; padding: 0 24px;
    position: sticky; top: 0; z-index: 10;
  }
  .topbar h1 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
  .topbar .sub { color: var(--muted); font-size: 12px; }
  .content { width: 100%; max-width: 980px; padding: 24px; flex: 1; }
  .footer { padding: 16px 24px 24px; color: var(--muted); font-size: 11px; max-width: 980px; }

  /* ---------- Status ---------- */
  .status-pill {
    margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 10px; border-radius: 100px; background: var(--surface-2);
    border: 1px solid var(--border); font-size: 12px; color: var(--text-2); white-space: nowrap;
  }
  .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
  .status-dot.connected { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
  .status-dot.working   { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1s infinite; }
  .status-dot.error     { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
  @keyframes pulse { 50% { opacity: .45; } }

  .compat-warning {
    display: none; background: var(--amber-soft); color: var(--text);
    border: 1px solid var(--amber); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 16px;
  }
  .compat-warning.visible { display: block; }

  /* ---------- Cards ---------- */
  .card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
  }
  .card-header {
    display: flex; align-items: center; gap: 10px; min-height: 48px;
    padding: 0 18px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600;
  }
  .card-header .actions { margin-left: auto; display: flex; gap: 4px; }
  .card-body { padding: 18px; }

  /* ---------- Forms ---------- */
  .field-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
  .field-group { flex: 1; min-width: 180px; }
  label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
  .hint { color: var(--muted); font-weight: 400; }
  input:not([type]), input[type="text"], input[type="password"] {
    width: 100%; height: 34px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 4px;
    font: inherit; font-size: 13px; padding: 0 10px; outline: none;
    transition: border-color .12s, box-shadow .12s;
  }
  input::placeholder { color: var(--muted); }
  input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
  input:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
  .mono { font-family: var(--mono); font-size: 12px; }

  .pw-wrap { position: relative; }
  .pw-wrap input { padding-right: 56px; }
  .pw-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--blue); cursor: pointer;
    font: inherit; font-size: 12px; padding: 4px 8px;
  }


  /* ---------- Buttons ---------- */
  .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  button { font: inherit; }
  .btn-primary, .btn-secondary, .btn-danger {
    height: 34px; padding: 0 16px; border-radius: 4px; font-size: 13px; font-weight: 500;
    cursor: pointer; border: 1px solid transparent; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px; transition: background .12s, border-color .12s, color .12s;
  }
  .btn-primary { background: var(--blue); color: #fff; }
  .btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
  .btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
  .btn-secondary:hover:not(:disabled) { background: var(--hover); }
  .btn-danger { background: var(--surface); color: var(--red); border-color: var(--border-strong); }
  .btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }
  .btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
  .btn-ghost {
    height: 28px; padding: 0 10px; background: none; border: none; border-radius: 4px;
    color: var(--blue); cursor: pointer; font-size: 12px;
  }
  .btn-ghost:hover:not(:disabled) { background: var(--blue-soft); }
  button:disabled { opacity: .45; cursor: not-allowed; }

  .badge {
    display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--amber); color: #fff;
    font-size: 11px; font-weight: 600; text-align: center;
  }
  .section-hidden { display: none !important; }

  /* ---------- Device summary (connected) ---------- */
  .device { display: flex; align-items: center; gap: 14px; }
  .device .avatar {
    width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft); color: var(--blue);
    display: grid; place-items: center;
  }
  .device .avatar svg.i { width: 24px; height: 24px; }
  .device .name { font-size: 15px; font-weight: 600; }
  .device .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .device .btn-row { margin-left: auto; }
  .chip-status {
    display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; vertical-align: 2px;
    padding: 1px 8px; border-radius: 100px; font-size: 11px; font-weight: 600;
    background: var(--green-soft); color: var(--green);
  }
  .chip-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  /* ---------- Settings rows + switch ---------- */
  .setting { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
  .setting + .setting { border-top: 1px solid var(--border); }
  .setting .title { font-weight: 500; }
  .setting .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .switch { margin-left: auto; position: relative; width: 36px; height: 20px; flex-shrink: 0; }
  .switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
  .switch .track {
    position: absolute; inset: 0; border-radius: 10px; background: var(--border-strong);
    transition: background .15s;
  }
  .switch .track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
  }
  .switch input:checked + .track { background: var(--blue); }
  .switch input:checked + .track::after { transform: translateX(16px); }
  .switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--blue-soft); }
  .switch input:disabled { cursor: not-allowed; }
  .switch input:disabled + .track { opacity: .5; }

  /* ---------- Config editor ---------- */
  .cfg-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
  .cfg-search { flex: 1; min-width: 200px; position: relative; }
  .cfg-search input { padding-left: 32px; }
  .cfg-search svg.i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
  .cfg-meta { color: var(--muted); font-size: 12px; }
  .cfg-toolbar .cfg-meta { margin-left: 4px; }

  .cfg-table-wrap { max-height: 480px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
  table.cfg { width: 100%; border-collapse: collapse; }
  table.cfg thead th {
    position: sticky; top: 0; z-index: 1; background: var(--surface-2);
    text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
    padding: 9px 12px; border-bottom: 1px solid var(--border);
  }
  table.cfg tbody td { padding: 0 12px; height: 38px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  table.cfg tbody tr:last-child td { border-bottom: none; }
  table.cfg tbody tr:hover td { background: var(--hover); }
  table.cfg td.k { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; width: 42%; padding-top: 6px; padding-bottom: 6px; }
  table.cfg td.v { width: 52%; padding-left: 4px; }
  table.cfg td.act { width: 6%; text-align: right; white-space: nowrap; }
  table.cfg td.act .btn-ghost { color: var(--muted); }
  table.cfg td.act .btn-ghost:hover { color: var(--red); background: var(--red-soft); }
  table.cfg input.vedit {
    height: 28px; border-color: transparent; background: transparent;
    font-family: var(--mono); font-size: 12px; padding: 0 8px;
  }
  table.cfg input.vedit:hover { border-color: var(--border-strong); background: var(--surface); }
  table.cfg input.vedit:focus { border-color: var(--blue); background: var(--surface); }
  table.cfg tr.dirty td { background: var(--amber-soft); }
  table.cfg tr.dirty td.k { color: var(--text); box-shadow: inset 3px 0 0 var(--amber); }
  table.cfg tr.added td.k::before { content: '+ '; color: var(--green); font-weight: 600; }
  table.cfg tr.removed td { opacity: .5; }
  table.cfg tr.removed input.vedit { text-decoration: line-through; }
  .cfg-empty { padding: 36px; text-align: center; color: var(--muted); }

  .addkey-row { display: flex; gap: 8px; margin-top: 12px; }
  .addkey-row input { flex: 1; }

  .apply-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
  }
  .apply-bar .cfg-meta { margin-left: 4px; }

  /* ---------- Dashboard ---------- */
  .dash-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
  .dash-bar h2 { font-size: 16px; font-weight: 600; }
  .dash-bar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
  .inline-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin: 0; font-weight: 400; }
  .inline-switch .switch { margin-left: 0; }

  .notice {
    display: flex; align-items: center; gap: 10px; border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--border);
    background: var(--blue-soft); color: var(--text);
  }
  .notice.warn { background: var(--amber-soft); border-color: var(--amber); }
  .notice .btn-ghost { margin-left: auto; }

  .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
  .stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: var(--shadow); padding: 14px 16px; min-width: 0;
  }
  .stat .label { font-size: 12px; color: var(--muted); }
  .stat .value {
    font-size: 22px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em;
    display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .stat .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meter { height: 6px; border-radius: 3px; margin-top: 10px; background: var(--blue-soft); overflow: hidden; }
  .meter > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width .4s; }
  .meter.warn { background: var(--amber-soft); } .meter.warn > span { background: var(--amber); }
  .meter.crit { background: var(--red-soft); }   .meter.crit > span { background: var(--red); }

  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .grid-2 > .card { margin-bottom: 16px; }

  dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; padding: 16px 18px; }
  dl.kv dt { color: var(--muted); }
  dl.kv dd { color: var(--text); min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

  .rows { border-top: 1px solid var(--border); }
  .row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; }
  .row + .row { border-top: 1px solid var(--border); }
  .row .main-t { font-weight: 500; }
  .row .sub-t { color: var(--muted); font-size: 12px; }
  .row .end { margin-left: auto; text-align: right; color: var(--text-2); font-size: 12px; white-space: nowrap; }
  .subhead { padding: 10px 18px 4px; font-size: 12px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--border); }

  /* State chips: colour plus a text label, never colour alone. */
  .state {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
    padding: 1px 8px; border-radius: 100px; background: var(--surface-2); color: var(--text-2);
    border: 1px solid var(--border); white-space: nowrap;
  }
  .state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
  .state.good { background: var(--green-soft); border-color: transparent; color: var(--green); }
  .state.good::before { background: var(--green); }
  .state.warn { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
  .state.warn::before { background: var(--amber); }
  .state.bad { background: var(--red-soft); border-color: transparent; color: var(--red); }
  .state.bad::before { background: var(--red); }

  table.data { width: 100%; border-collapse: collapse; }
  table.data th {
    text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
    padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
  }
  table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
  table.data tr:last-child td { border-bottom: none; }
  table.data tbody tr:hover td { background: var(--hover); }
  table.data .name { font-weight: 500; }
  table.data .muted { color: var(--muted); font-size: 12px; }
  table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
  .table-wrap { overflow-x: auto; }
  .empty-row td { text-align: center; color: var(--muted); padding: 24px; }

  /* Signal: bars + dBm + quality word; bar colour carries quality. */
  .sig { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
  .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
  .bars i { width: 3px; border-radius: 1px; background: var(--border-strong); }
  .bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; }
  .bars i:nth-child(3) { height: 10px; } .bars i:nth-child(4) { height: 12px; }
  .bars.good i.on { background: var(--green); }
  .bars.fair i.on { background: var(--amber); }
  .bars.poor i.on { background: var(--red); }

  @media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
  }

  /* ---------- Terminal ---------- */
  .quick-cmds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  .chip {
    height: 26px; padding: 0 10px; border-radius: 100px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2);
    font-family: var(--mono); font-size: 11px; transition: all .12s;
  }
  .chip:hover { border-color: var(--blue); color: var(--blue); }
  .chip.danger:hover { border-color: var(--red); color: var(--red); }
  .term {
    background: var(--term-bg); color: var(--term-text); border-radius: var(--radius);
    font-family: var(--mono); font-size: 12px; line-height: 1.6; padding: 12px 14px;
    height: 360px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  }
  .term .cmd { color: #6fb1ff; }
  .term .cmd::before { content: '$ '; color: #7e858f; }
  .term .sys { color: #7e858f; font-style: italic; }
  .term-input-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
  .term-input-row input { flex: 1; font-family: var(--mono); font-size: 12px; }
  .term-prompt { color: var(--muted); font-family: var(--mono); }

  /* ---------- Log ---------- */
  #log {
    font-family: var(--mono); font-size: 12px; line-height: 1.7; height: 420px; overflow-y: auto;
    padding: 10px 14px;
  }
  .log-ts { color: var(--muted); margin-right: 10px; }
  .log-info { color: var(--text); }
  .log-ok { color: var(--green); }
  .log-warn { color: var(--amber); }
  .log-error { color: var(--red); }
  .log-dim { color: var(--muted); }

  /* ---------- Toasts ---------- */
  #toasts {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center;
    width: calc(100% - 32px); max-width: 440px; pointer-events: none;
  }
  .toast {
    pointer-events: auto; width: 100%; display: flex; align-items: center; gap: 10px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-pop);
    padding: 11px 14px; font-size: 13px; animation: toastIn .18s ease;
  }
  .toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--blue); }
  .toast.ok::before { background: var(--green); }
  .toast.error::before { background: var(--red); }
  .toast.warn::before { background: var(--amber); }
  @keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

  /* ---------- Busy overlay ---------- */
  #busy {
    position: fixed; inset: 0; z-index: 900; display: none;
    align-items: center; justify-content: center; background: rgba(20, 22, 26, 0.28);
  }
  #busy.show { display: flex; }
  #busy .box {
    display: flex; align-items: center; gap: 12px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop);
    padding: 14px 18px;
  }
  .spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border-strong); border-top-color: var(--blue); animation: spin .7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---------- Narrow screens: rail becomes a top strip ---------- */
  @media (max-width: 640px) {
    .app { flex-direction: column; }
    .sidebar {
      width: 100%; height: auto; flex-direction: row; position: static;
      border-right: none; border-bottom: 1px solid var(--border); padding: 8px 12px;
    }
    .glyph { margin: 0 8px 0 0; }
    .nav { flex-direction: row; }
    .tab .tip { display: none; }
    .topbar { padding: 0 16px; position: static; }
    .topbar .sub { display: none; }
    .content { padding: 16px; }
    .device { flex-wrap: wrap; }
    .device .btn-row { margin-left: 0; width: 100%; }
    table.cfg td.k { width: 40%; }

  /* ---------- WiFi Scan ---------- */
  .scan-status {
    margin: 12px 0; padding: 10px 14px; border-radius: var(--radius);
    font-size: 0.875rem; background: var(--surface-2); border: 1px solid var(--border);
  }
  .scan-status.info { color: var(--text-2); }
  .scan-status.ok { color: var(--green); background: var(--green-soft); border-color: var(--green); }
  .scan-status.error { color: var(--red); background: var(--red-soft); border-color: var(--red); }
  .scan-table { margin-top: 12px; }
  .scan-table td .signal { font-weight: 600; }
  .scan-table td .signal.good { color: var(--green); }
  .scan-table td .signal.fair { color: var(--amber); }
  .scan-table td .signal.poor { color: var(--red); }
  .scan-table td .connect-btn { white-space: nowrap; }
