/* Automagically-Design. Schriften liegen lokal: kein Abruf bei Google. */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/dm-sans.d4c68940b772.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-mono-400.b4ddae058212.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-mono-500.ecb3fd43cbea.woff2") format("woff2"); }

:root {
  --bg: #efece3; --surface: #fff; --paper: #faf9f5; --ink: #1c1917; --ink-2: #57534e; --ink-3: #6b655b;
  --line: #e2ddd1; --line-soft: #ece9e2; --line-strong: #a8a29b; --chip: #e6e1d4; --dots: #dcd6c8;
  --accent: #be185d; --accent-ink: #be185d; --accent-soft: #f472a3;
  --btn: #131316; --btn-ink: #fff;
  --grad: linear-gradient(100deg, #e84a8a, #f97316); --bar: #e84a8a; --bar-old: #e8d9cf; --bar-mid: #f4a6c4;
  --up: #15803d; --down: #b91c1c; --on: #16a34a; --off: #a8a29b;
  --ok-bg: rgba(22, 163, 74, .12); --ok-ink: #166534; --warn-bg: rgba(245, 158, 11, .14); --warn-ink: #92400e;
  --off-bg: rgba(220, 38, 38, .1); --off-ink: #991b1b;
  --shadow: 0 40px 80px -56px rgba(28, 25, 23, .45);
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131316; --surface: #1a1a1f; --paper: #212127; --ink: #f5f3ee; --ink-2: #c9c4ba; --ink-3: #a8a29b;
    --line: #2b2a2e; --line-soft: #26252a; --line-strong: #57534e; --chip: #2b2a2e; --dots: #26252a;
    --accent-ink: #f472a3; --btn: #f5f3ee; --btn-ink: #131316;
    --bar-old: #3a3036; --bar-mid: #a94b73; --up: #4ade80; --down: #f87171;
    --ok-bg: rgba(74, 222, 128, .14); --ok-ink: #86efac; --warn-bg: rgba(245, 158, 11, .18); --warn-ink: #fcd34d;
    --off-bg: rgba(248, 113, 113, .16); --off-ink: #fca5a5; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
body { margin: 0; background: var(--bg); position: relative; }
/* Punktraster unter der Kopfleiste, läuft nach unten aus */
body::before { content: ""; position: absolute; left: 0; right: 0; top: 68px; height: 260px; background-image: radial-gradient(circle, var(--dots) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent); pointer-events: none; }
.site-header, main { position: relative; }
a { color: var(--accent-ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { min-height: 68px; padding-block: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; order: 1; }
.nav a { min-height: 44px; padding: 0 14px; display: flex; align-items: center; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--chip); color: var(--ink); }
/* Kopfleiste: Desktop alles in einer Zeile (Logo, Navigation, Aktion, Abmelden); mobil Aktion und Menü-Knopf rechts, Rest im Menü */
.menu { display: contents; }
.site-header .menu-btn { display: none; padding: 0 12px; }
.menu-btn .i-close { display: none; }
.site-header.is-open .menu-btn .i-open { display: none; }
.site-header.is-open .menu-btn .i-close { display: block; }
.head-new { order: 2; gap: 8px; margin-left: auto; }
.logout { margin: 0; order: 3; }
.logout .btn { border: 0; background: transparent; min-height: 44px; padding: 0 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; gap: 8px; }
.logout svg { display: none; }
@media (max-width: 639px) {
  .site-header .wrap { gap: 8px; }
  .brand { flex: 1; }
  .head-new { order: 0; margin-left: 0; padding: 0 12px; }
  .head-new-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .site-header .menu-btn { display: inline-flex; }
  .menu { display: none; flex: 0 0 100%; flex-direction: column; gap: 6px; padding-bottom: 10px; }
  .site-header.is-open .menu { display: flex; }
  .nav { flex-direction: column; flex-wrap: nowrap; flex-grow: 0; order: 0; }
  .nav a { padding: 0 12px; }
  .logout { order: 0; margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
  .logout .btn { width: 100%; justify-content: flex-start; padding: 0 12px; border-radius: 9px; color: var(--down); font-size: 14px; }
  .logout .btn:hover { background: var(--off-bg); }
  .logout svg { display: block; }
}

main.wrap { padding-block: 40px 72px; }
h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 40px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.lead { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-3); max-width: 640px; }
.page-head { margin-bottom: 32px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
.card-lg { padding: 24px; border-radius: 20px; box-shadow: var(--shadow); }
.card-dark { background: var(--btn); color: var(--btn-ink); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-dark .muted { color: inherit; opacity: .75; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { flex: 1 1 240px; min-width: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; }
.cols > aside { flex: 1 1 320px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; }
.hint { font-size: 14px; color: var(--ink-3); font-weight: 400; }
.error { color: var(--down); font-size: 14px; }
.input { height: 46px; width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: 14.5px var(--sans); }
.input[type="url"], #id_slug { font-family: var(--mono); font-size: 14px; }
.input::placeholder { color: var(--ink-3); opacity: .8; }
.input.is-invalid { border-color: var(--down); }
.inline { display: flex; gap: 8px; }
.inline .input { flex: 1; min-width: 0; }

.btn { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 13.5px var(--sans); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn-dark { background: transparent; border-color: var(--line-strong); color: inherit; }
.btn-danger { color: var(--down); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; }

.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 3px; gap: 2px; }
.seg a, .seg button { min-height: 44px; padding: 0 16px; display: flex; align-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 600 13px var(--sans); text-decoration: none; cursor: pointer; }
.seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { min-height: 44px; padding: 0 16px; display: flex; align-items: center; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); }

.opt { padding: 4px 0; border-top: 1px solid var(--line); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.opt-row > div { flex: 1 1 240px; }
.opt-title { font-weight: 600; }
.opt-extra { display: none; padding: 0 0 12px; flex-wrap: wrap; gap: 12px; }
.opt:has(.switch input:checked) .opt-extra { display: flex; }
.opt-extra .field { flex: 1 1 220px; }
.switch { position: relative; flex-shrink: 0; width: 56px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch .track { width: 48px; height: 28px; border-radius: 999px; background: var(--off); position: relative; transition: background .15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--on); }
.switch input:checked + .track .knob { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }

.kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { flex: 1 1 150px; padding: 18px 20px; display: flex; flex-direction: column; gap: 9px; }
.kpi > :first-child { font: 400 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.kpi > :last-child { font-size: 12.5px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.04em; line-height: 1; overflow-wrap: anywhere; }
.up { color: var(--up); } .down { color: var(--down); }

.chart { display: flex; gap: 8px; }
.chart-axis { position: relative; width: 36px; height: 240px; font-size: 13px; color: var(--ink-3); }
.chart-axis span { position: absolute; right: 0; transform: translateY(-50%); }
.chart-body { flex: 1; min-width: 0; }
.bars { position: relative; height: 240px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line-strong); }
.bars .grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.bars .bar { position: relative; flex: 1 1 0; min-width: 0; background: var(--bar-old); border-radius: 4px 4px 2px 2px; }
.bars .bar:nth-last-child(-n+7) { background: var(--bar-mid); }
.bars .bar:last-child { background: var(--grad); }
.chart-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-3); }

.table { overflow-x: auto; }
.table > div { min-width: 520px; }
.tr { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.th { min-height: 0; padding: 10px 0; font: 400 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
a.tr:hover { background: var(--paper); }
.grow { flex: 1 1 0; min-width: 0; }
.w-72 { width: 72px; text-align: right; } .w-84 { width: 84px; text-align: right; }
.w-spark { width: 96px; flex-shrink: 0; }
.spark { display: block; width: 96px; height: 28px; overflow: visible; }
.spark polygon { fill: var(--bar); opacity: .14; }
.spark polyline { fill: none; stroke: var(--bar); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.w-96 { width: 96px; } .w-110 { width: 110px; } .w-80 { width: 80px; } .w-54 { width: 54px; }
.nowrap { white-space: nowrap; }
.flag { font-size: 22px; line-height: 1; cursor: default; }
.slug { display: block; font: 400 14px var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.slug b { color: var(--accent-ink); font-weight: 500; }
.sub { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font: 14px var(--mono); }

.meter { margin-bottom: 14px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.meter-bar { height: 6px; border-radius: 3px; background: var(--paper); }
.meter-bar > div { height: 6px; border-radius: 3px; background: var(--grad); }

.preview-url { font: 500 22px var(--mono); overflow-wrap: anywhere; }
.preview-url b { color: var(--accent-soft); font-weight: 500; }
.preview-target { font: 14px var(--mono); overflow-wrap: anywhere; }
.recent { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.recent > span:first-child { min-width: 0; }
.recent > span:last-child { flex-shrink: 0; text-align: right; }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-off { background: var(--off-bg); color: var(--off-ink); }
.tag { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; text-align: right; font-weight: 500; }
.messages { list-style: none; margin: 0 0 16px; padding: 0; }
.messages li { background: var(--chip); border-radius: 10px; padding: 10px 14px; }
.narrow { max-width: 420px; margin: 8vh auto; }
.htmx-request { opacity: .6; transition: opacity .2s; }
@media (max-width: 560px) { .card, .card-lg { padding: 18px; } .chart-axis { width: 28px; } }

/* Linkliste: Suche und Filter-Pillen */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search { flex: 1 1 240px; max-width: 360px; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search .input { padding-left: 38px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label:has(input:checked) { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.pills label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.list-card { padding: 0; overflow: hidden; }
.list-card .tr { padding: 14px 24px; }
.list-card .tr:last-child { border-bottom: 0; }
.list-card .empty { padding: 20px 24px; }
.chev { color: var(--ink-3); font-size: 18px; }
@media (max-width: 640px) { .list-card .tr { padding-inline: 16px; } .list-card .w-spark { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1.mono, h2.mono { font-weight: 500; }
h1.mono { letter-spacing: -.03em; }

/* DNS-Angaben einer Domain in einer Zeile */
.dns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin: 0 0 12px; padding: 10px 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; }
.dns > div { display: flex; align-items: baseline; gap: 8px; }
.dns dt { font-size: 13px; color: var(--ink-3); }
.dns dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.dns .btn { margin-left: auto; }
.warn { color: var(--warn-ink); }
.dns-status { font-size: 14px; }

/* Live-Klicks auf der Linkseite */
.live { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); font-size: 12px; font-weight: 600; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--on); animation: live-pulse 2s ease-in-out infinite; }
.tr ~ .empty-note { display: none; }
.click-row.is-new { animation: click-in 1.6s ease-out; }
@keyframes live-pulse { 50% { opacity: .35; } }
@keyframes click-in { from { background: var(--warn-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live i, .click-row.is-new { animation: none; } }

/* Klick-Details neben der Liste */
button.tr { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.tr:hover { background: var(--paper); }
button.tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.click-row.is-selected, .click-row.is-selected:hover { background: var(--paper); box-shadow: inset 3px 0 0 var(--accent-ink); }
.follow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.follow input { width: 18px; height: 18px; accent-color: var(--accent-ink); }
#click-detail .dl dd { overflow-wrap: anywhere; }
.click-table .tr { padding-inline: 10px; }
