:root {
  --bg0: #07141a;
  --bg1: #0c1f28;
  --bg2: #123040;
  --ink: #e8f2f6;
  --muted: #8eacb8;
  --line: rgba(168, 214, 230, 0.16);
  --accent: #3dd6c6;
  --accent-2: #f0b429;
  --danger: #ff7a7a;
  --ok: #6ee7a8;
  --card: rgba(12, 36, 46, 0.82);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color-scheme: dark; }
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(240, 180, 41, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a1820);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 214, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 214, 230, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
}

.impersonate-banner {
  position: relative;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1.25rem;
  background: color-mix(in srgb, var(--accent-2, #f0b429) 22%, #142028);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-2, #f0b429) 45%, transparent);
  color: var(--ink, #e8eef2);
  font-size: 0.92rem;
}
.impersonate-banner .btn {
  margin: 0;
}

.topbar, main, .site-footer { position: relative; z-index: 1; }
.topbar { z-index: 50; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem;
  max-width: 1480px;
  margin: 0 auto;
  position: relative;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(420px, 70vw);
  min-width: 0;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-logo {
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
.hero-logo-wrap {
  margin: 0 0 1.25rem;
}
.hero-logo {
  height: clamp(48px, 8vw, 72px);
  width: auto;
  max-width: min(320px, 100%);
  object-fit: contain;
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  resize: vertical;
}
textarea:focus {
  outline: 2px solid rgba(61, 214, 198, 0.35);
  border-color: var(--accent);
}
input[type="color"] {
  width: 100%;
  height: 2.75rem;
  padding: 0.25rem;
  cursor: pointer;
}
.appearance-form { max-width: none; }
.appearance-form h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.15rem;
}
.appearance-form h2:first-child { margin-top: 0; }
.logo-row {
  margin: 1rem 0;
}
.logo-controls {
  display: grid;
  gap: 0.45rem;
}
.logo-label {
  font-size: 0.92rem;
  color: var(--muted);
}
.logo-file-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo-file-line input[type="file"] {
  width: auto;
  max-width: 100%;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
}
.logo-preview {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
}
.logo-preview img {
  display: block;
  max-height: 40px;
  max-width: 140px;
  object-fit: contain;
}
@media (max-width: 860px) {
  .logo-row { grid-template-columns: 1fr; }
}
.appearance-form .btn { margin-top: 1.25rem; }


.topbar nav,
.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: auto;
}
.nav-backdrop {
  display: none;
}
.nav-toggle-bars {
  width: 1.05rem;
  height: 0.78rem;
  display: block;
  background:
    linear-gradient(currentColor, currentColor) center top / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 100% 2px no-repeat;
}

.topbar nav a,
.site-nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover,
.site-nav a:hover { color: var(--ink); }
.topbar nav a.btn,
.site-nav a.btn {
  color: #000;
  font-weight: 600;
}
.topbar nav a.btn:hover,
.site-nav a.btn:hover {
  color: #000;
  text-decoration: none;
}

.nav-menu {
  position: relative;
}
.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: "▾";
  margin-left: 0.3rem;
  font-size: 0.75em;
  opacity: 0.8;
}
.nav-menu > summary:hover,
.nav-menu[open] > summary {
  color: var(--ink);
}
.nav-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  min-width: 11.5rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 32, 0.97);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.15rem;
  z-index: 100;
}
.nav-menu-label {
  margin: 0.45rem 0.35rem 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.nav-menu-label:first-child { margin-top: 0.15rem; }
.nav-menu-panel a {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--ink);
}
.nav-menu-panel a:hover {
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
  text-decoration: none;
}

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
}

