:root {
  color-scheme: light dark;
  --accent: #0071e3;
  --accent-pressed: #005bbd;
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff3b30;
  --label: #1d1d1f;
  --secondary-label: rgba(60, 60, 67, .72);
  --tertiary-label: rgba(60, 60, 67, .48);
  --placeholder: rgba(60, 60, 67, .34);
  --system-bg: #f5f5f7;
  --window-bg: #ffffff;
  --sidebar-bg: #f2f2f7;
  --content-bg: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --control: rgba(118, 118, 128, .12);
  --control-hover: rgba(118, 118, 128, .18);
  --selected: rgba(0, 113, 227, .14);
  --separator: rgba(60, 60, 67, .18);
  --opaque-separator: rgba(60, 60, 67, .28);
  --shadow: 0 24px 70px rgba(0, 0, 0, .14);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .64);
  --radius-window: 22px;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --focus: 0 0 0 4px rgba(0, 113, 227, .22);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0a84ff;
    --accent-pressed: #409cff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --label: #f5f5f7;
    --secondary-label: rgba(235, 235, 245, .72);
    --tertiary-label: rgba(235, 235, 245, .46);
    --placeholder: rgba(235, 235, 245, .32);
    --system-bg: #1c1c1e;
    --window-bg: #1c1c1e;
    --sidebar-bg: #2c2c2e;
    --content-bg: #1c1c1e;
    --surface: #2c2c2e;
    --surface-solid: #2c2c2e;
    --control: rgba(120, 120, 128, .22);
    --control-hover: rgba(120, 120, 128, .32);
    --selected: rgba(10, 132, 255, .2);
    --separator: rgba(84, 84, 88, .48);
    --opaque-separator: rgba(84, 84, 88, .64);
    --shadow: 0 36px 100px rgba(0, 0, 0, .52);
    --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .08);
    --focus: 0 0 0 4px rgba(10, 132, 255, .26);
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --window-bg: #ffffff;
    --sidebar-bg: #f2f2f7;
    --content-bg: #ffffff;
    --surface: #ffffff;
  }
}

