:root {
  --bg: #07111f;
  --surface: #0d1b2d;
  --surface-2: #11243a;
  --line: #213851;
  --text: #edf6ff;
  --muted: #8fa7bd;
  --accent: #37d5ff;
  --accent-2: #4c7dff;
  --success: #39dda2;
  --danger: #ff6685;
  --warning: #f9c74f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
}
.diagnostic-key { display: block; overflow-wrap: anywhere; max-width: 22rem; user-select: all; margin-top: 10px; }
.diagnostic-warning { color: var(--warning); margin: 8px 0; }
.diagnostic-heading { margin-top: 32px; }
.spaced, .bulk-panel { margin-top: 20px; margin-bottom: 20px; }
.text-link { color: var(--accent); }
textarea, select { font: inherit; padding: 12px; color: var(--text); border: 1px solid var(--line); border-radius: 10px; background: #081625; min-width: 0; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
.check-label { display: flex; align-items: center; gap: 12px; }
.check-label input { width: 20px; min-height: 20px; }
.action-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 26px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--surface); box-shadow: 0 28px 100px #0009; text-align: left; }
.action-dialog::backdrop { background: rgba(2,8,16,.75); backdrop-filter: blur(4px); }
.action-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 22px; }
.action-dialog-head h2 { margin-bottom: 8px; font-size: 1.25rem; }
.action-dialog-head p { margin: 0; overflow-wrap: anywhere; }
.dialog-close { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body:has(.action-dialog[open]) { overflow: hidden; }
.action-items { display: grid; gap: 18px; }
.action-items .button { width: 100%; }
.action-group { display: grid; gap: 8px; margin: 0; }
.action-group + .action-group { padding-top: 18px; border-top: 1px solid var(--line); }
.action-group-title { margin: 0 0 2px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.action-group-danger .action-group-title { color: var(--danger); }
.action-group-note { margin: 2px 0; font-size: .85rem; }
.action-dialog .button { min-height: 46px; font-size: .95rem; }
.action-dialog form { margin: 0; }
.password-view { display: grid; gap: 10px; }
.password-reveal { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #081625; }
.password-reveal label { margin: 0; }
.password-reveal input { margin-top: 7px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; user-select: all; }
.password-unavailable { margin: 4px 0; font-size: .9rem; }
.filter-form { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin: 24px 0; }
.pagination { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.dns-domain { max-width: 28rem; overflow-wrap: anywhere; font-weight: 700; color: var(--text); }
.dns-result { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.dns-result.allowed { color: var(--success); background: rgba(57,221,162,.1); }
.dns-result.blocked { color: var(--danger); background: rgba(255,102,133,.1); }
.help-item { padding: 14px 0; border-top: 1px solid var(--line); line-height: 1.6; }
.diagnostic-details { min-width: 250px; max-width: 360px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
details summary { cursor: pointer; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% -10%, #133555 0, transparent 38rem), var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(143,167,189,.18); background: rgba(7,17,31,.78); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #041019; background: linear-gradient(135deg, var(--accent), #82f8dc); font-weight: 900; box-shadow: 0 0 32px rgba(55,213,255,.2); }
.brand-mark.large { width: 52px; height: 52px; border-radius: 15px; font-size: 1.4rem; }
.topbar nav { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: .9rem; }
.topbar nav a:hover, .link-button:hover { color: var(--text); }
.user-name { color: var(--text); font-weight: 650; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }
.page-centered { min-height: 100vh; display: grid; place-items: center; padding: 32px 0; }
.login-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(17,36,58,.98), rgba(10,25,42,.98)); box-shadow: 0 30px 90px rgba(0,0,0,.36); }
.login-brand { margin-bottom: 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 1.18rem; letter-spacing: -.015em; }
.muted { color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 18px; margin-top: 30px; }
label { display: grid; gap: 8px; color: #bed0df; font-size: .88rem; font-weight: 650; }
input { min-height: 48px; padding: 0 14px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; outline: none; background: #081625; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(55,213,255,.12); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 750; transition: transform .15s, filter .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.button.primary { color: #03131c; background: linear-gradient(135deg, var(--accent), #73f0df); }
.button.danger { color: #ffdce4; border-color: rgba(255,102,133,.42); background: rgba(255,102,133,.09); }
.button.ghost { color: #c8d7e5; border-color: var(--line); background: transparent; }
.button.small { min-height: 34px; padding: 0 11px; font-size: .8rem; }
.button.full { width: 100%; }
.page-head { margin-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { margin-bottom: 10px; color: var(--accent); font-size: .75rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.panel, .stat-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17,36,58,.88), rgba(11,27,46,.88)); box-shadow: 0 22px 55px rgba(0,0,0,.16); }
.panel { border-radius: 18px; padding: 26px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 148px; display: flex; flex-direction: column; padding: 22px; border-radius: 16px; }
.stat-card span { color: var(--muted); font-size: .82rem; }
.stat-card strong { margin: 22px 0 auto; font-size: 1.28rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat-card small { margin-top: 7px; color: #68849d; font-size: .75rem; }
.config-panel, .create-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.config-panel p, .create-panel p { margin-bottom: 0; }
.config-actions, .actions, .create-form { display: flex; align-items: center; gap: 10px; }
.empty-config { padding: 70px 30px; text-align: center; }
.empty-config p { max-width: 520px; margin: 0 auto 28px; }
.config-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid rgba(55,213,255,.4); border-radius: 18px; color: var(--accent); background: rgba(55,213,255,.08); font-size: 2rem; }
.status { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status.online { color: var(--success); background: rgba(57,221,162,.1); }
.status.offline { color: #8297aa; background: rgba(130,151,170,.1); }
.large-status { padding: 8px 13px; font-size: .85rem; }
.count-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .84rem; }
.create-panel { margin-bottom: 18px; }
.create-form input { width: 220px; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 15px 20px; color: #6f8ba4; background: rgba(4,16,29,.38); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 18px 20px; border-top: 1px solid rgba(33,56,81,.72); color: #cbd9e5; vertical-align: middle; font-size: .88rem; }
td strong, td small { display: block; }
td small { margin-top: 5px; color: #a3b8cb; font-size: .875rem; }
th { font-size: .875rem; }
.stat-card small { font-size: .875rem; color: #a3b8cb; }
.topbar nav { flex-wrap: wrap; }
.empty { padding: 46px; text-align: center; color: var(--muted); }
.flash { margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: 12px; line-height: 1.45; }
.flash-success { color: #9bffda; border-color: rgba(57,221,162,.35); background: rgba(57,221,162,.09); }
.flash-error { color: #ffc1ce; border-color: rgba(255,102,133,.38); background: rgba(255,102,133,.1); }
.flash-secret { color: #fff0a7; border-color: rgba(249,199,79,.4); background: rgba(249,199,79,.1); font-weight: 700; overflow-wrap: anywhere; }
.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; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .actions { align-items: stretch; flex-direction: column; }
}
@media (max-width: 650px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 20px; }
  .topbar nav { gap: 12px; }
  .user-name { display: none; }
  .page { width: min(100% - 24px, 1180px); padding-top: 36px; }
  .login-card { padding: 28px 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .config-panel, .create-panel { align-items: stretch; flex-direction: column; }
  .config-actions, .create-form { align-items: stretch; flex-direction: column; width: 100%; }
  .create-form input { width: 100%; }
  .config-actions .button, .config-actions form, .config-actions form .button { width: 100%; }
  h1 { font-size: 2.2rem; }
}
