/* «Подключения» — светлая и тёмная темы задаются токенами ниже, компоненты берут цвета только из них. */
:root {
  --bg: #eef1ef;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #e8ecea;
  --line: #dce2de;
  --line-strong: #c3cbc6;
  --text: #16201b;
  --muted: #56635c;
  --faint: #7f8b85;
  --accent: #0e6b50;
  --accent-hover: #0a5a43;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe6;
  --accent-text: #0b5c44;
  --danger: #b42318;
  --danger-ink: #ffffff;
  --danger-soft: #fcebea;
  --warn-soft: #fff1cf;
  --warn-text: #7a4d00;
  --focus: #16906a;
  --overlay: rgb(10 18 14 / 0.46);
  --toast-bg: #17211c;
  --toast-ink: #eef3f0;
  --shadow-1: 0 1px 2px rgb(16 28 22 / 0.06);
  --shadow-2: 0 12px 32px rgb(16 28 22 / 0.18);
  --k-anydesk: #d6402c;
  --k-rustdesk: #2b66d6;
  --k-assistant: #d9730b;
  --k-rudesktop: #b2306c;
  --k-rdp: #0a76b6;
  --k-vnc: #6853c7;
  --k-ssh: #4b5661;
  --k-web: #11806e;
  --k-other: #7d8681;
  --radius: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311;
    --surface: #151b18;
    --surface-2: #19211d;
    --surface-3: #222c27;
    --line: #28322d;
    --line-strong: #38443e;
    --text: #e2e9e5;
    --muted: #a0ada6;
    --faint: #75827b;
    --accent: #36b184;
    --accent-hover: #4bc497;
    --accent-ink: #04120c;
    --accent-soft: #15372a;
    --accent-text: #6fd3aa;
    --danger: #ff7d70;
    --danger-ink: #1b0503;
    --danger-soft: #3a1714;
    --warn-soft: #3a2c0d;
    --warn-text: #f1c26a;
    --focus: #4bc497;
    --overlay: rgb(0 0 0 / 0.6);
    --toast-bg: #e2e9e5;
    --toast-ink: #101613;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-2: 0 12px 32px rgb(0 0 0 / 0.5);
    --k-anydesk: #f06450;
    --k-rustdesk: #5d8ef2;
    --k-assistant: #f29a3d;
    --k-rudesktop: #de5c98;
    --k-rdp: #3ea3df;
    --k-vnc: #9784ee;
    --k-ssh: #9ba7b1;
    --k-web: #3db5a2;
    --k-other: #9aa39e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1311;
  --surface: #151b18;
  --surface-2: #19211d;
  --surface-3: #222c27;
  --line: #28322d;
  --line-strong: #38443e;
  --text: #e2e9e5;
  --muted: #a0ada6;
  --faint: #75827b;
  --accent: #36b184;
  --accent-hover: #4bc497;
  --accent-ink: #04120c;
  --accent-soft: #15372a;
  --accent-text: #6fd3aa;
  --danger: #ff7d70;
  --danger-ink: #1b0503;
  --danger-soft: #3a1714;
  --warn-soft: #3a2c0d;
  --warn-text: #f1c26a;
  --focus: #4bc497;
  --overlay: rgb(0 0 0 / 0.6);
  --toast-bg: #e2e9e5;
  --toast-ink: #101613;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-2: 0 12px 32px rgb(0 0 0 / 0.5);
  --k-anydesk: #f06450;
  --k-rustdesk: #5d8ef2;
  --k-assistant: #f29a3d;
  --k-rudesktop: #de5c98;
  --k-rdp: #3ea3df;
  --k-vnc: #9784ee;
  --k-ssh: #9ba7b1;
  --k-web: #3db5a2;
  --k-other: #9aa39e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { width: 16px; height: 16px; flex: none; }
.mono, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font: 600 11.5px/1 var(--mono);
}
.boot, .loading { padding: 40px; color: var(--faint); }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* --- каркас --- */
.shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.view { display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand-mark .i { width: 18px; height: 18px; }
.search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 560px; }
.search > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 35px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus {
  outline: none;
  border-color: var(--focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }

.menu { position: relative; }
.menu > summary {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover .avatar { background: var(--line); }
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
}
.menu-pop .who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-pop .who .muted { font-size: 12.5px; }
.menu-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.menu-pop button:hover { background: var(--surface-3); }
.menu-pop button .i { color: var(--muted); }

/* --- кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.sm .i { width: 15px; height: 15px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-text); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* --- метки --- */
.kind {
  --kc: var(--k-other);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--kc) 13%, var(--surface));
  color: color-mix(in srgb, var(--kc) 78%, var(--text));
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.kind::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--kc); }
.kdot { --kc: var(--k-other); width: 9px; height: 9px; border-radius: 3px; background: var(--kc); }
[data-kind="anydesk"] { --kc: var(--k-anydesk); }
[data-kind="rustdesk"] { --kc: var(--k-rustdesk); }
[data-kind="assistant"] { --kc: var(--k-assistant); }
[data-kind="rudesktop"] { --kc: var(--k-rudesktop); }
[data-kind="rdp"] { --kc: var(--k-rdp); }
[data-kind="vnc"] { --kc: var(--k-vnc); }
[data-kind="ssh"] { --kc: var(--k-ssh); }
[data-kind="web"] { --kc: var(--k-web); }
[data-kind="other"] { --kc: var(--k-other); }
.pill {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.count { color: var(--faint); font-weight: 600; margin-left: 4px; }

/* --- клиенты: список и карточка --- */
.main { display: grid; grid-template-columns: minmax(290px, 380px) minmax(0, 1fr); min-height: 0; }
.list-pane { min-height: 0; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); }
.detail-pane, .page { min-height: 0; overflow-y: auto; padding: 26px 32px 56px; }
.page-inner { max-width: 1120px; margin: 0 auto; }
.list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 8px;
  background: var(--surface);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.list-head .btn { letter-spacing: 0; text-transform: none; }