@media (prefers-color-scheme: dark) and (prefers-reduced-transparency: reduce) {
  :root {
    --window-bg: #1c1c1e;
    --sidebar-bg: #2c2c2e;
    --content-bg: #1c1c1e;
    --surface: #2c2c2e;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--system-bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--control);
  color: var(--label);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .94em;
}

.vpn-shell {
  width: min(1540px, calc(100% - 40px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 0 34px;
}

.vpn-window {
  min-height: calc(100dvh - 60px);
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: var(--radius-window);
  background: var(--window-bg);
  box-shadow: var(--shadow);
}

.titlebar {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--separator);
  background: var(--window-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

@media (prefers-color-scheme: dark) {
  .titlebar { background: var(--window-bg); }
}

.traffic {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-left: 4px;
}

.traffic span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18);
}

.traffic-red { background: #ff5f57; }
.traffic-yellow { background: #ffbd2e; }
.traffic-green { background: #28c840; }

.titlebar-title {
  justify-self: center;
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toolbar-icon,
.icon-button,
.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary-label);
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.toolbar-icon:hover,
.icon-button:hover,
.sheet-close:hover {
  background: var(--control-hover);
  color: var(--label);
}

.toolbar-icon:active,
.icon-button:active,
.sheet-close:active,
.primary-button:active,
.secondary-button:active,
.nav-item:active {
  transform: scale(.98);
}

.app-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100dvh - 112px);
  background: var(--content-bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--separator);
  background: var(--sidebar-bg);
}

.sidebar-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, #0a84ff, #006edb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 113, 227, .22), var(--inner-highlight);
}

.app-name {
  overflow: hidden;
  color: var(--label);
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-subtitle {
  margin-top: 2px;
  color: var(--secondary-label);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.global-nav {
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary-label);
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-item svg {
  width: 16px;
  height: 16px;
}

.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item strong {
  color: var(--tertiary-label);
  font-size: 12px;
  font-weight: 650;
}

.nav-item:hover {
  background: var(--control);
  color: var(--label);
}

.nav-item.active {
  background: var(--selected);
  color: var(--label);
}

.nav-item.active strong {
  color: var(--accent);
}

.global-nav .nav-item {
  min-height: 38px;
}

.global-nav .nav-item strong {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.section-label {
  padding: 12px 14px 0;
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 700;
}

.create-form {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.sidebar-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  background: rgba(118, 118, 128, .14);
  color: var(--secondary-label);
}

.sidebar-search:focus-within {
  background: rgba(118, 118, 128, .18);
  box-shadow: var(--focus);
}

.sidebar-search svg {
  width: 15px;
  height: 15px;
}

.sidebar-search input {
  min-width: 0;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--label);
  outline: 2px solid transparent;
}

.sidebar-search input::placeholder {
  color: var(--placeholder);
}

.sidebar-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 2px 0;
  border-top: 1px solid var(--separator);
  background: transparent;
}

.sidebar-status div {
  min-width: 0;
}

.sidebar-status span {
  display: block;
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status strong {
  display: block;
  margin-top: 3px;
  color: var(--label);
  font-size: 17px;
  line-height: 1;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.route-picker legend {
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 650;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--surface);
  color: var(--label);
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--inner-highlight);
  transition: border-color .16s ease, box-shadow .16s ease;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--placeholder);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.route-picker {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.route-picker legend {
  padding: 0 0 1px;
}

.route-option {
  cursor: pointer;
}

.route-group {
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--surface);
}

.route-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.route-option > span {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  grid-template-areas:
    "icon title mark"
    "icon note mark";
  gap: 2px 10px;
  min-height: 58px;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--secondary-label);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.route-option + .route-option > span {
  border-top: 1px solid var(--separator);
}

.route-option svg {
  grid-area: icon;
  align-self: center;
  width: 18px;
  height: 18px;
}

.route-option strong {
  grid-area: title;
  color: var(--label);
  font-size: 14px;
  line-height: 1.15;
}

.route-option small {
  grid-area: note;
  color: var(--secondary-label);
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

.route-option:hover > span {
  background: var(--control);
}

.route-option input:checked + span {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
}

.route-option > span::after {
  content: "";
  grid-area: mark;
  align-self: center;
  justify-self: end;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.route-option input:checked + span::after {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 650;
  transition: background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.primary-button:hover {
  background: var(--accent-pressed);
}

.secondary-button {
  background: var(--control);
  color: var(--label);
}

.secondary-button:hover {
  background: var(--control-hover);
}

.support-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
  color: var(--secondary-label);
}

.support-note svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.support-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.42;
}

.content {
  min-width: 0;
  padding: 28px;
  background: var(--content-bg);
}

.content-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.content-toolbar h1 {
  margin: 0;
  color: var(--label);
  font-size: 34px;
  line-height: 1;
  font-weight: 750;
}

.content-toolbar p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--secondary-label);
  font-size: 14px;
  line-height: 1.4;
}

.content-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.page-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.filter-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--control);
}

.filter-strip .nav-item {
  min-height: 32px;
}

.page-search {
  width: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-link {
  min-width: 0;
}

.metric-card {
  display: grid;
  align-content: space-between;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--surface);
  transition: background .16s ease, transform .16s ease;
}

.metric-link .metric-card:hover {
  background: color-mix(in srgb, var(--control) 72%, var(--surface));
}

.metric-link .metric-card:active {
  transform: scale(.99);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  overflow: hidden;
  color: var(--label);
  font-size: 28px;
  line-height: 1;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card p {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 680;
}

.health-badge > span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tertiary-label);
}

.health-badge.ok > span,
.status-row.ok .state-light,
.metric-card.ok .health-badge > span {
  background: var(--green);
}

.health-badge.warn > span,
.status-row.warn .state-light,
.metric-card.warn .health-badge > span {
  background: var(--orange);
}

.health-badge.bad > span,
.status-row.bad .state-light,
.metric-card.bad .health-badge > span {
  background: var(--red);
}

.monitor-panel {
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--surface);
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--separator);
}

.panel-head h2 {
  margin: 0;
  color: var(--label);
  font-size: 18px;
  line-height: 1.15;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--secondary-label);
  font-size: 13px;
}

.status-table {
  display: grid;
}

