/* =====================================================================
   DynDNS – Design-System
   Aufbau: 1 Tokens · 2 Basis · 3 Layout & Navigation · 4 Komponenten
           5 Formulare · 6 Tabellen · 7 Diagramme · 8 Seiten · 9 Responsive
   ===================================================================== */

/* ---------- 1. Tokens (Hell) ---------- */
:root {
  --bg: #f5f6f8;
  --bg-2: #eceef2;
  --card: #ffffff;
  --card-2: #f8f9fb;
  --fg: #0f172a;
  --fg-2: #334155;
  --muted: #64748b;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eef4ff;
  --accent-fg: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --sidebar: #ffffff;
  --sidebar-w: 256px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 60px;
  --gap: 1.25rem;
  --pad: 1.4rem;
  color-scheme: light;
}

/* ---------- 1b. Tokens (Dunkel: System oder gewählt) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f15; --bg-2: #171d27; --card: #121821; --card-2: #171e29; --fg: #e7ecf3; --fg-2: #c3cad5;
    --muted: #8a94a6; --line: #232b37; --line-2: #313b4a; --accent: #5b8cff; --accent-2: #7aa2ff;
    --accent-soft: #16223a; --danger: #f06363; --danger-soft: #2a1618; --ok: #3fb96a; --ok-soft: #11261a;
    --warn: #e3a33a; --warn-soft: #2a2112; --sidebar: #0f141c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .4); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b0f15; --bg-2: #171d27; --card: #121821; --card-2: #171e29; --fg: #e7ecf3; --fg-2: #c3cad5;
    --muted: #8a94a6; --line: #232b37; --line-2: #313b4a; --accent: #5b8cff; --accent-2: #7aa2ff;
    --accent-soft: #16223a; --danger: #f06363; --danger-soft: #2a1618; --ok: #3fb96a; --ok-soft: #11261a;
    --warn: #e3a33a; --warn-soft: #2a2112; --sidebar: #0f141c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .4); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
}

/* ---------- 2. Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
/* Scrollbalken-Platz immer reservieren: kein seitliches Springen beim Wechsel zwischen kurzen und langen Tabs */
html { scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 1.1rem; font-weight: 650; word-break: break-word; }
h2 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 .9rem; font-weight: 600; }
h3 { font-size: .8rem; margin: 1.3rem 0 .5rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .8rem; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
[hidden] { display: none !important; }
.mono, code, pre { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.small-text { font-size: 1rem !important; }
.nowrap { white-space: nowrap; }
.center { text-align: center; margin: 1.1rem 0 0; }
.hint { color: var(--muted); font-size: .84rem; margin: .7rem 0 0; line-height: 1.5; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .err-text { color: var(--danger); }
pre { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .8rem;
  overflow-x: auto; margin: .3rem 0; white-space: pre-wrap; word-break: break-all; }
code { background: var(--card-2); border: 1px solid var(--line); padding: .1rem .4rem; border-radius: 5px; word-break: break-all; }

/* ---------- 3. Layout & Navigation ---------- */
main { width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 2rem max(1.5rem, env(safe-area-inset-right)) 4rem max(1.5rem, env(safe-area-inset-left)); }
body.public main { max-width: 1240px; }

/* App-Rahmen: feste Seitenleiste links, Inhalt rechts */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 1rem;
  padding: 1.1rem .85rem; background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto; z-index: 50; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.05rem; color: var(--fg); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--fg); }
.sidebar .brand { padding: .3rem .55rem .6rem; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed)); box-shadow: var(--shadow-sm); }
.brand-logo svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
.sidebar nav { display: flex; flex-direction: column; gap: 1.1rem; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-heading { font-size: .7rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 0 .7rem .35rem; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px;
  color: var(--fg-2); font-weight: 520; font-size: .93rem; white-space: nowrap; }
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.sidebar nav a:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; }
.nav-count { margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 99px; display: grid; place-items: center;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; }
.sidebar-foot { display: flex; flex-direction: column; gap: .7rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.sidebar-foot .theme-switch { align-self: flex-start; }
.me-row { display: flex; align-items: center; gap: .35rem; }
.whoami { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: var(--fg); padding: .4rem .5rem; border-radius: 9px; }
.whoami:hover, .whoami.active { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.whoami-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.whoami-text b { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-text small { font-size: .74rem; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: .82rem; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
a.avatar:hover { text-decoration: none; }
.icon-btn { width: 36px; height: 36px; min-height: 0; padding: 0; border-color: transparent; background: none; color: var(--muted); border-radius: 9px; }
.icon-btn:hover { background: var(--bg-2); color: var(--danger); border-color: transparent; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mobile-bar { display: none; }
.nav-backdrop { display: none; }
.nav-toggle { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Seitenkopf */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-head .crumbs { margin-bottom: .3rem; }
.page-sub { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.segmented { gap: 0; border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; background: var(--card); }
.segmented .button { border: 0; min-height: 30px; }
.segmented .button:not(.primary) { background: none; }

/* Tabs (ohne JavaScript werden alle Bereiche untereinander gezeigt) */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin: 0 0 1.4rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .95rem; margin-bottom: -1px; white-space: nowrap;
  color: var(--muted); font-weight: 560; font-size: .93rem; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
.tabs a:hover { color: var(--fg); text-decoration: none; background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: .72rem; font-weight: 650; padding: 0 .45rem; border-radius: 99px; background: var(--bg-2); color: var(--muted); line-height: 1.6; }
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }
.tabs .count.bad { background: var(--danger); color: #fff; }
.tabs-ready .tab-panel:not(.active) { display: none; }
/* Tab-Wechsel innerhalb einer Seite: bewusst ohne Animation (nur Seitenwechsel über das Menü animiert) */
@keyframes panel-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.between { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.between > h1, .between > h2 { margin: 0; }
.crumbs { margin: 0 0 .35rem; color: var(--muted); font-size: .88rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.two > .card { margin-bottom: 0; }
.two > .col-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.two > .col-stack > .card { margin-bottom: 0; }
.two > .col-stack > .card:last-child { flex: 1; }
.input-action { display: flex; gap: .5rem; align-items: center; }
.input-action input { flex: 1; min-width: 0; }
.input-action button { white-space: nowrap; }
.two.inner { margin-bottom: 0; gap: 1.5rem; }
.two.inner h3 { margin-top: 0; }
.section-title { margin: 2rem 0 .8rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }

/* ---------- 4. Komponenten ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--pad);
  margin-bottom: var(--gap); box-shadow: var(--shadow-sm); min-width: 0; }
.card > h2:first-child, .card > .between:first-child h2 { font-size: 1.02rem; }
.card-sub { margin: -.55rem 0 1rem; color: var(--muted); font-size: .88rem; }
.card > h2:first-child { margin-top: 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.login { max-width: 410px; margin: min(12vh, 6rem) auto 0; padding: 2.2rem 2rem 2rem; box-shadow: var(--shadow-lg); }
.login::before { content: ""; display: block; width: 44px; height: 44px; margin-bottom: 1.1rem; border-radius: 12px; box-shadow: var(--shadow);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M4 12h16M12 4c-2.7 2.5-2.7 13.5 0 16M12 4c2.7 2.5 2.7 13.5 0 16'/%3E%3C/svg%3E") center / 24px no-repeat,
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed)); }
body.public { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.login h1 { font-size: 1.45rem; margin-bottom: 1.3rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.tiles.tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.2rem;
  color: var(--fg); display: flex; flex-direction: column; gap: .15rem; min-width: 0; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile b { order: 2; font-size: 1.65rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tile > span { order: 1; color: var(--muted); font-size: .8rem; line-height: 1.4; font-weight: 550; }
.tile > progress, .tile > small { order: 3; }
.tile b .small-text, .tile b span { font-size: 1rem; }
a.tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); text-decoration: none; color: var(--fg); }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .55rem; border-radius: 99px; font-size: .74rem;
  font-weight: 600; line-height: 1.6; border: 1px solid var(--line-2); color: var(--muted); background: var(--card); white-space: nowrap; vertical-align: middle; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.badge.veraltet { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.badge.fehlt, .badge.offline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.badge.dyn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.badge.type { font-family: var(--mono); color: var(--fg-2); }
a.badge:hover { text-decoration: none; border-color: var(--accent); }

/* Meldungen */
.flash { position: relative; display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 2.6rem .8rem 1rem;
  border-radius: var(--radius); margin: 0 0 1rem; border: 1px solid; font-size: .92rem; line-height: 1.5;
  animation: flash-in .2s ease-out; }
.flash::before { content: ""; flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.flash.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.flash.err { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
.flash.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.flash.warn > div, .flash.err > b { color: var(--fg); }
.flash.warn b { color: var(--warn); }
.flash ul.plain { margin-top: .35rem; }
.flash form.ns-reset { margin-top: .5rem; }
.flash a { color: inherit; text-decoration: underline; }
.flash-close { position: absolute; top: .45rem; right: .45rem; width: 30px; height: 30px; padding: 0; border: 0;
  background: none; color: inherit; opacity: .6; font-size: 1.2rem; line-height: 1; border-radius: 6px; min-height: 0; }
.flash-close:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.flash.leaving { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Buttons */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 38px; padding: .45rem .95rem; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card); color: var(--fg); font: inherit; font-weight: 550; font-size: .92rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap; user-select: none; transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
button:hover, a.button:hover { background: var(--bg-2); border-color: var(--line-2); text-decoration: none; color: var(--fg); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-sm); }
button.primary:hover, a.button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-fg); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
button.small, a.button.small { min-height: 30px; padding: .25rem .6rem; font-size: .82rem; border-radius: 7px; }
button.link { border: 0; background: none; color: var(--muted); padding: .4rem .5rem; min-height: 0; font-weight: 500; }
button.link:hover { color: var(--fg); background: var(--bg-2); }
button.fritz { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
button.fritz:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
a.button.loading { opacity: .7; pointer-events: none; cursor: progress; }
a.plain-link { color: inherit; }
a.plain-link:hover { color: var(--accent); }

/* Dialog (FritzBox) */
dialog.fritz-dialog { width: min(720px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); color: var(--fg);
  padding: 1.4rem; text-align: left; white-space: normal; box-shadow: var(--shadow-lg); }
/* Dialoge immer mittig – auch wenn sie in einer Tabellenzelle neben einem Button stehen */
dialog.fritz-dialog, td.actions > dialog.fritz-dialog, table.stack-table td.actions > dialog.fritz-dialog { margin: auto; inset: 0; }
dialog.fritz-dialog::backdrop { background: rgba(9, 12, 18, .5); backdrop-filter: blur(2px); }
dialog.fritz-dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog.fritz-dialog h2 { margin: 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.2rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; padding-top: .15rem; }
dl.kv dd { margin: 0; min-width: 0; }
dl.copy-list dd { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
dl.copy-list code { flex: 1; min-width: 0; padding: .45rem .6rem; }
code.secret { filter: blur(5px); user-select: none; transition: filter .15s; }
code.secret.shown { filter: none; user-select: text; }

/* Umschalter Hell / Dunkel / System */
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; flex-shrink: 0; background: var(--card); }
.theme-switch button { border: 0; background: none; padding: 0; width: 30px; height: 28px; min-height: 0; border-radius: 7px; color: var(--muted); }
.theme-switch button:hover { color: var(--fg); background: var(--bg-2); }
.theme-switch button[aria-pressed="true"] { background: var(--bg-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.theme-switch svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border-radius: 7px;
  color: var(--muted); font-size: .75rem; font-weight: 600; text-decoration: none; }
.lang-switch a:hover { color: var(--fg); background: var(--bg-2); }
.lang-switch a[aria-current="true"] { background: var(--bg-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.theme-corner { position: fixed; top: max(.9rem, env(safe-area-inset-top)); right: max(.9rem, env(safe-area-inset-right)); z-index: 20; }

/* Belegung */
progress.meter { width: 100%; height: 6px; margin-top: .65rem; border: 0; border-radius: 3px; background: var(--bg-2); appearance: none; overflow: hidden; }
progress.meter::-webkit-progress-bar { background: var(--bg-2); border-radius: 3px; }
progress.meter::-webkit-progress-value { background: var(--ok); border-radius: 3px; }
progress.meter::-moz-progress-bar { background: var(--ok); border-radius: 3px; }
progress.meter.high::-webkit-progress-value { background: var(--warn); } progress.meter.high::-moz-progress-bar { background: var(--warn); }
progress.meter.full::-webkit-progress-value { background: var(--danger); } progress.meter.full::-moz-progress-bar { background: var(--danger); }

/* Blättern */
.pager { display: flex; gap: .6rem; align-items: center; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager .button { min-height: 34px; padding: .3rem .75rem; }
.refreshing { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* ---------- 5. Formulare ---------- */
input, select, textarea { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 40px; padding: .5rem .7rem; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card); color: var(--fg); transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: color-mix(in srgb, var(--muted) 55%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
select { appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 16px; }
textarea { font-family: var(--mono); font-size: .88rem; resize: vertical; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .86rem; font-weight: 500; color: var(--fg-2); min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 400; color: var(--fg); font-size: .92rem; cursor: pointer; }
label.disabled { opacity: .55; }
.inline-check { display: inline-flex; margin-right: .6rem; font-size: .88rem; }
.stack { display: flex; flex-direction: column; gap: .95rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row .grow { flex: 1; min-width: min(100%, 220px); width: auto; }
form.inline { display: inline; }
.row-inline { display: inline-flex; gap: .35rem; align-items: center; }
label.row-inline { flex-direction: row; font-weight: 400; white-space: nowrap; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.1rem; align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .wide-2 { grid-column: span 2; }
.grid-form > label { justify-content: flex-end; }
.grid-form > label.check { justify-content: flex-start; align-self: center; }
.filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.align-end { align-self: end; }
.small-input { width: 10rem !important; min-height: 32px !important; padding: .25rem .5rem !important; font-size: .86rem; }
.tiny-input { width: 4.8rem !important; min-height: 34px !important; padding: .25rem .5rem !important; display: inline-block; }
fieldset.zones-field { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin: 0; }
fieldset.zones-field legend { color: var(--fg-2); font-size: .86rem; font-weight: 500; padding: 0 .35rem; }
.zone-list { display: flex; flex-wrap: wrap; gap: .45rem 1.3rem; margin-top: .45rem; }
.zone-list label:has(input:disabled) { opacity: .5; }
.limits-row { color: var(--fg-2); line-height: 2.6; }
.limits-row b { display: inline-block; min-width: 14rem; font-weight: 600; color: var(--fg); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1 1 16rem; }
.toolbar .combo { flex: 0 1 13rem; }
.toolbar select { width: auto; flex: 0 1 12rem; }
input[type=search] { padding-left: 2.1rem;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .65rem center / 16px; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* Suchfeld mit Vorschlägen */
.combo { position: relative; min-width: 0; }
.combo-input { width: 100%; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem;
  list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 22rem; overflow-y: auto; min-width: 14rem; }
.combo-list li { padding: .5rem .65rem; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between;
  gap: 1rem; color: var(--fg); font-size: .92rem; }
.combo-list li small { color: var(--muted); white-space: nowrap; }
.combo-list li.active, .combo-list li:hover { background: var(--accent-soft); color: var(--accent); }
.combo-list li.empty { color: var(--muted); font-style: italic; }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }

/* ---------- 6. Tabellen ---------- */
.scroll { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  padding-top: .4rem; padding-bottom: .5rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background .1s; }
table tr:hover td { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
td.content { max-width: 480px; overflow-wrap: anywhere; }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * + * { margin-left: .3rem; }
tr.muted td { opacity: .55; }
table.checks td:first-child { width: 1%; white-space: nowrap; }

/* ---------- 7. Diagramme ---------- */
.chart { position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .45rem; flex-wrap: wrap; }
.chart-max { font-size: .75rem; color: var(--muted); }
.chart-legend { display: flex; gap: 1.1rem; font-size: .84rem; flex-wrap: wrap; color: var(--fg-2); }
.chart-legend .legend::before { content: ""; display: inline-block; width: .9rem; height: .22rem; margin-right: .4rem; vertical-align: middle; border-radius: 2px; }
.chart-legend .l0::before, .tip-row.l0::before { background: var(--accent); }
.chart-legend .l1::before, .tip-row.l1::before { background: var(--ok); }
.chart-legend .l2::before, .tip-row.l2::before { background: var(--warn); }
.chart-plot { position: relative; cursor: crosshair; touch-action: pan-y; }
.chart-svg { display: block; width: 100%; height: 150px; overflow: visible; }
.chart-svg line.grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.chart-svg polyline.line { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg polyline.l0 { stroke: var(--accent); } .chart-svg polyline.l1 { stroke: var(--ok); } .chart-svg polyline.l2 { stroke: var(--warn); }
.chart-svg polygon.area { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.chart-labels { display: flex; margin-top: .4rem; font-size: .72rem; color: var(--muted); }
.chart-labels span { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.chart-guide, .chart-dot, .chart-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s; }
.chart.hover .chart-guide, .chart.hover .chart-dot, .chart.hover .chart-tip { opacity: 1; }
.chart-guide { top: 0; bottom: 0; width: 1px; background: var(--muted); transform: translateX(-.5px); }
.chart-dot { width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--card); }
.chart-dot.l0 { background: var(--accent); } .chart-dot.l1 { background: var(--ok); } .chart-dot.l2 { background: var(--warn); }
.chart-tip { top: 0; z-index: 5; min-width: 9.5rem; padding: .5rem .65rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; box-shadow: var(--shadow-lg); font-size: .8rem; line-height: 1.5; white-space: nowrap; }
.chart-tip b { display: block; margin-bottom: .15rem; font-weight: 600; }
.tip-row::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; }
.tip-row strong { font-variant-numeric: tabular-nums; }

/* ---------- 8. Seitenspezifisch ---------- */
details.setup summary, details.collapsible > summary { cursor: pointer; list-style: none; }
details.guide { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
details.guide > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1.2em; line-height: 1; }
details.guide[open] > summary::before { transform: rotate(90deg); }
ul.plain { margin: 0; padding-left: 1.2rem; }
ul.plain li { margin: .3rem 0; }
.add-host { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
form.test-mail { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
form.delete-user { margin-top: .8rem; }
.delete-options { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.ban-note { margin: -.4rem 0 1rem; }

/* ---------- 9. Responsive ---------- */

/* Tablet & Handy: Seitenleiste als ausklappbares Menü */
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-100%);
    transition: transform .2s ease, box-shadow .2s ease; padding-top: max(1.1rem, env(safe-area-inset-top)); }
  .shell.open .sidebar { transform: none; box-shadow: var(--shadow-lg); }   /* Schatten nur bei geöffnetem Menü, sonst scheint er am Rand durch */
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(9, 12, 18, .45);
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .shell.open .nav-backdrop { opacity: 1; visibility: visible; }
  .mobile-bar { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 40; height: 58px;
    padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--card) 88%, transparent); border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }
  .mobile-bar .brand { flex: 1; }
  .sidebar nav a { padding: .7rem .75rem; font-size: 1rem; }
  body.nav-open { overflow: hidden; }
  html { scroll-padding-top: 5rem; }
}

/* Tablet hochkant */
@media (max-width: 900px) {
  :root { --gap: 1rem; --pad: 1.15rem; }
  main { padding-top: 1.4rem; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form .wide-2 { grid-column: 1 / -1; }
  h1 { font-size: 1.4rem; }
}

/* Handy */
@media (max-width: 640px) {
  :root { --gap: .85rem; --pad: 1rem; --header-h: 56px; }
  body { font-size: 15px; }
  main { padding: 1.1rem max(.85rem, env(safe-area-inset-right)) calc(3rem + env(safe-area-inset-bottom)) max(.85rem, env(safe-area-inset-left)); }
  h1 { font-size: 1.3rem; margin-bottom: .9rem; }
  .card { border-radius: var(--radius); }
  .login { margin-top: 3.5rem; padding: 1.4rem; }
  .tiles, .tiles.tiles-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }      /* keine einzelne halbe Kachel am Ende */
  .tile { padding: .9rem 1rem; }
  .tile b { font-size: 1.35rem; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .wide-2 { grid-column: auto; }
  dl.kv { grid-template-columns: 1fr; gap: .15rem; }
  dl.kv dd { margin-bottom: .6rem; }
  .between { align-items: flex-start; }
  .toolbar > *, .toolbar .combo, .toolbar select { flex: 1 1 100%; width: 100%; }
  .row > button, .row > a.button, .row > form > button { flex: 1 1 auto; }
  .limits-row { line-height: 2.2; }
  .limits-row b { display: block; min-width: 0; line-height: 1.6; margin-top: .4rem; }
  .small-input { width: 100% !important; }
  .row-inline { display: flex; width: 100%; }
  .chart-svg { height: 130px; }
  .chart-labels span:nth-child(even) { visibility: hidden; }
  .section-title { margin-top: 1.5rem; }
  dialog.fritz-dialog { width: calc(100vw - 1rem); padding: 1.1rem; }

  /* Touch: größere Bedienflächen, 16px in Feldern (kein Auto-Zoom auf iOS) */
  button, a.button { min-height: 44px; }
  button.small, a.button.small { min-height: 36px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 44px; font-size: 16px; }
  input[type=checkbox] { width: 20px; height: 20px; }

  /* Tabellen werden zu Karten (Beschriftung aus der Kopfzeile, per JS gesetzt) */
  table.stack-table, table.stack-table tbody, table.stack-table tr, table.stack-table td { display: block; width: 100%; }
  table.stack-table tr:first-child:has(th) { display: none; }
  .scroll:has(table.stack-table) { margin: 0; padding: 0; overflow: visible; }
  table.stack-table tr { border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem .85rem; margin-bottom: .7rem; background: var(--card); }
  table.stack-table tr:hover td { background: none; }
  table.stack-table td { display: grid; grid-template-columns: minmax(6.5rem, 38%) 1fr; gap: .6rem; align-items: start;
    padding: .45rem 0; border-bottom: 1px dashed var(--line); text-align: left; max-width: none; }
  table.stack-table td:last-child { border-bottom: 0; }
  table.stack-table td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; padding-top: .15rem; }
  table.stack-table td[data-label=""] { grid-template-columns: 1fr; }
  table.stack-table td > .badge, table.stack-table td > a.badge { justify-self: start; }
  table.stack-table td::before { font-family: var(--font); }
  table.stack-table td[data-label=""]::before { display: none; }
  table.stack-table td:first-child { font-weight: 600; font-size: .98rem; }
  table.stack-table td.actions { text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: .4rem; }
  table.stack-table td.actions::before { display: none; }
  table.stack-table td.actions > * + * { margin-left: 0; }
}

@media (max-width: 380px) {
  .tiles, .tiles.tiles-6 { grid-template-columns: 1fr; }
}

/* Bewegung reduzieren, wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Druck */
@media print {
  .sidebar, .mobile-bar, .tabs, .theme-corner, button, .pager, .toolbar { display: none !important; }
  .shell { display: block; }
  .tab-panel { display: block !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ---------- Landing-Page (öffentlich) ---------- */
body.landing main { max-width: 1100px; padding-top: 1.2rem; }
.lp-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; height: var(--header-h);
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.lp-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.lp-band { padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.2rem, 4vw, 2.4rem); margin-bottom: var(--gap);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.lp-band h1 { font-size: clamp(1.6rem, 4.5vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4rem; }
.lp-lead { margin: 0; color: var(--muted); font-size: 1.05rem; }
.lp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.lp-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.lp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.lp-panel > h2 { margin: 0; padding: .85rem 1.2rem; font-size: .95rem; background: var(--card-2); border-bottom: 1px solid var(--line); }
.lp-pad { padding: 1rem 1.2rem 1.2rem; }
.lp-kv { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1.4rem; margin: 0; padding: 1.1rem 1.2rem; align-items: center; }
.lp-kv dt { color: var(--fg); font-weight: 650; }
.lp-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lp-kv code { background: none; border: 0; padding: 0; font-size: 1.05rem; font-weight: 600; }
.lp-ns-row { display: grid; grid-template-columns: 1fr auto auto; gap: .2rem .8rem; align-items: center;
  padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); }
.lp-ns-row:last-child { border-bottom: 0; }
.lp-ns-lat { grid-column: 3; grid-row: 1; min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.lp-ns-ip { grid-column: 1 / -1; grid-row: 2; overflow-wrap: anywhere; }
.lp-feat { list-style: none; margin: 0; padding: .4rem 0; }
.lp-feat li { display: flex; gap: 1rem; align-items: center; padding: .7rem 1.2rem; }
.lp-feat li + li { border-top: 1px solid var(--line); }
.lp-feat b { display: block; font-weight: 650; }
.lp-feat span:not(.lp-icon) { color: var(--muted); font-size: .9rem; }
.lp-cta { display: flex; gap: .7rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.lp-icon { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.lp-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
dialog.login-dialog { width: min(400px, calc(100vw - 2rem)); }
.lp-dlg-links { display: flex; gap: .4rem 1.1rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; font-size: .9rem; }
.dlg-flash:empty { display: none; }
.dlg-flash .flash { margin-bottom: 1rem; }
@media (max-width: 860px) { .lp-cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) { a.button.lp-hide-sm { display: none; } .lp-top { gap: .5rem; } }

/* Namens-Check */
.nc-group { display: flex; gap: .5rem; }
.nc-group input { flex: 1 1 8rem; min-width: 0; }
.nc-group select { flex: 0 1 auto; width: auto; max-width: 60%; }
.nc-results { display: flex; flex-direction: column; margin-top: .6rem; }
.nc-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .5rem 0; border-top: 1px solid var(--line); }
.nc-row code { background: none; border: 0; padding: 0; flex: 1; min-width: 10rem; }
.nc-row form { margin-left: auto; }

/* Benachrichtigungskanäle */
.channel.paused { opacity: .75; }
.host-pick { max-height: 11rem; overflow-y: auto; }

/* Sichtbarkeit von Domains */
.visibility-form { display: flex; flex-direction: column; gap: .7rem; }
.visibility-form label.check { align-items: flex-start; }
.visibility-form input[type=radio] { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--accent); flex-shrink: 0; }
.visibility-select { width: auto !important; flex: 0 1 12rem; }
@media (max-width: 640px) { .visibility-select { flex: 1 1 100%; } }

/* Schritte (Konto löschen) */
ol.steps { list-style: none; counter-reset: step; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: .25rem; width: 1.8rem; height: 1.8rem;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
ol.steps > li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
ol.steps > li.disabled { opacity: .5; }
.code-input { max-width: 12rem; font-family: var(--mono); font-size: 1.25rem !important; letter-spacing: .3em; text-align: center; }
.delete-confirm { max-width: 32rem; }

/* Ankündigungen */
.announcement { position: relative; display: flex; gap: .75rem; padding: .85rem 2.6rem .85rem 1rem; margin: 0 0 1rem;
  border-radius: var(--radius); border: 1px solid; border-left-width: 4px; font-size: .92rem; line-height: 1.5; animation: flash-in .2s ease-out; }
.announcement::before { content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.announcement-body { color: var(--fg); min-width: 0; }
.announcement-body b { display: block; margin-bottom: .1rem; }
.announcement-body div { white-space: pre-line; color: var(--fg-2); }
.announcement.info { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 11v6M12 7h.01'/%3E%3C/svg%3E"); }
.announcement.warning { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.announcement.critical { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
.announcement.leaving { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
.login ~ .announcement, main > .announcement:first-child { margin-top: 0; }
/* Spam-Falle für Bots, für Menschen unsichtbar */
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.register-cta { padding-top: 1rem; border-top: 1px solid var(--line); }

/* Einladung */
.invite-card { max-width: 460px; }
a.button.wide-button { width: 100%; margin-top: .4rem; }

/* Nameserver-Assistent */
.kit-cmd { font-size: .95rem; }
.kit-details summary { cursor: pointer; color: var(--accent); margin-top: .6rem; font-weight: 500; }
.kit-script { max-height: 28rem; overflow: auto; white-space: pre; word-break: normal; font-size: .78rem; }
ol.plain-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
ol.plain-steps li::marker { font-weight: 700; color: var(--accent); }
ol.plain-steps table { margin-top: .4rem; width: auto; }
.kit-add { margin-top: .5rem; }

/* Healthchecks */
.input-unit { display: flex; gap: .4rem; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit .unit-select { width: auto !important; flex: 0 0 6.5rem; }
.input-unit .unit-text { align-self: center; color: var(--muted); font-family: var(--mono, monospace); font-size: .9rem; white-space: nowrap; }
.badge.state-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; display: inline-block; }
code.grow { flex: 1; padding: .5rem .65rem; }

/* Offline-Page */
.offline-body { display: grid; min-height: 100vh; place-items: center; background: var(--bg); }
.offline-main { padding: 1.5rem; max-width: 560px; width: 100%; }
.offline-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 2.4rem 2rem; text-align: center; box-shadow: var(--shadow); }
.offline-card h1 { font-size: 1.5rem; margin: 1rem 0 .6rem; }
.offline-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--warn-soft); display: grid; place-items: center; color: var(--warn); }
.offline-icon.back { background: var(--ok-soft); color: var(--ok); }
.offline-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.offline-message { color: var(--fg-2); white-space: pre-line; font-size: 1.02rem; }
.offline-host { color: var(--muted); margin-top: 1.2rem; }
.failover-form { margin-top: 1.1rem; }

/* Reservierungen: Name als Klickfläche, Menü als Dialog */
button.res-open { min-height: 0; padding: .2rem .4rem; margin-left: -.4rem; color: var(--accent); font-weight: 600; text-align: left; }   /* Text bündig mit den anderen Zeilen */
button.res-open:hover { text-decoration: underline; }
dialog.res-dialog { width: min(560px, calc(100vw - 2rem)); min-height: 22rem; }
/* Vorschlagsliste im Dialog im Fluss statt darüberliegend – der Dialog wächst mit */
dialog.res-dialog .suggest .combo-list { position: static; width: auto; max-width: none; margin-top: .35rem; max-height: 12rem; box-shadow: none; }
dialog.res-dialog h3 { margin-top: 1.2rem; }

.delete-modes { display: flex; flex-direction: column; gap: .6rem; }
.delete-modes label.check { align-items: flex-start; }
.delete-modes input[type=radio] { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--danger); flex-shrink: 0; }

.suggest { position: relative; min-width: 0; }
.suggest .combo-list { width: max-content; min-width: 100%; max-width: min(30rem, 90vw); }
.suggest .combo-list li { white-space: nowrap; }

[data-notify-fields].is-off { opacity: .45; pointer-events: none; }

/* ---------- Bewegung: weiches Scrollen, Einblenden beim Laden, Überblendung zwischen Seiten ---------- */
html { scroll-behavior: smooth; }

/* Inhalt blendet beim Laden dezent ein (gestaffelt); „backwards“ hinterlässt keine dauerhafte Transformation */
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
main > .page-head, main > .tiles, main > .tabs, main > .card, main > .two, main > .flash, main > .announcement,
main > .lp-band, main > .lp-cols, main > .lp-panel {
  animation: page-in .18s ease-out backwards;
}
main > :nth-child(2) { animation-delay: .02s; }
main > :nth-child(3) { animation-delay: .04s; }
main > :nth-child(4) { animation-delay: .06s; }
main > :nth-child(n + 5) { animation-delay: .08s; }
.lp-col > .lp-panel { animation: page-in .18s ease-out backwards; }
.lp-col > .lp-panel:nth-child(2) { animation-delay: .03s; }
.lp-col > .lp-panel:nth-child(3) { animation-delay: .06s; }

/* weichere Übergänge bei Navigation, Tabs, Karten und Dialogen */
.sidebar nav a, .tabs a, .tabs .count, .card, .tile, .lp-panel, .badge { transition: background-color .16s, color .16s, border-color .16s, box-shadow .2s, transform .2s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
dialog.fritz-dialog[open]::backdrop { animation: fade-in .2s ease; }
.combo-list:not([hidden]) { animation: panel-in .14s ease; }
tbody tr, table tr { transition: background-color .12s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Tab-Inhalte haben eine Mindesthöhe, damit die Seite beim Wechsel nicht springt */
.tabs-ready .tab-panel { min-height: 55vh; }

/* ---------- Konsistenz am Handy ---------- */
@media (max-width: 640px) {
  /* Seitenkopf überall gleich: Titel oben, Aktionen darunter über die volle Breite */
  .page-head { flex-direction: column; align-items: stretch; gap: .8rem; margin-bottom: 1.1rem; }
  .page-head .page-actions { width: 100%; }
  .page-head .page-actions > .button, .page-head .page-actions > form, .page-head .page-actions > button { flex: 1 1 auto; }
  .page-head .page-actions.segmented, .page-head .page-actions > .segmented { width: auto; flex: 0 0 auto; }
  /* Tabs: ausgeblendeter Rest wird am Rand angedeutet statt hart abgeschnitten */
  .tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .tabs a { padding: .75rem .85rem; }
}
.nowrap-muted { white-space: nowrap; color: var(--muted); }
@media (max-width: 640px) {
  /* mehrzeilige Zellen (z. B. mehrere Inhalte): alle Zeilen stehen in der Wertespalte */
  table.stack-table td:not([data-label=""]):not(.actions) > * { grid-column: 2; }
  table.stack-table td:not([data-label=""]):not(.actions)::before { grid-column: 1; grid-row: 1; }
}
.tab-panel > .section-title:first-child { margin-top: .2rem; }
.tier-table th:nth-child(n + 2) { white-space: nowrap; }
.tier-table .tier-cell { padding: .35rem 0; }
.tier-row { display: grid; grid-template-columns: minmax(8rem, 1.6fr) repeat(3, minmax(4.5rem, 1fr)) 4rem 11rem; gap: .6rem; align-items: center; }
.tier-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.tier-new { align-items: end; }
.tier-new label { display: flex; flex-direction: column; gap: .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.tier-new label input { text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400; color: var(--fg); }
.tier-row input { width: 100%; }
@media (max-width: 760px) { .tier-row, .tier-new { grid-template-columns: 1fr 1fr; } .tier-row input[name="name"], .tier-new label:first-child { grid-column: 1 / -1; } .tier-head { display: none; } }

/* Alle Karten, Kachelreihen und Listenzeilen blenden beim Laden ein (egal wie tief verschachtelt);
   nach dem Laden (html.settled, per JS) nicht mehr, damit Tab-Wechsel und Live-Aktualisierung ruhig bleiben */
main .card:not(.card .card), main .tiles, main .two, main .section-title { animation: page-in .18s ease-out backwards; }
main .tab-panel > :nth-child(2) { animation-delay: .03s; }
main .tab-panel > :nth-child(n + 3) { animation-delay: .06s; }
@keyframes row-in { from { opacity: 0; } to { opacity: 1; } }
main tr:not(:first-child) { animation: row-in .2s ease-out backwards; }   /* nur Deckkraft: keine Verschiebung, damit keine Scrollbalken aufblitzen */
main tr:nth-child(2) { animation-delay: .05s; }
main tr:nth-child(3) { animation-delay: .07s; }
main tr:nth-child(4) { animation-delay: .09s; }
main tr:nth-child(5) { animation-delay: .11s; }
main tr:nth-child(6) { animation-delay: .13s; }
main tr:nth-child(n + 7) { animation-delay: .15s; }
html.settled main .card, html.settled main .tiles, html.settled main .two, html.settled main .section-title,
html.settled main tr, html.settled .tab-panel > * { animation: none; }
@media (prefers-reduced-motion: reduce) { main .card, main .tiles, main .two, main tr { animation: none !important; } }

/* Tabellen-Container scrollen nur horizontal; die Einblendung darf nie einen vertikalen Balken erzeugen */
.scroll { overflow-y: hidden; }
.tier-members { margin: .5rem 0 .2rem; }
.tier-members summary { cursor: pointer; color: var(--muted, inherit); font-size: .9rem; }
dialog.res-dialog form.row { align-items: flex-start; }

/* ---------- Benutzer-Modus (Admin/Moderator handelt als Benutzer): durchgehende Leiste oben ---------- */
:root { --imp-h: 2.7rem; }
.imp-bar { position: fixed; top: 0; left: 0; right: 0; height: var(--imp-h); z-index: 300; display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: 0 1rem; background: #d97706; color: #fff; font-size: .92rem; box-shadow: 0 1px 6px rgb(0 0 0 / .25); }
.imp-bar .imp-real { opacity: .85; }
.imp-bar form { margin: 0; }
.imp-bar button { min-height: 0; padding: .3rem .8rem; background: #fff; color: #92400e; border: 0; font-weight: 700; border-radius: 8px; }
.imp-bar button:hover { background: #fef3c7; }
body.impersonating { padding-top: var(--imp-h); }
body.impersonating .sidebar { top: var(--imp-h); height: calc(100dvh - var(--imp-h)); }
body.impersonating .mobile-bar { top: var(--imp-h); }
body.impersonating .shell { min-height: calc(100vh - var(--imp-h)); }
html:has(body.impersonating) { scroll-padding-top: calc(var(--imp-h) + 1rem); }
@media (max-width: 640px) { .imp-bar { font-size: .8rem; gap: .5rem; padding: 0 .6rem; } .imp-bar .imp-real { display: none; } }
.tier-name { display: flex; flex-direction: column; gap: .15rem; }

/* ---------- Seitenleiste einklappbar (nur Symbole), nur am Desktop ---------- */
.sb-toggle { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 0; padding: .45rem .7rem; border: 0; background: none;
  color: var(--muted); font-weight: 520; font-size: .85rem; border-radius: 9px; justify-content: flex-start; }
.sb-toggle:hover { background: var(--bg-2); color: var(--fg); }
.sb-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; transition: transform .2s; }
@media (max-width: 1024px) { .sb-toggle { display: none; } }
@media (min-width: 1025px) {
  html.sb-anim .shell { transition: grid-template-columns .18s ease; }
  html.sb-collapsed { --sidebar-w: 4.5rem; }
  html.sb-collapsed .sidebar { padding-left: .55rem; padding-right: .55rem; overflow-x: hidden; align-items: stretch; }
  html.sb-collapsed .sidebar .brand { justify-content: center; padding: .3rem 0 .6rem; }
  html.sb-collapsed .sidebar .brand > span:not(.brand-logo) { display: none; }
  html.sb-collapsed .nav-label, html.sb-collapsed .whoami-text { display: none; }
  html.sb-collapsed .nav-heading { height: 1px; padding: 0; margin: .1rem .5rem .45rem; background: var(--line); font-size: 0; overflow: hidden; }
  html.sb-collapsed .sidebar nav a { justify-content: center; padding: .62rem 0; gap: 0; }
  html.sb-collapsed .nav-count { position: absolute; top: 2px; right: 6px; min-width: 1.05rem; height: 1.05rem; font-size: .62rem; padding: 0 .25rem; margin: 0; }
  html.sb-collapsed .sidebar-foot .theme-switch { display: none; }
  html.sb-collapsed .sb-toggle { justify-content: center; padding: .5rem 0; }
  html.sb-collapsed .sb-toggle svg { transform: rotate(180deg); }
  html.sb-collapsed .me-row { flex-direction: column; gap: .4rem; }
  html.sb-collapsed .whoami { justify-content: center; padding: .3rem 0; flex: none; }
}
/* Fußbereich der Seitenleiste hat in beiden Zuständen dieselbe Höhe, der Button bleibt beim Ein-/Ausklappen exakt an derselben Stelle */
@media (min-width: 1025px) { .sidebar-foot { box-sizing: border-box; height: 11rem; flex-shrink: 0; justify-content: flex-start;
  position: sticky; bottom: -1.1rem; margin-bottom: -1.1rem; padding-bottom: 1.1rem; background: var(--sidebar); z-index: 2; } }   /* bleibt auch bei niedrigem Fenster unten */
.sb-toggle { height: 2.1rem; }
.sidebar-foot > * { flex-shrink: 0; }
/* Während der Breiten-Animation darf nie ein waagerechter Balken am unteren Rand der Seitenleiste auftauchen (ließ den Fußbereich springen) */
@media (min-width: 1025px) { .sidebar { overflow-x: hidden; } .sidebar nav, .sidebar-foot, .sidebar .brand { min-width: 0; } .sidebar nav a { overflow: hidden; } }

/* ---------- Zwei-Faktor-Einrichtung ---------- */
.mfa-setup { max-width: 34rem; }
.mfa-steps { padding-left: 1.2rem; display: grid; gap: .5rem; color: var(--fg-2); }
.mfa-qr { display: grid; place-items: center; margin: 1.2rem auto; width: fit-content; padding: .6rem; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.mfa-qr svg { width: 15rem; height: 15rem; display: block; }
.mfa-secret { font-size: 1.05rem; letter-spacing: .08em; user-select: all; }
.mfa-confirm { margin-top: 1rem; justify-content: center; }
.mfa-confirm input { max-width: 11rem; text-align: center; font-size: 1.15rem; letter-spacing: .15em; }
