:root {
  --bg: #0d0f14;
  --bg-2: #12151c;
  --panel: #171a22;
  --panel-2: #1e222c;
  --line: #262b36;
  --text: #e8eaf0;
  --muted: #8e96a7;
  --faint: #5f6778;
  --accent: #7b93ff;
  --accent-2: #5d78f5;
  --mine: linear-gradient(135deg, #5d78f5, #7b5cf0);
  --theirs: #222632;
  --danger: #ff6b6b;
  --ok: #3ddc84;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --glow: #1a1f33;
  --glass: rgba(23, 26, 34, .92);
  --card: rgba(23, 26, 34, .85);
  --screen: rgba(13, 15, 20, .6);
  --body-text: #c9ced8;
  --hover-line: #3a4152;
  --avatar-text: #fff;
  color-scheme: dark;
}

/* ---------- Heller Modus (folgt der Systemeinstellung) ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb;
    --bg-2: #ffffff;
    --panel: #ffffff;
    --panel-2: #eef1f7;
    --line: #dfe3ec;
    --text: #1b1f2a;
    --muted: #5d6576;
    --faint: #8a92a3;
    --accent: #4a63e8;
    --accent-2: #4a63e8;
    --theirs: #eceff5;
    --danger: #e5484d;
    --ok: #1a9e5c;
    --shadow: 0 10px 40px rgba(30, 40, 80, .10);
    --glow: #e3e8ff;
    --glass: rgba(255, 255, 255, .92);
    --card: rgba(255, 255, 255, .9);
    --screen: rgba(255, 255, 255, .55);
    --body-text: #3b4252;
    --hover-line: #c3c9d6;
    color-scheme: light;
  }
  .btn.primary:hover:not(:disabled) { background: #3d55d6; }
  .dot { box-shadow: none; }
  .avatar:not(.on) { color: var(--muted); }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, var(--glow) 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

body:not(.legal-page) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.screen { display: none; flex: 1; min-height: 0; }
.screen.active { display: flex; }

/* ---------- Buttons & Inputs ---------- */
input, textarea, select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 147, 255, .18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 12px; padding: 10px 16px; min-height: 42px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent-2); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #e85555; }
.btn.warn:hover:not(:disabled) { color: var(--danger); border-color: rgba(255, 107, 107, .5); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.icon { padding: 10px 12px; }
.btn.primary.armed { background: var(--danger); }
.btn.muted { color: var(--faint); }
.btn.muted svg path { stroke-dasharray: 2 3; }
kbd {
  font: 600 10px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
}

/* ---------- Join ---------- */
#screen-join { align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.card {
  width: 100%; max-width: 460px; margin: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 36px 30px 26px; text-align: center; box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; font-size: 30px;
  display: grid; place-items: center; background: var(--mine); box-shadow: 0 8px 24px rgba(93, 120, 245, .35);
}
h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.6px; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); margin: 0 0 24px; }
#join-form { display: flex; flex-direction: column; gap: 12px; }
#join-form input { width: 100%; min-width: 0; }
#join-form .go { width: 100%; min-height: 46px; font-size: 15.5px; }
.error { color: var(--danger); font-size: 14px; white-space: pre-line; text-align: left; margin: 0; }
#join-error:not(:empty) {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; line-height: 1.5; color: var(--text);
  background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .45);
}
#join-error:empty { display: none; }
.meta { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.fine { color: var(--faint); font-size: 12px; margin: 18px 0 0; line-height: 1.55; }
.links { margin-top: 10px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); text-decoration: underline; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; box-shadow: 0 0 8px var(--ok); }

