:root {
  color-scheme: dark;
  /* Fluid layout: content grows with the viewport, with comfortable side padding. */
  --content-max: 96rem;
  --content-pad-x: clamp(1rem, 4vw, 3rem);
  --bg: #080c14;
  --panel: #121a2b;
  --panel-2: #182238;
  --text: #e8edf8;
  --muted: #8fa3c4;
  --accent: #5bc0ff;
  --accent-2: #a78bfa;
  --good: #34d399;
  --warn: #f59e0b;
  --bad: #f87171;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Sora", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(91, 192, 255, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(167, 139, 250, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--accent);
}
a:hover {
  color: #8fd4ff;
}

.topbar {
  padding: 0.85rem var(--content-pad-x);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  border-bottom: 1px solid rgba(56, 82, 127, 0.35);
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: flex;
  flex-shrink: 0;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(91, 192, 255, 0.22);
  border: 1px solid rgba(91, 192, 255, 0.28);
  background: #0a0f18;
}
.brand-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-text small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.topbar-center {
  justify-self: center;
  min-width: 0;
  max-width: min(100%, 44rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

/* Helpful, educational hint text. Hidden in admin mode or when the Help pill is off. */
.help-off .help-text {
  display: none !important;
}

.topbar-center .session-chips {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(135deg, #4eb8f7, #7c5cff);
  color: #041018;
  box-shadow: 0 4px 20px rgba(91, 192, 255, 0.22);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(91, 192, 255, 0.32);
}
.btn-secondary {
  background: #2a3a5c;
  color: var(--text);
  border: 1px solid #3d5280;
}
.btn-secondary:hover {
  background: #34456d;
}
.btn-danger {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #991b1b;
}
.btn-danger:hover:not(:disabled) {
  background: #991b1b;
}
.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: #3d5280;
  background: rgba(42, 58, 92, 0.35);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 500;
  padding: 0.35rem 0;
  box-shadow: none;
}
.btn-link:hover {
  text-decoration: underline;
}

.pill {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid #38527f;
  color: var(--muted);
}
.pill.ok {
  background: rgba(52, 211, 153, 0.14);
  color: #8bf5cf;
  border-color: #2d7f64;
}
.pill.bad {
  background: rgba(248, 113, 113, 0.12);
  color: #ffb2b2;
  border-color: #914a4a;
}

.view {
  animation: fadeIn 0.35s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.view.hidden {
  display: none !important;
}

/* Splash — single column so the hero illustration stays at the top at all widths (no side column reflow). */
.splash {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem var(--content-pad-x) 3rem;
}
.splash-copy {
  min-width: 0;
  width: 100%;
}

.splash-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0.4rem 0 1rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.splash-lead {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 1.5rem;
  max-width: none;
}
.splash-node-intro {
  margin-top: 0.35rem;
  margin-bottom: 1.5rem;
}
.splash-node-intro strong {
  color: var(--text);
  font-weight: 600;
}
.splash-section-lead {
  color: var(--muted);
  font-size: 0.93rem;
  margin: 0 0 0.85rem;
  max-width: none;
  line-height: 1.5;
}
.splash-flow-diagram {
  margin: 0.25rem 0 0;
  width: 100%;
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}
.splash-path-svg {
  width: 100%;
  height: auto;
  max-width: min(100%, 52rem);
  display: block;
  margin: 0 auto;
}
.splash-flow-caption {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0.9rem 0 0;
  max-width: none;
}
.splash-flow-caption strong {
  color: var(--text);
  font-weight: 600;
}
.splash-subhead {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  margin: 0.25rem 0 0.5rem;
  color: var(--text);
}
.splash-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.35rem;
  margin-bottom: 2rem;
}
.splash-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: none;
}
.splash-steps li {
  margin-bottom: 0.55rem;
}
.splash-steps strong {
  color: var(--text);
}

.splash-art {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
}
.splash-svg {
  width: 100%;
  max-width: min(28rem, 100%);
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.45));
}
.mesh-line {
  stroke-dasharray: 6 10;
  animation: meshdrift 24s linear infinite;
}
@keyframes meshdrift {
  to {
    stroke-dashoffset: -320;
  }
}

