/* DynDNS – Oberfläche. Farben als Tokens, hell und dunkel; eine Spalte auf dem Handy. */
:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f0f3f4;
  --border: #dde3e6;
  --text: #15202b;
  --muted: #5d6b76;
  --accent: #0f766e;
  --accent-strong: #0b5e58;
  --accent-soft: #e0f2ef;
  --on-accent: #ffffff;
  --ok: #15803d;
  --ok-soft: #e3f4e8;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --err: #b91c1c;
  --err-soft: #fbe7e7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1418; --surface: #151d23; --surface-2: #1b252c; --border: #2a363f; --text: #e6edf1; --muted: #93a3ae;
    --accent: #2dd4bf; --accent-strong: #5eead4; --accent-soft: #123532; --on-accent: #062925;
    --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf24; --warn-soft: #33270e; --err: #f87171; --err-soft: #3a1717;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1418; --surface: #151d23; --surface-2: #1b252c; --border: #2a363f; --text: #e6edf1; --muted: #93a3ae;
  --accent: #2dd4bf; --accent-strong: #5eead4; --accent-soft: #123532; --on-accent: #062925;
  --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf24; --warn-soft: #33270e; --err: #f87171; --err-soft: #3a1717;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Gerüst */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; overflow-y: auto; padding: 16px 12px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); padding: 4px 8px 16px; }
.brand:hover { text-decoration: none; }
.brand.center { justify-content: center; padding-bottom: 20px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--on-accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-strong); }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.sidebar-foot { margin-top: auto; font-size: .78rem; color: var(--muted); padding: 8px 10px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: 240px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 1.15rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right form { margin: 0; }
.content { padding: 24px; max-width: 1200px; width: 100%; }
.scrim { display: none; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--text); }
.user-chip:hover, .user-chip.on { background: var(--surface-2); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center;
  font-weight: 700; text-transform: uppercase; font-size: .85rem; }

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.card-head { flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg a { padding: 4px 10px; border-radius: 7px; color: var(--muted); font-size: .85rem; font-weight: 550; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.records-sources { margin: 0 0 12px; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: stretch; }
.grid > .card { margin-bottom: 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 10px; }

.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding: 20px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); }
.hello h2 { font-size: 1.3rem; margin-bottom: 4px; }
.hello p { margin: 0; }
.hello-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; color: var(--text); }
a.tile { transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.tile b { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .85rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.menu-btn { display: none; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 8px; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.danger-text { color: var(--err); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form.inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form.inline > .btn { height: 44px; align-self: flex-end; }
.form h2 { margin-top: 8px; }
.form h3 { margin: 4px 0 0; font-size: 1rem; }
.form .grid > div { display: flex; flex-direction: column; gap: 14px; }
textarea { resize: vertical; }
.form > .btn { align-self: flex-start; }
.form > .btn.block { align-self: stretch; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 140px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.checks legend { font-weight: 550; font-size: .9rem; padding: 0; margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.code-input { font-family: var(--mono); letter-spacing: .3em; font-size: 1.1rem; max-width: 12ch; height: 44px; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions.wrap { flex-wrap: wrap; margin: 12px 0; }
.actions form { margin: 0; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.toolbar .push { margin-left: auto; }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); }
.pill { display: inline-block; font-size: .8rem; padding: 1px 9px; border-radius: 999px; font-weight: 550; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.warn-text { color: var(--warn); }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.records tr.fixed td { color: var(--muted); }
.records tr.editing td { background: var(--surface-2); }
.records .meta { font-family: var(--font); font-size: .8rem; }
.form .record-fields { grid-template-columns: minmax(140px, 1fr) 120px minmax(220px, 2.5fr) 140px; align-items: start; margin-bottom: 0; }
.center-text { text-align: center; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; margin: 0; }
.secret { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; cursor: copy; }
.secret.copied { outline: 2px solid var(--ok); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.feed li > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed li:last-child { border-bottom: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rows li:last-child { border-bottom: 0; }
.rows form { margin: 0; }
.row-form { display: flex; gap: 8px; align-items: center; flex: 1; flex-wrap: wrap; }
.row-form input { flex: 1 1 140px; width: auto; }
.steps { padding-left: 1.2rem; color: var(--muted); }
.qr { display: block; width: 200px; height: 200px; border-radius: 8px; margin: 8px 0 12px; image-rendering: pixelated; }
details.danger-zone { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
details.danger-zone summary { cursor: pointer; color: var(--err); font-weight: 550; margin-bottom: 10px; }
details.profile { border-top: 1px solid var(--border); padding: 10px 0; }
details.profile:first-of-type { border-top: 0; }
details.profile summary { cursor: pointer; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
details.profile summary .push { margin-left: auto; }
details.profile .form { margin-top: 10px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 20px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.bar-fill { width: 100%; max-width: 36px; background: var(--accent); border-radius: 4px 4px 0 0; height: 0; }
.bar-val { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-label { font-size: .7rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bar.zero .bar-val { visibility: hidden; }
.bar.zero .bar-fill { height: 2px !important; background: var(--border); border-radius: 1px; }
.bar:hover .bar-fill { filter: brightness(1.1); }
/* Rangliste mit Balken (größte Domains, meistgefragte Domains) */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.rank-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-title { font-size: 1.3rem; text-align: center; margin-bottom: 1rem; }
.auth-theme { position: absolute; top: 16px; right: 16px; }

/* Befehle und URLs zum Kopieren */
.snippet { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 4px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.snippet[data-copy] { cursor: pointer; }

/* Handy */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .main { margin-left: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile b { font-size: 1.35rem; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .user-name, .user-chip .badge { display: none; }
  .hide-sm { display: none; }
  .grid.two { grid-template-columns: 1fr; }
  .form .record-fields { grid-template-columns: 1fr 1fr; }
  .form .record-fields > label:nth-child(3) { grid-column: 1 / -1; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .toolbar .push { margin-left: 0; }
  .bar-label { display: none; }
  .grid { gap: 16px; margin-bottom: 16px; }
  .card { margin-bottom: 16px; }
}
@media (max-width: 640px) {
  /* Fakten untereinander statt in zwei Spalten */
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { font-size: .8rem; margin-top: 10px; }
  .facts dt:first-child { margin-top: 0; }
  .topbar .btn { padding: 6px 10px; }
  /* DNS-Einträge als Liste: Name und Typ, darunter Wert und Knöpfe */
  .records thead { display: none; }
  .records, .records tbody { display: block; }
  .records tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .records td { display: block; padding: 0; border: 0; }
  .records td.hide-sm { display: none; }
  .records td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .records td:nth-child(3), .records td:nth-child(5) { grid-column: 1 / -1; }
}
