/* custom-guard console — "Meshy" UI adaptation (external-removal/VPN UI).
 * Tokens mirror external-removal/VPN UI/src/styles/theme.css + the status
 * palette hardcoded in App.tsx. Same class contract as before: templates
 * and Go-emitted markup keep working unchanged.
 *
 * Type: Figtree (UI) + JetBrains Mono (data), Google Fonts import;
 * falls back to the platform stack when offline — no build step, no JS,
 * no dependencies. */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* canvas + surfaces (theme.css :root) */
  --bg: #EAEAEC;
  --surface: #F5F5F7;
  --surface-2: #FFFFFF;
  --border: rgba(0, 0, 0, 0.09);
  --text-primary: #1C1C1E;
  --text-secondary: #6C6C70;

  /* brand + controls */
  --primary: #0071E3;
  --accent: #0071E3;
  --on-primary: #FFFFFF;
  --secondary: #D8D8DC;
  --muted: #DCDCE0;
  --input-bg: #EBEBED;
  --switch-bg: #B0B0B8;

  /* rail */
  --sidebar: #C8C8CC;
  --sidebar-accent: #B8B8BC;

  /* status palette (App.tsx StateBadge map) */
  --ok: #30D158;
  --ok-text: #1A7A38;
  --ok-bg: rgba(48, 209, 94, .13);
  --ok-border: rgba(48, 209, 94, .25);
  --bad: #C0392B;
  --bad-text: #9B2219;
  --bad-bg: rgba(192, 57, 43, .09);
  --bad-border: rgba(192, 57, 43, .19);
  --warn: #FF9F0A;
  --warn-text: #8B5800;
  --warn-bg: rgba(255, 159, 10, .10);
  --warn-border: rgba(255, 159, 10, .21);
  --info: #0071E3;
  --info-text: #004FA0;
  --info-bg: rgba(0, 113, 227, .10);
  --info-border: rgba(0, 113, 227, .21);
  --neutral: #8E8E93;
  --neutral-text: #48484A;
  --neutral-bg: rgba(142, 142, 147, .09);
  --neutral-border: rgba(142, 142, 147, .19);
  --purple: #AF52DE;
  --purple-text: #782C9E;
  --purple-bg: rgba(175, 82, 222, .10);
  --purple-border: rgba(175, 82, 222, .22);

  --font-ui: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-s: 4px;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --transition: 150ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101013;
    --surface: #1C1C1E;
    --surface-2: #242428;
    --border: rgba(255, 255, 255, 0.10);
    --text-primary: #F5F5F7;
    --text-secondary: #98989D;

    --primary: #0A84FF;
    --accent: #0A84FF;
    --on-primary: #FFFFFF;
    --secondary: #2C2C30;
    --muted: #2C2C30;
    --input-bg: #232327;
    --switch-bg: #3A3A3C;

    --sidebar: #161619;
    --sidebar-accent: #26262B;

    --ok-text: #4CD964;
    --ok-bg: rgba(48, 209, 94, .14);
    --ok-border: rgba(48, 209, 94, .28);
    --bad: #FF453A;
    --bad-text: #FF8A80;
    --bad-bg: rgba(255, 69, 58, .12);
    --bad-border: rgba(255, 69, 58, .26);
    --warn-text: #FFB340;
    --warn-bg: rgba(255, 159, 10, .12);
    --warn-border: rgba(255, 159, 10, .26);
    --info: #64A8FF;
    --info-text: #7CB8FF;
    --info-bg: rgba(100, 168, 255, .12);
    --info-border: rgba(100, 168, 255, .26);
    --neutral-text: #AEAEAe;
    --neutral-bg: rgba(142, 142, 147, .14);
    --neutral-border: rgba(142, 142, 147, .26);
    --purple: #BF5AF2;
    --purple-text: #DA8FFF;
    --purple-bg: rgba(191, 90, 242, .13);
    --purple-border: rgba(191, 90, 242, .26);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}

/* ---- type ---- */

h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 28px 0 12px;
}

h2:first-child,
.page-head+h2,
.panel>h2:first-child {
  margin-top: 0;
}

.panel h2:not(:first-child) {
  margin-top: 24px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--text-secondary);
}