.status-row {
  display: grid;
  grid-template-columns: 12px minmax(150px, .7fr) minmax(120px, .45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 16px;
  border-top: 1px solid var(--separator);
}

.status-row:first-child {
  border-top: 0;
}

.status-row strong {
  overflow: hidden;
  color: var(--label);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-row span:not(.state-light) {
  overflow: hidden;
  color: var(--label);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-row small {
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-screen {
  position: relative;
  overflow: hidden;
  min-height: calc(100dvh - 112px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 72%, var(--content-bg)), var(--content-bg));
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

.home-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

.home-hero h1 {
  margin: 0;
  color: var(--label);
  font-size: 52px;
  line-height: .96;
  font-weight: 780;
}

.home-hero p:not(.home-kicker) {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--secondary-label);
  font-size: 17px;
  line-height: 1.32;
}

.home-time {
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 132px;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.home-time span {
  color: var(--secondary-label);
  font-size: 11px;
  font-weight: 650;
}

.home-time strong {
  color: var(--label);
  font-size: 20px;
  line-height: 1;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(420px, .92fr) minmax(360px, 1fr);
  gap: 26px;
  align-items: start;
}

.home-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.home-widget-link {
  display: block;
  min-width: 0;
}

.home-widget-link:first-child {
  grid-column: 1 / -1;
}

.home-widget {
  display: grid;
  align-content: space-between;
  min-height: 176px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--separator) 70%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .08), var(--inner-highlight);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-widget-link:hover .home-widget {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--separator));
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}

.home-widget-link:active .home-widget {
  transform: scale(.985);
}

.home-widget header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-widget-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.accent-blue .home-widget-icon,
.accent-blue .home-app-icon { background: linear-gradient(180deg, #0a84ff, #006edb); }

.accent-green .home-widget-icon,
.accent-green .home-app-icon { background: linear-gradient(180deg, #34c759, #1f9d47); }

.accent-orange .home-widget-icon,
.accent-orange .home-app-icon { background: linear-gradient(180deg, #ff9f0a, #d97800); }

.accent-purple .home-widget-icon,
.accent-purple .home-app-icon { background: linear-gradient(180deg, #bf5af2, #7d3ec8); }

.accent-gray .home-widget-icon,
.accent-gray .home-app-icon { background: linear-gradient(180deg, #8e8e93, #54545a); }

.home-widget-body {
  min-width: 0;
  margin-top: 22px;
}

.home-widget-body span {
  display: block;
  color: var(--secondary-label);
  font-size: 13px;
  font-weight: 680;
}

.home-widget-body strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--label);
  font-size: 34px;
  line-height: 1;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-widget-body p {
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 13px;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-traffic,
.widget-mini-grid {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.widget-traffic {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.widget-traffic span,
.widget-mini-grid span {
  display: grid;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--control);
}

.widget-traffic span {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.widget-traffic svg {
  color: var(--accent);
}

.widget-traffic strong,
.widget-mini-grid strong {
  overflow: hidden;
  color: var(--label);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.widget-mini-grid small {
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-launchpad {
  min-width: 0;
  padding-top: 4px;
}

.launchpad-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 18px;
}

.launchpad-head h2 {
  margin: 0;
  color: var(--label);
  font-size: 24px;
  line-height: 1.08;
}

.launchpad-head p {
  margin: 6px 0 0;
  color: var(--secondary-label);
  font-size: 13px;
}

.home-apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 22px 16px;
}

.home-app {
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: 4px;
  border-radius: 18px;
  color: var(--label);
  text-align: center;
  transition: transform .18s ease, background .18s ease;
}

.home-app:hover {
  background: var(--control);
}

.home-app:active {
  transform: scale(.96);
}

.home-app-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.home-app-icon svg {
  width: 28px;
  height: 28px;
}

.home-app-title {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-app small {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-dock {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 28px auto 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--separator) 72%, transparent);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .12), var(--inner-highlight);
}

.dock-item {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: var(--label);
  transition: background .18s ease, transform .18s ease;
}

.dock-item:hover {
  background: var(--control-hover);
}

.dock-item:active {
  transform: scale(.94);
}

.dock-item svg {
  width: 24px;
  height: 24px;
}

.dock-item span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toolbar-summary {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 5px;
  border-radius: 12px;
  background: var(--control);
}

.toolbar-summary span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--secondary-label);
}

.toolbar-summary strong {
  color: var(--label);
  font-size: 13px;
  white-space: nowrap;
}

.toolbar-summary svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.toolbar-primary {
  min-height: 32px;
  white-space: nowrap;
}

.profile-surface {
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--inner-highlight);
}

.list-head,
.profile-row {
  display: grid;
  grid-template-columns: minmax(190px, .9fr) minmax(190px, .72fr) minmax(240px, 1fr) minmax(170px, .72fr) auto;
  gap: 14px;
  align-items: center;
}

.list-head {
  min-height: 38px;
  padding: 0 16px;
  border-bottom: 1px solid var(--separator);
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 650;
}

.profile-list {
  display: grid;
}

.profile-row {
  position: relative;
  min-width: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--separator);
  transition: background .16s ease;
}

.profile-row:first-child {
  border-top: 0;
}

.profile-row:hover {
  background: color-mix(in srgb, var(--control) 72%, transparent);
}

.profile-row.hidden {
  display: none;
}

.client-cell {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.state-light {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tertiary-label);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tertiary-label) 14%, transparent);
}

.profile-row[data-state="yes"] .state-light {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}

.profile-row[data-state="seen"] .state-light {
  background: var(--orange);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 16%, transparent);
}

.profile-row[data-state="locked"] .state-light {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent);
}

.client-name {
  overflow: hidden;
  color: var(--label);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-ip {
  margin-top: 4px;
  color: var(--secondary-label);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--control);
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.access-badge.on {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: color-mix(in srgb, var(--green) 72%, var(--label));
}

.access-badge.locked {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}

.connection-cell {
  min-width: 0;
}

.connection-main {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.connection-state {
  color: var(--label);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.connection-age {
  overflow: hidden;
  color: var(--secondary-label);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  margin-top: 5px;
  color: var(--secondary-label);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.endpoint svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--accent);
}

.endpoint span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reason {
  margin-top: 5px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.32;
}

.traffic-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.traffic-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--secondary-label);
  font-size: 12px;
}

.traffic-pill svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}

.traffic-pill strong {
  overflow: hidden;
  color: var(--label);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-group {
  display: inline-flex;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 9px;
  background: var(--surface);
}

.action-group form {
  display: inline-flex;
  margin: 0;
}

.action-group .icon-button {
  width: 34px;
  height: 32px;
  min-width: 34px;
  border-radius: 0;
}

.action-group .icon-button:focus-visible {
  position: relative;
  z-index: 1;
  outline-offset: -2px;
  box-shadow: none;
}

.icon-danger {
  color: var(--red);
}

.icon-danger:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
}

.empty-state {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 24px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--selected);
  color: var(--accent);
}

.empty-state strong {
  display: block;
  color: var(--label);
  font-size: 15px;
}

.empty-state span {
  display: block;
  margin-top: 3px;
  color: var(--secondary-label);
  font-size: 13px;
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .26);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

.modal.open {
  display: flex;
}

.sheet {
  width: min(460px, 100%);
  border: 1px solid var(--separator);
  border-radius: 18px;
  background: var(--window-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--separator);
}

.sheet-label {
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 650;
}

.sheet h2 {
  margin: 2px 0 0;
  color: var(--label);
  font-size: 22px;
  line-height: 1.08;
}

.qr-frame {
  padding: 18px;
}

.qr-frame img {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0 auto;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
}

.settings-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.settings-group {
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 14px;
  background: var(--surface);
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  background: transparent;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--separator);
}

.settings-row strong {
  display: block;
  color: var(--label);
  font-size: 14px;
}

.settings-row small {
  display: block;
  margin-top: 3px;
  color: var(--secondary-label);
  font-size: 12px;
  line-height: 1.34;
}

.switch-input {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 26px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(120, 120, 128, .32);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
  cursor: pointer;
  transition: background .18s ease;
}

.switch-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .24);
  transition: transform .18s ease;
}

