/* ==========================================================================
   StreamHex – Design System
   Ein Stylesheet fuer Landingpage, Dashboard und Rechtliches.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg:          #0b0c0f;
  --bg-raised:   #101115;
  --surface:     #14161a;
  --surface-2:   #1a1c21;
  --surface-3:   #212329;
  --line:        #222429;
  --line-2:      #2d3037;
  --line-3:      #3a3e47;

  --text:        #ecedf0;
  --text-2:      #a3a7b1;
  --text-3:      #6f7380;

  --accent:      #2ec4ee;
  --accent-hi:   #63d6f5;
  --accent-ink:  #03141a;
  --accent-soft: rgba(46, 196, 238, .12);
  --accent-line: rgba(46, 196, 238, .35);

  --ok:          #3ccf91;
  --ok-soft:     rgba(60, 207, 145, .12);
  --warn:        #f0b44a;
  --warn-soft:   rgba(240, 180, 74, .12);
  --danger:      #f06464;
  --danger-soft: rgba(240, 100, 100, .12);

  --twitch:      #a970ff;
  --youtube:     #ff4e45;
  --blurple:     #5865f2;

  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --sidebar-w: 248px;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .45), 0 0 0 1px var(--line-2);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface-2); color: var(--text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-discord { background: var(--blurple); border-color: var(--blurple); color: #fff; font-weight: 600; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #1a0505; font-weight: 600; }
.btn-danger:hover { background: #f47c7c; border-color: #f47c7c; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-3);
  cursor: pointer; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn .icon { width: 16px; height: 16px; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-ok     { background: var(--ok-soft); color: var(--ok); }
.badge-warn   { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-live   { background: rgba(240, 100, 100, .14); color: #ff8a8a; }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-outline { background: transparent; border: 1px solid var(--line-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .muted { font-size: 13px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.field-row > .field + .field { margin-top: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.label .opt { color: var(--text-3); font-weight: 400; }
.hint { font-size: 12.5px; color: var(--text-3); }
.hint a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.counter { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.counter.over { color: var(--danger); }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text); font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select {
  appearance: none; padding-right: 34px; 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='%236f7380' 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 10px center; background-size: 16px;
}
.input-group { display: flex; align-items: stretch; }
.input-group .addon {
  display: grid; place-items: center; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-right: 0;
  border-radius: var(--r) 0 0 var(--r); color: var(--text-3); font-size: 13px;
}
.input-group .input { border-radius: 0 var(--r) var(--r) 0; }

.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type="color"] {
  width: 38px; height: 38px; padding: 3px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--bg); cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-field .input { width: 110px; font-family: var(--mono); text-transform: lowercase; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.1); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; }
.check input { appearance: none; width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; border: 1px solid var(--line-3); border-radius: 4px; background: var(--bg); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check small { display: block; color: var(--text-3); font-size: 12.5px; }

.segmented { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); gap: 2px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; padding: 5px 12px; border-radius: 5px; font-size: 13px; color: var(--text-2); }
.segmented input:checked + span { background: var(--surface-3); color: var(--text); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

fieldset { border: 0; padding: 0; min-width: 0; }
.form-section + .form-section, .field + .form-section, .field-row + .form-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section > h3 { font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--text); }

/* ── Alerts / Flash ────────────────────────────────────────────────────── */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 13.5px; color: var(--text-2);
}
.alert .icon { width: 16px; height: 16px; margin-top: 2px; }
.alert strong { color: var(--text); font-weight: 600; }
.alert a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.alert-success { background: var(--ok-soft); border-color: rgba(60,207,145,.25); color: #b8f0d6; }
.alert-success .icon { color: var(--ok); }
.alert-error { background: var(--danger-soft); border-color: rgba(240,100,100,.28); color: #f8c4c4; }
.alert-error .icon { color: var(--danger); }
.alert-warn { background: var(--warn-soft); border-color: rgba(240,180,74,.25); color: #f6dcaa; }
.alert-warn .icon { color: var(--warn); }
.alert .alert-close { margin-left: auto; color: inherit; opacity: .6; background: none; border: 0; cursor: pointer; padding: 0; }
.alert .alert-close:hover { opacity: 1; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 20px; }

/* ── Data list (Tabellen) ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; position: relative; }
.show-sm { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3);
  padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.table tr.is-paused td:not(:last-child) { opacity: .55; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: inline-flex; gap: 2px; }

.entity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entity-text { min-width: 0; }
.entity-title { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.entity-sub { font-size: 12.5px; color: var(--text-3); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); object-fit: cover;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2);
}
.avatar.sq { border-radius: var(--r); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 56px; height: 56px; font-size: 18px; }
.avatar-live { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #e5484d; }

.channel-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; }
.channel-tag .icon { width: 14px; height: 14px; color: var(--text-3); }
.channel-tag.missing { color: var(--warn); }

.color-chip { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }

/* ── Empty states ──────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { width: 44px; height: 44px; border-radius: var(--r-lg); margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-2); }
.empty h3 { font-size: 15px; margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 400px; margin: 0 auto 18px; font-size: 13.5px; }

/* ── Dialog ────────────────────────────────────────────────────────────── */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  overflow: hidden; margin: auto;
}
dialog.modal.wide { width: min(980px, calc(100vw - 32px)); }
dialog.modal.narrow { width: min(420px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(4, 5, 7, .72); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .14s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.99); } }
/* Formular im Dialog: Kopf/Fuss fix, Inhalt scrollt */
dialog.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
dialog.modal > form > .modal-body, dialog.modal > form > .modal-split { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; }
.modal-head p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-raised); }
.modal-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.modal-split > .modal-body + .preview-pane { border-left: 1px solid var(--line); }
.preview-pane { background: #313338; padding: 20px; overflow-y: auto; }
.preview-pane .preview-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #949ba4; margin-bottom: 12px; }
.confirm-body { padding: 22px 22px 6px; }
.confirm-body h2 { font-size: 16px; margin-bottom: 8px; }
.confirm-body p { color: var(--text-2); font-size: 13.5px; }

/* ── Dropdown menu ─────────────────────────────────────────────────────── */
.menu { position: relative; }
.menu-panel {
  position: absolute; z-index: 50; min-width: 220px;
  background: var(--surface-2); border-radius: var(--r); box-shadow: var(--shadow-pop);
  padding: 4px; display: none;
}
.menu.open .menu-panel { display: block; animation: modal-in .1s ease-out; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 5px; border: 0; background: none;
  font-size: 13.5px; color: var(--text-2); text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.active { color: var(--text); }
.menu-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu-item .icon { width: 16px; height: 16px; }
.menu-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.menu-label { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-3); }

/* ==========================================================================
   App shell (Dashboard)
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-raised); border-right: 1px solid var(--line);
}
.sb-top { padding: 14px 12px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; }
.brand .env { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 4px; padding: 0 5px; line-height: 17px; }

.server-switch { margin-top: 12px; }
.server-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-2);
  cursor: pointer; text-align: left;
}
.server-btn:hover { border-color: var(--line-3); }
.server-btn .avatar { width: 28px; height: 28px; font-size: 11px; }
.server-btn .name { font-weight: 500; font-size: 13.5px; }
.server-btn .server-plan { font-size: 11.5px; color: var(--text-3); }
.server-btn .server-plan.premium { color: var(--warn); }
.server-btn > .icon { margin-left: auto; color: var(--text-3); width: 16px; height: 16px; }
.server-switch .menu-panel { left: 0; right: 0; top: calc(100% + 6px); max-height: 360px; overflow-y: auto; }
.menu-item .avatar { width: 22px; height: 22px; font-size: 10px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav-label { padding: 14px 8px 6px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 8px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 450;
  transition: background .1s, color .1s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--surface-3); color: var(--text); font-weight: 500; }
.nav-link .icon { width: 17px; height: 17px; color: var(--text-3); }
.nav-link.active .icon { color: var(--accent); }
.nav-link .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.sb-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.user-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: var(--r); border: 0; background: none; cursor: pointer; text-align: left;
}
.user-btn:hover { background: var(--surface-2); }
.user-btn .avatar { width: 28px; height: 28px; }
.user-btn .name { font-size: 13.5px; font-weight: 500; }
.user-btn .sub { font-size: 11.5px; color: var(--text-3); }
.user-btn > .icon { margin-left: auto; color: var(--text-3); width: 16px; height: 16px; }
.sb-foot .menu-panel { left: 0; right: 0; bottom: calc(100% + 6px); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; position: sticky; top: 0; z-index: 40;
  align-items: center; gap: 10px; height: 52px; padding: 0 12px;
  background: rgba(11, 12, 15, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 36px 56px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 640px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: 14px; height: 14px; }

.app-foot { padding: 18px 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.app-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.app-foot a:hover { color: var(--text-2); }

.sb-backdrop { display: none; }

/* Grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* Stat */
.stat { padding: 16px 18px; }
.stat-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat-label .icon { width: 15px; height: 15px; color: var(--text-3); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.stat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
a.stat:hover { background: var(--surface-2); }
.stat .bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.stat .bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.stat .bar span.full { background: var(--warn); }

/* Lists in cards */
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .meta { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-3); display: grid; place-items: center; flex-shrink: 0; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #04130c; }
.checklist .done .tick .icon { width: 12px; height: 12px; stroke-width: 3; }
.checklist .done span.txt { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-3); }
.checklist .btn { margin-left: auto; }

/* Callout for missing bot */
.callout {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-lg); margin-bottom: 20px;
}
.callout > .icon { color: var(--accent); width: 22px; height: 22px; }
.callout h3 { font-size: 14px; }
.callout p { color: var(--text-2); font-size: 13px; }
.callout .btn { margin-left: auto; }

