/* nxdns console — neutral, dense, wide. Themes: [data-theme=light|dark|system] on <html>. */

/* ---- tokens ---- */
:root, :root[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f2f4f7; --side: #fbfbfc;
  --text: #0f1419; --text-2: #3a434e; --muted: #67707d; --faint: #98a0ab;
  --line: #e4e7eb; --line-2: #d6dae0;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #eef3fe; --accent-text: #ffffff; --focus: rgba(37, 99, 235, .28);
  --ok: #18794e; --ok-soft: #eaf6ef; --ok-line: #bfe3cf;
  --warn: #9a5b00; --warn-soft: #fdf5e7; --warn-line: #f0d9a8;
  --bad: #c62828; --bad-soft: #fdeeee; --bad-line: #f2c4c4;
  --code: #f2f4f7; --code-block: #0d1117; --code-text: #d1d7e0;
  --overlay: rgba(15, 20, 25, .4); --pop-shadow: 0 8px 28px rgba(15, 20, 25, .14), 0 1px 3px rgba(15, 20, 25, .08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0c0e; --surface: #111317; --surface-2: #15181d; --surface-3: #1b1f25; --side: #0e1013;
  --text: #e8eaed; --text-2: #c3c8cf; --muted: #9098a3; --faint: #646c77;
  --line: #22262d; --line-2: #2e333b;
  --accent: #3b82f6; --accent-hover: #5b96f7; --accent-soft: #14213a; --accent-text: #ffffff; --focus: rgba(59, 130, 246, .35);
  --ok: #4cc38a; --ok-soft: #0f2419; --ok-line: #1d4a33;
  --warn: #e3a547; --warn-soft: #2a1f0d; --warn-line: #4e3a17;
  --bad: #f06a6a; --bad-soft: #2d1416; --bad-line: #57242a;
  --code: #1a1e24; --code-block: #08090b; --code-text: #c9d1db;
  --overlay: rgba(0, 0, 0, .6); --pop-shadow: 0 10px 32px rgba(0, 0, 0, .55), 0 0 0 1px var(--line);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b0c0e; --surface: #111317; --surface-2: #15181d; --surface-3: #1b1f25; --side: #0e1013;
    --text: #e8eaed; --text-2: #c3c8cf; --muted: #9098a3; --faint: #646c77;
    --line: #22262d; --line-2: #2e333b;
    --accent: #3b82f6; --accent-hover: #5b96f7; --accent-soft: #14213a; --accent-text: #ffffff; --focus: rgba(59, 130, 246, .35);
    --ok: #4cc38a; --ok-soft: #0f2419; --ok-line: #1d4a33;
    --warn: #e3a547; --warn-soft: #2a1f0d; --warn-line: #4e3a17;
    --bad: #f06a6a; --bad-soft: #2d1416; --bad-line: #57242a;
    --code: #1a1e24; --code-block: #08090b; --code-text: #c9d1db;
    --overlay: rgba(0, 0, 0, .6); --pop-shadow: 0 10px 32px rgba(0, 0, 0, .55), 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}
:root {
  --r: 6px; --r-sm: 5px; --r-lg: 8px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

/* ---- base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 20px; line-height: 1.3; margin: 0; font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }
h2 { font-size: 14px; margin: 0 0 .75rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
h2 .ic { width: 16px; height: 16px; color: var(--muted); }
h3 { font-size: 11px; margin: 0 0 .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
p { margin: .35rem 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; margin: .4rem 0 0; min-height: 1.1em; }
.ic { width: 16px; height: 16px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: var(--focus); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .75rem; padding: .9rem .65rem;
  background: var(--side); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 14px; color: var(--text); padding: .25rem .5rem .5rem; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: var(--text); color: var(--bg); }
.logo svg { width: 14px; height: 14px; }
.logo.lg { width: 36px; height: 36px; border-radius: 7px; }
.logo.lg svg { width: 20px; height: 20px; }
.env { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 0 .35rem; }
.side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side nav a, .me { display: flex; align-items: center; gap: .6rem; height: 32px; padding: 0 .6rem; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; }
.side nav a .ic, .me .ic { color: var(--muted); }
.side nav a:hover, .me:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.side nav a[aria-current], .me.on { background: var(--surface-3); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.side nav a[aria-current] .ic { color: var(--text); }
.nav-label { font-size: 10.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin: .9rem .6rem .25rem; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 .35rem; border-radius: 4px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.side-foot { border-top: 1px solid var(--line); padding-top: .65rem; display: flex; flex-direction: column; gap: .3rem; }
.side-foot form { margin: 0; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.side-foot .ghost { width: 100%; justify-content: flex-start; color: var(--muted); height: 32px; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: .2rem; }
.theme-switch button { height: 24px; padding: 0; font-size: 11.5px; font-weight: 500; border: none; background: none; color: var(--muted); border-radius: 4px; }
.theme-switch button:hover { color: var(--text); background: none; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.content { padding: 22px 32px 72px; width: 100%; max-width: 1640px; min-width: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .5rem .75rem; gap: .4rem;
    border-right: none; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 .3rem; }
  .env, .nav-label, .me span, .side-foot .ghost span { display: none; }
  .side nav { flex-direction: row; flex: 1; overflow-x: auto; }
  .side-foot { flex-direction: row; align-items: center; border: none; padding: 0; }
  .theme-switch { margin: 0; width: 150px; }
  .side-foot .ghost { width: auto; }
  .content { padding: 16px 14px 64px; }
}

/* ---- page ---- */
.crumb { margin: 0 0 .3rem; font-size: 12px; color: var(--muted); }
.crumb a { color: var(--muted); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head p { margin: .25rem 0 0; font-size: 12.5px; }
.title-row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.head-meta { display: flex; align-items: center; gap: .9rem; font-size: 12px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.danger-zone { border-color: var(--bad-line); }
.danger-zone h2 { color: var(--bad); }

/* ---- controls ---- */
input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 0 .65rem; height: 32px; min-width: 0; transition: border-color .1s, box-shadow .1s; }
textarea { height: auto; padding: .5rem .65rem; width: 100%; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
select { padding-right: 1.6rem; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input.lg { height: 38px; font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; padding: 0; }
input[type=file] { height: auto; padding: .35rem; }
button, .button { font: inherit; font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 32px; padding: 0 .85rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .1s, border-color .1s; }
button:hover, .button:hover { background: var(--surface-3); text-decoration: none; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover { filter: brightness(1.08); background: var(--bad); }
button.ghost { border-color: transparent; background: none; }
button.ghost:hover { background: var(--surface-3); }
button.sm, .button.sm { height: 28px; padding: 0 .65rem; font-size: 12.5px; }
button.block { width: 100%; height: 36px; }
button[disabled] { opacity: .55; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--line); }
button.icon-btn.danger { background: none; border-color: transparent; color: var(--muted); }
button.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); filter: none; }
form.inline { display: inline; margin: 0; }

.field { display: flex; flex-direction: column; gap: .3rem; font-size: 12px; font-weight: 550; color: var(--text-2); min-width: 0; }
.field > input, .field > select, .field > textarea { font-weight: 400; }
.field.sm { flex: 0 0 10rem; }
.field.grow, .grow { flex: 1 1 14rem; }
.field-hint { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: 13px; color: var(--text); padding-bottom: .4rem; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.2rem; }
.stack.narrow { max-width: 380px; }
.form-row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > .field:not(.sm) { flex: 1 1 14rem; }
.actions-row { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ---- status pills, record types ---- */
.pill { display: inline-flex; align-items: center; gap: .35rem; height: 20px; padding: 0 .45rem; font-size: 11.5px; font-weight: 600;
  border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.pill.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.pill.lg { height: 22px; font-size: 12px; }
.pill.xs { height: 17px; font-size: 10.5px; padding: 0 .3rem; }
a.pill:hover { text-decoration: none; filter: brightness(.97); }
.type { display: inline-block; min-width: 3.6rem; text-align: center; font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: .12rem .4rem; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); }
.type.lg { font-size: 12px; }
.t-A, .t-AAAA { color: #2f6fd6; }
.t-CNAME, .t-ALIAS { color: #7a52c7; }
.t-MX { color: #13866f; }
.t-TXT { color: #a3620a; }
:root[data-theme="dark"] .t-A, :root[data-theme="dark"] .t-AAAA { color: #7aa7f2; }
:root[data-theme="dark"] .t-CNAME, :root[data-theme="dark"] .t-ALIAS { color: #b195ec; }
:root[data-theme="dark"] .t-MX { color: #5fd0b5; }
:root[data-theme="dark"] .t-TXT { color: #e3a65a; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .t-A, :root[data-theme="system"] .t-AAAA { color: #7aa7f2; }
  :root[data-theme="system"] .t-CNAME, :root[data-theme="system"] .t-ALIAS { color: #b195ec; }
  :root[data-theme="system"] .t-MX { color: #5fd0b5; }
  :root[data-theme="system"] .t-TXT { color: #e3a65a; }
}

/* ---- tables ---- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; margin-bottom: 14px; }
.table-card.flat { margin: .5rem 0 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  height: 34px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 42px; padding: .4rem 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table.compact td { height: 36px; padding: .3rem 14px; }
.table .val { max-width: 640px; }
.table .val code { font-size: 12.5px; word-break: break-all; color: var(--text); }
.records .val code { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.table td.check, .table th.check { width: 2.4rem; padding-right: 0; }
.table tr.invalid td { opacity: .6; }
.table tr.warned td { background: var(--warn-soft); }
.records .name { max-width: 380px; }
.records .name .fqn { white-space: normal; word-break: break-all; }
.note { font-size: 11.5px; margin-top: .2rem; color: var(--muted); }
.note.warn { color: var(--warn); }
.note.bad { color: var(--bad); }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- search, toolbar, chips, tabs ---- */
.searchbar { display: flex; align-items: center; gap: .45rem; height: 32px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 0 .6rem; margin-bottom: 14px; max-width: 420px; color: var(--faint); }
.searchbar input { border: none; box-shadow: none; height: 30px; padding: 0; flex: 1; background: none; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.searchbar.inline { margin: 0; }
.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .primary { margin-left: auto; }
.toolbar .searchbar.inline { flex: 1 1 260px; max-width: 380px; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; order: 3; flex-basis: 100%; }
.chip { height: 24px; padding: 0 .55rem; font-size: 12px; font-weight: 500; border-radius: 4px; background: var(--surface); color: var(--text-2); }
.chip span { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on span { color: inherit; opacity: .65; }
.chips.static { margin-bottom: 12px; }
.chips.static .chip { cursor: default; display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line-2); }
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin: 6px 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .8rem; color: var(--muted); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--text); }
.count { font-size: 11px; background: var(--surface-3); color: var(--muted); padding: 0 .4rem; border-radius: 4px; font-variant-numeric: tabular-nums; }

/* ---- nodes / status dots ---- */
.node { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.node i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.node.ok i { background: var(--ok); }
.node.bad i { background: var(--warn); }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.node-card header { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.node-card h2 { margin: 0; font-family: var(--mono); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0 0 .6rem; padding: .6rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats dd.bad { color: var(--bad); }
.stats dd.warn { color: var(--warn); }
.node-card .host { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; font-size: 12px; margin: .5rem 0; }
.node-card .host dt { color: var(--muted); }
.node-card .host dd { margin: 0; font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ---- copy chips ---- */
.ns-copy { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 .2rem; }
.copy-chip { gap: .55rem; height: auto; min-height: 30px; padding: .3rem .6rem; background: var(--surface-2); font-weight: 500; }
.copy-chip code { font-size: 12.5px; }
.copy-chip .ic { width: 14px; height: 14px; color: var(--faint); }
.copy-chip:hover .ic { color: var(--text); }
.copy-chip.copied { border-color: var(--ok); }
.copy-chip.copied .ic { color: var(--ok); }
.copy-chip.wrap { white-space: normal; text-align: left; justify-content: space-between; }
.copy-chip.wrap code { word-break: break-all; }
.copy-inline { height: auto; padding: 0 .1rem; border: none; background: none; font-weight: 600; color: var(--text); }
.copy-inline:hover { background: none; text-decoration: underline dotted; }
.copy-inline.copied code { color: var(--ok); }

/* ---- alerts, toasts, banners ---- */
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r); margin-bottom: 12px;
  background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn-line); font-size: 13px; }
.alert > .ic { color: var(--warn); margin-top: .12rem; }
.alert.danger { background: var(--bad-soft); border-color: var(--bad-line); }
.alert.danger > .ic { color: var(--bad); }
.alert.info { background: var(--surface); border-color: var(--line); }
.alert.info > .ic { color: var(--muted); }
.alert p { margin: .2rem 0 0; color: var(--text-2); }
.toast { position: fixed; bottom: 18px; right: 18px; z-index: 60; display: flex; align-items: center; gap: .55rem;
  max-width: min(480px, calc(100vw - 2rem)); padding: .65rem .9rem; border-radius: var(--r); background: var(--surface);
  box-shadow: var(--pop-shadow); border: 1px solid var(--line-2); font-size: 13px; animation: toast-in .16s ease-out; }
.toast.ok .ic { color: var(--ok); }
.toast.err { border-color: var(--bad-line); }
.toast.err .ic { color: var(--bad); }
.toast.static { position: static; margin-bottom: 12px; max-width: none; animation: none; box-shadow: none; }
.toast.hide { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.banner { display: flex; align-items: center; gap: .9rem; padding: .75rem .9rem; margin-bottom: 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--warn-line); box-shadow: inset 3px 0 0 var(--warn); }
.banner-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); flex: none; }
.banner-body { flex: 1; min-width: 0; }
.banner-body p { margin: .1rem 0 0; font-size: 12.5px; }
@media (max-width: 640px) { .banner { flex-wrap: wrap; } .banner .button { width: 100%; } }

/* ---- empty states ---- */
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty.small { padding: 1rem; }
.empty.big { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 3rem 1.5rem; }
.empty.big h2 { justify-content: center; color: var(--text); font-size: 15px; }
.empty.big p { margin: .3rem auto 1.1rem; max-width: 520px; }
.empty-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--muted); margin-bottom: .6rem; }
.empty-icon .ic { width: 20px; height: 20px; }

/* ---- onboarding ---- */
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: .45rem; font-size: 12.5px; color: var(--faint); padding-right: .7rem; }
.steps li + li::before { content: ""; width: 1.25rem; height: 1px; background: var(--line-2); margin-right: .35rem; }
.steps b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 11px; color: var(--muted); }
.steps b .ic { width: 12px; height: 12px; }
.steps li.on { color: var(--text); font-weight: 600; }
.steps li.on b { background: var(--text); border-color: var(--text); color: var(--bg); }
.steps li.done { color: var(--muted); }
.steps li.done b { background: var(--ok); border-color: var(--ok); color: #fff; }
.tiles { border: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.tiles legend { font-size: 12px; font-weight: 550; color: var(--text-2); margin-bottom: .45rem; padding: 0; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: .8rem .9rem; border: 1px solid var(--line-2);
  border-radius: var(--r-lg); cursor: pointer; background: var(--surface); transition: border-color .1s, box-shadow .1s; }
.tile:hover { border-color: var(--faint); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile > .ic { width: 18px; height: 18px; color: var(--muted); }
.tile span { display: flex; flex-direction: column; gap: .2rem; }
.tile b { font-weight: 600; display: flex; align-items: center; gap: .4rem; font-size: 13px; }
.tile small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.tile:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile:has(input:checked) > .ic { color: var(--accent); }
.tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); padding: 0 .3rem; border-radius: 3px; }
.panel { border-left: 2px solid var(--line-2); padding: .1rem 0 .1rem 1rem; display: flex; flex-direction: column; gap: .75rem; }
.help summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.help ol { margin: .4rem 0; padding-left: 1.2rem; font-size: 12.5px; }
.help li { margin: .2rem 0; }
.big-num { font-size: 24px; font-weight: 650; margin: 0; line-height: 1.1; }
.big-num small { font-size: 12px; color: var(--muted); font-weight: 500; }
ul.plain { list-style: none; padding: 0; margin: .4rem 0 0; }
ul.plain li { padding: .1rem 0; }
.sticky-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: .6rem; justify-content: flex-end; padding: .7rem 1rem;
  margin: 0 -1rem; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.sticky-bar .muted { margin-right: auto; }
.summary { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 12px; }
.sum-item { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .9rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); min-width: 7.5rem; }
.sum-item b { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sum-item.warn b { color: var(--warn); }
.sum-item.bad b { color: var(--bad); }
.sum-item.wide { flex: 1 1 18rem; justify-content: center; }

.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .setup-grid { grid-template-columns: minmax(0, 1fr); } .status-panel { order: -1; } }
.step-card { display: flex; gap: .9rem; }
.step-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 12px;
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2); }
.step-num.bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.step-body { flex: 1; min-width: 0; }
.step-body h2 { margin: .1rem 0 .4rem; }
.danger-step { border-color: var(--bad-line); }
.sub-steps { margin: .4rem 0; padding-left: 1.2rem; }
.sub-steps li { margin: .15rem 0; }
.path { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .75rem; font-size: 12.5px; }
.ns-table { display: flex; gap: .9rem; flex-wrap: wrap; margin: .7rem 0; }
.ns-col { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 240px; }
.ns-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ns-head.remove { color: var(--bad); }
.ns-head.add { color: var(--ok); }
.ns-row { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: .35rem .7rem; border-radius: var(--r);
  border: 1px solid var(--line); font-size: 13px; }
.ns-row.old { background: var(--bad-soft); border-color: var(--bad-line); }
.ns-row.old code { text-decoration: line-through; color: var(--bad); }
.ns-row.new { background: var(--ok-soft); border-color: var(--ok-line); width: 100%; }
.ns-row.new code { font-weight: 600; color: var(--text); }

.status-panel { position: sticky; top: 16px; padding: 14px 16px; }
.status-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.status-panel header h3 { margin: 0; }
.status-panel footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line);
  padding-top: .65rem; margin-top: .4rem; }
.live { display: inline-flex; align-items: center; gap: .4rem; font-size: 11.5px; color: var(--muted); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.live.busy i { background: var(--accent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ok-line); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.checks { list-style: none; margin: 0; padding: 0; }
.chk { display: flex; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.chk:last-child { border-bottom: none; }
.chk b { display: block; font-size: 13px; font-weight: 550; }
.chk-detail { display: block; font-size: 12px; color: var(--muted); }
.chk-found { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); word-break: break-all; margin-top: .1rem; }
.chk-icon { flex: none; width: 16px; height: 16px; border-radius: 50%; margin-top: .15rem; position: relative; }
.chk.ok .chk-icon { background: var(--ok); }
.chk.ok .chk-icon::after { content: ""; position: absolute; left: 5.5px; top: 3px; width: 4px; height: 7.5px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.chk.fail .chk-icon { background: var(--bad); }
.chk.fail .chk-icon::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 10.5px; }
.chk.pending .chk-icon { border: 1.5px solid var(--warn); }
.chk.pending .chk-icon::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--warn); }
.chk.checking .chk-icon { border: 1.5px solid var(--line-2); border-top-color: var(--accent); background: none; animation: spin .8s linear infinite; }
.chk.checking .chk-icon::after { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.chk.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--ok-soft); } }

.hero-ok { display: flex; gap: .9rem; align-items: center; border-color: var(--ok-line); box-shadow: inset 3px 0 0 var(--ok); }
.hero-ok h2 { margin: 0 0 .15rem; font-size: 15px; }
.hero-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff;
  animation: pop .35s ease-out; }
.hero-icon .ic { width: 20px; height: 20px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card.next { display: flex; flex-direction: column; gap: .25rem; color: var(--text); margin: 0; transition: border-color .1s; }
.card.next:hover { text-decoration: none; border-color: var(--faint); }
.card.next .ic { color: var(--muted); width: 18px; height: 18px; margin-bottom: .2rem; }
.card.next .muted { font-size: 12px; }

/* ---- add panel, dialog ---- */
.add-panel h2 { margin-bottom: .9rem; }
.record-form { display: flex; flex-direction: column; gap: .85rem; }
dialog.modal { border: 1px solid var(--line-2); padding: 0; border-radius: var(--r-lg); width: min(680px, calc(100vw - 2rem));
  background: var(--surface); color: var(--text); box-shadow: var(--pop-shadow); }
dialog.modal::backdrop { background: var(--overlay); }
dialog.modal form { padding: 16px 18px 18px; }
dialog.modal header { display: flex; align-items: center; justify-content: space-between; padding-bottom: .8rem; margin-bottom: .2rem; border-bottom: 1px solid var(--line); }
dialog.modal header h2 { margin: 0; }
dialog.modal footer { margin-top: .3rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* ---- kv lists, menus ---- */
dl.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .5rem 1rem; margin: .6rem 0 0; align-items: center; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; min-width: 0; }
dl.kv.ds { margin: .6rem 0 .2rem; }
@media (max-width: 600px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: .4rem; } }
.menu-pop { position: relative; display: inline-block; text-align: left; }
.menu-pop summary { list-style: none; }
.menu-pop summary::-webkit-details-marker { display: none; }
.menu-pop .pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 280px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--pop-shadow); padding: .3rem; display: flex; flex-direction: column; gap: .2rem; }
.menu-pop form { margin: 0; display: flex; flex-direction: column; }
.menu-item { justify-content: flex-start; border: none; background: none; height: 30px; padding: 0 .6rem; font-weight: 500; }
.menu-item.danger { color: var(--bad); background: none; }
.pop-row { flex-direction: row !important; gap: .3rem; padding: .35rem .2rem .15rem; border-top: 1px solid var(--line); }
.pop-row input { flex: 1; height: 28px; font-size: 12.5px; }

