/* Compact mobile-first refinement. System/browser accessibility zoom remains
   under the OS's control; 16px inputs avoid Safari's automatic focus zoom. */
:root {
  --bg: #f2f5f5;
  --panel: #fff;
  --text: #182b31;
  --muted: #62747b;
  --line: #dde6e8;
  --accent: #147860;
  --accent2: #e7f5ee;
  --button-text: #fff;
  --shadow: 0 3px 16px #142b3505;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141a;
    --panel: #151f27;
    --text: #ecf3f5;
    --muted: #96a8b1;
    --line: #293740;
    --accent: #78dec0;
    --accent2: #193c33;
    --button-text: #082b20;
    --danger: #f39393;
    --warn: #efc17d;
    --shadow: 0 3px 16px #00000012;
    color-scheme: dark;
  }
}
[data-theme="light"] {
  --bg: #f2f5f5;
  --panel: #fff;
  --text: #182b31;
  --muted: #62747b;
  --line: #dde6e8;
  --accent: #147860;
  --accent2: #e7f5ee;
  --button-text: #fff;
  --danger: #b53d3d;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d141a;
  --panel: #151f27;
  --text: #ecf3f5;
  --muted: #96a8b1;
  --line: #293740;
  --accent: #78dec0;
  --accent2: #193c33;
  --button-text: #082b20;
  --danger: #f39393;
  color-scheme: dark;
}
html {
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-size: 14px;
  line-height: 1.5;
  overflow-x: clip;
}
button,
a,
input,
select,
textarea,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
input,
select,
textarea {
  font-size: 16px;
  min-height: 44px;
  background: var(--bg);
}
input[readonly] {
  color: var(--muted);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23778d98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}