.site-footer {
  max-width: 1480px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-left,
.footer-right {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}
.footer-sep {
  opacity: 0.55;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--accent);
}
.footer-version {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.changelog-page .dash-head {
  margin-bottom: 1rem;
}
.changelog-list {
  display: grid;
  gap: 1rem;
}
.changelog-release h2 {
  margin: 0;
  font-size: 1.2rem;
}
.changelog-release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
}
.changelog-date {
  margin: 0;
  font-size: 0.9rem;
}
.changelog-release h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}
.changelog-items {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
}
.changelog-items li {
  margin: 0.28rem 0;
  color: var(--muted);
}
.changelog-items li::marker {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 1rem 0 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.brand-hero {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  background: linear-gradient(135deg, var(--accent), #2bb8c4);
  color: #000;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(61, 214, 198, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 14px 34px rgba(61, 214, 198, 0.35); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-small { padding: 0.55rem 0.95rem; font-size: 0.92rem; }
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
  background: #f0b429;
  color: #1a1405;
  box-shadow: 0 10px 28px rgba(240, 180, 41, 0.28);
}
.btn-download:hover {
  box-shadow: 0 14px 34px rgba(240, 180, 41, 0.4);
  color: #1a1405;
}
.dash-download-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  margin: 1.25rem 0 0.25rem;
}
.dash-download-row .muted {
  margin: 0;
}
.dash-download-row .btn-download {
  margin: 0;
}
.help-subhead {
  margin: 1.15rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.soft-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.25rem 0;
}
.label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.info-tip-text {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  width: min(260px, 70vw);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a1c24;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: var(--shadow);
  z-index: 20;
  text-align: left;
  white-space: normal;
}
.info-tip:hover .info-tip-text,
.info-tip:focus .info-tip-text,
.info-tip:focus-within .info-tip-text {
  display: block;
}
.mail-admin-grid {
  align-items: stretch;
}
.mail-admin-grid > .mail-col {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.mail-admin-grid .mail-col > label {
  margin: 0.45rem 0;
  gap: 0.25rem;
}
.mail-admin-grid .mail-col > h2 {
  margin-bottom: 0.35rem;
}
.mail-admin-grid .mail-col > p {
  margin: 0.35rem 0 0.5rem;
}
.mail-admin-grid .mail-col > .hint {
  margin: 0.35rem 0 0;
}
.mail-admin-grid .mail-send-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.mail-admin-grid .mail-send-form label {
  margin: 0.45rem 0;
  gap: 0.25rem;
}
.mail-admin-grid .mail-foot {
  margin-top: auto;
  padding-top: 1.75rem;
}
.mail-admin-grid .btn-mail-foot {
  width: 11.5rem;
  min-width: 11.5rem;
  max-width: 11.5rem;
  margin-top: 0;
  align-self: flex-start;
  box-sizing: border-box;
  text-align: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.muted.compact { margin: 0 0 0.35rem; font-size: 0.9rem; }
.guide-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
}
.guide-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.guide-list a:hover { text-decoration: underline; color: var(--ink); }
@media (max-width: 520px) {
  .guide-list { grid-template-columns: 1fr; }
}

.hero-panel { position: relative; }
.pulse-ring {
  position: absolute;
  inset: 12% 8%;
  border-radius: 50%;
  border: 1px solid rgba(61, 214, 198, 0.25);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.96); opacity: 0.45; }
  50% { transform: scale(1.04); opacity: 0.9; }
}