/* ---- legacy standalone shell (kept for non-console pages) ---- */

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.wordmark {
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.wordmark .accent {
  color: var(--primary);
}

nav.masthead-links {
  display: flex;
  gap: var(--space-3);
}

nav.masthead-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

nav.masthead-links a:hover {
  color: var(--text-primary);
}

/* ---- tables: card-wrapped, hairline rows, quiet headers ---- */

table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  margin-bottom: 24px;
}

table.grid th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: color-mix(in srgb, var(--text-primary) 72%, var(--text-secondary));
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.grid td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.grid tbody tr:last-child td {
  border-bottom: none;
}

table.grid tbody tr {
  transition: background var(--transition);
}

table.grid tbody tr:hover td {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
}

.empty-row td {
  color: var(--text-secondary);
  text-align: center;
  padding: var(--space-5) var(--space-3);
}

tr.revoked-row td {
  opacity: 0.55;
}

/* ---- forms ---- */

.field {
  margin-bottom: var(--space-4);
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.field input:not([type="checkbox"]):not([type="radio"]),
.inline-form input:not([type="checkbox"]):not([type="radio"]),
.row input:not([type="checkbox"]):not([type="radio"]),
.stack input:not([type="checkbox"]):not([type="radio"]) {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 32px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.inline-form select,
.field select,
.row select,
.stack select,
select {
  height: 38px;
  min-height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236C6C70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: normal;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

select option {
  background-color: var(--surface-2);
  color: var(--text-primary);
  padding: 8px 12px;
}

@media (prefers-color-scheme: dark) {

  .inline-form select,
  .field select,
  .row select,
  .stack select,
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398989D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }

  select option {
    background-color: #242428;
    color: #F5F5F7;
  }
}

.field input {
  width: 100%;
  max-width: 360px;
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.inline-form input:not([type="checkbox"]):not([type="radio"]):focus,
.inline-form select:focus,
.row input:not([type="checkbox"]):not([type="radio"]):focus,
.row select:focus,
.stack input:not([type="checkbox"]):not([type="radio"]):focus,
.stack select:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.btn,
button.primary,
button.secondary,
button:not([class]):not(.icon) {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--transition);
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button.primary,
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid var(--primary);
}

button.primary:hover,
.btn-primary:hover {
  opacity: 0.9;
}

button.primary:active,
.btn-primary:active {
  transform: translateY(1px);
}

button.secondary,
.btn-secondary,
button:not([class]):not(.icon),
.linklike-as-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

button.secondary:hover,
.btn-secondary:hover,
button:not([class]):not(.icon):hover {
  background: var(--muted);
}

/* Standalone Danger Button (e.g. Danger Zone) */
button.danger:not(.icon),
.btn-danger {
  background: var(--bad);
  color: #ffffff;
  border: 1px solid var(--bad);
  border-radius: 6px;
  padding: 7px 16px;
  height: 34px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: opacity var(--transition);
}

button.danger:not(.icon):hover,
.btn-danger:hover {
  opacity: 0.9;
}

.confirm-delete {
  background: none;
  border: 1px solid var(--bad-border);
  color: var(--bad-text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.confirm-delete:hover {
  background: var(--bad-bg);
}

/* ---- status semantics ---- */

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

.dot.ok {
  background: var(--ok);
}

.dot.bad {
  background: var(--bad);
}

.dot.idle {
  background: var(--neutral);
}

.tag {
  font-size: 11px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-s);
  color: var(--text-secondary);
}

.error-text {
  color: var(--bad-text);
  font-size: 13px;
  min-height: 20px;
}

/* ---- auth card ---- */

.auth-card {
  max-width: 380px;
  margin: 14vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: var(--space-5);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
}

/* ---- console shell (sidebar / topbar / content) ---- */

.console {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  border-right: 1px solid var(--border);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  background: var(--sidebar);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-host {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: background var(--transition);
}

.nav a svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.nav a:hover {
  background: var(--sidebar-accent);
}

.nav a.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.nav a.active svg {
  opacity: 0.92;
}

.badge {
  margin-left: auto;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.nav a.active .badge {
  background: rgba(255, 255, 255, .22);
  color: var(--on-primary);
}

.badge.warn {
  background: var(--warn);
  color: #fff;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sidebar-foot .peers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  height: 28px;
  box-sizing: border-box;
  text-align: center;
}

.sidebar-foot .peers .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  display: inline-block;
}

.sidebar-foot form {
  margin: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.sidebar-foot .who {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-foot .linklike {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  text-align: center;
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all var(--transition);
  height: 36px;
  box-sizing: border-box;
}

.sidebar-foot .linklike svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.sidebar-foot .linklike:hover {
  background: var(--sidebar-accent);
  color: var(--text-primary);
}

.sidebar-foot .linklike:hover svg {
  opacity: 0.9;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 65%, var(--bg));
}

.crumb {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumb strong {
  color: var(--text-primary);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.pill.ver::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.pill.warn,
a.pill.warn {
  border-color: var(--warn-border);
  color: var(--warn-text);
  background: var(--warn-bg);
}

.pill.user-pill {
  display: none;
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.content-inner {
  max-width: 1024px;
  margin: 0 auto;
}

/* mobile top-bar brand (mirrors Figma md:hidden block) */
.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.topbar-brand .mini-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-brand .mini-mark svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- page furniture ---- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-secondary);
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chipbtn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.chipbtn:hover {
  color: var(--text-primary);
}

.chipbtn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.chipbtn .n {
  opacity: 0.65;
  margin-left: 4px;
  font-family: var(--font-mono);
}

/* ---- stat cards ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 1023px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition);
  box-sizing: border-box;
}

.card:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-ico {
  display: inline-flex;
}

.card-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-ico.c-ok svg {
  stroke: var(--ok);
}

.card-ico.c-info svg {
  stroke: var(--info);
}

.card-ico.c-warn svg {
  stroke: var(--warn);
}

.card-ico.c-purple svg {
  stroke: var(--purple);
}

.card-num {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---- panels grid (Recent nodes & Audit log side by side) ---- */

.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .panels-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  box-sizing: border-box;
}

.panel h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

/* Recent nodes & Audit log feeds */
.feed-list,
.audit-list {
  display: flex;
  flex-direction: column;
}

.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.feed-row:last-child {
  border-bottom: none;
}

.feed-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-left .dot {
  margin-right: 0;
}

.feed-name {
  font-weight: 500;
  color: var(--text-primary);
}

.feed-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.audit-row {
  display: grid;
  grid-template-columns: 66px 54px 14px 130px 14px 1fr;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  min-width: 0;
}

.audit-row:last-child {
  border-bottom: none;
}

.audit-row .sep {
  color: var(--text-secondary);
  opacity: 0.5;
  text-align: center;
  user-select: none;
}

.audit-row .obj-text {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .audit-row {
    grid-template-columns: 58px 46px 10px 115px 10px 1fr;
    font-size: 12px;
  }
}

/* ---- chips / badges (StateBadge) ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  color: var(--text-secondary);
  background: var(--surface-2);
  white-space: nowrap;
}

.chip.ok {
  color: var(--ok-text);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.chip.bad {
  color: var(--bad-text);
  border-color: var(--bad-border);
  background: var(--bad-bg);
}

.chip.warn {
  color: var(--warn-text);
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

.chip.info,
.chip.admin {
  color: var(--info-text);
  border-color: var(--info-border);
  background: var(--info-bg);
}

.chip.role,
.chip.feat {
  color: var(--info-text);
  border-color: var(--info-border);
  background: var(--info-bg);
}

.chip.neutral,
.chip.user {
  color: var(--neutral-text);
  border-color: var(--neutral-border);
  background: var(--neutral-bg);
}

.chip.purple {
  color: var(--purple-text);
  border-color: var(--purple-border);
  background: var(--purple-bg);
}

.kind {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.kind.domain {
  color: var(--purple);
}

.kind.subnet {
  color: var(--info);
}

.kind.exit {
  color: var(--warn);
}

/* audit action coloring (App.tsx actionColor) */
.act-danger {
  color: var(--bad);
}

.act-ok {
  color: var(--ok-text);
}

.act-info {
  color: var(--info);
}

.act-neutral {
  color: var(--text-primary);
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.actions form {
  display: inline;
  margin-left: 4px;
}

.link-action {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
  margin-right: 4px;
}

.link-action:hover {
  color: var(--primary);
}

.icon,
button.icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  border-radius: 4px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: all var(--transition);
  height: 24px;
  width: 24px;
  box-sizing: border-box;
}

.icon svg,
button.icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon:hover,
button.icon:hover {
  background: var(--muted);
  color: var(--text-primary);
}

.icon.danger,
button.icon.danger {
  color: var(--bad);
  background: transparent;
}

.icon.danger:hover,
button.icon.danger:hover {
  background: var(--bad-bg);
  color: var(--bad-text);
  opacity: 0.85;
}

.icon.ok,
button.icon.ok {
  color: var(--ok-text);
  background: transparent;
}

.icon.ok:hover,
button.icon.ok:hover {
  background: var(--ok-bg);
}

.linklike {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
  text-decoration: none;
}

.linklike:hover {
  color: var(--text-primary);
}

/* ---- network detail standout components ---- */

.network-meta-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.network-meta-card .meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.network-meta-card .meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 500;
}

.network-meta-card .meta-val {
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.invite-code-card {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invite-code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--warn-text);
}

.invite-code-header svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.invite-code-box {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--transition);
  max-width: 100%;
}

.invite-code-box:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.invite-code-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  word-break: break-all;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-ui);
  flex-shrink: 0;
  transition: color var(--transition);
}

.btn-copy svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-copy .copy-feedback {
  display: none;
  align-items: center;
  gap: 4px;
  color: var(--ok-text);
  font-weight: 500;
  font-size: 12px;
}

.invite-code-box.copied {
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.invite-code-box.copied .btn-copy .copy-icon {
  display: none;
}

.invite-code-box.copied .btn-copy .copy-feedback {
  display: inline-flex;
}

/* ---- banners / alerts (Figma amber callouts) ---- */

.banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.banner-ico svg,
.banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.banner.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}

.banner.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-text);
}

