:root {
  --bg: #060911;
  --bg-glow: none;
  --panel: rgba(15, 22, 38, .86);
  --panel-2: rgba(20, 29, 49, .72);
	--navigation-bg: rgba(8, 12, 22, .95);
  --border: rgba(94, 118, 168, .22);
  --border-strong: rgba(120, 148, 205, .38);
  --text: #e6ecf8;
  --muted: #93a4c4;
  --dim: #64748b;
  --accent: #7c8cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --fail: #fb7185;
  --radius: 14px;
  --shadow: 0 18px 44px rgba(2, 6, 16, .55);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Offline world map; city markers use the same projection as its SVG. */
.landing { width: 100%; min-height: 100vh; padding: 0; display: flex; flex-direction: column; }
.landing > * { flex-shrink: 0; }
.landing a { color: #fff; }
.landing-head { display: flex; align-items: stretch; justify-content: space-between; border: 1px solid var(--border); border-radius: 0; background: var(--navigation-bg); padding: 0; gap: 20px; }
.public-menu-toggle { display: none; }
.landing-intro { text-align: center; margin: 56px 0 28px; padding: 0 20px; }
.landing-intro h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 500; letter-spacing: -.04em; margin-bottom: 6px; }
.landing-map { width: calc(100% - 40px); max-width: 1600px; margin: 0 auto; }
.landing-map .pop-map-viewport { overflow-x: auto; border: 1px solid rgba(185, 193, 207, .24); border-radius: 12px; }
.landing-map .pop-world-map { height: auto; aspect-ratio: 2 / 1; max-height: none; }
.landing-map .pop-map-locations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; border: 0; margin: 24px auto 0; max-width: 960px; gap: 18px; }
.landing-map .pop-map-location { min-height: 112px; min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.landing-map .pop-map-latency { margin-left: auto; }
.landing-brand { color: var(--text); text-decoration: none; padding: 14px clamp(20px, 2.5vw, 48px); }
.landing-nav { display: flex; align-items: stretch; gap: 0; font-size: 1rem; font-weight: 550; }
.landing-nav > a, .landing-nav > .btn { display: flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; padding: 18px 24px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; font-size: inherit; font-weight: inherit; }
.landing-nav > a:hover { color: var(--text); background: rgba(124, 140, 255, .11); }
.landing-nav > a[aria-current="page"] { color: #fff; background: rgba(124, 140, 255, .1); }
.landing-nav > .btn { color: var(--text); }
.landing-nav [data-dashboard-link] { min-width: 132px; }
.pricing-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; width: calc(100% - 40px); max-width: 850px; margin: 0 auto 48px; }
.pricing-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.pricing-card-pro { display: flex; flex-direction: column; border-color: rgba(56, 153, 255, .45); }
.pricing-subscribe { margin-top: auto; padding-top: 8px; }
.pricing-subscribe [data-pro-availability] { margin: 18px 0 0; line-height: 1.5; }
.pricing-price { margin: 16px 0 8px; font-size: 2.5rem; font-weight: 600; letter-spacing: -.04em; }
.pricing-price span { font-size: .85rem; font-weight: 400; color: var(--muted); letter-spacing: normal; margin-left: 8px; }
.pricing-features { padding-left: 18px; margin: 24px 0; display: grid; gap: 12px; font-size: .9rem; }
.pricing-features li::marker { color: #3899ff; }
.pricing-limits-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.pricing-limits-link:hover { color: #3899ff; }
.pricing-limits { width: min(950px, calc(100% - 28px)); max-height: 88vh; overflow: auto; margin: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #0f1626; color: var(--text); box-shadow: var(--shadow); }
.pricing-limits::backdrop { background: rgba(3, 6, 14, .66); backdrop-filter: blur(6px); }
.pricing-limits > p { margin-top: 10px; }
.pricing-bandwidth { width: min(600px, calc(100% - 28px)); }
.pricing-bandwidth > p { margin-top: 16px; line-height: 1.6; }
.pricing-limit-table { width: 100%; table-layout: fixed; margin: 16px 0; }
.pricing-limit-table th, .pricing-limit-table td { text-align: left; padding: 12px 8px; white-space: normal; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); font-size: .82rem; }
.pricing-limit-table th { color: var(--muted); font-weight: 500; }
@media (max-width: 650px) { .landing-head { flex-wrap: wrap; gap: 0; } .landing-brand { padding: 14px; } .landing-nav { width: 100%; border-top: 1px solid var(--border); } .landing-nav > a, .landing-nav > .btn { flex: 1; min-width: 0; padding: 14px 8px; } .landing-nav > a:first-child { border-left: 0; } .landing-map .pop-world-map { min-width: 1000px; } .pricing-plans { grid-template-columns: 1fr; } .pricing-card { padding: 22px; } }
@media (max-width: 900px) {
  .landing-head { align-items: center; flex-wrap: wrap; gap: 0; }
  .landing-brand { padding: 14px; }
  .landing-nav { flex-direction: column; width: 100%; border-top: 1px solid var(--border); }
  .landing-nav > a, .landing-nav > .btn { justify-content: flex-start; border-left: 0; border-top: 1px solid var(--border); padding: 14px 20px; }
  .landing-nav > a:first-child { border-top: 0; }
  .public-menu-ready .landing-nav { display: none; }
  .public-menu-ready .landing-head[data-menu-open] .landing-nav { display: flex; }
  .public-menu-ready .public-menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; margin: 6px 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
  .public-menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .public-menu-icon { display: grid; gap: 5px; width: 20px; }
  .public-menu-icon > span { display: block; height: 2px; background: currentColor; border-radius: 1px; }
  .public-menu-toggle[aria-expanded="true"] .public-menu-icon > span:first-child { transform: translateY(7px) rotate(45deg); }
  .public-menu-toggle[aria-expanded="true"] .public-menu-icon > span:nth-child(2) { opacity: 0; }
  .public-menu-toggle[aria-expanded="true"] .public-menu-icon > span:last-child { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 600px) { .landing-map, .pricing-plans { width: calc(100% - 28px); } .landing-map .pop-map-locations { grid-template-columns: 1fr; } .landing-intro { margin-top: 44px; } }
.panel-pop-map { overflow: hidden; }
.pop-world-map { display: block; width: 100%; max-height: 440px; background: radial-gradient(ellipse at 55% 32%, rgba(39, 77, 125, .14), transparent 65%); }
.pop-map-grid { stroke: var(--border); stroke-width: .5; opacity: .35; }
.pop-map-marker { color: var(--ok); }
.pop-map-dot { fill: currentColor; stroke: currentColor; stroke-width: 1.4; }
.pop-map-halo { fill: currentColor; opacity: .14; }
.pop-map-callout { fill: none; stroke: currentColor; stroke-width: .8; opacity: .6; }
.pop-map-label { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: #0c1422; stroke-width: 4px; stroke-linejoin: round; }
.pop-map-marker:focus { outline: none; }
.pop-map-marker:hover .pop-map-halo, .pop-map-marker:focus .pop-map-halo { opacity: .4; }
.pop-map-marker.is-offline { color: var(--fail); }
.pop-map-locations { display: flex; flex-wrap: wrap; gap: 12px 30px; padding: 16px 20px; border-top: 1px solid var(--border); }
.pop-map-location { display: flex; align-items: center; gap: 10px; }
.pop-map-latency { margin-left: 12px; text-align: right; min-width: 94px; }
.pop-map-latency-value { font-size: .9rem; font-weight: 600; color: var(--text); }
.pop-map-latency-value { display: block; }
.pop-map-latency[data-latency-band="green"] .pop-map-latency-value { color: var(--ok); }
.pop-map-latency[data-latency-band="yellow"] .pop-map-latency-value { color: var(--warn); }
.pop-map-latency[data-latency-band="red"] .pop-map-latency-value { color: var(--fail); }
.pop-map-latency-note { text-align: center; margin-top: 10px; color: var(--muted); font-size: .73rem; }
.pop-map-location > div { display: grid; }
.pop-map-location strong { font-size: .9rem; }
.pop-map-location-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; color: var(--ok); background: currentColor; box-shadow: 0 0 8px currentColor; flex-shrink: 0; }
.pop-map-location-dot.is-offline { color: var(--fail); }
.pop-map-key { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.pop-map-note { padding: 0 20px 12px; }
@media (max-width: 600px) { .pop-map-key { display: none; } .pop-map-location > .mono { display: none; } .pop-map-locations { gap: 12px 20px; padding: 12px; } }

* { box-sizing: border-box; }

/* An author rule with a display value (see .view below) overrides the browser's
   built in `[hidden] { display: none }`, which would leave every hidden panel
   visible. Force the attribute to win. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.simple-page { min-height: 100vh; max-width: 430px; margin: 0 auto; padding: min(16vh, 120px) 24px 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.simple-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.simple-page form { width: 100%; }

code, .mono, .ip, pre { font-family: var(--mono); font-size: .92em; }

a { color: var(--accent); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }

p { margin: 0; }

.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .input { flex: 1 1 200px; width: auto; min-width: 160px; }

/* ---------- account menu ---------- */

.menu { position: relative; }

.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 250px; padding: 6px; display: grid; gap: 2px;
  background: rgba(15, 22, 38, .97);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.menu-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.menu-title { font-weight: 600; font-size: .9rem; }
.menu-sub { color: var(--muted); font-size: .78rem; margin-top: 2px; overflow-wrap: anywhere; }

.menu-item {
  appearance: none; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: .88rem; text-align: left;
  padding: 8px 11px; border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.menu-item:hover { background: rgba(124, 140, 255, .14); }
.menu-item.danger { color: #fecdd3; }
.menu-item.danger:hover { background: rgba(251, 113, 133, .16); }
.stack { display: flex; flex-direction: column; gap: 16px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 148, 205, .22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 148, 205, .38); background-clip: padding-box; }

/* ---------- boot / login ---------- */

.app.is-loading { display: block; }

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.boot-mark, .brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: #2c3550;
  box-shadow: 0 0 24px rgba(124, 140, 255, .45);
}

.boot-mark { width: 42px; height: 42px; animation: spin 2.6s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-wrap { min-height: 100vh; display: grid; place-items: start center; padding: 24px; }
.auth-page > .login-wrap { min-height: 0; flex: 1; padding: clamp(72px, 14vh, 144px) 24px 48px; }
.auth-intro { display: grid; gap: 8px; }
.auth-intro h1 { font-size: 1.65rem; line-height: 1.2; }
.auth-intro p { margin: 0; font-size: .92rem; line-height: 1.5; }
@media (max-width: 650px) { .auth-page > .login-wrap { padding: 24px 16px 32px; } }
.auth-page a { color: #fff; }
.dns-nameserver { display: block; overflow-wrap: anywhere; }
.dns-delegation, .dns-record-row { padding: 16px; border: 1px solid var(--border); border-radius: 10px; }
.dns-record-row { display: grid; gap: 14px; }
.dns-records-table table { min-width: 820px; }
.dns-records-table td { vertical-align: top; }
.dns-records-table td:nth-child(2) input { min-width: 130px; }
.dns-records-table td:nth-child(3) input { min-width: 230px; }
.dns-records-table td:nth-child(4) input { width: 95px; }
.dns-records-table td:nth-child(5) { min-width: 215px; }
.dns-pool-value { padding: 16px; border: 1px solid var(--border); border-radius: 10px; }

.card.login {
  width: min(400px, 100%);
  display: grid;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; object-fit: cover;
  background: #0b1220; box-shadow: 0 0 18px rgba(124, 140, 255, .35);
}
.brand-lg .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
.auth-page .card.login .brand-logo { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.landing-brand .brand-logo { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.sidebar-brand .brand-logo { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.brand-lg .brand-mark { width: 34px; height: 34px; }
.brand-text { font-weight: 650; letter-spacing: -.02em; font-size: 1.05rem; }
.login-sub { color: var(--muted); font-size: .92rem; }
.login-provider { display: grid; gap: 16px; }
.login-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .8rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- shell ---------- */

.app { min-height: 100vh; }

.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.main-column { min-width: 0; }
.sidebar {
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 23px 0 24px;
  background: var(--navigation-bg);
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 0 25px 28px; }
.sidebar-brand, .sidebar-nav { flex-shrink: 0; }
.sidebar-plan { margin: auto 0 0; padding: 24px 25px 0; color: var(--muted); font-size: .75rem; }
.sidebar-nav {
  display: grid; align-content: start;
  border-top: 1px solid var(--border);
}
.sidebar-link, .sidebar-sublink {
  appearance: none; width: 100%; border: 0; text-align: left;
  font: inherit; color: var(--muted); background: transparent;
  border-radius: 10px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.sidebar-link {
  position: relative; padding: 11px 26px; font-size: .91rem; font-weight: 550;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.sidebar-link:hover, .sidebar-sublink:hover { color: var(--text); background: rgba(124, 140, 255, .11); }
.sidebar-link:hover { border-bottom-color: var(--border-strong); }
.sidebar-link.is-active { color: #fff; border-bottom-color: rgba(124, 140, 255, .58); background: rgba(124, 140, 255, .1); }
.sidebar-link[data-view="tickets"] { padding-right: 50px; }
.ticket-unread { position: absolute; right: 22px; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: #e53935; color: #fff; font-size: 11px; font-weight: 750; line-height: 1; transform: translateY(-50%); }
.ticket-unread > span { display: block; transform: translateY(-.5px); -webkit-text-stroke: .35px #000; paint-order: stroke fill; }
.ticket-unread[hidden] { display: none; }
.sidebar-link.has-children::after {
  content: ''; position: absolute; right: 29px; top: 17px;
  width: 6px; height: 6px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  transition: transform .15s;
}
.sidebar-link.has-children[aria-expanded="true"]::after { transform: rotate(225deg); }
.sidebar-subnav {
  position: relative; display: grid; animation: fade .16s ease;
}
.sidebar-subnav::before {
  content: ''; position: absolute; z-index: 1; left: 37px; top: 0; bottom: 0;
  width: 1px; background: var(--border-strong); pointer-events: none;
}
.sidebar-sublink {
  padding: 9px 26px 9px 51px; font-size: .84rem;
  border-bottom: 1px solid rgba(94, 118, 168, .14); border-radius: 0;
}
.sidebar-sublink.is-active { color: #fff; background: rgba(124, 140, 255, .13); }
.sidebar-scrim, .sidebar-toggle { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; min-height: 72px;
  padding: 12px 26px;
  background: rgba(8, 12, 22, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-heading { display: grid; line-height: 1.25; }
.page-heading span { color: var(--dim); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.page-heading strong { font-size: 1rem; font-weight: 650; }

.content { padding: 22px; max-width: 1440px; margin: 0 auto; display: grid; gap: 18px; }
.view { display: grid; gap: 18px; }
.view.is-active { animation: fade .16s ease; }

/* ---------- panels ---------- */

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head p { font-size: .86rem; margin-top: 3px; }
.resource-header-actions { display: flex; align-items: center; flex: 0 0 auto; flex-wrap: nowrap; gap: 10px; }
.resource-header-actions input { width: clamp(140px, 18vw, 240px); min-width: 0; }
.resource-header-actions .btn { white-space: nowrap; }
.resource-create-actions { display: flex; align-items: stretch; gap: 8px; }
.resource-quick-button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; }
.resource-quick-button .quick-spark { width: 13px; height: 17px; fill: #fff; }
@media (max-width: 680px) { .view[data-view-panel="resources"] .panel-head { flex-wrap: wrap; } }
.panel-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.domain-row.is-single { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 51; width: min(270px, 84vw);
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-scrim {
    position: fixed; inset: 0; z-index: 50; border: 0;
    background: rgba(3, 6, 14, .7); cursor: pointer;
  }
  .app-shell.sidebar-open .sidebar-scrim { display: block; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
}

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  display: grid; gap: 6px;
}
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; }
.stat .value small { font-size: .92rem; color: var(--muted); font-weight: 500; }
.stat .value.is-good { color: var(--ok); }
.stat .hint { font-size: .82rem; color: var(--dim); }

/* ---------- health ---------- */

.checks { display: grid; gap: 10px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.check .check-title { font-weight: 550; display: flex; align-items: center; gap: 8px; }
.check .check-detail { color: var(--muted); font-size: .88rem; }
.check pre { margin: 8px 0 0; padding: 9px 11px; background: rgba(3, 6, 14, .7); border: 1px solid var(--border); border-radius: 9px; overflow-x: auto; }
.check-status { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; }
.check-status.ok { background: var(--ok); box-shadow: 0 0 12px rgba(52, 211, 153, .6); }
.check-status.warn { background: var(--warn); box-shadow: 0 0 12px rgba(251, 191, 36, .55); }
.check-status.fail { background: var(--fail); box-shadow: 0 0 12px rgba(251, 113, 133, .55); }
.check-status.info { background: var(--dim); }

/* ---------- topology ---------- */

.panel-topology { overflow: hidden; }
.topo { position: relative; min-height: 380px; }
.topo svg { width: 100%; height: auto; display: block; }
.topo .link { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .75; }
.topo .link.direct { stroke: url(#linkDirect); stroke-width: 2.2; opacity: .95; }
.topo .link.relay { stroke: var(--dim); stroke-dasharray: 5 6; animation: dash 3.4s linear infinite; }
.topo .link.hub-link { stroke: var(--border-strong); stroke-width: 1.5; opacity: .72; }
.topo .link.idle { stroke: var(--border-strong); stroke-dasharray: 3 7; opacity: .5; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.topo .node, .topo .hub-node { cursor: grab; touch-action: none; }
.topo .node.dragging, .topo .hub-node.dragging { cursor: grabbing; }
.topo .node text, .topo .hub-node text { pointer-events: none; user-select: none; }
.topo .node circle { transition: r .15s ease; }
.topo .node:hover circle { r: 27; }
.topo .node-label { fill: var(--text); font-size: 12px; text-anchor: middle; font-weight: 550; }
.topo .node-sub { fill: var(--muted); font-size: 10.5px; text-anchor: middle; font-family: var(--mono); }
.topo .hub-ring { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .5; }
.topo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; color: var(--muted); text-align: center; gap: 14px; }

.legend { display: flex; gap: 16px; color: var(--muted); font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.line { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--accent); }
.line-relay { border-top-style: dashed; border-color: var(--dim); }
.line-hub { border-color: var(--border-strong); }

/* ---------- agent cards ---------- */

.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

.agent-card {
  border: 1px solid var(--border); border-radius: 13px;
  background: var(--panel-2);
  padding: 15px; display: grid; gap: 11px;
  transition: border-color .15s, transform .15s;
}
.agent-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.agent-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.agent-update-indicator { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); transform: translateY(.5px); }
.agent-update-indicator.has-update { background: #e53935; }
.agent-name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-addr { font-family: var(--mono); color: var(--accent-2); font-size: .92rem; }
.agent-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .85rem; }
.agent-meta dt { color: var(--dim); }
.agent-meta dd { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.dot-on { background: var(--ok); }
.dot-off { background: #475569; }
.dot-warn { background: var(--warn); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .14), 0 0 12px rgba(52, 211, 153, .5); } 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, .05), 0 0 16px rgba(52, 211, 153, .7); } }
.dot-live { background: var(--accent-2); box-shadow: 0 0 10px rgba(34, 211, 238, .7); }

.live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; background: var(--panel-2); }
.live.is-stale .dot-live { background: var(--warn); box-shadow: none; }

/* ---------- chips / badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted); background: rgba(124, 140, 255, .08);
  white-space: nowrap;
}
.chip-quiet { border-color: var(--border); background: transparent; }
.chip-direct { color: #a7f3d0; border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); }
.chip-relay { color: #cbd5f5; border-color: rgba(148, 163, 184, .4); background: rgba(148, 163, 184, .1); }
.chip-warn { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }
.chip-fail { color: #fecdd3; border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .1); }
.chip-off { color: #94a3b8; border-color: rgba(148, 163, 184, .28); background: rgba(148, 163, 184, .07); }
/* Walking a long list one page at a time: the control sits at the bottom right,
   where a reader arrives after the last row. */
.pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pager .btn[disabled] { opacity: .45; cursor: default; }
/* An error chip is a way in, not a label: it opens Logs, Errors on that entry. */
.chip-link { cursor: pointer; font: inherit; }
.chip-link:hover { border-color: rgba(251, 191, 36, .8); }
/* The row an "error" chip pointed at, in the Errors table. */
tr.row-highlight td { background: rgba(251, 191, 36, .09); }
tr.row-highlight td:first-child { box-shadow: inset 3px 0 0 rgba(251, 191, 36, .8); }

/* ---------- buttons ---------- */

/* ---------- publish page ---------- */

.form-page { display: grid; gap: 16px; }

.form-page .panel-head { margin-bottom: 0; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }

.type-card {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel-2); cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.type-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.type-card.is-selected {
  border-color: var(--accent);
  background: rgba(124, 140, 255, .12);
  box-shadow: 0 0 0 1px rgba(124, 140, 255, .35) inset;
}
.type-card input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.type-card-icon { width: 27px; height: 27px; flex: none; fill: currentColor; color: #fff; }
.dns-provider-picker .type-card, .exit-kind-picker .type-card { position: relative; }
.dns-provider-picker .type-card input, .exit-kind-picker .type-card input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  opacity: 0; pointer-events: none;
}
.dns-provider-picker .type-card:has(input:focus-visible), .exit-kind-picker .type-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.dns-provider-logo { width: 28px; height: 28px; margin-top: 2px; object-fit: contain; flex: none; }
.agent-install-label { color: var(--muted); font-size: .86rem; font-weight: 600; }
.agent-install-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agent-install-grid .type-card, .role-picker .type-card { position: relative; }
.agent-install-grid .type-card input, .role-picker .type-card input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  opacity: 0; pointer-events: none;
}
.agent-install-grid .type-card:focus-within,
.agent-install-grid .type-card.is-selected { outline: none; box-shadow: none; }
.agent-install-grid .type-card.is-selected { border-color: var(--accent); }
.agent-install-grid .type-card input:focus { outline: none; box-shadow: none; }
.agent-install-grid .type-card:has(input:focus-visible) .type-card-body strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.role-picker .type-card:focus-within,
.role-picker .type-card.is-selected { outline: none; box-shadow: none; }
.role-picker .type-card.is-selected { border-color: var(--accent); }
.role-picker .type-card input:focus { outline: none; box-shadow: none; }
.role-picker .type-card:has(input:focus-visible) .type-card-body strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 620px) { .agent-install-grid { grid-template-columns: 1fr; } }
.type-card-body { display: grid; gap: 3px; }
.type-card-body strong { font-weight: 600; font-size: .92rem; }
.type-card.is-disabled { opacity: .45; cursor: not-allowed; }

.targets { display: grid; gap: 10px; }

.rules { display: grid; gap: 10px; }

.rule-row {
  display: grid;
  grid-template-columns: 130px 110px minmax(150px, 1fr) 130px auto;
  gap: 10px; align-items: end;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--panel-2);
}
@media (max-width: 900px) { .rule-row { grid-template-columns: 1fr 1fr; } }

/* A boxed section inside a form, e.g. the targets list. */
.subpanel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9, 14, 26, .5);
  padding: 14px;
}
.subpanel .panel-head { margin-bottom: 10px; gap: 12px; }
.subpanel h3 { font-size: .95rem; }

/* Step navigation for the publish page. */
.steps-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.step-pill {
  appearance: none; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); font: inherit; font-size: .85rem;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.step-pill:hover { color: var(--text); border-color: var(--border-strong); }
.step-pill.is-active {
  color: #fff; border-color: var(--accent);
  background: rgba(124, 140, 255, .16);
}

.form-step { animation: fade .16s ease; }

.target-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(170px, 1.4fr) 110px auto;
  gap: 10px; align-items: end;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
}

.target-row .field > span { font-size: .78rem; }

@media (max-width: 800px) {
  .target-row { grid-template-columns: 1fr 1fr; }
  .target-row button { grid-column: 1 / -1; justify-self: start; }
}

.btn {
  appearance: none; font: inherit; font-size: .88rem; font-weight: 550;
  text-decoration: none;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 7px 13px; cursor: pointer;
  white-space: nowrap; flex: none;
  transition: background .15s, border-color .15s, transform .1s, color .15s;
}
.btn:hover { background: rgba(124, 140, 255, .14); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #5566e8; border-color: #5566e8; color: #fff; box-shadow: none; }
.btn-primary:hover { background: #6273f0; border-color: #6273f0; }
.btn-discord { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.btn-discord svg { flex: none; }
.source-link { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; align-self: center; color: var(--muted); font-size: .84rem; text-decoration: none; }
.source-link:hover { color: var(--text); text-decoration: underline; }
.source-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.source-link svg { display: block; flex: none; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-icon { padding: 6px 11px; background: transparent; border-color: var(--border); }
.btn-danger { color: #fecdd3; border-color: rgba(251, 113, 133, .45); background: rgba(251, 113, 133, .1); }
.btn-danger:hover { background: rgba(251, 113, 133, .2); border-color: var(--fail); }
.btn-block { width: 100%; }
.btn-sm { font-size: .8rem; padding: 4px 10px; }

.link-btn { appearance: none; background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* ---------- forms ---------- */

.field { display: grid; gap: 6px; }
.field > span { font-size: .84rem; color: var(--muted); }
.field:has(:is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select):is(:required, [aria-required="true"]):not(:disabled):not([readonly])) > span:first-child::after,
[data-required-label]::after { content: ' *'; color: #f87171; font-size: .85em; font-weight: 600; white-space: pre; }
.field > em { font-style: normal; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.fields { display: grid; gap: 13px; }
.limit-quota-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.limit-speed-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.limit-speed-grid .field { min-width: 0; }
.limit-usage { display: grid; gap: 11px; }
.limit-usage-metric { display: grid; gap: 6px; }
.limit-usage-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; color: var(--muted); font-size: .83rem; }
.limit-usage-label strong { color: var(--text); font-weight: 550; }
.limit-usage-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--border-strong); }
.limit-usage-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
@media (max-width: 620px) { .limit-quota-grid, .limit-speed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.geoip-providers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.geoip-provider { display: flex; gap: 10px; align-items: start; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.geoip-provider:has(input:checked) { border-color: var(--accent); }
.geoip-provider input { width: auto; margin: 3px 0 0; accent-color: var(--accent); }
.geoip-provider strong, .geoip-provider em { display: block; }
.geoip-provider em { margin-top: 3px; color: var(--muted); font-size: .8rem; font-style: normal; }
.geoip-endpoint-row { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(0, 1.6fr); gap: 12px; }
[data-geoip-self] { display: grid; gap: 10px; }
@media (max-width: 650px) { .geoip-providers, .geoip-endpoint-row { grid-template-columns: 1fr; } }

input, select, textarea {
  font: inherit; color: var(--text);
  background: rgba(6, 10, 20, .72);
  border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 8px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(124, 140, 255, .45); outline-offset: 1px; border-color: var(--accent); }

.form-error, .field-error { color: #fecdd3; font-size: .85rem; }

.switch { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); }
.switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.switch strong { display: block; font-weight: 550; font-size: .9rem; }
.switch em { display: block; font-style: normal; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.token-permissions { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.token-permissions legend { padding: 0; margin-bottom: 10px; color: var(--muted); font-size: .84rem; }
.token-permissions .switch { cursor: pointer; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th { text-align: left; color: var(--dim); font-weight: 550; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table-header-button { appearance: none; border: 0; padding: 2px 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.table-header-button:hover, .table-header-button:focus-visible { color: var(--text); }
.table-header-button[data-sort="asc"]::after { content: " \2191"; color: var(--accent); }
.table-header-button[data-sort="desc"]::after { content: " \2193"; color: var(--accent); }
.table-header-button.has-filter::before { content: "\2022 "; color: var(--accent); }
.request-filter-list { display: grid; gap: 8px; max-height: min(48vh, 420px); overflow: auto; }
.request-column-options .row .btn { flex: 1; }
.request-facet-row .switch { flex: 1; min-width: 0; }
td { padding: 11px 10px; border-bottom: 1px solid rgba(94, 118, 168, .12); vertical-align: middle; }
tbody tr:hover { background: rgba(124, 140, 255, .05); }
/* A request row is green or red as a whole, so the decision reads at a glance
   from the row instead of from a pill in one cell. */
tbody tr.is-allowed { background: rgba(52, 211, 153, .09); }
tbody tr.is-blocked { background: rgba(251, 113, 133, .13); }
tbody tr.is-allowed:hover { background: rgba(52, 211, 153, .15); }
tbody tr.is-blocked:hover { background: rgba(251, 113, 133, .2); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- key/value ---------- */

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 9px 16px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ---------- events ---------- */

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

/* Request breakdowns and country / host bars on the Logs tab. */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; gap: 16px; margin-bottom: 18px; }
.chart { display: grid; gap: 8px; }
.chart h3 { font-size: .9rem; color: var(--muted); font-weight: 550; }
.pie-chart, .bar-chart { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.pie-layout { display: grid; justify-items: center; gap: 8px; }
.pie-visual { width: min(100%, 210px); aspect-ratio: 1; position: relative; }
.pie-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pie-slice { cursor: pointer; transition: stroke-width .12s ease, filter .12s ease; }
.pie-slice:hover, .pie-slice:focus { stroke-width: 40; filter: brightness(1.12); outline: none; }
.pie-hole { position: absolute; inset: 28%; display: grid; align-content: center; justify-items: center; gap: 2px; pointer-events: none; min-width: 0; text-align: center; color: var(--text); }
.pie-hole strong { font-family: var(--mono); font-size: 1.25rem; }
.pie-hole span { max-width: 100%; color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-legend { display: grid; gap: 6px; width: 100%; min-width: 0; }
.pie-legend-row { display: flex; align-items: center; gap: 7px; font-size: .78rem; min-width: 0; }
.pie-key { width: 8px; height: 8px; flex: none; border-radius: 2px; }
.pie-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-value { margin-left: auto; color: var(--muted); font-family: var(--mono); }
/* The label column takes the room it needs up to a limit and then clips: a
   hostname such as "phpmyadmin" used to run into the bar next to it. */
.bar-row { display: grid; grid-template-columns: minmax(0, 9rem) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.bar-row .code { font-family: var(--mono); color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: rgba(3, 6, 14, .6); border-radius: 5px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: #5566e8; border-radius: 5px; }
.bar-fill.is-blocked { background: var(--fail); }
.bar-row .value { color: var(--muted); font-family: var(--mono); }
.events li { display: grid; grid-template-columns: 150px max-content 1fr; gap: 12px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); font-size: .88rem; }
.events li .chip { justify-self: start; }
.events time { color: var(--dim); font-family: var(--mono); font-size: .82rem; }

.tokens { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.tokens li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); font-size: .88rem; }
.token-info { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.token-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tokens li > button { flex-shrink: 0; }
.linked-account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.linked-account { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); }
.linked-account-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.linked-account-logo { width: 44px; height: 44px; padding: 10px; border-radius: 11px; background: #5865f2; flex: none; }
.linked-account-label { display: grid; gap: 4px; min-width: 0; }
.linked-account-actions { display: flex; gap: 8px; flex: none; }
.linked-account-note { margin-top: 12px; }
@media (max-width: 420px) { .linked-account { padding: 12px; gap: 12px; } }

/* ---------- empty ---------- */

.empty { display: grid; place-items: center; gap: 12px; padding: 34px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 13px; background: rgba(13, 19, 33, .5); }
.empty h3 { font-size: 1rem; color: var(--text); }

/* ---------- modal / drawer ---------- */

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 14, .66); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal { width: min(680px, 100%); max-height: 88vh; overflow: auto; animation: rise .18s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.modal-shake { animation: modal-shake .34s ease; }
@keyframes modal-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { width: min(580px, 100%); height: 100%; max-height: 100vh; overflow: auto; border-radius: 0; border-right: 0; border-top: 0; border-bottom: 0; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(22px); opacity: .7; } to { transform: none; opacity: 1; } }
.drawer-overlay.is-closing { animation: drawer-fade-out .22s ease forwards; }
.drawer-overlay.is-closing .drawer { animation: drawer-slide-out .22s ease forwards; }
@keyframes drawer-fade-out { to { opacity: 0; } }
@keyframes drawer-slide-out { to { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .drawer-overlay, .drawer-overlay .drawer,
  .drawer-overlay.is-closing, .drawer-overlay.is-closing .drawer { animation-duration: .01ms; }
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.first-service-welcome { margin: 24px 0; color: #91bfff; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; font-size: clamp(2.5rem, 7vw, 3.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -.04em; text-align: center; }

.cmd {
  position: relative; font-family: var(--mono); font-size: .84rem;
  background: rgba(3, 6, 14, .82); border: 1px solid var(--border-strong);
  border-radius: 11px; padding: 13px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.cmd-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.callout { display: grid; gap: 5px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border-strong); background: rgba(124, 140, 255, .08); font-size: .87rem; }
.callout.warn { border-color: rgba(251, 191, 36, .38); background: rgba(251, 191, 36, .08); }
.callout.fail { color: #fecdd3; border-color: rgba(251, 113, 133, .5); background: rgba(251, 113, 133, .1); }
.target-loopback-warning { grid-column: 1 / -1; }
.callout.ok { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.callout strong { font-weight: 600; }

.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: .87rem; display: grid; gap: 6px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 10px; }
.toast { background: rgba(15, 22, 38, .96); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 11px 14px; min-width: 240px; max-width: 380px; box-shadow: var(--shadow); animation: rise .18s ease; font-size: .88rem; }
.toast.ok { border-left-color: var(--ok); }
.toast.fail { border-left-color: var(--fail); }

.exit-country-flag { flex: 0 0 24px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.exit-country-unknown { display: inline-flex; width: 24px; justify-content: center; color: var(--muted); }

/* Public reading pages also work without the dashboard JavaScript. */
.public-content { width: calc(100% - 40px); max-width: 1000px; margin: 48px auto; line-height: 1.8; overflow-wrap: anywhere; }
.public-content h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.25; margin-bottom: 24px; }
.public-content h2 { margin: 32px 0 12px; line-height: 1.35; }
.public-content h2.guide-step { font-size: 1.2rem; }
.public-content h3 { margin-bottom: 12px; line-height: 1.4; }
.public-content p { margin: 14px 0; color: var(--muted); }
.public-content pre { overflow-x: auto; padding: 18px; margin: 20px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); line-height: 1.6; }
.public-content :not(pre) > code { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--text); font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
.public-content a, .public-footer a { color: #fff; text-underline-offset: 3px; }
.privacy-policy { max-width: 860px; }
.public-content .policy-updated { color: var(--dim); font-size: .88rem; }
.privacy-policy h2[id] { scroll-margin-top: 24px; }
.privacy-summary { margin: 28px 0; padding: 20px 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.privacy-summary h2 { margin: 0 0 12px; font-size: 1.15rem; }
.privacy-summary ul { margin-bottom: 0; padding-left: 20px; }
.privacy-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 28px 0 36px; font-size: .9rem; line-height: 1.6; }
@media (max-width: 600px) { .privacy-toc { grid-template-columns: 1fr; } .privacy-summary { padding: 18px; } }
.faq-list { margin-top: 28px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item summary { color: #fff; cursor: pointer; font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
.faq-item summary:focus-visible { outline: 2px solid #fff; outline-offset: 5px; border-radius: 3px; }
.faq-item p:last-child { margin-bottom: 0; }
.public-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 28px 0; }
.public-grid section { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--panel); }
.public-grid h2 { font-size: 1.15rem; margin-top: 0; }
.public-footer { width: 100%; margin: auto 0 0; padding: 24px 20px; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
.public-footer span { color: var(--muted); }
.landing-hero { width: calc(100% - 40px); max-width: 1200px; margin: 40px auto 28px; display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 48px; }
.landing-hero-copy { min-width: 0; }
.landing-hero h1 { font-size: clamp(2.3rem, 4.2vw, 3.5rem); line-height: 1.12; font-weight: 500; letter-spacing: -.045em; }
.landing-hero-description { max-width: 460px; margin-top: 22px; color: var(--muted); line-height: 1.75; font-size: 1rem; }
.landing-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 24px; }
.landing-hero-actions .btn { gap: 12px; }
.landing-mesh-preview { position: relative; aspect-ratio: 4 / 3; margin: 0; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #0e1424; }
.landing-mesh-preview .topo { position: absolute; inset: 0; min-height: 0; }
.landing-mesh-preview .topo svg { width: 100%; height: 100%; }
.topo.topo-demo-static .node, .topo.topo-demo-static .hub-node { cursor: default; touch-action: auto; }
.topo.topo-demo-static .node:hover circle { r: 22; }
@media (prefers-reduced-motion: reduce) { .landing-mesh-preview .topo.topo-demo-static .link { animation: none; } }
.landing-network { margin: 0 0 12px; scroll-margin-top: 24px; }
.landing-network > .public-content { max-width: 1200px; margin-top: 0; margin-bottom: 20px; }
.landing-network h2 { margin-top: 0; }
.landing-network .landing-map { max-width: 1200px; }
.landing-details { margin-top: 32px; margin-bottom: 32px; }
.landing-details > h2:first-child { margin-top: 0; }
html:has(#network-locations) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(#network-locations) { scroll-behavior: auto; } }
.guide-images { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 24px 0; }
.guide-figure { margin: 24px 0; }
.guide-video { margin: 24px 0; }
.guide-video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 12px; }
.guide-images .guide-figure { margin: 0; }
.guide-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; }
.guide-agent-card { max-width: 280px; }
.guide-install-modal { max-width: 675px; }
.guide-figure figcaption { margin-top: 10px; color: var(--muted); font-size: .85rem; line-height: 1.6; }
@media (max-width: 700px) { .guide-images { grid-template-columns: 1fr; } .guide-agent-card { margin-left: auto !important; margin-right: auto !important; } }
.not-found { text-align: center; margin: auto; padding: 48px 20px; }
.not-found-cat { display: block; width: 180px; max-width: 100%; height: auto; margin: 0 auto 24px; }
.not-found .error-code { color: var(--muted); font-size: .95rem; letter-spacing: .12em; margin-bottom: 12px; }
.not-found .btn { margin-top: 12px; }
@media (max-width: 800px) { .public-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .landing-hero { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; } .landing-hero-description { max-width: none; } .landing-mesh-preview { max-width: 560px; width: 100%; margin: 0 auto; } }
@media (max-width: 600px) { .landing-hero, .landing-network > .public-content { width: calc(100% - 28px); } .landing-hero h1 { font-size: 2.3rem; } }

.ticket-panel > .panel-head { flex-wrap: wrap; gap: 12px; }
.ticket-panel > .panel-head > .row { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.ticket-panel [data-ticket-filter] { width: auto; }
.ticket-subject { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; padding: 0; text-align: left; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.ticket-subject:hover { color: var(--accent); }
.ticket-conversation { min-width: 0; }
.ticket-conversation h2 { overflow-wrap: anywhere; }
.ticket-messages { display: grid; gap: 16px; max-height: 65vh; overflow-y: auto; }
.ticket-message { padding: 16px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.ticket-message-admin { border-left: 3px solid var(--accent); }
.ticket-message > .row { flex-wrap: wrap; gap: 10px; }
.ticket-message-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; }
.ticket-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ticket-files a { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.ticket-closed-status { color: var(--fail); }

/* Quick setup keeps related fields on one line within the modal. */
.quick-resource-form .quick-form-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; }
.quick-resource-form .domain-row.is-single { grid-template-columns: minmax(0, 1fr); }
.quick-resource-form .quick-server-row { grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); }
.quick-resource-form .quick-proxy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-proxy-grid .type-card { padding: 11px 10px; align-items: center; }
.quick-proxy-grid .type-card-body strong { font-size: .78rem; }
@media (max-width: 420px) {
  .quick-resource-form .quick-form-row { grid-template-columns: minmax(0, 1fr); }
  .quick-resource-form .quick-server-row { grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr); }
}

/* Admin DNS diagnostics */
[data-geodns-panel] .form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
[data-geodns-panel] .form-row input, [data-geodns-panel] .form-row select { flex: 1 1 300px; min-width: 0; }
[data-geodns-panel] td { vertical-align: top; max-width: 380px; overflow-wrap: anywhere; white-space: normal; }
[data-geodns-panel] td:last-child { min-width: 250px; }
[data-geodns-panel] summary { cursor: pointer; color: var(--accent); }
[data-geodns-panel] details p { margin: 10px 0; }
[data-geodns-panel] small { display: block; color: var(--muted); margin-top: 5px; }