.switch-input:checked {
  background: var(--green);
}

.switch-input:checked::after {
  transform: translateX(16px);
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 0 2px;
}

.login-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 18px;
}

.login-box {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: var(--window-bg);
  box-shadow: var(--shadow), var(--inner-highlight);
  -webkit-backdrop-filter: blur(32px) saturate(1.35);
  backdrop-filter: blur(32px) saturate(1.35);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.login-box h1 {
  margin: 8px 0 7px;
  color: var(--label);
  font-size: 34px;
  line-height: 1;
  font-weight: 760;
}

.login-box p {
  margin: 0 0 18px;
  color: var(--secondary-label);
  line-height: 1.45;
}

.login-box label {
  display: grid;
  gap: 7px;
  margin: 13px 0;
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 650;
}

.login-box button {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.login-box button:hover {
  background: var(--accent-pressed);
}

.error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media (max-width: 1180px) {
  .app-grid {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-apps {
    grid-template-columns: repeat(4, minmax(78px, 1fr));
  }

  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-head,
  .profile-row {
    grid-template-columns: minmax(170px, .9fr) minmax(160px, .7fr) minmax(220px, 1fr) auto;
  }

  .list-head span:nth-child(4),
  .traffic-cell {
    display: none;
  }
}

@media (max-width: 900px) {
  .vpn-shell {
    width: 100%;
    padding: 0;
  }

  .vpn-window {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .titlebar {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 16px;
  }

  .traffic {
    display: none;
  }

  .titlebar-title {
    justify-self: start;
    color: var(--label);
    font-size: 15px;
    font-weight: 700;
  }

  .toolbar-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--separator);
    padding: 16px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 58px;
    padding: 7px 6px;
    text-align: center;
  }

  .nav-item span {
    max-width: 100%;
    font-size: 11px;
  }

  .nav-item strong {
    display: none;
  }

  .content {
    padding: 18px 14px 30px;
  }

  .content-toolbar {
    grid-template-columns: 1fr;
  }

  .home-screen {
    min-height: auto;
  }

  .home-hero {
    grid-template-columns: 1fr;
    align-items: start;
    margin-bottom: 20px;
  }

  .home-hero h1 {
    font-size: 42px;
  }

  .home-hero p:not(.home-kicker) {
    font-size: 15px;
  }

  .home-time {
    justify-items: start;
    width: fit-content;
  }

  .home-widgets {
    grid-template-columns: 1fr;
  }

  .home-widget-link:first-child {
    grid-column: auto;
  }

  .home-apps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 10px;
  }

  .home-dock {
    position: sticky;
    bottom: 12px;
    z-index: 3;
  }

  .content-actions {
    justify-self: start;
  }

  .page-tools {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .status-row {
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 6px 10px;
  }

  .status-row span:not(.state-light),
  .status-row small {
    grid-column: 2;
  }

  .toolbar-summary {
    justify-self: start;
  }

  .list-head {
    display: none;
  }

  .profile-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
  }

  .client-cell,
  .badge-stack,
  .connection-cell {
    grid-column: 1 / 2;
  }

  .action-group {
    grid-column: 2 / 3;
    grid-row: 1 / span 3;
    align-self: start;
  }

  .action-group .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .connection-main {
    flex-wrap: wrap;
  }

  .modal {
    align-items: flex-end;
    padding: 12px;
  }

  .sheet {
    border-radius: 22px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
}

@media (max-width: 560px) {
  body {
    background: var(--system-bg);
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .toolbar-primary,
  .toolbar-summary {
    width: 100%;
  }

  .content-toolbar h1 {
    font-size: 30px;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .home-layout {
    gap: 22px;
  }

  .home-widget {
    min-height: 164px;
    padding: 16px;
    border-radius: 22px;
  }

  .home-widget-body strong {
    font-size: 30px;
  }

  .widget-traffic,
  .widget-mini-grid {
    grid-template-columns: 1fr;
  }

  .home-apps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-app-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .home-dock {
    width: 100%;
    justify-content: space-around;
  }

  .profile-row {
    grid-template-columns: 1fr;
  }

  .settings-row {
    min-height: 72px;
  }

  .action-group {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .action-group .icon-button {
    flex: 1 1 25%;
  }

  .qr-frame img {
    width: min(100%, 330px);
  }
}