/* ---- login ---- */
body.auth { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.auth-main { width: min(380px, calc(100vw - 2rem)); padding: 2rem 0; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.auth-name { font-weight: 650; font-size: 16px; }
.auth-card h1 { font-size: 18px; }
.auth-card > p { margin: .2rem 0 1.3rem; font-size: 12.5px; }

/* ---- API tokens & docs ---- */
.secret-card { border-color: var(--ok-line); box-shadow: inset 3px 0 0 var(--ok); }
.secret-card h2 .ic { color: var(--ok); }
.copy-chip.secret { width: 100%; padding: .6rem .8rem; margin: .4rem 0 .8rem; }
.copy-chip.secret code { font-size: 13px; font-weight: 600; }
pre.code { background: var(--code-block); color: var(--code-text); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem;
  overflow-x: auto; margin: .6rem 0; font-family: var(--mono); font-size: 12px; line-height: 1.65; }
pre.code code { font-size: inherit; background: none; padding: 0; color: inherit; }
fieldset.scope { border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .85rem; margin: 0; display: flex; flex-direction: column; gap: .1rem; }
fieldset.scope legend { font-size: 12px; font-weight: 550; color: var(--text-2); padding: 0 .3rem; }
fieldset.scope .check { padding-bottom: .2rem; }
.zone-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .1rem .75rem; max-height: 240px; overflow: auto;
  margin: .3rem 0 0 1.4rem; padding: .4rem .6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.zone-pick .check { font-family: var(--mono); font-size: 12.5px; }
.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs-toc { position: static !important; flex-direction: row !important; flex-wrap: wrap; } }
.docs-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; padding: .45rem; }
.docs-toc a { padding: .3rem .55rem; border-radius: var(--r-sm); color: var(--text-2); font-size: 12.5px; }
.docs-toc a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.docs-body { max-width: 1000px; }
.docs-body .card { scroll-margin-top: 16px; }
.docs-body .table { margin: .6rem 0; border: 1px solid var(--line); border-radius: var(--r); }
.endpoints { display: flex; flex-direction: column; gap: 4px; margin: .5rem 0 .8rem; }
.endpoints > div { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; min-height: 34px; padding: .3rem .6rem; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r); }
.endpoints > div > code { font-weight: 600; color: var(--text); }
.endpoints > div > span:last-child { color: var(--muted); font-size: 12.5px; }
.m { display: inline-block; min-width: 4rem; text-align: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: .12rem .35rem;
  border-radius: 3px; border: 1px solid currentColor; }