/* Inner pages */
.page-narrow {
  max-width: 460px;
  margin: 0 auto;
  padding: 2rem 1.35rem 3rem;
}
.page-narrow h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0.5rem 0 0.75rem;
}
.lead {
  color: var(--muted);
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
}
.back-link {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
}
.back-link:hover {
  color: var(--accent);
}
.footer-hint {
  margin-top: 1.5rem;
  font-size: 0.88rem;
}

.welcome-banner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto 1rem;
  padding: 1rem var(--content-pad-x);
  border-radius: 12px;
  border: 1px solid #2c4068;
  background: linear-gradient(120deg, rgba(91, 192, 255, 0.08), rgba(167, 139, 250, 0.06));
}
.welcome-banner h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  font-weight: 800;
}
.welcome-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.welcome-admin {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(120deg, rgba(245, 158, 11, 0.1), rgba(91, 192, 255, 0.05));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  padding: 1rem var(--content-pad-x) 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}
/* Let cards shrink inside the grid so nested overflow-x (e.g. accounts table) scrolls on narrow phones. */
.grid > .card {
  min-width: 0;
}
.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid #283656;
  border-radius: 14px;
  padding: 1.1rem;
}
.card.full {
  grid-column: 1 / -1;
}
.card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 800;
}
/* Collapsible panels: click the title (.panel-title) to expand/compress the card body. */
.collapsible .panel-title {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.collapsible .panel-title::before {
  content: "\25be"; /* ▾ */
  font-size: 0.8em;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.collapsible.collapsed .panel-title::before {
  transform: rotate(-90deg);
}
.collapsible.collapsed > :not(:first-child) {
  display: none !important;
}
/* When compressed, only the title shows — hide toolbar buttons in the header row. */
.collapsible.collapsed > .row > :not(.panel-title) {
  display: none !important;
}
/* Account/Role panel: keep the Log out button inside the panel and visible on
   narrow (iPhone) widths by wrapping it below the chips and going full width. */
.overview-session-row {
  flex-wrap: wrap;
  gap: 0.6rem;
}
.overview-session-row #nav-logout {
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .overview-session-row #nav-logout {
    width: 100%;
  }
}
/* Panel toolbars: buttons sit in the upper-right of the panel header, inline
   with the title (right-justified). The collapse rule above hides them when the
   panel is compressed, so they only show in expanded mode. */
#console-vpn-invites-panel .tile-toolbar,
#console-agents-panel .tile-toolbar,
#admin-accounts-panel .tile-toolbar {
  justify-content: flex-end;
}
table.data.admin-users-table {
  font-size: 0.82rem;
}
/* Name-only tables: show just the first (Name) column, hide the rest of each row. */
table.data.name-only th:not(:first-child),
table.data.name-only td:not(:first-child) {
  display: none;
}
/* Single visible column = the item name; the "Name" header adds nothing, so hide it. */
table.data.name-only thead {
  display: none;
}
.muted {
  color: var(--muted);
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0.75rem;
}
.status-line {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text);
}
.subsection-title {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 0.65rem;
}
.stack.compact {
  margin-top: 0.9rem;
}
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
}
input,
select,
textarea {
  background: #0f1729;
  border: 1px solid #36486f;
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  /* ≥16px prevents iOS Safari from auto-zooming on focus / rotation quirks */
  font-size: 16px;
}

.code {
  margin: 0.65rem 0;
  min-height: 2.4rem;
  background: #0a1222;
  border: 1px solid #2e4166;
  border-radius: 10px;
  padding: 0.65rem;
  overflow-x: auto;
  font-size: 0.82rem;
}
.list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}
.row.gap {
  margin-top: 0.5rem;
  margin-bottom: 0;
  justify-content: flex-start;
}

.toast {
  position: fixed;
  bottom: 14px;
  right: 14px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #2e4166;
  background: #0f1729;
  font-size: 0.88rem;
  z-index: 100;
  max-width: min(420px, calc(100vw - 2rem));
}
.toast.error {
  border-color: #9d4d4d;
  color: #ffb8b8;
}
.toast.success {
  border-color: #38765f;
  color: #9ef2d1;
}
.hidden {
  display: none !important;
}