/* Interessen */
.tags-box { margin: 4px 0 4px; text-align: left; }
.tags-label { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.tags-label span { color: var(--faint); font-weight: 400; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.tag:hover { color: var(--text); border-color: var(--hover-line); }
.tag[aria-pressed="true"] { background: rgba(123, 147, 255, .16); color: var(--text); border-color: var(--accent); }
.tags.full .tag[aria-pressed="false"] { opacity: .4; cursor: not-allowed; }

/* Bot-Falle: unsichtbar */
.hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; }

/* ---------- Chat ---------- */
#screen-chat {
  flex-direction: column; position: relative;
  width: 100%; max-width: 880px; margin: 0 auto;
  background: var(--screen);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px);
}
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-text { min-width: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff;
  background: var(--panel-2); border: 1px solid var(--line);
}
.avatar.on { background: var(--mine); border-color: transparent; }
.partner-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.partner { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gender-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.gender-badge svg { width: 14px; height: 14px; stroke-width: 2.2; display: block; }
.gender-badge[hidden] { display: none; }
.state { color: var(--muted); font-size: 13px; }
.state.on { color: var(--ok); }
.state.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.actions { display: flex; align-items: center; gap: 6px; flex: none; }

.messages {
  flex: 1; overflow-y: auto; padding: 20px 18px 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.msg {
  max-width: min(75%, 560px); padding: 9px 13px; border-radius: var(--radius);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  animation: pop .15s ease-out;
}
.msg.theirs { align-self: flex-start; background: var(--theirs); border-bottom-left-radius: 6px; }
.msg.mine   { align-self: flex-end;   background: var(--mine); color: #fff; border-bottom-right-radius: 6px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; text-align: right; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sys {
  align-self: center; color: var(--muted); font-size: 13px; text-align: center;
  padding: 6px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; margin: 10px 0;
}

/* Leerzustand (Suchen / kein Chat) */
.empty-state {
  position: absolute; inset: 70px 0 110px; display: none;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 20px; pointer-events: none;
}
#screen-chat[data-empty="1"] .empty-state { display: flex; }
.empty-title { font-size: 18px; font-weight: 700; margin: 18px 0 4px; }
.empty-sub { color: var(--muted); margin: 0; max-width: 340px; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
}
#screen-chat[data-status="waiting"] .empty-icon { animation: spin 1s linear infinite; }
#screen-chat[data-status="idle"] .empty-icon { border-top-color: var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }

.typing { padding: 0 22px 8px; display: flex; gap: 4px; align-items: center; }
.typing[hidden] { display: none; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 8px;
  border-top: 1px solid var(--line); background: var(--glass);
}
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 44px; line-height: 1.4; }
.composer textarea:disabled { opacity: .5; }
.composer .send { min-height: 44px; }

.chat-footer {
  text-align: center; font-size: 11px; color: var(--faint);
  padding: 0 0 calc(8px + env(safe-area-inset-bottom)); background: var(--glass);
}
.chat-footer strong { color: var(--muted); font-weight: 600; }
.chat-footer a { color: var(--faint); text-decoration: none; }
.chat-footer a:hover { color: var(--text); }

/* ---------- Melde-Dialog ---------- */
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 4px; font-size: 20px; }
dialog .sub { margin-bottom: 4px; font-size: 14px; }
dialog label { display: block; margin-top: 14px; font-size: 14px; color: var(--muted); }
dialog select, dialog textarea { display: block; width: 100%; margin-top: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  #screen-chat { border: 0; }
  .topbar { padding-left: 12px; padding-right: 10px; gap: 8px; }
  .avatar { width: 36px; height: 36px; font-size: 15px; }
  .actions .lbl, .send .lbl { display: none; }
  .actions .btn, .send { padding: 9px; min-height: 40px; min-width: 40px; }
  .actions { gap: 4px; }
  .messages { padding: 14px 10px 6px; }
  .msg { max-width: 85%; }
  .composer { padding: 10px 10px 6px; }
  .card { padding: 28px 20px 22px; border-radius: 20px; }
  input, textarea, select { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  .kbd-hint { display: none; }
  #btn-sound { display: none; }
}

/* ---------- Rechtstexte ---------- */
body.legal-page { overflow-y: auto; }
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.legal h1 { font-size: 28px; margin: 16px 0 8px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--body-text); }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--panel); }
@media (max-width: 640px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .legal td { border: 0; border-bottom: 1px solid var(--line); }
  .legal td:first-child { font-weight: 600; background: var(--panel); }
  .legal td:last-child { border-bottom: 0; }
}