/* Server picker */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.server-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .12s, background .12s; }
a.server-card:hover { border-color: var(--line-3); background: var(--surface-2); }
.server-card .name { font-weight: 500; }
.server-card .sub { font-size: 12.5px; color: var(--text-3); }
.server-card .go { margin-left: auto; color: var(--text-3); }
.section-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }

/* Log */
.log { font-size: 13px; }
.log li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 9px 18px; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log time { font-family: var(--mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.log .msg { color: var(--text-2); overflow-wrap: anywhere; }
.log .msg strong { color: var(--text); font-weight: 500; }
.log-day { padding: 8px 18px; font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }

/* Editor-Seiten (Embeds, Reaction Roles) */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 20px; align-items: start; }
.editor .preview-sticky { position: sticky; top: 24px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.repeater-item { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); }
.repeater-item + .repeater-item { margin-top: 8px; }
.repeater-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.rr-entry { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rr-entry + .rr-entry { margin-top: 8px; }
.emoji-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; font-size: 13px; color: var(--text-2); width: 100%; }
.emoji-btn:hover { border-color: var(--line-3); }
.emoji-btn .glyph { font-size: 18px; line-height: 1; width: 20px; text-align: center; }
.emoji-btn img { width: 20px; height: 20px; object-fit: contain; }
.emoji-picker { padding: 8px; width: 300px; }
.emoji-picker .grid-emoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-picker button { width: 32px; height: 32px; display: grid; place-items: center; font-size: 19px; background: none; border: 0; border-radius: 5px; cursor: pointer; }
.emoji-picker button:hover { background: var(--surface-3); }
.emoji-picker button img { width: 22px; height: 22px; object-fit: contain; }
.emoji-picker .menu-label { padding-left: 2px; }

.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   Discord preview (moeglichst nah am Original)
   ========================================================================== */
.dc { font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: #dbdee1; font-size: 15px; line-height: 1.375; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; overflow: hidden; }
.dc-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-name { font-weight: 500; color: #f2f3f5; font-size: 15px; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 4.5px; border-radius: 3px; line-height: 15px; }
.dc-time { font-size: 12px; color: #949ba4; margin-left: 2px; }
.dc-content { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 4px; }
.dc-content:empty { display: none; }
.dc-embed {
  display: grid; max-width: 432px; margin-top: 2px;
  background: #2b2d31; border-radius: 4px; border-left: 4px solid #1e1f22;
  padding: 8px 16px 16px 12px; gap: 8px; font-size: 14px;
}
.dc-embed.has-thumb { grid-template-columns: minmax(0, 1fr) 80px; }
.dc-embed-main { display: grid; gap: 8px; min-width: 0; padding-top: 0; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { font-weight: 600; color: #f2f3f5; font-size: 16px; overflow-wrap: anywhere; }
.dc-title.link { color: #00a8fc; }
.dc-desc { color: #dbdee1; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.375; }
.dc-desc:empty, .dc-title:empty, .dc-author:empty { display: none; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dc-field { grid-column: 1 / -1; min-width: 0; }
.dc-field.inline { grid-column: auto; }
.dc-field-name { font-weight: 600; color: #f2f3f5; font-size: 14px; margin-bottom: 2px; }
.dc-field-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-image { border-radius: 4px; max-width: 100%; margin-top: 8px; }
.dc-image.placeholder { aspect-ratio: 16/9; background: linear-gradient(135deg, #3a3c43, #232428); display: grid; place-items: center; color: #6d6f78; font-size: 13px; }
.dc-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; grid-column: 2; grid-row: 1; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b5bac1; }
.dc-footer:empty { display: none; }
.pv-empty { color: #949ba4; font-size: 13px; font-style: italic; }
.dc-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dc-reaction { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 7px; background: #2b2d31; border: 1px solid transparent; border-radius: 8px; font-size: 14px; color: #b5bac1; }
.dc-reaction img { width: 16px; height: 16px; object-fit: contain; }
.dc-reaction b { font-weight: 600; font-size: 13px; }
.dc .md-code { background: #1e1f22; padding: 1px 3px; border-radius: 3px; font-family: var(--mono); font-size: 85%; }
.dc .md-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; }
.dc .md-link { color: #00a8fc; }
.dc .md-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc .md-quote { border-left: 4px solid #4e5058; padding-left: 12px; display: block; }

/* ==========================================================================
   Marketing / Legal
   ========================================================================== */
.site-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-nav .links { display: flex; align-items: center; gap: 4px; }
.site-nav .links a.navlink { padding: 6px 12px; color: var(--text-2); font-size: 14px; border-radius: var(--r-sm); }
.site-nav .links a.navlink:hover { color: var(--text); }
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: rgba(11,12,15,.88); backdrop-filter: blur(10px); }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding: 88px 0 96px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.eyebrow .badge { height: 20px; font-size: 11.5px; }
.hero h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.06; letter-spacing: -.035em; font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--text-2); }
.hero .lead { font-size: 17px; color: var(--text-2); margin-top: 20px; max-width: 520px; line-height: 1.6; }
.hero .cta { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.hero .note { margin-top: 16px; font-size: 13px; color: var(--text-3); }

.hero-visual { position: relative; }
.discord-window { background: #313338; border-radius: var(--r-lg); border: 1px solid #1e1f22; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.discord-bar { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-bottom: 1px solid #26272b; color: #f2f3f5; font-weight: 600; font-family: "gg sans", "Noto Sans", sans-serif; font-size: 15px; }
.discord-bar .icon { color: #80848e; width: 20px; height: 20px; }
.discord-feed { padding: 16px 16px 20px; display: grid; gap: 18px; }

.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 620px; margin-bottom: 48px; }
.section-head .kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.025em; line-height: 1.15; }
.section-head p { color: var(--text-2); font-size: 16px; margin-top: 12px; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.feature { padding: 28px; background: var(--surface); }
.feature:nth-child(odd) { border-right: 1px solid var(--line); }
.feature:nth-child(n+3) { border-top: 1px solid var(--line); }
.feature-icon { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-3); margin-bottom: 18px; }
.feature-icon.twitch { color: var(--twitch); } .feature-icon.yt { color: var(--youtube); }
.feature-icon.rr { color: var(--ok); } .feature-icon.eb { color: var(--accent); }
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 14.5px; }
.feature ul { margin-top: 14px; display: grid; gap: 6px; }
.feature li { display: flex; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.feature li .icon { width: 15px; height: 15px; color: var(--text-3); margin-top: 3px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.step { border-top: 1px solid var(--line-2); padding-top: 20px; }
.step .num { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 14.5px; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 820px; }
.plans .plan { padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.plans .plan.featured { border-color: var(--accent-line); }
.plans .plan h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.plans .plan .price { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 4px; }
.plans .plan .price small { font-size: 14px; color: var(--text-3); font-weight: 400; }
.plans .plan .desc { color: var(--text-2); font-size: 14px; }
.plans .plan ul { margin-top: 20px; display: grid; gap: 10px; }
.plans .plan li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.plans .plan li .icon { width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.plans .plan li.no .icon { color: var(--text-3); }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 500; font-size: 15px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-3); transition: transform .15s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { padding: 0 0 18px; color: var(--text-2); font-size: 14.5px; max-width: 640px; }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); flex-wrap: wrap; }
.cta-band h2 { font-size: 22px; }
.cta-band p { color: var(--text-2); margin-top: 4px; }

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 13px; color: var(--text-3); }
.site-footer .row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }
.site-footer .brand { padding: 0; margin-bottom: 8px; color: var(--text); }

/* Legal */
.legal { max-width: 760px; padding: 56px 0 80px; }
.legal h1 { font-size: 32px; letter-spacing: -.025em; }
.legal .updated { color: var(--text-3); margin-top: 8px; font-size: 13.5px; }
.legal .toc { margin: 28px 0 8px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); columns: 2; column-gap: 32px; font-size: 13.5px; }
.legal .toc a { display: block; padding: 3px 0; color: var(--text-2); break-inside: avoid; }
.legal .toc a:hover { color: var(--text); }
.legal section { padding-top: 32px; scroll-margin-top: 80px; }
.legal h2 { font-size: 18px; margin-bottom: 12px; }
.legal h3 { font-size: 15px; margin: 18px 0 8px; }
.legal p, .legal li { color: var(--text-2); font-size: 15px; line-height: 1.7; }
.legal p + p { margin-top: 12px; }
.legal ul { list-style: disc; padding-left: 20px; margin: 10px 0; display: grid; gap: 4px; }
.legal li::marker { color: var(--text-3); }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); }
.legal address { font-style: normal; color: var(--text); line-height: 1.7; padding: 14px 18px; border-left: 2px solid var(--line-2); margin: 10px 0; }
.legal .note { margin-top: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

/* Standalone (Fehler, Beta) */
.standalone { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.standalone-card { width: min(440px, 100%); text-align: center; }
.standalone-card img.logo { width: 44px; height: 44px; margin: 0 auto 28px; }
.standalone-card .code { font-family: var(--mono); color: var(--text-3); font-size: 13px; margin-bottom: 10px; }
.standalone-card h1 { font-size: 22px; margin-bottom: 10px; }
.standalone-card p { color: var(--text-2); }
.standalone-card .actions { display: flex; gap: 8px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.standalone-card .box { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-align: left; display: flex; gap: 12px; align-items: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .preview-sticky { position: static; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: min(var(--sidebar-w), 86vw);
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  body.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); }
  .topbar { display: flex; }
  .topbar .brand { font-size: 14px; }
  .content { padding: 20px 16px 40px; }
  .app-foot { padding: 16px; }
  .modal-split { grid-template-columns: minmax(0, 1fr); }
  .modal-split > .modal-body + .preview-pane { border-left: 0; border-top: 1px solid var(--line); }

  .hero { grid-template-columns: minmax(0, 1fr); padding: 56px 0 64px; gap: 40px; }
  .features, .plans { grid-template-columns: minmax(0, 1fr); }
  .feature:nth-child(odd) { border-right: 0; }
  .feature:nth-child(n+2) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section { padding: 64px 0; }
  .site-nav .links a.navlink { display: none; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 20px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .table .hide-sm { display: none; }
  .table .show-sm { display: block; margin-top: 4px; }
  .table .entity-sub.hide-sm { display: none; }
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
  .log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rr-entry { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .legal .toc { columns: 1; }
  .site-wrap { padding: 0 16px; }
  .callout { flex-wrap: wrap; }
  .callout .btn { margin-left: 0; width: 100%; }
  .dc-fields { grid-template-columns: minmax(0, 1fr); }
  .dc-field.inline { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