/* Fresh install with no accounts yet: hide every "Sign in" affordance and leave
   only the Create-account path. JS toggles body.bootstrap-empty via /v1/auth/bootstrap-state. */
body.bootstrap-empty #nav-login,
body.bootstrap-empty #login-form button[type="submit"],
body.bootstrap-empty #console-gate a[href="#/login"] {
  display: none !important;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-top: 0.5rem;
  padding-bottom: 0.15rem;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
table.data th.admin-user-actions-th,
table.data td.admin-user-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.admin-user-actions-inner {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  max-width: 100%;
}
table.data th,
table.data td {
  border: 1px solid #2e4166;
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
table.data th {
  background: #0f1729;
  color: var(--muted);
  font-weight: 600;
}
button.danger {
  background: #7f1d1d;
  color: #fecaca;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button.inline {
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
}
button.secondary {
  background: #2a3a5c;
  color: var(--text);
  border: 1px solid #3d5280;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
button.secondary:hover {
  background: #34456d;
}
.debug-export-pre {
  margin-top: 0.75rem;
  max-height: 24rem;
  overflow: auto;
  padding: 0.75rem;
  background: #0a1222;
  border: 1px solid #2e4166;
  border-radius: 10px;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.78rem;
}

.admin-detail-dialog {
  margin: auto;
  padding: 0;
  max-width: min(52rem, calc(100vw - 2rem));
  width: 100%;
  border: 1px solid #283656;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.admin-detail-dialog::backdrop {
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}

.signup-invite-denied-dialog {
  max-width: min(28rem, calc(100vw - 2rem));
}
.signup-invite-denied-message {
  margin: 0;
  line-height: 1.55;
  font-size: 0.95rem;
  color: var(--text);
}
.admin-detail-inner {
  padding: 1.1rem 1.25rem 1.25rem;
}
.admin-detail-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.admin-detail-body {
  font-size: 0.92rem;
}
.admin-detail-body h3 {
  font-size: 0.98rem;
  margin: 1rem 0 0.4rem;
  color: var(--muted);
  font-weight: 600;
}
.admin-detail-body .pill-inline {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid #38527f;
  margin-right: 0.35rem;
}
.admin-detail-body .pill-inline.ok {
  border-color: #2d7f64;
  color: #8bf5cf;
  background: rgba(52, 211, 153, 0.12);
}
.admin-detail-body .pill-inline.muted {
  color: var(--muted);
}
/* Account detail dialog: keep Close at the top-right and cap the body so the
   dialog never overflows the viewport (the body scrolls). Tidy body spacing. */
#admin-user-detail .admin-detail-header {
  justify-content: space-between;
  flex-wrap: nowrap;
}
#admin-user-detail .admin-detail-header h2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#admin-user-detail .admin-detail-header .btn {
  flex-shrink: 0;
}
#admin-user-detail .admin-detail-body {
  max-height: 70vh;
  overflow: auto;
}
#admin-user-detail .admin-detail-body p {
  margin: 0.3rem 0;
  line-height: 1.45;
}
#admin-user-detail .admin-detail-body h3:first-child {
  margin-top: 0.35rem;
}
#admin-user-detail .admin-detail-body td.admin-detail-more {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.admin-record-dl {
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.45rem;
}
.admin-record-dl > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.2rem 0.85rem;
  align-items: baseline;
}
.admin-record-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.admin-record-dl dd {
  margin: 0;
  word-break: break-word;
}
.admin-record-detail-footer {
  margin-top: 0.85rem;
  border-top: 1px solid #24324d;
  padding-top: 0.75rem;
}
.inv-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inv-name-row .inv-name-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
/* Reusable state indicator pill (same look as the VPN invite console badge). */
.state-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.state-pill.is-pending {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.4);
  background: rgba(252, 211, 77, 0.1);
}
.state-pill.is-bound {
  color: #5bc0ff;
  border-color: rgba(91, 192, 255, 0.4);
  background: rgba(91, 192, 255, 0.1);
}
.state-pill.is-completed {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}
.state-pill.is-off {
  color: #f3a3a3;
  border-color: rgba(243, 163, 163, 0.4);
  background: rgba(243, 163, 163, 0.1);
}
.state-pill.is-dim {
  color: var(--muted);
  border-color: #33415c;
  background: rgba(255, 255, 255, 0.03);
}
/* Push the pill (and any trailing actions) to the right of a name line. */
.inv-name-row .state-pill {
  margin-left: auto;
}
.admin-detail-header .state-pill {
  flex-shrink: 0;
}
#admin-record-detail .admin-detail-header {
  justify-content: flex-start;
  gap: 0.6rem;
}
#admin-record-detail .admin-detail-header h2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .admin-record-dl > div {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }
}
#admin-user-detail .admin-detail-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}
.admin-detail-body pre.rows {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  background: #0a1222;
  border: 1px solid #2e4166;
  border-radius: 8px;
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 14rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* VPN invite console inspect (view popup) */
.vpn-invite-dialog-shell.vpn-console-mode {
  max-width: min(38rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid #1e3a5f;
  background: #050a12;
  box-shadow:
    0 0 0 1px rgba(91, 192, 255, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.55);
}
.vpn-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #1e3050;
  background: linear-gradient(180deg, #121c2e, #0a101c);
}
.vpn-dialog-head h2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #8fa3c4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vpn-console-inspect {
  padding: 0.65rem 0.85rem 0.85rem;
}
.vpn-console-frame {
  border: 1px solid #243b5c;
  border-radius: 8px;
  overflow: hidden;
  background: #03060c;
  box-shadow: inset 0 1px 0 rgba(91, 192, 255, 0.05);
}
.vpn-console-titlebar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  background: linear-gradient(180deg, #0f1828, #0a1018);
  border-bottom: 1px solid #1a2d48;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.7rem;
}
.vpn-console-dots {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.vpn-console-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: block;
}
.vpn-console-dots span:nth-child(1) {
  background: #ff5f57;
}
.vpn-console-dots span:nth-child(2) {
  background: #febc2e;
}
.vpn-console-dots span:nth-child(3) {
  background: #28c840;
}
.vpn-console-title {
  color: #5bc0ff;
  flex: 1;
  letter-spacing: 0.03em;
}
.vpn-console-badge {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: 1px solid transparent;
}
.vpn-console-badge.state-pending {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.4);
  background: rgba(252, 211, 77, 0.1);
}
.vpn-console-badge.state-bound {
  color: #5bc0ff;
  border-color: rgba(91, 192, 255, 0.4);
  background: rgba(91, 192, 255, 0.1);
}
.vpn-console-badge.state-completed {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}
.vpn-console-body {
  padding: 0.55rem 0.6rem 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  max-height: min(52vh, 26rem);
  overflow: auto;
}
.vpn-console-grid {
  display: grid;
  gap: 0.28rem;
}
.vpn-console-row {
  display: grid;
  grid-template-columns: 8.75rem 1fr;
  gap: 0.5rem;
  align-items: start;
}
.vpn-console-row .k {
  color: #5a7494;
}
.vpn-console-row .k::before {
  content: "› ";
  color: #3d5a78;
}
.vpn-console-row .v {
  color: #d4e4f8;
  word-break: break-all;
}
.vpn-console-row .v.dim {
  color: #6b8299;
}
.vpn-console-row .v.accent {
  color: #5bc0ff;
}
.vpn-console-row .v.good {
  color: #6ee7b7;
}
.vpn-console-row .v.warn {
  color: #fcd34d;
}
.vpn-console-footer {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-top: 1px solid #1a2d48;
  background: #060b12;
  font-size: 0.68rem;
}
.vpn-console-prompt {
  color: #28c840;
  font-weight: 700;
  flex-shrink: 0;
}
.vpn-console-share {
  color: #6b8299;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.vpn-console-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

.vpn-invite-summary {
  padding: 0.65rem 0.85rem 0.85rem;
}
.vpn-summary-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #36486f;
  background: linear-gradient(155deg, rgba(91, 192, 255, 0.08), rgba(15, 23, 41, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.vpn-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.vpn-summary-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}
.vpn-summary-dl {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.vpn-summary-dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.88rem;
}
.vpn-summary-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vpn-summary-dl dd {
  margin: 0;
  word-break: break-word;
}
.vpn-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.vpn-summary-apps {
  margin: 0 0 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(54, 72, 111, 0.65);
}
.vpn-summary-apps-heading {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vpn-summary-apps-lead {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}
.vpn-summary-apps-list {
  margin: 0;
  padding: 0;
}
.vpn-invite-dialog-shell.vpn-invite-friendly-mode {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid #36486f;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
}

/* Console: signed-in summary (log out in header; diagnostics below Accounts) */
#console-tile-session {
  margin: 0;
}
.console-signed-in {
  margin: 0;
  font-size: 0.95rem;
}
.console-role-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}
.console-resource-panel h3 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.console-resource-panel h3:first-child {
  margin-top: 0;
}
.tile-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}
.table-wrap tr[data-selectable="true"] {
  cursor: pointer;
}
.table-wrap tr.row-selected td {
  background: rgba(91, 192, 255, 0.12);
}