/* ---------- Admin ---------- */
.admin { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-card { margin: 10vh auto; }
.admin-card form { display: flex; gap: 8px; }
.admin-card form input { flex: 1; }
.admin-card textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.admin-head h1 { font-size: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.flash { background: #1d2a1f; border: 1px solid #2f5a37; color: #9be3a9; padding: 10px 14px; border-radius: 10px; }
.empty, .muted { color: var(--muted); }
.report { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.report.open { border-left: 3px solid var(--danger); }
.report-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.report-head .muted { font-size: 13px; }
.badge { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); }
.comment { font-style: italic; }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.transcript { background: var(--bg); border-radius: 10px; padding: 10px 12px; max-height: 320px; overflow-y: auto; font-size: 14px; }
.transcript .line { padding: 3px 0; }
.transcript .line.bad b { color: var(--danger); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-actions select { padding: 8px; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }

/* ---------- Reaktionen ---------- */
.msg { position: relative; }
.msg.theirs { cursor: pointer; }
.msg.theirs:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg.has-react { margin-bottom: 12px; }
.msg .react {
  position: absolute; bottom: -12px; font-size: 14px; line-height: 1;
  padding: 3px 6px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); animation: pop .15s ease-out;
}
.msg.theirs .react { right: -6px; }
.msg.mine .react { left: -6px; }
.react-picker {
  position: fixed; z-index: 50; display: flex; gap: 2px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  animation: pop .12s ease-out;
}
.react-picker[hidden] { display: none; }
.react-picker button {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent;
  font-size: 21px; cursor: pointer; transition: transform .1s, background .1s;
}
.react-picker button:hover { transform: scale(1.18); background: var(--panel-2); }
.react-picker button.on { background: rgba(123, 147, 255, .2); }

/* ---------- Gesprächsstarter ---------- */
.composer .starter { min-height: 44px; min-width: 44px; padding: 0; font-size: 19px; }
.composer .starter:not(:disabled):hover { transform: rotate(-12deg); }

/* ---------- Formatierung ---------- */
.msg b { font-weight: 700; }
.msg code {
  font: .92em ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 5px; border-radius: 5px;
  background: rgba(0, 0, 0, .22);
}
.msg.theirs code { background: var(--bg-2); }

/* ---------- Ankündigung / Wartung ---------- */
.announce {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex: none; position: relative;
  padding: 10px 48px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  font-size: 14px; line-height: 1.4; border-bottom: 1px solid var(--line);
  background: rgba(123, 147, 255, .14); color: var(--text);
  animation: pop .2s ease-out;
}
.announce[hidden] { display: none; }
.announce.warn { background: rgba(245, 184, 74, .16); border-bottom-color: rgba(245, 184, 74, .35); }
.announce-ico { font-size: 17px; flex: none; }
.announce-text { flex: 0 1 auto; max-width: 800px; overflow-wrap: anywhere; }
.announce-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1;
}
.announce-close:hover { background: rgba(127, 127, 127, .15); color: var(--text); }
.announce-close[hidden] { display: none; }
body:has(.announce:not([hidden])) .topbar { padding-top: 12px; }

/* ---------- Geschlecht (optional) ---------- */
.gender-box { text-align: left; }
.seg-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.seg-g button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font: inherit; font-size: 13px; line-height: 1; min-height: 34px; padding: 0 6px;
  border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); white-space: nowrap;
}
.seg-g button svg { width: 15px; height: 15px; stroke-width: 2.2; display: block; flex: none; }
.seg-g button:hover { color: var(--text); }
.seg-g button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 480px) { .seg-g { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Verwarnung ---------- */
.sys.warn {
  max-width: 92%; border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.45;
  color: var(--text); background: rgba(245, 184, 74, .14); border: 1px solid rgba(245, 184, 74, .5);
  animation: pop .2s ease-out;
}

/* ---------- Versprechen auf der Startseite ---------- */
.promises { list-style: none; margin: -6px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.promises li {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px 11px;
  border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); text-align: center;
}
.p-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 3px;
  background: rgba(123, 147, 255, .14); color: var(--accent); }
.p-ico svg { width: 19px; height: 19px; }
.promises b { font-size: 13.5px; }
.promises small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.trust { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.trust a { color: var(--accent); text-decoration: none; font-weight: 600; }
.trust a:hover { text-decoration: underline; }
@media (max-width: 420px) {
  .promises { grid-template-columns: 1fr; }
  .promises li { flex-direction: row; text-align: left; gap: 10px; padding: 9px 12px; }
  .promises li .p-ico { margin: 0; flex: none; }
  .promises li b { min-width: 104px; }
}

/* ---------- Transparenzbericht ---------- */
.transp .lead { font-size: 16px; color: var(--text); }
.t-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 8px; }
.t-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.t-num { font-size: 26px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.t-lbl { color: var(--muted); font-size: 13px; }
.t-sub { color: var(--faint); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.t-facts { margin: 16px 0 0; padding-left: 20px; }
.t-facts li { margin-bottom: 8px; }
@media (max-width: 720px) { .t-grid { grid-template-columns: repeat(2, 1fr); } }

/* =====================================================================
   Rechtstexte & Infoseiten (Impressum, Datenschutz, Regeln, Transparenz)
   ===================================================================== */
body.legal-page { display: block; min-height: 100vh; }
.site-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; padding: 12px max(20px, calc((100vw - 1080px) / 2));
  background: var(--glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand-sm { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600; white-space: nowrap; }
.brand-sm b { color: var(--accent); font-weight: 800; }
.brand-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: var(--mine); box-shadow: 0 4px 14px rgba(93, 120, 245, .3); }
.top-links { display: flex; gap: 2px; margin-left: auto; }
.top-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 11px; border-radius: 9px; }
.top-links a:hover { color: var(--text); background: var(--panel-2); }
.top-links a.on { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.top-cta { min-height: 38px; padding: 8px 14px; font-size: 14px; text-decoration: none; }

.legal { max-width: 1080px; margin: 0 auto; padding: 40px 20px 56px; }
.legal-hero { max-width: 760px; margin: 0 0 28px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(123, 147, 255, .12); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.legal-hero h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -.8px; margin: 0 0 12px; }
.legal-hero .lead { font-size: 17px; color: var(--muted); margin: 0 0 8px; max-width: 640px; }
.legal-hero .fine { margin: 6px 0 0; }

.legal-layout { display: block; }
.legal-layout.has-toc { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.toc { position: sticky; top: 84px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; }
.toc b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; color: var(--faint); }
.toc li { margin: 3px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.legal-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sec {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px;
  scroll-margin-top: 84px;
}
.sec h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; margin: 0 0 10px; letter-spacing: -.2px; }
.sec-num {
  flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--accent); background: rgba(123, 147, 255, .14);
}
.sec p, .sec li { color: var(--body-text); line-height: 1.65; }
.sec p { margin: 0 0 10px; }
.sec p:last-child { margin-bottom: 0; }
.sec a { color: var(--accent); text-underline-offset: 2px; }
.sec strong { color: var(--text); }
.sec ul { margin: 6px 0 10px; padding-left: 20px; }
.addr { display: inline-block; padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); line-height: 1.6; }
.sec table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 12px 0; font-size: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sec th, .sec td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.sec tr:last-child td { border-bottom: 0; }
.sec th { background: var(--bg-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.sec td + td, .sec th + th { border-left: 1px solid var(--line); }

/* Transparenz-Kacheln innerhalb der Abschnitte */
.transp .sec .t-grid { margin-top: 4px; }
.transp .sec .t-card { background: var(--bg-2); }
.transp .sec .fine { margin-top: 10px; }

.site-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 22px max(20px, calc((100vw - 1080px) / 2)); border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

@media (max-width: 900px) {
  .legal-layout.has-toc { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 24px; }
  .top-links { display: none; }
  .top-cta { margin-left: auto; }
}
@media (max-width: 560px) {
  .site-top { padding: 10px 14px; gap: 10px; }
  .brand-sm { font-size: 15.5px; }
  .legal { padding: 26px 14px 40px; }
  .sec { padding: 18px 16px; border-radius: 16px; }
  .sec h2 { font-size: 17px; }
  .toc ol { columns: 1; }
  .site-foot { padding: 18px 14px; flex-direction: column; align-items: flex-start; }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .sec td + td { border-left: 0; }
}
