:root {
  --bg: #0b0d12;
  --surface: #141821;
  --raised: #1d2330;
  --line: #262d3b;
  --text: #f2f4f8;
  --muted: #9aa3b5;
  --accent: #3db8ff;
  --ok: #3ddc97;
  --warn: #ffc857;
  --err: #ff6b6b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: .3px; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
main.wrap { padding-top: 24px; padding-bottom: 40px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 28px 0 10px; }
p.lead { color: var(--muted); margin-top: -6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; }
form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--raised); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 180px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: #041420; border-color: var(--accent); }
button.danger { color: var(--err); }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; }
.msg { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.msg.ok { background: rgba(61, 220, 151, .12); border: 1px solid rgba(61, 220, 151, .4); }
.msg.err { background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .4); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.b-trial { background: rgba(61, 184, 255, .15); color: var(--accent); }
.b-active { background: rgba(61, 220, 151, .15); color: var(--ok); }
.b-expired { background: rgba(255, 200, 87, .15); color: var(--warn); }
.b-moved, .b-blocked { background: rgba(255, 107, 107, .15); color: var(--err); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.stat { font-size: 28px; font-weight: 800; }
.stat small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.pl { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pl:last-child { border-bottom: 0; }
.pl .name { flex: 1; font-weight: 600; }
.pl .kind { color: var(--muted); font-size: 12px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.login { max-width: 420px; margin: 40px auto; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; }
@media (max-width: 560px) {
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
}

/* Nutzungsbedingungen-Fenster */
.terms { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); z-index: 50; }
.terms[hidden] { display: none; }
/* Große Schrift / kleine Bildschirme: Text scrollt, „Ich stimme zu“ bleibt immer sichtbar. */
.terms-text { overflow-y: auto; min-height: 0; flex: 1 1 auto; padding-right: 4px; -webkit-overflow-scrolling: touch; }
.terms-box > .primary { flex: none; margin-top: 14px; align-self: flex-start; }
@media (max-height: 640px) { .terms-box { padding: 16px !important; } }
.terms-box { max-width: 560px; max-height: 100%; display: flex; flex-direction: column; background: linear-gradient(160deg, #13233a, #141821 60%); border: 1px solid var(--accent); border-radius: var(--radius); padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.terms-box h2 { margin-top: 0; color: var(--text); font-size: 20px; text-transform: none; letter-spacing: 0; }
.terms-box p { color: #d6dbe5; }
.legal p, .legal li { color: #d6dbe5; }

/* Download-Knopf mit Versionsliste */
details.downloads { margin-top: 18px; }
details.downloads > summary { list-style: none; width: 100%; }
details.downloads > summary::-webkit-details-marker { display: none; }
.dl-list { display: grid; gap: 8px; margin-top: 10px; }
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); color: var(--text); }
.dl:hover { border-color: var(--accent); text-decoration: none; }
.dl span { flex: 1; font-weight: 600; }
.dl small { width: 100%; color: var(--muted); }

.foot-links { margin-top: 6px; }

/* ── Admin-Übersicht ─────────────────────────────────────────── */
/* Zahlenkacheln: kompakt, PC 4–5 nebeneinander, Handy 2 × 2; Antippen = Filter. */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-tile { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.stat-tile b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-tile span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.stat-tile:hover { border-color: var(--accent); text-decoration: none; }
.stat-tile.on { border-color: var(--accent); background: var(--raised); box-shadow: inset 0 0 0 1px var(--accent); }
.stat-tile.ok b { color: var(--ok); } .stat-tile.info b { color: var(--accent); }
.stat-tile.warn b { color: var(--warn); } .stat-tile.bad b { color: var(--err); }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr 1fr; } .stat-tile { flex-direction: column; gap: 0; } }

.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 220px; min-width: 0; }
.toolbar select { flex: 0 1 220px; }
.toolbar button { flex: 0 0 auto; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
.chip small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #041420; }
.chip.on small { color: #041420; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.small-lead { font-size: 13px; margin: 6px 0 8px; }

/* Geräteliste: PC = Zeilen in Spalten, Handy = Karten. Kein seitliches Scrollen. */
.dev-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.dev-head, .dev { display: grid; grid-template-columns: 150px minmax(170px, 1.3fr) minmax(170px, 1.2fr) 90px 110px; gap: 12px; align-items: center; padding: 10px 16px; }
.dev-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; border-bottom: 1px solid var(--line); }
.dev { color: var(--text); border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev:hover { background: var(--raised); text-decoration: none; }
.dev-type { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dev-type i { font-style: normal; font-size: 20px; width: 26px; text-align: center; }
.dev-mac { min-width: 0; overflow-wrap: anywhere; }
.dev-mac small { display: block; color: var(--muted); font-family: inherit; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-ver, .dev-seen { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.dev .badge { white-space: nowrap; }
@media (max-width: 760px) {
  .dev-head { display: none; }
  .dev { grid-template-columns: 1fr auto; grid-template-areas: "type status" "mac mac" "ver seen"; gap: 4px 10px; padding: 12px 14px; }
  .dev-type { grid-area: type; } .dev-status { grid-area: status; justify-self: end; }
  .dev-mac { grid-area: mac; font-size: 15px; } .dev-ver { grid-area: ver; } .dev-seen { grid-area: seen; justify-self: end; }
  .dev-ver::before { content: "App "; } .dev-seen::before { content: "zuletzt "; }
}
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 8px 0 20px; color: var(--muted); font-size: 14px; }
.backup { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 24px; color: var(--muted); font-size: 13px; }
.backup button { flex: 0 0 auto; }

/* ── Admin: einzelnes Gerät ──────────────────────────────────── */
.back { display: inline-block; font-size: 14px; margin: 4px 0 10px; }
.dev-head-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dev-head-line h1 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.dev-icon { font-size: 24px; line-height: 1; }
.dev-actions { display: grid; gap: 12px; }
.dev-actions form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.dev-actions form input { flex: 1 1 180px; min-width: 0; }
.dev-actions form button { flex: 0 0 auto; }
.dev-actions .done { margin: 0; color: var(--ok); font-weight: 600; }
.dev-actions form[data-note] { flex-wrap: nowrap; }
.dev-actions form[data-note] button { width: 44px; padding-left: 0; padding-right: 0; }
.danger-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-row { flex-wrap: nowrap; }
.danger-row form { flex: 1 1 0; min-width: 0; }
.danger-row button { width: 100%; font-size: 13px; }
.danger-row button[disabled] { opacity: .45; cursor: default; }
.dev-details summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.dev-details summary::-webkit-details-marker { display: none; }
.dev-details summary::after { content: "▾"; }
.dev-details[open] summary::after { content: "▴"; }
.dev-details[open] summary { margin-bottom: 10px; }
/* Details: Bezeichnung links, Wert rechts – eine Zeile pro Angabe. */
.dev-details .kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.dev-details .kv dt { color: var(--muted); font-size: 13px; margin: 0; }
.dev-details .kv dd { margin: 0; text-align: right; font-size: 14px; overflow-wrap: anywhere; }
/* Desktop-Ansicht: Aktionen und Details nebeneinander. */
@media (min-width: 900px) {
  main.wrap:has(.dev-actions) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 16px; align-items: start; }
  main.wrap:has(.dev-actions) > .back, main.wrap:has(.dev-actions) > .dev-head-line, main.wrap:has(.dev-actions) > .msg { grid-column: 1 / -1; }
  .dev-details { margin-top: 0; }
}

/* ── Downloads: grüner Knopf (unterscheidet sich vom blauen „Anmelden“) ── */
.btn.download, button.download { background: var(--ok); color: #04210f; border-color: var(--ok); font-weight: 700; }
.btn.download:hover { filter: brightness(1.08); border-color: var(--ok); }
.dl .dl-ver { width: auto; color: var(--muted); }
.dl.old { opacity: .85; }
.dl-older { margin-top: 6px; }
.dl-older > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* ── Werbeseite & Anleitung (Vorschau) ─────────────────────────── */
.promo h2.sec, .guide h2.sec { font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 44px 0 14px; }
.shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: #000; }
.hero { text-align: center; padding: 18px 0 6px; }
.hero-icon { border-radius: 22px; margin: 0 auto 14px; display: block; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.15; margin: 0 auto 12px; max-width: 18em; text-wrap: balance; }
.hero-lead { color: var(--muted); font-size: 17px; max-width: 34em; margin: 0 auto 20px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.hero-actions .btn { padding: 12px 20px; font-size: 16px; }
.hero-shot { box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.features { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; align-content: start; }
.feature.tall { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.55; }
.points { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; }
.point span { font-size: 22px; }
.point small { color: var(--muted); line-height: 1.45; }
.devices { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.devices div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 600; text-align: center; }
.price { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.price-main b { display: block; font-size: 44px; line-height: 1; color: var(--ok); }
.price-main span { color: var(--muted); }
.price ul { margin: 0; padding-left: 18px; line-height: 1.8; }
.dl.dl-big { padding: 16px; font-size: 17px; }
.firetv { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--raised); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.firetv-code { font-size: 30px; font-weight: 800; letter-spacing: 3px; color: var(--accent); }
.faq { display: grid; gap: 8px; }
.faq details { margin: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); line-height: 1.55; margin: 10px 0 0; }
.legal-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }
@media (max-width: 720px) {
  .features, .points, .devices { grid-template-columns: minmax(0, 1fr); }
  .points, .devices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature.tall { grid-template-columns: minmax(0, 1fr); }
  .feature.tall img { max-width: 260px; margin: 0 auto; }
}
/* Anleitung */
.guide .toc { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.guide .toc a { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-weight: 600; }
.guide .toc a:hover { border-color: var(--accent); text-decoration: none; }
.guide .step { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-bottom: 18px; }
.guide .step.solo { grid-template-columns: minmax(0, 1fr); }
.guide .step img.narrow { max-width: 300px; }
.guide ol, .guide ul { line-height: 1.75; padding-left: 20px; margin: 0; }
.guide h3 { margin: 22px 0 8px; font-size: 18px; }
.guide .keys { width: 100%; border-collapse: collapse; }
.guide .keys td, .guide .keys th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide .keys th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.guide kbd { display: inline-block; min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font-family: inherit; font-weight: 700; }
.guide .tip { background: var(--raised); border-left: 3px solid var(--accent); border-radius: 0; padding: 10px 14px; margin: 10px 0; color: var(--text); }
@media (max-width: 720px) { .guide .step { grid-template-columns: minmax(0, 1fr); } }
