/* OnyxDNS – Weboberfläche. Dark Mode ist Standard, Light Mode über data-theme="light". */
:root {
  --bg: #0b0e14;
  --surface: #121722;
  --surface-2: #171d2a;
  --border: #1f2633;
  --border-strong: #2b3445;
  --text: #e6eaf2;
  --muted: #8a93a6;
  --accent: #7cf5c4;
  --accent-ink: #062a1d;
  --accent-soft: rgba(124, 245, 196, .12);
  --danger: #ff5d73;
  --danger-soft: rgba(255, 93, 115, .12);
  --warn: #ffc857;
  --warn-soft: rgba(255, 200, 87, .12);
  --cf: #8b9cff;
  --cf-soft: rgba(139, 156, 255, .14);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --logo-bg: #0e131c;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --border: #e1e6ef;
  --border-strong: #cdd5e2;
  --text: #141a26;
  --muted: #5d6779;
  --accent: #0f9e6e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 158, 110, .1);
  --danger: #d92d48;
  --danger-soft: rgba(217, 45, 72, .08);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, .1);
  --cf: #5468e8;
  --cf-soft: rgba(84, 104, 232, .1);
  --shadow: 0 10px 30px rgba(20, 26, 38, .12);
  --logo-bg: #141a26;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.boot { padding: 40px; color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-weight: 550;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; font-weight: 600; }
