/* Ellis Bells — one stylesheet, served as /static/style.css?v=<content hash>.
   Strong violet-ink base, a brass bell, and the pride spectrum as the "ring"
   that marks live things. No inline styles anywhere (CSP style-src 'self'). */

:root {
  color-scheme: dark;
  --bg: #17132b;
  --bg-deep: #120e23;
  --surface: #211b3d;
  --surface-2: #2c2550;
  --line: #3d3468;
  --text: #f7f4ff;
  --muted: #bdb4dd;
  --brass: #ffd166;
  --bell: #ffd166;
  --brass-ink: #1d1638;
  --ok: #63e6a4;
  --warn: #ffb067;
  --danger: #ff8595;
  --danger-bg: #4a1f3a;
  --focus: #5cc2ff;
  --r1: #ff6b7d; --r2: #ffa94d; --r3: #ffe066; --r4: #63e6a4; --r5: #5cc2ff; --r6: #b48cff;
  --spectrum: linear-gradient(90deg, var(--r1), var(--r2), var(--r3), var(--r4), var(--r5), var(--r6));
  --font: ui-rounded, "SF Pro Rounded", "Avenir Next", "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -24px rgba(5, 2, 20, .8);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf7ff;
    --bg-deep: #f1ecfb;
    --surface: #ffffff;
    --surface-2: #f3eefc;
    --line: #ddd3f0;
    --text: #1d1638;
    --muted: #574d77;
    --brass: #ffd166;
    --bell: #d99a00;
    --brass-ink: #1d1638;
    --ok: #0b7a4b;
    --warn: #8f4c00;
    --danger: #b4233a;
    --danger-bg: #fde8ec;
    --focus: #1665c1;
    --shadow: 0 18px 40px -28px rgba(40, 20, 90, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--text); text-decoration-color: var(--r5); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--r3); }
strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.flush { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brass); color: var(--brass-ink); padding: .5rem .8rem; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }

/* ------------------------------------------------------------------ bell */
.bell { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -.22em; fill: var(--bell); transform-origin: 50% 8%; }
.bell .bell-clapper { fill: inherit; }
.is-ringing { animation: ring .9s cubic-bezier(.36, .07, .19, .97) 1; }
@keyframes ring {
  0% { transform: rotate(0); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-13deg); }
  45% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
  100% { transform: rotate(0); }
}