/*
 * Shared session chip-row: a small dashboard of pill-shaped indicators
 * showing connection status, signed-in account, and (server only) role.
 * Same visual idiom is mirrored inline in the agent console.
 *   <div class="session-chips">
 *     <span class="session-chip session-chip-status session-status-ok">
 *       <span class="session-led" aria-hidden="true"></span>
 *       <span class="chip-val">mesh ready</span>
 *     </span>
 *     <span class="session-chip">
 *       <span class="chip-key">Account</span>
 *       <span class="chip-val mono">you@example.com</span>
 *     </span>
 *   </div>
 */
.session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
}
.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #283656;
  background: rgba(15, 23, 41, 0.6);
  font-size: 0.85rem;
  color: var(--text);
  min-width: 0;
}
.session-chip .chip-key {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.session-chip .chip-val {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 24rem;
}
.session-led {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.session-chip-status .chip-val {
  font-weight: 700;
}
.session-chip-status.session-status-ok {
  border-color: #2d7f64;
  background: rgba(52, 211, 153, 0.14);
}
.session-chip-status.session-status-ok .chip-val {
  color: #8bf5cf;
}
.session-chip-status.session-status-ok .session-led {
  background: var(--good);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.65);
  animation: session-led-breathe 2.5s ease-in-out infinite;
}
.session-chip-status.session-status-bad {
  border-color: #914a4a;
  background: rgba(248, 113, 113, 0.12);
}
.session-chip-status.session-status-bad .chip-val {
  color: #ffb2b2;
}
.session-chip-status.session-status-bad .session-led {
  background: var(--bad);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}
@keyframes session-led-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(0.92);
  }
}
.console-diagnostics-panel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #283656;
}
.diagnostics-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