.flash {
  color: var(--bad-text);
  font-size: 14px;
}

/* ---- sortable tables ---- */
th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "↕";
  opacity: .3;
  margin-left: 4px;
  font-size: 11px;
}

th.sortable.asc::after {
  content: "↑";
  opacity: 1;
}

th.sortable.desc::after {
  content: "↓";
  opacity: 1;
}

th:empty::after,
th.actions::after,
th:not(.sortable)::after {
  content: none !important;
  display: none !important;
}

/* ---- iOS / Figma style Switch ---- */
.switch-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.switch-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.switch-track {
  width: 36px;
  height: 20px;
  background: var(--switch-bg, #B0B0B8);
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.switch-thumb {
  position: absolute;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-item input:checked+.switch-track {
  background: var(--primary);
}

.switch-item input:checked+.switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch-item input:focus-visible+.switch-track {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ---- action & feature cards ---- */
.feature-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 28px;
}

.feature-switches {
  display: flex;
  align-items: center;
  gap: 28px;
}

.action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.action-card.danger-card {
  border-color: color-mix(in srgb, var(--bad) 35%, var(--border));
}

.action-card-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.action-card-title.danger-title {
  color: var(--bad);
}

.action-card-desc {
  font-size: 12px;
  line-height: 1.4;
}

/* ---- Table row approval actions ---- */
.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin: 0;
}

.btn-action-approve,
.btn-action-reject,
.btn-action-neutral,
.btn-action-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 66px;
  padding: 0 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-action-approve {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}

.btn-action-approve:hover {
  background: var(--ok);
  color: #ffffff;
  border-color: var(--ok);
  box-shadow: 0 1px 3px rgba(48, 209, 88, 0.3);
}

.btn-action-reject {
  background: var(--bad-bg);
  color: var(--bad-text);
  border: 1px solid var(--bad-border);
}

.btn-action-reject:hover {
  background: var(--bad);
  color: #ffffff;
  border-color: var(--bad);
  box-shadow: 0 1px 3px rgba(192, 57, 43, 0.3);
}

.btn-action-neutral {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-action-neutral:hover {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong, var(--text-secondary));
}

.btn-action-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}

.btn-action-ok:hover {
  background: var(--ok);
  color: #ffffff;
  border-color: var(--ok);
  box-shadow: 0 1px 3px rgba(48, 209, 88, 0.3);
}

/* ---- Table search toolbar ---- */
.table-toolbar {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.search-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search-field {
  height: 32px;
  width: 250px;
  padding: 0 12px 0 32px;
  font-family: var(--font-ui);
  font-size: 13px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  box-sizing: border-box;
}

.search-field:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15);
}