input[type="checkbox"] {
  min-height: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
label {
  font-size: 12px;
}
h1,
h2,
h3 {
  letter-spacing: -0.025em;
}
h1 {
  font-size: 25px;
  line-height: 1.2;
}
.icon {
  width: 19px;
  height: 19px;
  flex: none;
  vertical-align: middle;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.help-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 0;
}
.server-location,
.selected-location {
  overflow-wrap: anywhere;
  white-space: normal;
}
.selected-location {
  color: var(--accent);
  font-size: 12px;
  margin: 6px 0 0;
}
.location-details {
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}
.location-details label { margin: 10px 0; }
.shell {
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100dvh;
}
.shell aside {
  background: #101c24;
  border-right: 1px solid #26343e;
  padding: 28px 14px 16px;
  height: 100dvh;
}
.brand {
  letter-spacing: -0.04em;
  padding-bottom: 30px;
}
.shell nav {
  gap: 5px;
}
.shell nav a {
  min-height: 44px;
  color: #9eafb9;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 550;
  gap: 12px;
}
.shell nav a.active {
  color: #88e5c8;
  background: #1b3534;
  box-shadow: inset 2px 0 #78dec0;
}
.aside-foot {
  border-top: 1px solid #26343e;
  font-size: 12px;
}
.link-btn {
  min-height: 44px;
}
.shell > header {
  grid-column: 2;
  justify-content: flex-start;
  gap: 12px;
  background: var(--bg);
  padding: 0 28px;
  z-index: 10;
}
.shell > header strong {
  font-size: 16px;
}
.shell > header #subtitle {
  font-size: 9px;
  letter-spacing: 0.14em;
}
.status-dot {
  margin-left: auto;
  font-size: 11px;
}
.status-dot i {
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.icon-btn {
  height: 44px;
  width: 44px;
  padding: 0;
  flex: none;
}
.menu-backdrop {
  display: none;
}
.icon-button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}
main {
  padding: 26px 28px 36px;
  max-width: 1240px;
  min-width: 0;
}
.card {
  min-width: 0;
  padding: 20px;
  border-radius: 15px;
}
.grid {
  gap: 16px;
}
.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
}
.text-link {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  text-decoration: none;
  color: var(--accent);
  min-height: 32px;
}
.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric {
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 8px;
}
.metric > span {
  grid-column: 1/3;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  font-weight: 550;
}
.metric .icon {
  width: 15px;
  height: 15px;
}
.metric b {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1.15;
  margin: 0;
}
.metric small {
  font-size: 10px;
  color: var(--muted);
}
.overview-hero {
  background: #163830
    radial-gradient(ellipse at 100% 0, #34645570, transparent 60%);
  border: 1px solid #285047;
  border-radius: 17px;
  color: #f0faf6;
  padding: 23px 24px 0;
  overflow: hidden;
}
.hero-heading,
.hero-main,
.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.eyebrow {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.overview-hero .eyebrow {
  color: #a9c6bd;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #b5d9cb;
}
.live-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8becbd;
  box-shadow: 0 0 0 4px #8becbd12;
}
.hero-main {
  margin: 18px 0;
}
.hero-main h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.045em;
}
.hero-main h1 span {
  color: #9ae7cc;
}
.hero-main p {
  font-size: 12px;
  color: #b0ccc1;
  margin: 0;
}
.hero-symbol {
  height: 75px;
  width: 75px;
  display: grid;
  place-items: center;
  border: 1px solid #8ee1bf33;
  border-radius: 22px;
  transform: rotate(-7deg);
  color: #9ce9cb;
  background: #73c6a410;
}
.hero-symbol .icon {
  height: 37px;
  width: 37px;
}
.hero-foot {
  border-top: 1px solid #ffffff17;
  padding: 12px 0;
  font-size: 11px;
  color: #b8d0c8;
}
.hero-foot > span,
.hero-foot a {
  display: flex;
  align-items: center;
  gap: 7px;
}
.hero-foot a {
  color: #dcfaed;
  text-decoration: none;
}
.hero-foot .icon {
  width: 15px;
  height: 15px;
}
.row {
  padding: 12px;
  gap: 11px;
  min-width: 0;
}
.row-main {
  min-width: 0;
  flex: 1;
}
.row strong {
  font-size: 13px;
}
.row small {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.compact-list {
  gap: 0;
}
.compact-list .row {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.compact-list .row:last-child {
  border-bottom: 0;
}
.bottom-note {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.device-summary {
  text-decoration: none;
  color: inherit;
  flex-wrap: nowrap;
}
.device-summary:hover {
  background: color-mix(in srgb, var(--accent2) 60%, transparent);
}
.device-summary strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-summary > .icon {
  width: 14px;
  color: var(--muted);
}
.device-icon,
.provider-mark {
  height: 38px;
  width: 38px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.badge {
  font-size: 10px;
  line-height: 1.4;
  padding: 4px 8px;
  display: inline-block;
  border-radius: 6px;
  font-weight: 600;
}
.badge.neutral {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.warning {
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
}
.badge.danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel));
}
.events-list .row {
  align-items: flex-start;
  gap: 10px;
}
.events-list .row strong {
  font-size: 12px;
  font-weight: 550;
}
.events-list .badge {
  font-size: 9px;
}
.events-list small {
  font-size: 10px;
}
.setup-shortcut {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
}
.setup-shortcut > div {
  flex: 1;
}
.setup-shortcut strong {
  display: block;
  font-size: 12px;
}
.setup-shortcut small {
  font-size: 11px;
  color: var(--muted);
}
.setup-shortcut > .icon {
  color: var(--muted);
}
.actions {
  align-items: center;
}
.btn {
  min-height: 42px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  line-height: 1.4;
  color: var(--button-text);
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn.secondary {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.btn.quiet {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  font-weight: 550;
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.page-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-toolbar h1 {
  font-size: 23px;
  margin: 0 0 6px;
}
.page-toolbar p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.provider-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}
.provider-card .section-head {
  margin-bottom: 18px;
}
.provider-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.provider-card > p {
  margin: 0 0 12px;
  font-size: 12px;
}
.provider-card .actions {
  margin-top: auto;
  padding-top: 6px;
}
.device-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 15px;
  padding: 16px;
  scroll-margin-top: 100px;
  box-shadow: var(--shadow);
}
.device-head {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 15px;
}
.device-head strong {
  display: block;
  font-size: 14px;
}
.device-name-button { display: flex; align-items: center; gap: 8px; text-align: left; color: var(--text); border: 0; background: transparent; padding: 0; min-height: 44px; width: 100%; cursor: pointer; font: inherit; }
.device-name-button strong { min-width: 0; overflow-wrap: anywhere; }
.device-name-button > span { flex: 0 0 auto; color: var(--accent); font-size: 18px; }
#profile-name-form { display: grid; gap: 10px; margin: 16px 0; }
#enrollment-dialog [data-enrollment-ready] { display: grid; gap: 12px; margin: 14px 0; }
#enrollment-dialog .code { overflow-wrap: anywhere; }
.device-head small {
  font-size: 11px;
  color: var(--muted);
}
.exit-control {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.exit-control > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  min-width: 96px;
}
.exit-control select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
}
.list {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.device-card .row-main {
  overflow-wrap: anywhere;
}
.server-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.server-controls .btn {
  min-height: 40px;
  font-size: 12px;
}
.server-filter {
  display: flex;
  align-items: end;
  gap: 16px;
  margin: 0 0 18px;
}
.server-filter label { flex: 1; max-width: 380px; min-width: 0; }
.server-filter > span { padding-bottom: 14px; font-size: 13px; white-space: nowrap; }
.managed-server { min-width: 0; }
.managed-server h2 { margin: 18px 0 6px; font-size: 19px; }
.managed-server p { margin: 6px 0; font-size: 14px; overflow-wrap: anywhere; }
.server-name-link {
  display: block;
  max-width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.server-name-link:hover { color: var(--accent); }
.server-card-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 20px; }
.favorite-button { padding: 0; width: 44px; min-height: 44px; }
.server-cards .profile-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.server-cards .profile-row-actions .btn { padding-inline: 14px; }
.provider-server-list {
  margin: 10px 0 14px;
}
.provider-server-list .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.provider-server-list .row-main {
  overflow-wrap: anywhere;
}
.provider-server-list .btn {
  flex: none;
  padding: 8px 10px;
  min-height: 44px;
  font-size: 11px;
}
dialog select,
dialog input,
dialog textarea {
  min-width: 0;
  max-width: 100%;
}
.device-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr .8fr;
  gap: 8px;
  margin-top: 12px;
}
.selected-device {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.connection-result { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.connection-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.connection-disclosure > summary { cursor: pointer; list-style: none; min-height: 44px; padding: 2px 0; }
.connection-disclosure > summary::-webkit-details-marker { display: none; }
.connection-disclosure > summary .connection-heading::after { content: "⌄"; color: var(--accent); }
.connection-disclosure[open] > summary .connection-heading::after { content: "⌃"; }
.connection-heading > strong { flex: 1; }
.connection-heading .badge { flex-shrink: 0; }
.connection-compact { display: block; color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.connection-disclosure[open] .connection-compact { display: none; }
.connection-body { padding-top: 8px; }
.connection-target { color: var(--muted); font-size: 12px; margin: 7px 0 14px; overflow-wrap: anywhere; }
.connection-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.connection-metric { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; background: var(--bg); }
.connection-metric > span { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.connection-metric .icon { width: 13px; height: 13px; }
.connection-metric > strong { display: block; font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-size: clamp(18px,4vw,28px); line-height: 1.25; margin: 10px 0 2px; overflow-wrap: anywhere; }
.connection-metric > small { color: var(--muted); font-size: 10px; }
.connection-metric.is-measuring { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 7%,var(--bg)); }
.connection-progress { height: 3px; border-radius: 3px; overflow: hidden; background: var(--line); margin-top: 15px; }
.connection-progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.connection-state { font-size: 12px; color: var(--accent); margin: 12px 0 4px; }
.connection-scope { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 5px 0 0; }
.connection-error { color: var(--danger,#e7a09d); font-size: 12px; overflow-wrap: anywhere; margin: 6px 0; }
.device-actions .btn { white-space: normal; }
@media (max-width: 700px) {
  .device-actions [data-revoke] { grid-column: 1 / -1; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .connection-progress i { transition: none; } }
[data-page="devices"] > .card {
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}
#device-sync {
  font-size: 10px;
  margin: 0 0 12px;
}
.device-server-field { min-width: 0; margin-bottom: 18px; }
.device-server-field > .btn { width: 100%; margin-top: 8px; min-height: 44px; }
.device-server-field > small { display: block; margin-top: 6px; color: var(--accent); }
.field-title { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.device-server-label { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.device-server-summary { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.device-server-summary > div { flex: 1; min-width: 0; }
.device-server-summary strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.device-server-summary > button { flex: 0 0 auto; min-height: 44px; }
.device-protocol { margin: 16px 0; }
#device-server-picker > label { display: block; margin-bottom: 18px; }
#device-server-picker .saved-connections { margin: 0 0 16px; }
.saved-connection-list { display: grid; gap: 8px; padding-top: 10px; }
.saved-connection-list button { white-space: normal; text-align: left; overflow-wrap: anywhere; }
#device-server-picker [data-server-editor] > div { margin: 0; padding: 0; }
dialog {
  border-radius: 20px;
  padding: 22px;
  width: min(570px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 90px #0004;
}
dialog::backdrop {
  background: #05131bcc;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 22px;
  margin: 3px 0 4px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.dialog-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  position: sticky;
  bottom: -22px;
  background: var(--panel);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.dialog-actions .btn {
  min-height: 44px;
}
.privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.privacy-note .icon {
  width: 12px;
  height: 12px;
}
.setup-help {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
}
.step-title {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 650;
}
.step-title > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--accent2);
  color: var(--accent);
  border-radius: 50%;
  font-size: 10px;
}
.setup-help p {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.6;
}
.help-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 7px 0 0;
}
.help-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  min-height: 36px;
  color: var(--accent);
}
.help-link:hover {
  text-decoration: underline;
}
.upload-box {
  border: 1px dashed color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px 10px;
  background: color-mix(in srgb, var(--accent2) 45%, var(--panel));
  cursor: pointer;
}
.upload-box.drag-over {
  border-style: solid;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  box-shadow: 0 0 0 2px var(--accent);
}
.upload-icon {
  grid-row: 1/3;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.upload-box strong {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.upload-box small {
  font-size: 10px;
  color: var(--muted);
}
.upload-box input {
  background: var(--panel);
  font-size: 16px;
  margin-top: 8px;
  padding: 6px;
  min-height: 36px;
}
.entry-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.entry-methods button {
  min-height: 44px;
  padding: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.entry-methods button[aria-pressed="true"] {
  background: var(--accent2);
  color: var(--accent);
}
.provider-links {
  margin: -4px 0;
  justify-content: space-between;
}
#provider-form .provider-basics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.credential-fields {
  display: grid;
  gap: 12px;
}
#provider-paste textarea {
  min-height: 112px;
  max-height: 180px;
}
.upload-box input::file-selector-button {
  background: var(--accent2);
  border: 0;
  border-radius: 5px;
  color: var(--accent);
  padding: 7px;
  font-size: 12px;
  margin-right: 10px;
}
.disclosure {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.disclosure summary {
  cursor: pointer;
  font-size: 12px;
  min-height: 34px;
  padding: 6px 0;
  font-weight: 550;
  color: var(--muted);
}
.disclosure[open] summary {
  color: var(--text);
  margin-bottom: 10px;
}
.disclosure > form {
  margin-top: 6px;
}
.file-summary {
  min-width: 0;
  overflow-wrap: anywhere;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  color: var(--accent);
}
.file-summary > div {
  min-width: 0;
}
.config-import-summary { display: grid; gap: 8px; min-width: 0; }
.import-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.import-fields label { min-width: 0; }
.import-fields output { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.import-filename { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.import-filename svg { flex: 0 0 16px; width: 16px; height: 16px; }
.file-summary strong {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.file-summary small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.inline-error {
  color: var(--danger);
  font-size: 12px;
  border-left: 3px solid var(--danger);
  padding: 8px 10px;
  margin: 0;
  background: color-mix(in srgb, var(--danger) 7%, var(--panel));
}
.facts {
  margin: 0 0 16px;
}
.facts > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-size: 10px;
  color: var(--muted);
}
.facts dd {
  margin: 4px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.cloudflare-card {
  grid-column: 1/-1;
}
.ip-summary {
  display: grid;
  gap: 2px;
  padding: 12px 0;
}
.ip-summary > span {
  color: var(--muted);
  font-size: 10px;
}
.ip-summary strong {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ip-summary small {
  color: var(--muted);
  font-size: 10px;
}
.settings-grid {
  align-items: start;
}
.notice.compact {
  font-size: 11px;
  margin: 14px 0 0;
}
.empty {
  font-size: 12px;
  padding: 24px 12px;
}
.auth-shell {
  min-height: 100dvh;
  background: var(--bg);
}
.auth-card {
  max-width: 430px;
}
.auth-card p {
  font-size: 13px;
  color: var(--muted);
}
#toast {
  max-width: min(440px, calc(100% - 28px));
  font-size: 12px;
  bottom: max(20px, env(safe-area-inset-bottom));
}
@media (max-width: 1000px) {
  .three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two {
    grid-template-columns: 1fr;
  }
  .metric {
    grid-template-columns: 1fr;
  }
  .metric small {
    grid-column: 1;
  }
  .metric > span {
    grid-column: 1;
  }
}
@media (max-width: 920px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 66px 1fr;
  }
  .shell aside {
    z-index: 30;
    left: 0;
    top: 0;
    width: 260px;
    visibility: hidden;
    padding-top: max(26px, env(safe-area-inset-top));
  }
  .shell.menu-open aside {
    visibility: visible;
  }
  .shell > header {
    grid-column: 1;
    padding: 0 16px 0 8px;
  }
  .menu-open .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: #031119a8;
    border: 0;
    backdrop-filter: blur(2px);
  }
  body:has(.menu-open) {
    overflow: hidden;
  }
  main {
    padding: 18px;
    max-width: 780px;
    margin: 0 auto;
  }
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .metric {
    padding: 14px 12px;
  }
  .metric > span {
    font-size: 10px;
  }
}
@media (max-width: 540px) {
  body {
    touch-action: pan-x pan-y;
  }
  .shell {
    grid-template-rows: 62px 1fr;
  }
  .shell > header strong {
    font-size: 15px;
  }
  .shell > header #subtitle {
    font-size: 8px;
  }
  .status-dot span {
    display: none;
  }
  main {
    padding: 14px 14px calc(26px + env(safe-area-inset-bottom));
  }
  .grid {
    gap: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 12px 0;
  }
  .metric {
    padding: 12px 14px;
    grid-template-columns: 1fr auto;
    min-height: 89px;
  }
  .metric > span {
    grid-column: 1/3;
    font-size: 10px;
  }
  .metric b {
    font-size: 28px;
  }
  .metric small {
    grid-column: 2;
    font-size: 9px;
  }
  .card {
    padding: 16px;
    border-radius: 13px;
  }
  .overview-hero {
    padding: 17px 17px 0;
    border-radius: 14px;
  }
  .hero-main h1 {
    font-size: 25px;
  }
  .hero-main p {
    font-size: 11px;
  }
  .hero-symbol {
    width: 45px;
    height: 52px;
    border-radius: 13px;
  }
  .hero-symbol .icon {
    height: 29px;
    width: 29px;
  }
  .hero-heading .eyebrow {
    font-size: 8px;
  }
  .live-label {
    font-size: 8px;
  }
  .hero-foot {
    font-size: 9px;
    gap: 8px;
  }
  .hero-foot .icon {
    width: 12px;
    height: 12px;
  }
  .hero-main {
    margin: 17px 0 15px;
  }
  .three,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .page-toolbar {
    align-items: flex-start;
    margin-bottom: 15px;
  }
  .page-toolbar h1 {
    font-size: 21px;
  }
  .page-toolbar p {
    font-size: 11px;
  }
  .page-toolbar:has(#add-provider) {
    display: block;
  }
  .page-toolbar #add-provider {
    margin-top: 12px;
  }
  .section-head {
    margin-bottom: 7px;
  }
  .section-head h2 {
    font-size: 14px;
  }
  .device-summary.row {
    gap: 9px;
    flex-direction: row;
    align-items: center;
  }
  .device-summary .device-icon {
    width: 31px;
    height: 35px;
    border-radius: 8px;
  }
  .device-summary .row-main strong {
    font-size: 12px;
  }
  .device-summary .row-main small {
    font-size: 10px;
  }
  .device-summary > .icon {
    display: none;
  }
  .device-summary .badge {
    font-size: 9px;
    padding: 4px 6px;
  }
  .compact-list .row {
    padding: 11px 0;
  }
  .bottom-note {
    font-size: 10px;
  }
  .setup-shortcut {
    padding: 13px;
    margin-top: 12px;
    gap: 10px;
  }
  .setup-shortcut strong {
    font-size: 11px;
  }
  .setup-shortcut small {
    font-size: 10px;
    display: block;
  }
  .setup-shortcut .provider-mark {
    width: 32px;
    height: 36px;
  }
  .device-card {
    padding: 14px;
  }
  .device-head {
    gap: 9px;
    flex-wrap: wrap;
  }
  .device-head .row-main {
    min-width: 0;
    flex: 1;
  }
  .device-head > span:last-child {
    margin-left: auto;
  }
  .device-head strong {
    font-size: 13px;
  }
  .device-head small {
    font-size: 10px;
  }
  .device-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .exit-control > span {
    font-size: 10px;
    min-width: 0;
  }
  .exit-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .btn {
    min-height: 44px;
  }
  .row:not(.device-summary) {
    flex-wrap: wrap;
  }
  .auth-card {
    padding: 24px;
  }
  dialog {
    padding: 18px;
    width: calc(100% - 16px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
  dialog h2 {
    font-size: 21px;
  }
  .dialog-actions {
    bottom: -18px;
    margin-bottom: -3px;
  }
  .dialog-actions .btn {
    flex: 1;
  }
  .credential-fields {
    gap: 10px;
  }
  .settings-grid .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #toast {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}
.nord-location-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nord-location-fields label,
.nord-selection,
#server-host,
#nord-server {
  min-width: 0;
}
.nord-selection select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.nord-selection > label {
  margin-top: 12px;
}
.picker-toggle,
.picker-retry {
  min-height: 44px;
  padding: 8px 0;
  text-align: left;
  font-size: 14px;
}
.profile-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-row-actions .btn {
  min-height: 44px;
  padding: 7px 10px;
}
.danger-text {
  color: var(--danger, #e7a09d);
}
.unlimited-setup,
.unlimited-setup > div {
  min-width: 0;
}
.unlimited-setup label {
  min-width: 0;
}
.unlimited-setup select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.field-alias {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.field-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px 8px;
}
.unlimited-setup .provider-links {
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.unlimited-setup .provider-links .help-text {
  margin: 0;
}
.unlimited-setup .credential-fields {
  margin-top: 12px;
}
@media (max-width: 600px) {
  #provider-form .provider-basics {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  #provider-form:has(#unlimited-setup:not([hidden])) {
    gap: 10px;
  }
  .provider-server-list .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .profile-row-actions {
    justify-content: flex-end;
  }
}
.provider-password { display: flex; gap: 8px; min-width: 0; }
.provider-password input { min-width: 0; flex: 1; }
.provider-password button { flex: 0 0 auto; }
#provider-edit-dialog [data-location] { overflow-wrap: anywhere; }
#provider-edit-dialog textarea { max-width: 100%; overflow-wrap: anywhere; }

/* Live VPS measurement; only measured samples move the needle. */
.speed-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.speed-toolbar .btn { min-height: 44px; padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
.speed-toolbar .help-text { margin: 0; font-size: 11px; line-height: 1.4; }
.speed-live { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 0 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg); }
.speed-dial { position: relative; width: 120px; margin: 0; grid-row: 1 / 3; }
.speed-dial svg { display: block; width: 100%; overflow: visible; }
.speed-track, .speed-arc { fill: none; stroke-width: 10; stroke-linecap: round; }
.speed-track { stroke: var(--line); }
.speed-arc { stroke: var(--accent); stroke-dasharray: 0 100; transition: stroke-dasharray .45s ease-out; }
.speed-needle { transform: rotate(-90deg); transform-origin: 160px 155px; transition: transform .45s ease-out; }
.speed-needle path { fill: var(--accent); }
.speed-dial text { display: none; }
.speed-reading { position: absolute; top: 42%; left: 18%; right: 18%; display: grid; justify-items: center; background: var(--bg); border-radius: 8px; padding: 0; }
.speed-reading strong { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.speed-reading span { line-height: 1; font-size: 9px; color: var(--muted); }
.speed-phase-label { align-self: end; margin: 0 0 3px; font-size: 13px; line-height: 1.35; font-weight: 600; }
.speed-live-note { margin: 0; font-size: 11px; }
.speed-live [data-live-metrics] { grid-column: 1 / -1; margin-top: 8px; }
.speed-preview .connection-metrics { gap: 6px; }
.speed-preview .connection-metric { padding: 6px 8px; border-radius: 8px; }
.speed-preview .connection-metric > span { font-size: 10px; }
.speed-preview .connection-metric > strong { display: inline; font-size: 18px; margin: 0 4px 0 0; line-height: 1.4; }
.speed-preview .connection-metric > small { font-size: 9px; white-space: nowrap; }
.speed-preview [data-preview-result] > .help-text, .speed-preview .connection-error { margin: 6px 0 0; font-size: 11px; }
@media (max-width: 360px) { .speed-live { grid-template-columns: 100px minmax(0,1fr); gap: 0 8px; } .speed-dial { width: 100px; } .speed-reading strong { font-size: 19px; } .speed-toolbar { gap: 8px; } .speed-toolbar .btn { padding-inline: 8px; } }
@media (prefers-reduced-motion: reduce) { .speed-needle, .speed-arc { transition: none; } }

.speed-preview [data-preview-result] { scroll-margin-block: 12px 100px; }

.search-select { position: relative; min-width: 0; }
.search-select input { padding-right: 30px; cursor: text; }
.search-select::after { content: "⌄"; position: absolute; right: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.search-options { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; background: var(--bg); padding: 4px; }
.search-options [role=option] { padding: 9px 10px; min-height: 40px; font-size: 14px; font-weight: 400; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; border-radius: 6px; }
.search-options [role=option]:hover, .search-options .is-active { background: color-mix(in srgb,var(--accent) 14%,var(--bg)); }
.search-options [aria-selected=true] { color: var(--accent); font-weight: 600; }
.search-empty { padding: 8px; margin: 0; font-size: 13px; color: var(--muted); }

.search-label { align-content: start; }

.saved-connection-list button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }

/* CSP-safe spacing and discrete connection-test progress. */
.actions.page-actions { margin-bottom: 16px; }
.actions.spread-actions { justify-content: space-between; }
.connection-progress .progress-step-0 { width: 0; }
.connection-progress .progress-step-1 { width: 33.333333%; }
.connection-progress .progress-step-2 { width: 66.666667%; }
.connection-progress .progress-step-3 { width: 100%; }

/* Keep events below devices on every viewport. Connection and exit are distinct. */
.dashboard-details { grid-template-columns: minmax(0, 1fr); }
.device-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.device-status small { color: var(--muted); font-size: 12px; line-height: 1.4; white-space: normal; }
.device-status .route-warning { color: var(--warn); }
.device-summary [data-device-health] { flex-shrink: 0; max-width: 45%; }
.device-summary .server-location { display: block; }