/* ---------------------------------------------------------------- topbar */
.topbar { background: var(--bg-deep); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -.02em; }
.brand-bell { width: 1.6rem; height: 1.6rem; }
.brand:hover .brand-bell { animation: ring .9s cubic-bezier(.36, .07, .19, .97) 1; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a, .nav .linkish { color: var(--muted); text-decoration: none; padding: .4rem .7rem; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav .linkish:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a.btn-primary { color: var(--brass-ink); margin-left: .25rem; }
.nav-form { margin: 0; }
.linkish { background: none; border: 0; font: inherit; cursor: pointer; }
.rainbow-rule { height: 3px; background: var(--spectrum); }

/* --------------------------------------------------------------- layout */
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 2.25rem 1rem 4rem; }
.page-narrow { max-width: 460px; }
.page-wide { max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.two-col { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 700 .95rem/1 var(--font); padding: .75rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background-color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn-primary:hover { background: #ffdc8a; border-color: #ffdc8a; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #22091a; }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger); }
.btn-danger-text { color: var(--danger); }
.btn-small { padding: .45rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------- pills/banners */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.pill-ok { color: var(--ok); border-color: currentColor; }
.pill-ok::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill-soon { color: var(--muted); border-style: dashed; }
.pill-warn { color: var(--warn); border-color: currentColor; }
.pill-danger { color: var(--danger); border-color: currentColor; }
.pill-plain { color: var(--text); background: var(--surface-2); border-color: transparent; }

.banner { padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1rem; border: 1.5px solid; font-weight: 600; }
.banner-error { color: var(--danger); border-color: currentColor; background: var(--danger-bg); }
.banner-ok { color: var(--ok); border-color: currentColor; }
.banner-warn { color: var(--warn); border-color: currentColor; }
.banner-info { color: var(--text); border-color: var(--line); background: var(--surface-2); }

/* ----------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }

/* ----------------------------------------------------------------- forms */
.stack { display: grid; gap: 1rem; margin: 1rem 0; }
.field { display: grid; gap: .35rem; }
.field > span:first-child { font-weight: 700; font-size: .9rem; }
input, select {
  font: inherit; color: var(--text); background: var(--bg); border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: .65rem .8rem; width: 100%; min-width: 0;
}
input:focus, select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], .claim.has-error { border-color: var(--danger); }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--brass); }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; }
.field-hint { color: var(--muted); font-size: .85rem; }
.code-input { letter-spacing: .3em; font-size: 1.25rem; text-align: center; }
form.inline { display: inline; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------ auth pages */
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem 1.6rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); }
.auth-switch { margin: .5rem 0 0; font-size: .9rem; }
.error-code { font-size: 3rem; font-weight: 800; margin: 0; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --------------------------------------------------------------- landing */
.landing-main { width: 100%; }
.hero {
  max-width: 1180px; margin: 0 auto; padding: clamp(2.5rem, 7vw, 5.5rem) 1rem clamp(2rem, 5vw, 4rem);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
}
.hero-title { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 850; letter-spacing: -.035em; line-height: .98; margin-bottom: 1.25rem; max-width: 11ch; }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 34rem; }
.hero-lede .mono { color: var(--text); }
.hero-ctas { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-ctas .btn { padding: .95rem 1.4rem; font-size: 1rem; }

.hero-copy, .hero-visual { min-width: 0; }
.hero-visual { display: grid; gap: 1.25rem; justify-items: center; }
.rings { position: relative; width: min(300px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; border-radius: 50%; padding: 4px; background: var(--spectrum);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .9; }
.ring.r2 { inset: 14%; opacity: .65; }
.ring.r3 { inset: 28%; opacity: .4; }
.hero-bell { width: 38%; height: 38%; position: relative; filter: drop-shadow(0 10px 24px rgba(255, 209, 102, .35)); }
.hero-bell { animation: ring 1.4s cubic-bezier(.36, .07, .19, .97) .5s 1; }
.ring { animation: ripple 1.6s ease-out .55s 1 both; }
.ring.r2 { animation-delay: .45s; }
.ring.r3 { animation-delay: .35s; }
@keyframes ripple { 0% { transform: scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }

.serverlist { min-width: 0; width: 100%; max-width: 420px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; }
.sl-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 10px; }
.sl-row-you { background: var(--surface); outline: 2px solid var(--brass); outline-offset: -2px; }
.sl-icon { width: 2.4rem; height: 2.4rem; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; }
.sl-icon .bell { width: 1.5rem; height: 1.5rem; }
.sl-icon-you { background: var(--spectrum); }
.sl-icon-you .bell { fill: var(--brass-ink); }
.sl-text { display: grid; line-height: 1.25; min-width: 0; }
.sl-text .mono { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.sl-bars i { width: 3px; background: var(--ok); border-radius: 1px; }
.sl-bars i:nth-child(1) { height: 20%; } .sl-bars i:nth-child(2) { height: 40%; } .sl-bars i:nth-child(3) { height: 60%; }
.sl-bars i:nth-child(4) { height: 80%; } .sl-bars i:nth-child(5) { height: 100%; }
.sl-bars i.off { background: var(--line); }

.section { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) 1rem; }
.section-head { margin-bottom: 1.5rem; max-width: 40rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }

.region-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.region-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.25rem 1.1rem; display: grid; gap: .25rem; align-content: start; position: relative; overflow: hidden; }
.region-card h3 { margin: 0; font-size: 1.15rem; }
.region-card p { margin: 0 0 .6rem; font-size: .9rem; }
.region-card .pill { justify-self: start; }
.region-code { color: var(--muted); font-size: .8rem; }
.region-card p.region-host { color: var(--text); font-size: .8rem; margin-bottom: .75rem; }
.region-card.is-live { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.region-card.is-live::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border-radius: var(--radius-lg); padding: 1.4rem; border: 1px solid var(--line); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brass); color: var(--brass-ink); font-weight: 850; margin-bottom: .8rem; }
.steps p { color: var(--muted); margin: 0; }

.facts { display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-top: 1px solid var(--line); }
.fact h3 { margin-bottom: .3rem; }
.fact p { margin: 0; font-size: .95rem; }

.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 1rem; }