.table-toolbar .btn-search {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.table-toolbar .btn-search:hover {
  background: var(--surface);
  border-color: var(--border-strong, var(--text-secondary));
}

/* misc layout helpers used by emitted markup */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.row input {
  width: 90px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

details>form.stack {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-top: 6px;
}

details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

pre.mono {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
}

/* ---- responsive: rail -> bottom nav (App.tsx breakpoints) ---- */

.bottomnav {
  display: none;
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }

  .main {
    height: auto;
    min-height: 100vh;
  }

  .content {
    padding: 16px 16px calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .crumb {
    display: none;
  }

  .topbar-brand {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .pill.user-pill {
    display: inline-flex;
  }

  .bottomnav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-top: 1px solid var(--border);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .bottomnav a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--neutral);
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
  }

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

  .bottomnav a.active {
    color: var(--primary);
  }

  .bottomnav .bn-badge {
    position: absolute;
    top: 8px;
    margin-left: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warn);
    border: 2px solid var(--surface);
  }

  .bottomnav a {
    position: relative;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {

  /* icon rail */
  .sidebar {
    width: 56px;
    flex-basis: 56px;
    padding: 20px 8px 16px;
    align-items: center;
  }

  .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
  }

  .nav {
    width: 100%;
    align-items: center;
  }

  .nav a {
    justify-content: center;
    padding: 10px;
    width: 36px;
    height: 36px;
  }

  .nav-label,
  .brand-text,
  .badge {
    display: none;
  }

  .sidebar-foot {
    padding: 12px 0 4px;
    width: 100%;
    align-items: center;
  }

  .sidebar-foot .peers {
    display: none;
  }

  .sidebar-foot .who {
    display: none;
  }

  .sidebar-foot form {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .sidebar-foot .linklike {
    justify-content: center;
    padding: 0;
    width: 36px;
    height: 36px;
  }

  .sidebar-foot .linklike span {
    display: none;
  }

  .pill.user-pill {
    display: inline-flex;
  }
}

/* responsive column hiding (Figma hidden md:/lg: columns) */
@media (max-width: 767px) {

  .col-sm,
  .col-md,
  .col-lg {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {

  .col-md,
  .col-lg {
    display: none;
  }
}

/* ---- macOS Leopard authentication screens ---- */

.shell:has(.leopard-bg) {
  max-width: none;
  padding: 0;
  margin: 0;
}

:root {
  --sys-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
}

.leopard-bg {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  position: relative;
  background-image: url('/static/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.leopard-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 50%, transparent 30%, rgba(0, 10, 30, 0.28) 100%);
  pointer-events: none;
}

.leopard-panel {
  width: 100%;
  max-width: clamp(340px, 55vw, 480px);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #f5f5f5 0%, #e4e4e4 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.18) inset,
    0 32px 100px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.leopard-panel--wide {
  max-width: clamp(340px, 58vw, 500px);
}

.leopard-header {
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 100%);
  padding: clamp(22px, 4vw, 34px) 24px clamp(18px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.leopard-header h1 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: #1a1a1a;
  margin: 12px 0 4px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  letter-spacing: -0.4px;
  font-family: var(--sys-font);
}

.leopard-header p {
  font-size: clamp(11px, 1.5vw, 13px);
  color: #666;
  margin: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: var(--sys-font);
}

.apple-logo {
  width: 57px;
  height: 79px;
}

/* ---- SSO drawer (login screen) ---- */

.leopard-drawer-container {
  padding: 14px 14px 0;
}

.leopard-drawer-tray {
  background: linear-gradient(180deg, #c6c6c6 0%, #d2d2d2 100%);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28) inset, 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: hidden;
  max-height: 0;
  animation: leopard-drawer-open 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.42s forwards;
}

@keyframes leopard-drawer-open {
  to {
    max-height: 120px;
  }
}

.leopard-sso-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  border-radius: 7px;
  background: transparent;
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.leopard-sso-tile:hover {
  background: linear-gradient(180deg, #3b7ce8 0%, #2563c8 100%);
}

.leopard-sso-tile:active {
  background: linear-gradient(180deg, #1d4fbd 0%, #1a42a0 100%);
}

.sso-icon-box {
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
  line-height: 0;
}

/* The design reference renders under Tailwind preflight (svg is block);
   without this the inline svg baseline adds a ~4px gap and the icon
   sits high inside the rounded box. */
.sso-icon-box svg {
  display: block;
}

.sso-text-box {
  flex: 1;
  min-width: 0;
}

.sso-title {
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 600;
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  font-family: var(--sys-font);
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sso-subtitle {
  font-size: clamp(10px, 1.3vw, 12px);
  color: #666;
  margin-top: 2px;
  font-family: var(--sys-font);
  transition: color 0.15s;
}

.leopard-sso-tile:hover .sso-title {
  color: white;
}

.leopard-sso-tile:hover .sso-subtitle {
  color: rgba(255, 255, 255, 0.78);
}

.sso-chevron {
  flex-shrink: 0;
  stroke: #aaa;
  transition: stroke 0.15s;
}

.leopard-sso-tile:hover .sso-chevron {
  stroke: rgba(255, 255, 255, 0.8);
}

/* ---- circle buttons (login screen) ---- */

.leopard-actions-row {
  display: flex;
  justify-content: center;
  gap: clamp(40px, 12vw, 80px);
  padding: clamp(16px, 3vw, 22px) 24px clamp(20px, 3.5vw, 28px);
}

.circle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}

.circle-btn-disc {
  width: clamp(38px, 5vw, 46px);
  height: clamp(38px, 5vw, 46px);
  border-radius: 50%;
  background: linear-gradient(180deg, #ebebeb 0%, #d0d0d0 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 2px 5px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease;
}

.circle-btn:hover .circle-btn-disc {
  background: linear-gradient(180deg, #d8d8d8 0%, #c0c0c0 100%);
}

.circle-btn:active .circle-btn-disc {
  background: linear-gradient(180deg, #b0b0b0 0%, #a8a8a8 100%);
}

.circle-btn-label {
  font-size: clamp(10px, 1.3vw, 12px);
  color: #555;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: var(--sys-font);
}

/* ---- onboarding form ---- */

.leopard-form-body {
  padding: 20px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.leopard-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.leopard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
}

.leopard-dot--active {
  background: #2563c8;
  box-shadow: 0 0 0 2px rgba(37, 99, 200, 0.25);
}

.leopard-step-label {
  font-size: 11px;
  color: #888;
  margin-left: 4px;
  font-family: var(--sys-font);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Aqua-style inputs */
.aqua-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.aqua-label {
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 600;
  color: #444;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: var(--sys-font);
}

.aqua-input {
  width: 100%;
  padding: 7px 10px;
  font-size: clamp(12px, 1.6vw, 14px);
  font-family: var(--sys-font);
  color: #111;
  background: white;
  border: none;
  border-radius: 5px;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.15) inset;
  transition: box-shadow 0.15s ease;
}

.aqua-input:focus {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.18) inset,
    0 0 0 3px rgba(74, 144, 226, 0.45);
}

/* Aqua-style buttons */
.aqua-btn {
  padding: 7px clamp(20px, 3vw, 32px);
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 600;
  font-family: var(--sys-font);
  color: #333;
  background: linear-gradient(180deg, #efefef 0%, #d8d8d8 100%);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 2px 4px rgba(0, 0, 0, 0.12);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 0.12s ease, opacity 0.15s;
  min-width: 80px;
}

.aqua-btn:hover {
  background: linear-gradient(180deg, #e0e0e0 0%, #c8c8c8 100%);
}

.aqua-btn:active {
  background: linear-gradient(180deg, #b8b8b8 0%, #a8a8a8 100%);
}

.aqua-btn--primary {
  color: white;
  background: linear-gradient(180deg, #5a9fe8 0%, #2b6dd8 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 80, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 5px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.aqua-btn--primary:hover {
  background: linear-gradient(180deg, #4a8fe8 0%, #2660d8 100%);
}

.aqua-btn--primary:active {
  background: linear-gradient(180deg, #1347b0 0%, #1040a0 100%);
}

.aqua-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Onboarding bottom row */
.leopard-bottom-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 22px 22px;
}

.leopard-cancel-link {
  background: none;
  border: none;
  font-size: clamp(11px, 1.4vw, 13px);
  color: #777;
  cursor: pointer;
  font-family: var(--sys-font);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.leopard-bottom-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leopard-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 200, 0.2);
  border-top: 2px solid #2563c8;
  border-radius: 50%;
  display: none;
}

.leopard-spinner--active {
  display: block;
  animation: leopard-spin 0.8s linear infinite;
}

@keyframes leopard-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error text for Leopard screens */
.leopard-panel .error-text,
.leopard-panel--wide .error-text {
  color: #c0392b;
  font-size: 13px;
  font-family: var(--sys-font);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