.terminal {
  position: relative;
  background: rgba(4, 18, 24, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.8s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.terminal-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.terminal-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #355868;
}
.terminal-bar span:nth-child(1) { background: #e07a5f; }
.terminal-bar span:nth-child(2) { background: var(--accent-2); }
.terminal-bar span:nth-child(3) { background: var(--accent); }
.terminal pre {
  margin: 0;
  padding: 1.25rem 1.35rem 1.5rem;
  font-size: 0.92rem;
  color: #b7e6df;
  white-space: pre-wrap;
  line-height: 1.55;
}
.terminal .term-muted { color: var(--muted); }
.terminal .term-accent { color: var(--accent); font-weight: 600; }
.terminal .term-ok { color: #7dcea0; }

.strip {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  padding: 1.75rem 0 0.5rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.strip h2 { margin: 0 0 0.4rem; font-size: 1.35rem; }
.strip p { margin: 0; color: var(--muted); max-width: 28rem; }
.chips { display: flex; gap: 0.6rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.chips li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(255,255,255,0.02);
}

.auth-wrap {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 1rem 0;
}
.auth-card, .panel {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.auth-card h1, .panel h2 { margin: 0 0 0.35rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
label {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  color: var(--muted);
}
input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
}
input:focus {
  outline: 2px solid rgba(61, 214, 198, 0.35);
  border-color: var(--accent);
}
.alert {
  background: rgba(255, 122, 122, 0.12);
  border: 1px solid rgba(255, 122, 122, 0.35);
  color: #ffc9c9;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
}
.alert.ok {
  background: rgba(110, 231, 168, 0.1);
  border-color: rgba(110, 231, 168, 0.35);
  color: var(--ok);
}

.dash-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}
.dash-head h1 { margin: 0; font-family: var(--serif); font-size: 2.4rem; }
.stat-row { display: flex; gap: 0.75rem; }
.stat {
  min-width: 90px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  text-align: center;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
a.stat:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: rgba(255,255,255,0.06);
}
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.8rem; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.dash-grid.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
}
.dash-grid.dash-grid-3 > .panel {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.dash-grid.dash-grid-3 > .panel > .btn {
  margin-top: auto;
  align-self: flex-start;
}
.dash-grid > .panel {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.dash-grid > .panel > .btn {
  margin-top: auto;
  align-self: flex-start;
}
.panel { width: auto; }
.create-form .btn { width: 100%; margin-top: 0.5rem; }
.fqdn-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.fqdn-input span { color: var(--muted); white-space: nowrap; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0; }
.hint code, .kv code, td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--accent-2);
}
.totp-qr-wrap {
  margin: 1rem 0;
  padding: 0.75rem;
  display: inline-block;
  background: #fff;
  border-radius: 12px;
}
.totp-qr {
  display: block;
  width: 180px;
  height: 180px;
}
.totp-secret {
  word-break: break-all;
  user-select: all;
}
.backup-codes {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
}
.backup-codes code {
  font-size: 0.95rem;
  color: var(--ink);
}
.stack-form {
  display: grid;
  gap: 0.75rem;
}
.device-table {
  width: 100%;
  margin-top: 0.75rem;
}
.device-table th:nth-child(2),
.device-table td:nth-child(2) {
  white-space: nowrap;
  width: 12rem;
}
.device-table th:last-child,
.device-table td:last-child {
  width: 5rem;
  text-align: center;
}
.security-panel {
  max-width: min(920px, 100%);
  width: 100%;
}
.account-row-top .security-panel,
.security-layout .security-panel,
.account-row-alerts .security-panel {
  max-width: none;
}
.account-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.account-row-top,
.account-row-alerts,
.security-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  width: 100%;
}
.security-backup-codes {
  max-width: none !important;
}
.account-row-password {
  width: 100%;
}
.account-row-plans {
  width: 100%;
}
.account-billing-portal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 0.65rem 0 0.85rem;
}
.plan-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.plan-pick {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  min-width: 0;
}
.plan-pick.is-current {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.plan-pick-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.plan-pick h3 {
  margin: 0;
  font-size: 1.05rem;
}
.plan-pick-price {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.plan-pick-features {
  margin: 0.15rem 0 0.35rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.plan-pick-features li {
  margin: 0.15rem 0;
}
.plan-pick .btn {
  margin-top: auto;
  align-self: flex-start;
}
.account-meta dd .hint.tight {
  margin-left: 0.15rem;
}
.pricing-strip {
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}
.pricing-strip .home-plans {
  width: 100%;
  margin-top: 0.5rem;
}
.account-row-webhooks {
  width: 100%;
}
.account-row-shares {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}
.account-row-shares .security-panel {
  max-width: none;
  width: 100%;
  min-width: 0;
}
.share-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  vertical-align: middle;
}
.host-note {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  max-width: 18rem;
}
.cname-badge {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.host-group-share {
  margin-left: 0.75rem;
  font-size: 0.85rem;
}
.settings-copy-box {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
}
.settings-copy-text {
  margin: 0.35rem 0 0.65rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: var(--ink);
}
.settings-form h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.status-page .status-hero-pill {
  margin: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  align-self: start;
}
.status-hero-pill.ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 16%, transparent);
}
.status-hero-pill.bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}
.status-check-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.status-check-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--danger);
}
.status-check-list li.ok .status-dot {
  background: var(--ok);
}
.hosts-table .actions button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
.hosts-table .actions button.linkish:hover {
  text-decoration: underline;
}
.hosts-table .actions .linkish {
  margin-left: 0.55rem;
}
.hosts-table .actions .inline:first-child .linkish,
.hosts-table .actions > .linkish:first-child {
  margin-left: 0;
}
.share-panel {
  margin-top: 1rem;
}
.share-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.share-panel-head h2 {
  margin: 0 0 0.25rem;
}
.share-panel-head .muted {
  margin: 0;
}
.share-panel-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 10rem) auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.share-panel-form label {
  margin: 0;
}
.share-panel-form input,
.share-panel-form select {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
}
.share-panel-actions {
  display: flex;
  align-items: end;
}
.share-panel-actions .btn {
  margin: 0;
}
.share-people-wrap {
  margin-top: 1rem;
}
@media (max-width: 800px) {
  .share-panel-form {
    grid-template-columns: 1fr;
  }
}
.account-row-webhooks .security-panel {
  max-width: none;
  width: 100%;
}
.webhook-form .webhook-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.25rem 0 0.35rem;
}
.webhook-form .webhook-events .check {
  margin: 0;
}
.webhook-url-hint {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-tokens-table {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.account-tokens-table .actions .inline {
  display: inline;
  margin-left: 0.55rem;
}
.account-tokens-table .actions .inline:first-child {
  margin-left: 0;
}
.account-tokens-table th,
.account-tokens-table td {
  padding: 0.5rem 0.4rem;
  text-align: left;
}
.token-once {
  word-break: break-all;
  background: rgba(0,0,0,0.35);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.account-row-top .security-panel,
.account-row-top .panel,
.account-row-alerts .security-panel,
.account-row-alerts .panel,
.security-layout .security-panel,
.account-password-panel {
  max-width: none;
  width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.account-row-top .panel,
.account-row-alerts .panel,
.security-layout .panel,
.account-password-panel {
  padding: 1.15rem 1.1rem;
}
.account-row-top .panel,
.account-row-alerts .panel {
  padding: 0.9rem 1rem;
}
.account-layout h2 {
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
}
.account-row-top h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.account-row-top .muted {
  flex: 0 0 auto;
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.account-row-top .stack-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.account-row-top .stack-form .btn {
  margin-top: 0.55rem;
  align-self: flex-start;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}
.account-row-top .stack-form label {
  font-size: 0.82rem;
  margin: 0;
  gap: 0.25rem;
}
.account-row-top .stack-form input {
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}
.account-row-top .account-meta {
  flex: 0 0 auto;
  gap: 0.45rem;
}
.account-row-top .account-meta dt {
  font-size: 0.75rem;
}
.account-row-top .account-meta dd {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
}
.account-card-foot {
  margin-top: 0.65rem;
  padding-top: 0;
  font-size: 0.85rem;
}
.account-resend {
  margin: 0.5rem 0 0;
}
.plan-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem 1rem;
}
.plans-panel {
  width: 100%;
  max-width: none;
}
.plans-admin-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .plans-admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .plans-admin-list {
    grid-template-columns: 1fr;
  }
}
.plan-card {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-sizing: border-box;
}
.plan-card > label {
  margin: 0;
  gap: 0.25rem;
  font-size: 0.82rem;
}
.plan-card .plan-form-row {
  gap: 0.35rem 0.5rem;
  margin: 0;
}
.plan-card .plan-form-row > label {
  gap: 0.25rem;
  font-size: 0.82rem;
  margin: 0;
}
.plan-card input,
.plan-card select {
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
}
.plan-form-row-dense {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .plan-form-row-dense {
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  }
}
.plan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0 0 0.1rem;
}
.plan-card-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}
.plan-card-head .muted.compact {
  margin-top: 0.1rem;
  font-size: 0.8rem;
}
.plan-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.plan-card textarea.plan-features {
  min-height: 0;
  height: auto;
  overflow: hidden;
  resize: none;
  padding: 0.4rem 0.55rem;
  line-height: 1.35;
  font-size: 0.9rem;
  field-sizing: content;
}
.plan-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.plan-card-buttons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.btn.btn-danger {
  background: color-mix(in srgb, var(--danger) 88%, #000);
  color: #1a0a0a;
  border-color: transparent;
}
.btn.btn-danger:hover {
  filter: brightness(1.06);
}
.plan-delete {
  margin: 0;
}
.muted.compact {
  margin: 0;
  font-size: 0.88rem;
}
.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8em;
}
textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  box-sizing: border-box;
  font: inherit;
  color: var(--ink);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.password-inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.85rem 1rem;
  align-items: end;
  margin-top: 0.35rem;
}
.password-inline-form label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.88rem;
  min-width: 0;
}
.password-inline-form input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.password-inline-action {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.05rem;
}
.password-inline-action .btn {
  white-space: nowrap;
}
.account-meta {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}
.account-meta dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}
.account-meta dd {
  margin: 0.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.eyebrow a {
  color: inherit;
  text-decoration: none;
}
.eyebrow a:hover {
  color: var(--accent);
}
.ex-host {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ex-host-label,
code .ex-host-label,
pre .ex-host-label,
.hint code .ex-host-label,
.kv code .ex-host-label {
  color: inherit;
  font-weight: 600;
}
.kv { margin: 1rem 0; }
.kv dt { color: var(--muted); font-size: 0.8rem; margin-top: 0.75rem; }
.kv dd { margin: 0.2rem 0 0; }

.hosts-panel { margin-top: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
th, td {
  text-align: left;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
th { color: var(--muted); font-weight: 500; }
.actions { text-align: right; }
.inline { display: inline; margin: 0; }
.linkish {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.linkish:hover { color: var(--ink); text-decoration: underline; }
.linkish.danger { color: var(--danger); }
.empty { padding: 1rem 0; }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  margin: 1rem 0;
}
.check input { width: auto; }
.check.compact { margin: 0.4rem 0; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
select {
  width: 100%;
  border: 1px solid var(--line);
  background-color: rgba(0,0,0,0.25);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.8rem 2.75rem 0.8rem 0.9rem;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238eacb8' d='M1.4 0.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px 8px;
}
select:focus {
  outline: 2px solid rgba(61, 214, 198, 0.35);
  border-color: var(--accent);
}
select option,
select optgroup {
  background-color: #07141a;
  color: #e8f4f7;
}
select option:checked,
select option:hover {
  background-color: #0d2a32;
  color: #e8f4f7;
}
.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}
.label-text {
  display: inline;
}
.host-group { margin-top: 1.25rem; }
.host-group:first-of-type { margin-top: 0.75rem; }
.host-group-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.host-group-row td {
  background: rgba(61, 214, 198, 0.08);
  border-bottom: 1px solid rgba(61, 214, 198, 0.28);
  padding-top: 0.85rem;
  padding-bottom: 0.75rem;
}
.host-group-row-muted td {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--line);
}
.host-group-row .host-group-title {
  color: var(--accent);
  letter-spacing: 0.01em;
}
.host-group-row-muted .host-group-title {
  color: var(--muted);
}
.host-group-count {
  margin-left: 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.host-group-count::before { content: "("; }
.host-group-count::after { content: ")"; }
.host-row-nested td:first-child {
  position: relative;
  padding-left: 1.85rem;
}
.tree-branch {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  width: 0.85rem;
  height: 0.7rem;
  border-left: 2px solid rgba(142, 172, 184, 0.45);
  border-bottom: 2px solid rgba(142, 172, 184, 0.45);
  transform: translateY(-60%);
  border-bottom-left-radius: 4px;
}
.hosts-panel { margin-top: 1rem; }
.hosts-panel .table-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
}
.hosts-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  margin-top: 0.35rem;
}
.hosts-table th,
.hosts-table td {
  padding: 0.65rem 0.55rem;
  vertical-align: middle;
  font-size: 0.9rem;
}
.hosts-table th:nth-child(1),
.hosts-table td:nth-child(1) {
  min-width: 11rem;
  width: 22%;
}
.hosts-table th:nth-child(2),
.hosts-table td:nth-child(2),
.hosts-table th:nth-child(3),
.hosts-table td:nth-child(3) {
  min-width: 6.5rem;
  font-variant-numeric: tabular-nums;
}
.hosts-table td:nth-child(3) {
  word-break: break-all;
  max-width: 12rem;
}
.hosts-table td.host-status {
  min-width: 5rem;
  text-align: left;
  vertical-align: middle;
}
.hosts-table td:has(.group-edit) {
  vertical-align: middle;
}
.hosts-table th:last-child,
.hosts-table td:last-child {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.hosts-table .actions {
  white-space: nowrap;
}
.hosts-table .actions .inline {
  display: inline;
  margin-left: 0.55rem;
}
.hosts-table .actions .inline:first-child {
  margin-left: 0;
}
.group-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "select select"
    "new save";
  gap: 0.3rem 0.4rem;
  margin: 0;
  align-items: center;
  min-width: 8.5rem;
  max-width: 11.5rem;
}
.group-edit select,
.group-edit .group-new {
  display: block;
  box-sizing: border-box;
  margin: 0;
  min-width: 0;
  max-width: none;
  padding: 0.28rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.2;
  border-radius: 7px;
}
.group-edit select {
  grid-area: select;
  width: 100%;
  padding-right: 1.55rem;
  background-position: right 0.4rem center;
  background-size: 9px 6px;
}
.group-edit .group-new {
  grid-area: new;
  width: 100%;
}
.group-edit .linkish {
  grid-area: save;
  justify-self: start;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}
.col-center {
  text-align: center;
}
.col-center .inline {
  display: inline-flex;
  justify-content: center;
}
.col-center .check {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}
.users-table th.col-center,
.users-table td.col-center {
  text-align: center;
  vertical-align: middle;
}
.tfa-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.hint.tight {
  margin: 0;
  font-size: 0.75rem;
}
.inline-edit {
  display: grid;
  gap: 0.45rem;
  min-width: 220px;
}
.inline-edit .btn-small { justify-self: start; }

.users-panel .table-wrap {
  overflow-x: visible;
}
.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 11%;
}
.user-name-cell {
  word-break: break-word;
}
.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 22%;
}
.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 8.5rem;
}
.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 7rem;
}
.users-table th:nth-child(5),
.users-table td:nth-child(5),
.users-table th:nth-child(6),
.users-table td:nth-child(6),
.users-table th:nth-child(7),
.users-table td:nth-child(7),
.users-table th:nth-child(8),
.users-table td:nth-child(8) {
  width: 4.1rem;
}
.users-table th:nth-child(9),
.users-table td:nth-child(9) {
  width: 13.5rem;
}
.table-select {
  cursor: pointer;
}
.table-input-pw {
  width: 100%;
  max-width: none;
}
.table-input {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 8px;
  box-sizing: border-box;
}
.user-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.user-actions-save {
  margin: 0;
  display: flex;
  flex: 0 0 auto;
}
.user-actions-save .btn-small {
  width: auto;
  min-width: 0;
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 999px;
  justify-content: center;
}
.user-actions-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.15rem;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  font-size: 0.85rem;
}
.users-table td.user-actions-cell {
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.users-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
.users-table th,
.users-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.4rem;
}
.users-table td {
  vertical-align: middle;
}
.status-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  line-height: 1.2;
}
.status-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.status-btn:disabled {
  cursor: default;
  opacity: 0.85;
}
.status-btn.status-pending {
  box-shadow: 0 0 0 1px var(--accent-2);
}