.client-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.client-item:hover { background: var(--surface-2); }
.client-item[aria-current="true"] { background: var(--accent-soft); }
.ci-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ci-kinds { display: flex; gap: 4px; }
.ci-meta { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.list-empty, .list-more { padding: 18px 16px; color: var(--muted); }
.list-more { border-top: 1px solid var(--line); font-size: 12.5px; }
.recent { display: grid; padding: 0 8px 10px; }
.recent-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.recent-item:hover { background: var(--surface-2); }
.ri-text { display: grid; min-width: 0; color: inherit; text-decoration: none; }
.ri-client, .ri-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-client { font-weight: 600; }
.ri-sub { color: var(--muted); font-size: 12.5px; }

.back-link { display: none; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); font-weight: 600; text-decoration: none; }
.client-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.client-head h1 { margin: 0; font-size: 22px; font-weight: 650; line-height: 1.25; }
.head-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 0; }
.facts dt, .cf dt { margin-bottom: 1px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.facts dd { margin: 0; }
.notes {
  max-width: 78ch;
  margin-top: 16px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.conn-list { display: grid; gap: 12px; }
.conn {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.conn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.conn-title { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 650; }
.conn-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.conn-actions .btn { margin-right: 4px; }
.conn-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 22px; margin: 0; }
.cf { min-width: 0; }
.cf dd { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0; }
.cf .value { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.cf .value.masked { color: var(--faint); letter-spacing: 0.1em; }
.cf .pill { margin-left: 6px; }
.conn-notes { margin: 0; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.conn-foot { color: var(--faint); font-size: 12.5px; }
.meta-line { margin-top: 26px; color: var(--faint); font-size: 12.5px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 20px; color: var(--muted); text-align: center; }
.empty h2 { margin: 0; color: var(--text); font-size: 17px; }
.empty p { margin: 0; max-width: 46ch; }
.empty.small { padding: 30px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.welcome { max-width: 560px; margin: 8vh auto 0; }
.welcome h1 { margin: 0 0 8px; font-size: 22px; }
.welcome p { margin: 0 0 18px; color: var(--muted); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- страницы администратора --- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 650; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar select, .toolbar input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.toolbar input { width: min(280px, 100%); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 4px 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .nowrap { white-space: nowrap; }
.table .details { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.more-row { display: flex; justify-content: center; padding: 14px; }
.section-title { margin: 28px 0 10px; font-size: 16px; font-weight: 650; }
.card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 16px; }
.card > .section-title:first-child { margin-top: 0; }
.card p { max-width: 75ch; margin: 0 0 14px; }
.download-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 20px; }
.steps { display: grid; gap: 14px; max-width: 75ch; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}
.note-text { max-width: 75ch; color: var(--muted); font-size: 13px; }
.notice {
  padding: 10px 12px;
  background: var(--warn-soft);
  border-radius: 8px;
  color: var(--warn-text);
  font-size: 13.5px;
}

/* --- формы и окна --- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span:first-child { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:not([type="checkbox"]):focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.hint { color: var(--faint); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 66px; }
.pw-tools { position: absolute; top: 50%; right: 5px; display: flex; gap: 2px; transform: translateY(-50%); }
.form-error { padding: 8px 11px; background: var(--danger-soft); border-radius: 8px; color: var(--danger); font-size: 13px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 7vh 16px 16px;
  overflow-y: auto;
  background: var(--overlay);
}
.modal { width: min(580px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
.modal-body { padding: 16px 20px; }
.modal-body > p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }

.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-card {
  width: min(380px, 100%);
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}
.auth-card h1 { margin: 6px 0 4px; font-size: 20px; }
.auth-card p { margin: 0; color: var(--muted); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(390px, calc(100vw - 32px)); }
.toast {
  padding: 11px 14px;
  background: var(--toast-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  color: var(--toast-ink);
  font-size: 13.5px;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.error { background: var(--danger); color: var(--danger-ink); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast .sub { margin-top: 3px; font-size: 12.5px; opacity: 0.82; }
.toast a { color: inherit; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search kbd { display: none; }
  .nav a { padding: 7px 8px; }
  .nav a span { display: none; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .main.has-client .list-pane, .main:not(.has-client) .detail-pane { display: none; }
  .list-pane { border-right: 0; }
  .detail-pane, .page { padding: 18px 16px 48px; }
  .back-link { display: inline-flex; }
  .client-head { flex-direction: column; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .conn-actions { width: 100%; margin-left: 0; }
  .conn-actions .btn { flex: 1; }
}

@media (max-width: 480px) {
  .topbar .brand > span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
