:root {
  --navy: #1b2a4a;
  --moss: #5c8a3a;
  --moss-bright: #7cb34f;
  --tan: #c4a574;
  --sky: #8ec5e8;
  --bg: #0a0e14;
  --card: #141b26;
  --stroke: #2a3548;
  --text: #f3f6fb;
  --muted: #9aa6b8;
  --danger: #c45c5c;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.011em;
}

a { color: var(--moss-bright); text-decoration: none; }
a:hover { color: #9fd06a; }

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img {
  height: 44px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover { color: var(--text); background: #1a2330; text-decoration: none; }
.nav .who { padding: 0 8px; }
.nav form { margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 32px;
}

h1 {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}
.lede { color: var(--muted); margin: 0 0 32px; max-width: 36em; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select {
  width: 100%;
  background: #0a0e14;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  margin-bottom: 18px;
}
input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(92, 138, 58, 0.22);
}

button, .btn {
  appearance: none;
  border: 0;
  background: var(--moss);
  color: #f7fbee;
  font: inherit;
  font-weight: 650;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
}
button:hover, .btn:hover { background: #6a9b44; }
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
}
button.ghost:hover, .btn.ghost:hover {
  color: var(--text);
  background: #1a2330;
}
button.danger, .btn.danger {
  background: #8b3a3a;
  color: #f7fbee;
}
button.danger:hover, .btn.danger:hover { background: #a44848; }

.flash {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash li {
  background: #1a2433;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
}
.flash li.error, .flash li.warning { border-color: var(--danger); color: #e08a8a; }
.flash li.success { border-color: var(--moss); }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  font-size: 14px;
}
table.data th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
table.data tr:last-child td { border-bottom: 0; }
table.data .pill { margin-top: 0; }
.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 28px;
}
.danger-zone { border-color: #5a2b2b; }
.one-time { margin-bottom: 20px; }
.one-time h2, .card h2 { margin: 0 0 8px; font-size: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.pop {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px 20px 18px;
  background: var(--card);
  border-left: 3px solid var(--stroke);
}
.pop.up { border-left-color: var(--moss-bright); }
.pop.down { border-left-color: #c45c5c; }
.pop.degraded { border-left-color: var(--tan); }
.pop h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.03em; }
.pop p { margin: 0; color: var(--muted); font-size: 13px; }
.pill {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 650;
  padding: 5px 10px;
  border-radius: 999px;
  background: #1a2433;
  color: var(--muted);
}
.pill.up { background: #1a2e1c; color: var(--moss-bright); }
.pill.down { background: #2a1717; color: #e08a8a; }
.pill.degraded { background: #2a2418; color: var(--tan); }
.pill.active { background: #1a2e1c; color: var(--moss-bright); }
.pill.inactive { background: #2a1717; color: #e08a8a; }
.pill.invite-pending { background: #2a2418; color: var(--tan); }

.error { color: #e08a8a; font-size: 14px; margin: 0 0 16px; }
.errorlist { list-style: none; padding: 0; margin: 0 0 16px; color: #e08a8a; font-size: 14px; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-wrap .brand {
  margin-bottom: 36px;
}
.auth-wrap .brand img {
  height: auto;
  width: min(320px, 86vw);
}
.auth-wrap .card { width: min(420px, 100%); }
.auth-wrap .card.totp-card {
  width: min(480px, 100%);
  padding: 48px 44px 40px;
}
.auth-wrap .card.totp-enroll { width: min(520px, 100%); }
.auth-wrap h1 { text-align: left; }
.auth-wrap .totp-card h1 {
  text-align: center;
  margin: 0 0 14px;
  font-size: 28px;
}
.auth-wrap .totp-card .lede {
  text-align: center;
  margin: 0 auto 36px;
  max-width: 28em;
  line-height: 1.55;
}
.auth-wrap .totp-card .error { text-align: center; margin-bottom: 20px; }
.auth-wrap .totp-card .qr { margin: 0 auto 28px; }
.auth-wrap .totp-card .meta {
  text-align: center;
  margin: 0 0 32px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.totp-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.totp-form label {
  margin: 0;
  text-align: center;
}
.auth-wrap button[type="submit"] { width: 100%; margin-top: 4px; }
.totp-form button[type="submit"] {
  width: 372px;
  max-width: 100%;
  margin-top: 4px;
}
.auth-wrap .qr { margin-left: auto; margin-right: auto; }
input[type="text"].otp-input {
  display: block;
  width: 260px;
  max-width: 100%;
  box-sizing: border-box;
  background: #0a0e14;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 14px;
  height: 72px;
  padding: 18px 12px 18px 22px;
  margin: 0;
  font: inherit;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0.42em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
input[type="text"].otp-input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(92, 138, 58, 0.22);
}
.otp-boxes {
  width: 100%;
}
.otp-label {
  display: block;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.otp-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
input[type="text"].otp-digit {
  width: 52px;
  height: 60px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #0a0e14;
  color: var(--text);
  font: inherit;
  font-size: 24px;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
input[type="text"].otp-digit:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(92, 138, 58, 0.22);
}
.auth-alt {
  margin-top: 18px;
}
.auth-wrap .auth-alt button[type="submit"] {
  width: auto;
  margin-top: 0;
  background: transparent;
  color: var(--muted);
}

.meta { margin-top: 12px; color: var(--muted); font-size: 13px; }

.page-head { margin: 0 0 28px; }
.page-head h1 { margin-bottom: 8px; }
.page-head .lede { margin: 0; }

.ops-fleet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.ops-list { display: flex; flex-direction: column; gap: 20px; }
.ops-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  border-left: 4px solid var(--stroke);
}
.ops-card.up { border-left-color: var(--moss-bright); }
.ops-card.down { border-left-color: #c45c5c; }
.ops-card.degraded { border-left-color: var(--tan); }
.ops-card > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ops-card > summary::-webkit-details-marker { display: none; }
.ops-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 0;
}
.ops-card-head::after {
  content: "";
  flex: 0 0 0.45em;
  width: 0.45em;
  height: 0.45em;
  margin: 10px 2px 0 8px;
  border-right: 2px solid var(--moss-bright);
  border-bottom: 2px solid var(--moss-bright);
  transform: rotate(-45deg);
}
.ops-card[open] > .ops-card-head::after { transform: rotate(45deg); }
.ops-card-body { margin-top: 18px; }
.ops-card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.03em; }
.ops-card h3 {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}
.ops-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.metric {
  background: #0a0e14;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
}
.metric .label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 4px;
}
.metric .value {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.metric .value-sm { font-size: 15px; letter-spacing: -0.02em; }
.metric .sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.chart-legend .swatch::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: -1px;
}
.chart-legend .swatch.inn::before { background: var(--moss-bright); }
.chart-legend .swatch.out::before { background: var(--tan); }
.chart-axis { margin-left: auto; font-weight: 500; }
.traffic-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.traffic-chart {
  margin: 0;
  background: #0a0e14;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px 8px;
}
.traffic-chart.wide { grid-column: 1 / -1; }
.traffic-chart figcaption .label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 2px;
}
.traffic-chart figcaption .value {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.traffic-chart figcaption .sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.traffic-chart.summary { padding-bottom: 14px; }
.chart-empty {
  margin: 18px 8px 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.traffic-svg { display: block; width: 100%; height: auto; }
.traffic-svg .grid line { stroke: var(--stroke); stroke-width: 1; }
.traffic-svg .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.traffic-svg .area.inn { fill: rgba(124, 179, 79, 0.22); }
.traffic-svg .area.out { fill: rgba(196, 165, 116, 0.22); }
.traffic-svg .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.traffic-svg .line.inn { stroke: var(--moss-bright); }
.traffic-svg .line.out { stroke: var(--tan); }
@media (max-width: 820px) {
  .traffic-charts { grid-template-columns: 1fr; }
  .traffic-chart.wide { grid-column: auto; }
  .chart-axis { margin-left: 0; }
}
.notes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.notes li {
  background: #1a2433;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 5px 10px;
  border-radius: 999px;
}

.qr {
  margin: 0 0 20px;
  padding: 14px;
  width: fit-content;
  background: #ffffff;
  border-radius: 12px;
}
.qr svg {
  display: block;
  width: 196px;
  height: 196px;
}
.qr figcaption {
  margin: 10px 0 0;
  color: #4a5568;
  font-size: 12px;
  font-weight: 600;
}

.settings-form { max-width: 640px; }
.settings-section { margin-bottom: 18px; }
.settings-section h2 { margin: 0 0 6px; font-size: 18px; }
.settings-section .lede { margin-bottom: 18px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}
.test-email { margin: 18px 0 0; max-width: 640px; }

.guide {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: none;
}
.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 20px;
  align-items: start;
  margin: 0;
  padding: 24px 24px 22px;
}
.guide-num {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #1a2e1c;
  color: var(--moss-bright);
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.guide-body { min-width: 0; }
.guide-body h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.03em; }
.guide-body p { margin: 0 0 14px; color: var(--muted); }
.guide-body p:last-child { margin-bottom: 0; }
.os-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.os-card {
  display: block;
  background: #0a0e14;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
}
.os-card:hover {
  border-color: var(--moss);
  color: var(--text);
  text-decoration: none;
}
.os-card h3 { margin: 0 0 4px; font-size: 15px; }
.os-card p { margin: 0; color: var(--muted); font-size: 13px; }
.callout {
  background: #1a2e1c;
  border: 1px solid #2d4a28;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
}
.callout strong { display: block; margin-bottom: 4px; color: var(--moss-bright); }
.device-form { max-width: 560px; margin-top: 6px; }
input.mono, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 0; }
.device-card {
  background: #0a0e14;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0 0;
}
.device-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.device-card-head h3 { margin: 0 0 4px; font-size: 16px; }
.device-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.copy-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}
pre.conf {
  margin: 0;
  padding: 14px 16px;
  background: #080b10;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.help-card { margin-bottom: 28px; }
.help-card h2 { margin: 0 0 12px; font-size: 18px; }
.faq { margin: 0; }
.faq dt {
  font-weight: 650;
  margin: 14px 0 4px;
}
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 0; color: var(--muted); }
.locations-block h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.03em; }
.locations-block .lede { margin-bottom: 16px; }
.pop.ready { border-left-color: var(--moss-bright); }
.pop.soon { border-left-color: var(--stroke); }
.pill.ready { background: #1a2e1c; color: var(--moss-bright); }
.pill.soon { background: #1a2433; color: var(--muted); }
details.advanced {
  margin: 0 0 28px;
}
details.advanced > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 20px;
  letter-spacing: -0.03em;
  list-style: none;
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 10px;
  border-right: 2px solid var(--moss-bright);
  border-bottom: 2px solid var(--moss-bright);
  transform: rotate(-45deg);
  vertical-align: 0.15em;
}
details.advanced[open] > summary::before { transform: rotate(45deg); }
details.advanced > summary + p { margin-top: 14px; }
#profile-status { margin-top: 12px; }
#profile-status.error { color: #e08a8a; font-weight: 650; }
@media (max-width: 720px) {
  .guide-step { grid-template-columns: 1fr; }
}