.m.get { color: #2f6fd6; }
.m.post { color: #18794e; }
.m.put { color: #9a5b00; }
.m.del { color: #c62828; }

/* ---- monitor ---- */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.mon-group { margin: 0; }
.lat-bars { display: flex; flex-direction: column; gap: .45rem; margin-top: .6rem; max-width: 760px; }
.lat { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 5rem; align-items: center; gap: .75rem; font-family: var(--mono); font-size: 12.5px; }
progress.bar { width: 100%; height: 6px; appearance: none; border: none; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 3px; }
progress.bar::-webkit-progress-value { background: var(--ok); border-radius: 3px; }
progress.bar::-moz-progress-bar { background: var(--ok); border-radius: 3px; }
.timeline { list-style: none; margin: .4rem 0 0; padding: 0; }
.ev { display: flex; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: none; }
.ev-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; background: var(--faint); }
.ev.firing.critical .ev-dot, .ev.reminder.critical .ev-dot { background: var(--bad); }
.ev.firing.warning .ev-dot, .ev.reminder.warning .ev-dot { background: var(--warn); }
.ev.resolved .ev-dot { background: var(--ok); }
.ev.test .ev-dot { background: var(--accent); }
.ev-head { font-size: 13px; }

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

/* ---- full record names ---- */
.fqn { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.fq-host { color: var(--text); font-weight: 600; }
.fq-zone { color: var(--faint); }
h1 .fqn { font-size: inherit; font-family: inherit; }
h1 .fq-zone { font-weight: 500; }
.fq-preview { font-family: var(--mono); font-weight: 500; color: var(--accent); margin-left: .35rem; }
.fq-preview.bad { color: var(--bad); }