/* VPN invite result dialog */
.vpn-setup-config-pre {
  max-height: min(40vh, 18rem);
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.vpn-setup-qr-wrap img {
  display: block;
  max-width: min(280px, 92vw);
  height: auto;
  border-radius: 10px;
  border: 1px solid #2e4166;
  background: #fff;
  padding: 0.35rem;
}
.vpn-setup-pending {
  color: #fbbf24;
}
.vpn-app-picker {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid #2e4166;
  border-radius: 8px;
  background: rgba(15, 23, 41, 0.45);
}
.vpn-app-pick-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
}
.vpn-app-pick-row:hover {
  background: rgba(91, 192, 255, 0.08);
}
.vpn-app-pick-row input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent, #5bc0ff);
}
.vpn-app-pick-name {
  flex: 1;
  font-weight: 600;
  line-height: 1.35;
}
.vpn-shared-apps-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.vpn-shared-app-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #2e4166;
  border-radius: 10px;
  background: #121a2a;
}
.vpn-shared-app-qr-wrap {
  flex: 0 0 auto;
}
.vpn-shared-app-qr {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid #2e4166;
  background: #fff;
  padding: 0.2rem;
  object-fit: contain;
}
.vpn-shared-app-qr-failed .vpn-shared-app-qr {
  opacity: 0.35;
}
.vpn-shared-app-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}
.vpn-shared-app-url {
  margin: 0;
  font-size: 0.78rem;
  word-break: break-all;
  line-height: 1.35;
}
a.vpn-app-launch {
  text-align: left;
  text-decoration: none;
}