.nav-label.with-action { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.nav-label .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); text-align: center; letter-spacing: 0; }
.nav-label .btn.icon.small { width: 24px; height: 24px; padding: 0; }
.nav-label .btn.icon.small svg { width: 15px; height: 15px; }
.nav-search { position: relative; margin: 2px 0 6px; }
.nav-search svg { position: absolute; left: 9px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nav-search input { width: 100%; padding: 6px 8px 6px 28px; font-size: 12.5px; border-radius: 7px; }
.nav-zone { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12.5px; padding: 5px 10px; border-radius: 6px; color: var(--muted); }
.nav-zone .zn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-zone[hidden], .nav-empty[hidden] { display: none; }
.nav-zone:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-zone.active { color: var(--accent); background: var(--accent-soft); }
.zflags { display: inline-flex; gap: 3px; flex: none; }
.zf { display: inline-flex; color: var(--muted); opacity: .8; }
.zf svg { width: 12px; height: 12px; }
.zf.ok { color: var(--accent); }
.zf.cf { color: var(--cf); }
.nav-empty { padding: 4px 10px; }
.nav-zones { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.userbox { border-top: 1px solid var(--border); padding: 12px 4px 0; display: flex; align-items: center; gap: 8px; }
.userbox .avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; }
.userbox .who { flex: 1; min-width: 0; line-height: 1.25; }
.userbox .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.main { min-width: 0; padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mobile-nav { display: none; }

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.icon { width: 32px; padding: 0; height: 32px; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 10px; min-height: 34px; width: 100%;
}
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.mono { font-family: var(--mono); font-size: 13px; }
input[type="checkbox"] { width: auto; min-height: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 12px; margin-top: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.type { font-family: var(--mono); color: var(--text); min-width: 52px; justify-content: center; }
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.cf { background: var(--cf-soft); color: var(--cf); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.error { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.pending { background: var(--border-strong); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.value { font-family: var(--mono); font-size: 12.5px; word-break: break-all; max-width: 420px; }
td.name { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.row-actions { text-align: right; white-space: nowrap; width: 1%; }
tr.editing td { background: var(--surface-2) !important; }
.comment { color: var(--muted); font-size: 12px; font-family: var(--sans); word-break: normal; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="search"] { max-width: 280px; }
.toolbar select { width: auto; }
.spacer { flex: 1; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 8px; }
.empty ol { text-align: left; display: inline-block; margin: 12px 0 18px; }
.loading { color: var(--muted); padding: 24px 0; display: flex; align-items: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); }
.items li:last-child { border-bottom: none; }
.items .dot { position: relative; top: 1px; }
.ns-list { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); }
.ns-list div { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.callout { border-radius: 8px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); }
.callout.cf { background: var(--cf-soft); border-color: transparent; }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.err { background: var(--danger-soft); border-color: transparent; color: var(--danger); white-space: pre-wrap; }
.callout.ok { background: var(--accent-soft); border-color: transparent; }
.secret { font-family: var(--mono); background: var(--bg); border: 1px dashed var(--accent); border-radius: 8px; padding: 10px; word-break: break-all; user-select: all; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: var(--bg); text-align: left; color: var(--text); font: inherit; }
.mode b { display: block; margin-bottom: 4px; }
.mode span { color: var(--muted); font-size: 12.5px; }
.mode.active { border-color: var(--cf); box-shadow: 0 0 0 3px var(--cf-soft); }
.mode:disabled { cursor: default; opacity: .7; }
.mode.active:disabled { opacity: 1; }
h1.mono { font-size: 22px; letter-spacing: 0; }

/* Wolken-Schalter */
.cloud { background: none; border: none; cursor: pointer; padding: 4px; color: var(--muted); display: inline-flex; border-radius: 6px; }
.cloud svg { width: 22px; height: 22px; }
.cloud.on { color: #f6821f; }
.cloud:disabled { cursor: default; }

/* Diagramm */
.chart-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 11px; color: var(--muted); height: 160px; font-variant-numeric: tabular-nums; }
.chart-y span { line-height: 1; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart { width: 100%; height: 160px; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .area { fill: var(--accent-soft); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.chart .line2 { fill: none; stroke: var(--danger); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .8; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; font-weight: 600; }
.seg button.active { background: var(--accent-soft); color: var(--accent); }

/* Protokoll */
.audit-entry { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.audit-entry:last-child { border-bottom: none; }
.audit-entry details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 4px; }
.audit-entry pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12px; max-height: 320px; }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Login */
.auth form { display: flex; flex-direction: column; gap: 14px; }

/* Dialoge und Toasts */
dialog { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 8, 12, .6); backdrop-filter: blur(2px); }
dialog h2 { margin-bottom: 10px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); animation: slide .2s ease-out; white-space: pre-wrap; }
.toast.error { border-left-color: var(--danger); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }


/* Records: Auswahl, Sortierung, direktes Bearbeiten */
th .sort { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
th .sort:hover, th .sort.active { color: var(--text); }
th .sort .arrow { font-size: 9px; color: var(--accent); min-width: 8px; }
th.sel, td.sel { width: 1%; padding-right: 0; }
tr.selected td { background: var(--accent-soft) !important; }
td.editable { cursor: text; }
td.editable:hover { box-shadow: inset 0 0 0 1px var(--border-strong); border-radius: 6px; }
.inline-edit { min-height: 32px; padding: 4px 8px; }
textarea.inline-edit { min-height: 56px; }
td .hint { margin-top: 3px; }
.bulkbar { position: sticky; top: 8px; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.bulkbar select { width: auto; height: 28px; min-height: 0; padding: 0 8px; font-size: 12.5px; }
.bulkbar .btn svg { width: 14px; height: 14px; }
.keys { margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; }
dialog.wide { width: min(680px, calc(100vw - 32px)); }
dialog .stack > * + * { margin-top: 12px; }
.toast.with-action { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.toast.with-action .btn { color: var(--accent); flex: none; }


/* Assistenten */
.wizard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wizard-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.wizard-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wizard-card svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 4px; }
.wizard-card span { color: var(--muted); font-size: 12.5px; }
.wizard details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.wiz-preview td { padding: 6px 10px; }
.wiz-preview tr.delete td.name, .wiz-preview tr.delete td.value { text-decoration: line-through; color: var(--muted); }
.wiz-preview tr.exists td { color: var(--muted); }
.ca-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
dialog.wide { max-height: calc(100vh - 40px); overflow-y: auto; }
@media (max-width: 520px) { .wizard-grid { grid-template-columns: 1fr; } }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 96px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 4px 0; font-weight: 600; }
  .mobile-nav a svg { width: 20px; height: 20px; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .two-col, .modes, .diff-cols { grid-template-columns: 1fr; }
  #toasts { right: 12px; left: 12px; bottom: 84px; max-width: none; }
  h1, h1.mono { font-size: 19px; }
  h1.mono { word-break: break-all; }
  .audit-entry { grid-template-columns: 1fr; gap: 2px; }
  /* Record-Tabelle als Karten */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 12px; border-bottom: 1px solid var(--border); position: relative; }
  table.cards td { border: none; padding: 2px 0; max-width: none; }
  table.cards td.row-actions { position: absolute; top: 8px; right: 8px; width: auto; }
  table.cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--sans); font-size: 11.5px; }
  table.cards tr.editing td::before { content: none; }
  table.cards td.name, table.cards td.typ, table.cards td.ttl { display: inline-block; width: auto; margin-right: 8px; vertical-align: middle; }
  table.cards td.ttl { color: var(--muted); font-size: 12px; }
  table.cards td.ttl::before { content: none !important; }
  table.cards td.name { padding-right: 0; }
  .toolbar input[type="search"] { max-width: none; flex: 1 1 100%; }
  table.cards td.sel { display: inline-block; width: auto; vertical-align: middle; margin-right: 6px; padding: 0; }
  table.cards.adv td.name { max-width: calc(100% - 170px); overflow: hidden; text-overflow: ellipsis; }
  table.cards thead { display: none; }
  .bulkbar { position: fixed; left: 8px; right: 8px; top: auto; bottom: 76px; margin: 0; }
  .keys { display: none; }
  table.cards tr.selected { background: var(--accent-soft); }
  table.cards tr.selected td { background: transparent !important; }
  .has-bulk { padding-bottom: 150px; }
}
@media (min-width: 861px) { .mobile-top { display: none; } }
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid > * { grid-column: span 2 !important; }
  .form-grid > .field[data-field="type"], .form-grid > .field[data-field="ttl"] { grid-column: span 1 !important; }
}
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.auth-links a:only-child { margin: 0 auto; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; max-height: 200px; overflow: auto; padding: 4px 0; }

/* Schlüssel/Wert-Liste (DNSSEC) */
.kv { display: grid; gap: 2px; }
.kv-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv-row code.wrap { overflow-wrap: anywhere; white-space: normal; font-size: 12.5px; }
.badge svg { width: 12px; height: 12px; }
@media (max-width: 640px) {
  .kv-row { grid-template-columns: minmax(0, 1fr) auto; }
  .kv-row > span { grid-column: 1 / -1; }
}

/* Assistent „Domain hinzufügen“ */
.stepper { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; padding: 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stepper li + li::before { content: ''; width: 28px; height: 1px; background: var(--border-strong); margin-right: 4px; }
.stepper .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.stepper .num svg { width: 13px; height: 13px; }
.stepper li.active { color: var(--text); }
.stepper li.active .num { background: var(--accent); color: var(--bg); border-color: transparent; }
.stepper li.done .num { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.wizard { max-width: 920px; }
.wizard input.big { font-size: 18px; padding: 12px 14px; }
.wizard h2 + p { margin-top: 6px; margin-bottom: 14px; }
.wizard .btn svg { width: 16px; height: 16px; }
.wizard .btn .spinner { width: 14px; height: 14px; }
.wizard .provider { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; }
.wizard .callout + .callout, .wizard .callout + p, .wizard p + .callout { margin-top: 10px; }
.wizard .callout svg { width: 15px; height: 15px; vertical-align: -2px; }
.scan-table td.check, .scan-table th.check { width: 34px; }
.scan-table tr.dim td:not(.check) { opacity: .5; }
.scan-table .value { overflow-wrap: anywhere; }
.scan-table .small-input { width: 100%; max-width: 260px; padding: 5px 8px; font-size: 12.5px; }
.warn-text { color: var(--warn); margin-top: 4px; }
.live-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-bottom: 10px; }
.live-status .dot { margin-top: 5px; }

/* ---------- Marke ---------- */
.wordmark { font-weight: 700; letter-spacing: -.02em; }
.wordmark b { color: var(--accent); font-weight: 700; }
.brand svg.logo { filter: drop-shadow(0 0 10px var(--accent-soft)); }

/* ---------- Balken (Kontingent, Fortschritt) ---------- */
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }
.bar.full span { background: var(--warn); }

/* ---------- Tarif in der Seitenleiste ---------- */
.nav-quota { display: block; margin: 8px 4px 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
.nav-quota:hover { text-decoration: none; border-color: var(--border-strong); }
.nq-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.nq-plan { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.nq-plan svg { width: 14px; height: 14px; color: var(--accent); }
.nq-up { color: var(--warn); margin-top: 6px; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.auth-pitch { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 36px 48px;
  background: radial-gradient(900px 500px at 0% 0%, var(--accent-soft), transparent 60%), radial-gradient(700px 500px at 100% 100%, var(--cf-soft), transparent 60%), var(--surface);
  border-right: 1px solid var(--border); }
.auth-pitch .brand { padding: 0; font-size: 18px; }
.pitch-body { max-width: 520px; }
.pitch-body h1 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 16px; }
.pitch-body .accent { color: var(--accent); }
.pitch-body .lead { font-size: 16px; color: var(--muted); margin-bottom: 28px; }
.features { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 16px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features li > div { display: flex; flex-direction: column; }
.features .fi { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.features .fi svg { width: 18px; height: 18px; }
.pitch-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pitch-link svg { width: 16px; height: 16px; }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin-bottom: 18px; }
.auth-card .btn.primary { padding: 10px 14px; font-size: 15px; }
.auth-theme { margin-top: 18px; }
.only-mobile { display: none !important; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-pitch { display: none; }
  .only-mobile { display: flex !important; justify-content: center; font-size: 20px; padding-bottom: 18px; }
  .auth-form { min-height: 100vh; background: radial-gradient(900px 500px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
}

/* ---------- Tarife ---------- */
.plans { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.plan.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan.current { border-color: var(--accent); }
.plan h3 { font-size: 18px; }
.plan-flag { position: absolute; top: -11px; right: 18px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 650; }
.price b { font-size: 30px; letter-spacing: -.02em; }
.plan-limits, .plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan-limits { padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-weight: 600; }
.plan-features { flex: 1; align-content: start; color: var(--muted); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.btn.block { width: 100%; justify-content: center; }
.btn[aria-disabled="true"] { opacity: .7; cursor: default; }
.usage-card { margin-bottom: 16px; max-width: 520px; }
.usage-card h2 { margin-bottom: 12px; }
.usage-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }

/* ---------- Erste Schritte ---------- */
.guide { margin-bottom: 16px; background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface); }
.guide .card-head { margin-bottom: 10px; }
.guide-bar { margin-bottom: 14px; }
.guide-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.guide-steps li > a, .guide-steps .gs-row { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.guide-steps li > a:hover { text-decoration: none; border-color: var(--accent); }
.guide-steps li > a > svg { margin-left: auto; flex: none; width: 16px; height: 16px; color: var(--muted); }
.guide-steps li div { display: flex; flex-direction: column; gap: 2px; }
.guide-steps li.done b { text-decoration: line-through; color: var(--muted); }
.gs-dot { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); }
.gs-dot.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gs-dot svg { width: 12px; height: 12px; stroke-width: 3; }

/* ---------- Leere Zustände ---------- */
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); }
.empty-icon svg { width: 26px; height: 26px; }

/* ---------- Tarif-Editor ---------- */
.plan-edit-list { display: grid; gap: 12px; margin-top: 12px; }
.plan-edit { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.plan-edit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.plan-edit-head b { flex: 1; }