/* ------------------------------------------------------------- dashboard */
.state-card { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow); }
.state-card p:last-child { margin-bottom: 0; }
.state-bell { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.state-bell .bell { width: 2rem; height: 2rem; }
.state-pending .state-bell { background: var(--spectrum); }
.state-pending .state-bell .bell { fill: var(--brass-ink); }
.bell-waiting { animation: ring 1.2s cubic-bezier(.36, .07, .19, .97) .4s 1; }
.state-rejected .bell, .state-locked .bell { fill: var(--muted); }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; display: grid; gap: .35rem; align-content: start; }
.stat-label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat-of { font-size: 1rem; font-weight: 600; color: var(--muted); }
.stat.is-over { border-color: var(--danger); }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--spectrum); background-size: 100vw 100%; }
.stat.is-over .meter > span { background: var(--danger); }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

.create-form { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr); align-items: start; margin-top: .75rem; }
.field-host { grid-column: 1; }
.field-port { grid-column: 2; }
.create-submit { grid-column: 1 / -1; justify-self: start; }
.preview { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .95rem; }
.preview .mono { color: var(--text); font-weight: 700; word-break: break-all; }
.claim { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.claim:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.claim input { border: 0; border-radius: 0; box-shadow: none; font-family: var(--mono); }
.claim input:focus { box-shadow: none; }
.claim-suffix { display: flex; align-items: center; padding: 0 .8rem; color: var(--muted); background: var(--surface-2); white-space: nowrap; }

.list-heading { margin: 2rem 0 .75rem; }
.route-list { display: grid; gap: .75rem; }
.route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
.route-icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.route-icon .bell { width: 1.6rem; height: 1.6rem; }
.route.is-active .route-icon { background: var(--spectrum); }
.route.is-active .route-icon .bell { fill: var(--brass-ink); }
.route.is-paused .route-icon .bell, .route.is-blocked .route-icon .bell { fill: var(--muted); }
.route-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.route-name { margin: 0; font-size: 1.2rem; font-weight: 800; word-break: break-word; }
.rename-btn { padding: .25rem .6rem; }
.rename { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rename .field { flex: 1 1 200px; }
.route-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.route-host { font-size: .98rem; font-weight: 600; overflow-wrap: anywhere; }
.route-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.region-tag { color: var(--text); }
.route-arrow { color: var(--r5); }
.route-reason { margin: .35rem 0 0; color: var(--danger); font-weight: 600; font-size: .9rem; }
.route-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.route-actions form { margin: 0; }
.route-confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1rem; border-radius: var(--radius); background: var(--danger-bg); color: var(--text); }
.route-confirm span { flex: 1 1 260px; font-weight: 600; }
.empty { border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; color: var(--muted); }
.empty p { margin: 0; }

.copy { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; border: 1.5px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.copy:hover { color: var(--text); background: var(--surface-2); }
.copy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.copy .ic-check { opacity: 0; color: var(--ok); }
.copy.copied .ic-copy { opacity: 0; }
.copy.copied .ic-check { opacity: 1; }

.howto { margin-top: 2rem; }
.howto-steps { padding-left: 1.25rem; margin: .5rem 0 1rem; }
.howto-steps li { margin-bottom: .4rem; }
.howto-steps li::marker { color: var(--brass); font-weight: 800; }

/* --------------------------------------------------------------- account */
.qr { background: #fff; border-radius: var(--radius); padding: .75rem; width: max-content; max-width: 100%; margin: .5rem 0 1rem; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { word-break: break-all; color: var(--text); }

/* ----------------------------------------------------------------- admin */
.admin-section { margin-top: 2.5rem; scroll-margin-top: 5rem; }
.admin-section h3 { margin-top: 1.5rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .7rem .9rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 700; font-size: .85rem; background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.is-disabled td { opacity: .6; }
td.actions { white-space: nowrap; }
td.actions form, td.actions details { display: inline-block; margin: 0 .15rem .2rem 0; vertical-align: middle; }
details.confirm summary { list-style: none; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm[open] summary { display: none; }
.limits-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.limits-form .mini { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); }
.limits-form input[type="number"] { width: 6rem; padding: .4rem .5rem; }
.toggle { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .85rem; }
.region-strip { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.region-strip li { padding: .35rem .7rem; border-radius: 999px; border: 1.5px dashed var(--line); color: var(--muted); font-size: .85rem; }
.region-strip li.is-live { border-style: solid; border-color: var(--ok); color: var(--ok); }
.search-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.search-row .field { flex: 0 1 320px; }
.inline-rename { display: inline-flex; gap: .3rem; align-items: center; }
.inline-rename input { width: 12rem; padding: .35rem .5rem; }
.link-box { display: flex; gap: .5rem; align-items: center; background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .7rem; margin: 1rem 0; }
.link-box .mono { flex: 1; word-break: break-all; }

/* -------------------------------------------------------------- login log */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin: 0 0 1.5rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-image: var(--spectrum) 1; border-bottom-width: 3px; border-bottom-style: solid; }
.chips { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; color: var(--muted); font-size: .9rem; }
.chips .chip-num { color: var(--text); font-weight: 800; margin-right: .2rem; }
.chips li.is-live { border-color: var(--ok); }
.chips li.is-live .chip-num { color: var(--ok); }
.filters { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 1rem; }
.filters input, .filters select { padding: .5rem .6rem; }
.filter-actions { display: flex; gap: .4rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: .75rem; margin: 1rem 0; }
.copy.copy-small { width: 1.5rem; height: 1.5rem; vertical-align: middle; margin-left: .2rem; }
.copy.copy-small svg { width: .8rem; height: .8rem; }
table.logins td { font-size: .88rem; }
table.logins tr.login-refused td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.logins tr.login-live td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-deep); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1rem; display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: .9rem; }
.footer-brand { font-weight: 800; display: inline-flex; align-items: center; gap: .4rem; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { order: -1; }
  .rings { width: min(200px, 55vw); }
}
@media (max-width: 640px) {
  .create-form { grid-template-columns: 1fr; }
  .field-host, .field-port { grid-column: 1; }
  .create-submit { width: 100%; }
  .route { grid-template-columns: auto minmax(0, 1fr); }
  .route-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .state-card { grid-template-columns: 1fr; }
  .claim { flex-wrap: wrap; }
  .claim-suffix { width: 100%; padding: .4rem .8rem; }
  .nav a, .nav .linkish { padding: .35rem .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Illustrative addresses (landing, pending dashboard): never copyable. */
.example-addr { font-style: italic; opacity: .72; user-select: none; -webkit-user-select: none; }
.serverlist-example { position: relative; margin: 0; }
.example-badge { position: absolute; top: -.7rem; right: .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.example-caption { margin: .45rem .7rem .2rem; }

/* Bandwidth charts (inline SVG from templates/_charts.html). Two series,
   validated for CVD separation and contrast on both surfaces:
   dark #2f95dc / #c96f12 on #211b3d, light #1665c1 / #b45f00 on #fff. */
:root { --series-user: #2f95dc; --series-static: #c96f12; }
@media (prefers-color-scheme: light) {
  :root { --series-user: #1665c1; --series-static: #b45f00; }
}
.chart { margin: .5rem 0 1rem; }
.chart-summary { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .5rem; padding: 0; font-size: .875rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.swatch { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }
.swatch.bar-user { background: var(--series-user); }
.swatch.bar-static { background: var(--series-static); }
.chart-scroll { overflow-x: auto; }
.chart-svg { display: block; width: 100%; min-width: 520px; height: auto; }
.chart-svg text { fill: var(--muted); font: 600 10px var(--font); }
.chart-svg .chart-axis-title { font-weight: 700; }
.chart-grid line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-baseline { stroke: var(--muted); stroke-width: 1; }
path.bar-user { fill: var(--series-user); }
path.bar-static { fill: var(--series-static); }
.bar-hit { fill: transparent; pointer-events: all; }
.bar:hover .bar-hit { fill: var(--text); fill-opacity: .06; }
.chart-table { margin-top: .5rem; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: .875rem; font-weight: 600; }
.chart-table .table-wrap { margin-top: .5rem; max-height: 22rem; overflow-y: auto; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; background: var(--surface-2); border-radius: 999px; padding: .2rem; }
.seg a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.bw-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.bw-stats .stat-projection { border-style: dashed; }
.card-head { flex-wrap: wrap; }
table.data tbody th { background: none; color: var(--text); font-weight: 600; font-size: .92rem; }
.bw-user { margin-top: 1.25rem; }
.stat-num.stat-pending { font-size: 1.05rem; line-height: 1.3; }
.chart-note { margin: .25rem 0 .75rem; }
.bw-quota { margin-bottom: 1rem; }