/* Client setup / help */
.help-hero { margin-bottom: 1.5rem; }
.help-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin: 0 0 0.75rem;
}
.help-creds { margin-bottom: 1.25rem; max-width: none; }
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}
.help-toc a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  background: rgba(255,255,255,0.02);
}
.help-toc a:hover { color: var(--ink); border-color: var(--accent); }
.help-section {
  max-width: none;
  margin: 0 0 1rem;
  scroll-margin-top: 1.25rem;
}
.help-section h2 { margin: 0 0 0.35rem; }
.help-section h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
}
.help-section ol {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  color: var(--ink);
}
.help-section li { margin: 0.35rem 0; }
.help-section pre {
  margin: 0.75rem 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 18, 24, 0.85);
  color: #b7e6df;
  font-size: 0.88rem;
  white-space: pre-wrap;
}
.strip-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
}

.status-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.status-badge.ok {
  color: #06241f;
  background: rgba(61, 214, 198, 0.85);
}
.status-badge.bad {
  color: #fff;
  background: var(--danger);
}
.result-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.85em;
  background: rgba(255,255,255,0.06);
}
.result-pill.result-good { color: #3dd6c6; }
.result-pill.result-nochg { color: #8eacb8; }
.result-pill.result-bad,
.result-pill.result-badauth,
.result-pill.result-badip,
.result-pill.result-nohost,
.result-pill.result-dnserr,
.result-pill.result-notfqdn { color: #f07178; }
.host-status-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 3.25rem;
}
.host-status-inner .result-pill {
  display: inline-block;
}
.host-status-inner .host-ok-count,
.host-status-inner .host-fail-count {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1.2;
  text-align: center;
  width: 100%;
}
.host-fail-count {
  font-size: 0.75rem;
  color: #f07178;
}
.host-ok-count {
  font-size: 0.75rem;
}
.stat-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}
.compact-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.compact-label select { width: auto; min-width: 5rem; padding: 0.45rem 2.2rem 0.45rem 0.65rem; }
.clear-activity { margin-top: 1rem; }
.clear-activity .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 860px) {
  .hero, .dash-grid, .strip, .dash-head { grid-template-columns: 1fr; display: grid; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .strip { align-items: start; }
  .strip-actions { align-items: flex-start; }
  .hero { min-height: auto; padding-top: 1.5rem; gap: 1.5rem; }
  .site-footer { flex-direction: column; gap: 0.35rem; }
  .form-row { grid-template-columns: 1fr; }
  .hosts-table th:last-child,
  .hosts-table td:last-child,
  .hosts-table .actions {
    white-space: normal;
  }
  .hosts-table .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    justify-content: flex-end;
    max-width: 11rem;
  }
  .hosts-table .actions .linkish,
  .hosts-table .actions .inline {
    margin-left: 0 !important;
  }
  .hosts-table .group-edit {
    max-width: 9.5rem;
  }

  .topbar {
    padding: 0.85rem 1rem;
    flex-wrap: nowrap;
  }
  main {
    padding: 0.35rem 1rem 2.5rem;
  }
  .site-footer {
    padding: 0 1rem 1.25rem;
  }
  .brand {
    max-width: calc(100% - 6.5rem);
  }
  .brand-logo {
    height: 32px;
    max-width: 140px;
  }
  .nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 130;
  }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.45);
  }
  .topbar.nav-open .nav-backdrop {
    display: block;
  }
  body.nav-lock {
    overflow: hidden;
  }
  .site-nav {
    display: none !important;
    position: fixed !important;
    right: 0.85rem;
    top: 3.6rem;
    left: auto;
    width: min(18rem, calc(100vw - 1.7rem));
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.65rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(8, 24, 32, 0.98);
    box-shadow: var(--shadow);
    z-index: 120;
    margin-left: 0 !important;
  }
  .topbar.nav-open .site-nav {
    display: flex !important;
  }
  .site-nav a,
  .site-nav .nav-menu > summary,
  .site-nav .nav-logout {
    display: block;
    width: 100%;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    text-align: left;
  }
  .site-nav a:hover,
  .site-nav .nav-menu > summary:hover {
    background: rgba(61, 214, 198, 0.1);
    text-decoration: none;
  }
  .site-nav a.btn {
    text-align: center;
    margin-top: 0.25rem;
  }
  .site-nav .nav-menu {
    width: 100%;
  }
  .site-nav .nav-menu-panel {
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    margin-top: 0.25rem;
    background: rgba(0, 0, 0, 0.25);
  }
  .site-nav .nav-logout {
    margin: 0;
  }
  .site-nav .nav-logout .linkish {
    width: 100%;
    text-align: left;
    padding: 0;
  }

  .dash-head h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); }
  .dash-head .stat-row { flex-wrap: wrap; }
  .auth-wrap {
    min-height: auto;
    padding: 0.5rem 0 1.5rem;
    place-items: start center;
  }
  .auth-card, .panel {
    width: 100%;
    max-width: 100%;
    padding: 1.25rem;
  }
  .security-panel {
    max-width: 100%;
  }
  .account-row-top,
  .account-row-alerts,
  .account-row-shares,
  .security-layout {
    grid-template-columns: 1fr;
  }
  .password-inline-form {
    grid-template-columns: 1fr;
  }
  .password-inline-action .btn {
    width: 100%;
  }
  .fqdn-input {
    flex-wrap: wrap;
  }
  .fqdn-input span {
    white-space: normal;
    word-break: break-all;
    font-size: 0.85rem;
  }
  .cta-row {
    width: 100%;
  }
  .cta-row .btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .terminal pre {
    font-size: 0.82rem;
  }
  .table-wrap {
    margin: 0 -0.25rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .users-table,
  .hosts-panel table {
    min-width: 0;
  }
  .users-panel .table-wrap {
    overflow-x: auto;
  }
  .device-table {
    min-width: 520px;
  }
  .user-actions {
    gap: 0.35rem;
  }
  .mail-admin-grid {
    grid-template-columns: 1fr !important;
  }
  .help-section pre {
    font-size: 0.8rem;
  }
  .backup-codes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-hero { font-size: clamp(2.2rem, 12vw, 3rem); }
  .lede { font-size: 1.02rem; }
  .topbar { padding: 0.75rem 0.85rem; }
  main { padding: 0.25rem 0.85rem 2rem; }
  .site-footer { padding: 0 0.85rem 1rem; }
  .auth-card, .panel { padding: 1.1rem; border-radius: 14px; }
  .cta-row { flex-direction: column; }
  .cta-row .btn,
  .strip-actions .btn,
  .create-form .btn,
  .panel > .btn { width: 100%; }
  .user-actions {
    gap: 0.35rem;
  }
  .user-actions-meta {
    gap: 0.25rem 0.5rem;
  }
  .user-actions-meta {
    justify-content: center;
    min-width: 0;
  }
}
