/* Dashboard im Apple-Stil (macOS/iOS): Systemschrift, Glas mit Unschärfe, iOS-Schalter, Hell/Dunkel. */
:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --sidebar: rgba(246, 246, 248, 0.66);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --separator: rgba(60, 60, 67, 0.14);
  --label: #000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.4);
  --tint: #007aff;
  --tint-soft: rgba(0, 122, 255, 0.12);
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;
  --gold: #c8962c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.18);
  --input: rgba(255, 255, 255, 0.85);
  --wall-1: #c9d6ff;
  --wall-2: #ffd6e7;
  --wall-3: #d4f5e9;
  --series-1: #2a78d6; /* Diagramm: geprüfte Farbe (Hellmodus) */
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto,
    Inter, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --bg: #000;
    --glass: rgba(28, 28, 30, 0.72);
    --glass-strong: rgba(44, 44, 46, 0.92);
    --sidebar: rgba(30, 30, 32, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --separator: rgba(84, 84, 88, 0.6);
    --label: #fff;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.32);
    --tint: #0a84ff;
    --tint-soft: rgba(10, 132, 255, 0.2);
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --purple: #bf5af2;
    --gold: #e3b341;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    --input: rgba(44, 44, 46, 0.85);
    --wall-1: #1b2a6b;
    --wall-2: #4a1838;
    --wall-3: #0d3b33;
    --series-1: #3987e5;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000;
  --glass: rgba(28, 28, 30, 0.72);
  --glass-strong: rgba(44, 44, 46, 0.92);
  --sidebar: rgba(30, 30, 32, 0.6);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.36);
  --separator: rgba(84, 84, 88, 0.6);
  --label: #fff;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.32);
  --tint: #0a84ff;
  --tint-soft: rgba(10, 132, 255, 0.2);
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --purple: #bf5af2;
  --gold: #e3b341;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  --input: rgba(44, 44, 46, 0.85);
  --wall-1: #1b2a6b;
  --wall-2: #4a1838;
  --wall-3: #0d3b33;
  --series-1: #3987e5;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
html {
  background: var(--bg);
}
body {
  /* Hintergrund nur am html-Element – sonst verdeckt der body-Hintergrund das Glas-Wallpaper dahinter. */
  background: transparent;
  color: var(--label);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
a {
  color: var(--tint);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hintergrund: weiche Farbflächen, damit das Glas wirkt */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.wallpaper i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.85;
}
.wallpaper i:nth-child(1) {
  width: 55vmax;
  height: 55vmax;
  background: var(--wall-1);
  top: -20vmax;
  left: -15vmax;
}
.wallpaper i:nth-child(2) {
  width: 45vmax;
  height: 45vmax;
  background: var(--wall-2);
  bottom: -18vmax;
  right: -12vmax;
}
.wallpaper i:nth-child(3) {
  width: 35vmax;
  height: 35vmax;
  background: var(--wall-3);
  top: 35%;
  left: 40%;
  opacity: 0.6;
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Start */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--fill-strong);
  border-top-color: var(--tint);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Grundgerüst: Seitenleiste wie in macOS */
.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 12px;
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border-right: 0.5px solid var(--separator);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand b {
  display: block;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
}
.brand small {
  color: var(--label-2);
  font-size: 12px;
}
.nav-group {
  margin: 12px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--label);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s var(--ease);
}
.nav a:hover {
  background: var(--fill);
}
.nav a.on {
  background: var(--tint);
  color: #fff;
}
.nav a .ico {
  width: 18px;
  height: 18px;
  color: var(--tint);
  flex: none;
}
.nav a.on .ico {
  color: #fff;
}
.nav a .badge {
  margin-left: auto;
}
.sidebar .spacer {
  flex: 1;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
  border-top: 0.5px solid var(--separator);
  margin-top: 8px;
}
.me img,
.me .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fill-strong);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.me div {
  min-width: 0;
  flex: 1;
}
.me b {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me small {
  color: var(--label-2);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 40px) 60px;
}
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.head p {
  margin: 4px 0 0;
  color: var(--label-2);
}
.view {
  animation: enter 0.32s var(--ease);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Karten und Raster */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
}
.card {
  padding: 18px 20px;
  min-width: 0;
}
.card + .card,
.stack > * + * {
  margin-top: 16px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .ico {
  width: 18px;
  height: 18px;
  color: var(--tint);
}
.muted {
  color: var(--label-2);
}
.small {
  font-size: 13px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.right {
  margin-left: auto;
}

/* Kennzahlen */
.stat {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat .k {
  font-size: 13px;
  color: var(--label-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .k .ico {
  width: 16px;
  height: 16px;
}
.stat .v {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat .s {
  font-size: 12px;
  color: var(--label-2);
}
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--fill);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--series-1);
  transition: width 0.4s var(--ease);
}

/* Listen wie in iOS-Einstellungen */
.list {
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass-strong);
}
.list > * {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  min-height: 44px;
}
.list > * + * {
  border-top: 0.5px solid var(--separator);
}
.list .grow {
  flex: 1;
  min-width: 0;
}
.list .sub {
  display: block;
  color: var(--label-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* Badges/Pillen */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--fill);
  color: var(--label-2);
  white-space: nowrap;
}
.badge.ok {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: color-mix(in srgb, var(--green) 80%, var(--label));
}
.badge.warn {
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: color-mix(in srgb, var(--orange) 85%, var(--label));
}
.badge.bad {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: color-mix(in srgb, var(--red) 85%, var(--label));
}
.badge.gold {
  background: linear-gradient(135deg, #f7d77c, #d69b2b);
  color: #3a2600;
}
.badge.silber {
  background: linear-gradient(135deg, #e8e8ee, #a9a9b6);
  color: #222;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}
.dot.off {
  background: var(--red);
}

/* Knöpfe */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: var(--tint);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 0.12s var(--ease),
    filter 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.08);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.gray {
  background: var(--fill-strong);
  color: var(--label);
}
.btn.red {
  background: var(--red);
}
.btn.green {
  background: var(--green);
}
.btn.discord {
  background: #5865f2;
  height: 46px;
  font-size: 16px;
  padding: 0 22px;
  border-radius: 12px;
  width: 100%;
}
.btn.small {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}
.btn .ico {
  width: 16px;
  height: 16px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--fill);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--label);
  transition:
    transform 0.12s var(--ease),
    background 0.15s;
}
.icon-btn:hover {
  background: var(--fill-strong);
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn.big {
  width: 60px;
  height: 60px;
  background: var(--label);
  color: var(--bg);
}
.icon-btn .ico {
  width: 20px;
  height: 20px;
}
.icon-btn.big .ico {
  width: 26px;
  height: 26px;
}

/* iOS-Schalter */
.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 31px;
  background: var(--fill-strong);
  transition: background 0.25s var(--ease);
}
.switch span::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch input:checked + span {
  background: var(--green);
}
.switch input:checked + span::after {
  transform: translateX(20px);
}
.switch input:disabled {
  cursor: not-allowed;
}
.switch input:disabled + span {
  opacity: 0.45;
}
.switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: 2px;
}

/* Segmentierte Auswahl */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--fill);
  gap: 2px;
}
.segmented button {
  border: 0;
  background: none;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--label);
}
.segmented button.on {
  background: var(--glass-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

/* Formulare */
label.field {
  display: block;
  margin: 0 0 14px;
}
label.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
  margin-bottom: 6px;
}
label.field > small {
  display: block;
  font-size: 12px;
  color: var(--label-3);
  margin-top: 4px;
}
input[type='text'],
input[type='password'],
input[type='number'],
input[type='url'],
input[type='search'],
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0.5px solid var(--separator);
  background: var(--input);
  outline: none;
  transition: box-shadow 0.15s;
}
textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.4;
}
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent);
}
input.placeholder,
select.placeholder,
textarea.placeholder {
  border-color: color-mix(in srgb, var(--orange) 70%, transparent);
  background: color-mix(in srgb, var(--orange) 8%, var(--input));
}
input[type='color'] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border-radius: 10px;
  border: 0.5px solid var(--separator);
  background: var(--input);
  cursor: pointer;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--tint);
}
fieldset {
  border: 0.5px solid var(--separator);
  border-radius: 14px;
  margin: 0 0 14px;
  padding: 12px 14px 2px;
  min-width: 0;
}
legend {
  font-weight: 650;
  font-size: 13px;
  padding: 0 6px;
  color: var(--label-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--tint-soft);
  font-size: 13px;
}
.chip button {
  border: 0;
  background: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--label-2);
}
.chip button:hover {
  background: var(--fill-strong);
}

/* Tabellen */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--separator);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 0.5px solid var(--separator);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
.empty {
  color: var(--label-2);
  text-align: center;
  padding: 26px 10px;
}

/* Modul-Center */
.cat-title {
  margin: 26px 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.module {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  min-width: 0;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s;
}
.module:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}
.module header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.module .app-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #5e5ce6, #0a84ff);
}
.module.off .app-ico {
  background: var(--fill-strong);
  color: var(--label-2);
}
.module.locked .app-ico {
  background: linear-gradient(135deg, #f7d77c, #d69b2b);
  color: #3a2600;
}
.module .app-ico .ico {
  width: 22px;
  height: 22px;
}
.module h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.module p {
  margin: 0;
  font-size: 13px;
  color: var(--label-2);
}
.module .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.module code {
  font: 12px var(--mono);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--fill);
}
.module .err {
  font-size: 12px;
  color: var(--red);
  overflow-wrap: anywhere;
}

/* Premium */
.hero {
  padding: 28px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 6px 0 0;
  color: var(--label-2);
  max-width: 60ch;
}
.hero .big-ico {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #3a2600;
  background: linear-gradient(135deg, #f7d77c, #d69b2b);
  box-shadow: 0 10px 30px rgba(214, 155, 43, 0.4);
}
.hero .big-ico .ico {
  width: 44px;
  height: 44px;
}
.lock-hero {
  text-align: center;
  padding: 48px 24px;
  display: grid;
  justify-items: center;
  gap: 14px;
}
.lock-hero .big-ico {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f7d77c, #d69b2b);
  color: #3a2600;
  box-shadow: 0 14px 40px rgba(214, 155, 43, 0.4);
}
.lock-hero .big-ico .ico {
  width: 50px;
  height: 50px;
}
.lock-hero h2 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.lock-hero p {
  margin: 0;
  color: var(--label-2);
  max-width: 52ch;
}
.features {
  display: grid;
  gap: 8px;
  text-align: left;
  margin: 6px 0;
}
.features div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.features .ico {
  width: 18px;
  height: 18px;
  color: var(--green);
  flex: none;
}
.tiers {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.tier {
  padding: 18px;
}
.tier.current {
  outline: 2px solid var(--tint);
}
.tier h3 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tier ul {
  margin: 0;
  padding-left: 18px;
  color: var(--label-2);
  font-size: 13px;
}
.key {
  font: 12px/1.4 var(--mono);
  word-break: break-all;
  padding: 10px;
  border-radius: 10px;
  background: var(--fill);
  user-select: all;
}

/* Embed-Builder */
.builder {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.preview {
  position: sticky;
  top: 20px;
}
.discord {
  background: #313338;
  color: #dbdee1;
  border-radius: 14px;
  padding: 16px;
  font:
    15px/1.375 'gg sans',
    'Noto Sans',
    'Helvetica Neue',
    Helvetica,
    Arial,
    sans-serif;
  letter-spacing: 0;
}
.discord .msg {
  display: flex;
  gap: 14px;
}
.discord .msg img.av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: #5865f2;
}
.discord .who {
  font-weight: 600;
  color: #f2f3f5;
}
.discord .who .tag {
  font-size: 10px;
  font-weight: 600;
  background: #5865f2;
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: 2px;
}
.discord .who time {
  font-size: 12px;
  color: #949ba4;
  font-weight: 400;
  margin-left: 6px;
}
.discord .content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.discord .embed {
  margin-top: 6px;
  max-width: 520px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  background: #2b2d31;
  border-radius: 4px;
  border-left: 4px solid #1e1f22;
  padding: 8px 16px 16px 12px;
  gap: 0 16px;
}
.discord .embed > div {
  grid-column: 1 / 3;
  min-width: 0;
}
.discord .embed .thumb {
  grid-column: 3;
  grid-row: 1 / 5;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 8px;
}
.discord .e-author {
  font-size: 14px;
  font-weight: 600;
  color: #f2f3f5;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.discord .e-author img,
.discord .e-footer img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.discord .e-title {
  font-weight: 600;
  color: #f2f3f5;
  margin-top: 8px;
}
.discord .e-title a {
  color: #00a8fc;
}
.discord .e-desc {
  font-size: 14px;
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.discord .e-fields {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.discord .e-field {
  grid-column: 1 / -1;
  font-size: 14px;
  min-width: 0;
}
.discord .e-field.inline {
  grid-column: auto;
}
.discord .e-field b {
  display: block;
  color: #f2f3f5;
  margin-bottom: 2px;
}
.discord .e-image {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 16px;
}
.discord .e-footer {
  font-size: 12px;
  color: #b5bac1;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.discord .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.discord .buttons span {
  background: #4e5058;
  color: #fff;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
}
.discord code {
  font-family: var(--mono);
  background: #1e1f22;
  border-radius: 3px;
  padding: 0 3px;
  font-size: 85%;
}
.discord h3,
.discord h4,
.discord h5 {
  margin: 4px 0;
  color: #f2f3f5;
}
.discord a {
  color: #00a8fc;
}
.field-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto;
  align-items: center;
  margin-bottom: 8px;
}

/* Musik */
.player {
  display: grid;
  gap: 22px;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  padding: 22px;
}
.artwork {
  width: 220px;
  aspect-ratio: 1;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff375f, #bf5af2 55%, #5e5ce6);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artwork .ico {
  width: 70px;
  height: 70px;
  opacity: 0.9;
}
.track-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}
.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--fill-strong);
  overflow: hidden;
  margin: 14px 0 4px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--label);
  border-radius: 3px;
}
.times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 14px 0;
}
.volume {
  display: flex;
  align-items: center;
  gap: 10px;
}
.volume .ico {
  width: 18px;
  height: 18px;
  color: var(--label-2);
  flex: none;
}
.queue-item .num {
  width: 22px;
  text-align: right;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* Diagramm */
.chart {
  position: relative;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid-line {
  stroke: var(--separator);
  stroke-width: 1;
}
.chart .axis {
  fill: var(--label-2);
  font-size: 11px;
}
.chart .bar {
  fill: var(--series-1);
  transition: opacity 0.15s;
}
.chart .hit {
  fill: transparent;
  cursor: default;
}
.chart .hit:hover + .bar,
.chart .bar.hover {
  opacity: 0.75;
}
.chart .value {
  fill: var(--label);
  font-size: 11px;
  font-weight: 600;
}
.tooltip {
  position: absolute;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  white-space: nowrap;
  transform: translate(-50%, -110%);
  border: 0.5px solid var(--separator);
}
.tooltip b {
  font-variant-numeric: tabular-nums;
}
details.table-toggle summary {
  cursor: pointer;
  color: var(--tint);
  font-size: 13px;
  margin-top: 10px;
}

/* Einstellungen */
.settings {
  display: grid;
  gap: 16px;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
}
.settings nav {
  position: sticky;
  top: 20px;
  padding: 8px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.settings nav button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.settings nav button:hover {
  background: var(--fill);
}
.settings nav button.on {
  background: var(--tint);
  color: #fff;
}
.settings nav button .badge {
  margin-left: auto;
}
.settings nav button.on .badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 14px;
}
.toggle-row span {
  font-weight: 500;
}

/* Anmeldung */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login .card {
  width: min(400px, 100%);
  padding: 34px 28px;
  text-align: center;
}
.login img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(10, 132, 255, 0.35);
}
.login h1 {
  margin: 16px 0 4px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.login p {
  margin: 0 0 22px;
  color: var(--label-2);
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--label-3);
  font-size: 12px;
  margin: 18px 0;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--separator);
}
.error {
  color: var(--red);
  font-size: 14px;
  margin: 0 0 14px;
}

/* Hinweise */
#toasts {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-pop);
  border: 0.5px solid var(--separator);
  font-weight: 500;
  display: flex;
  gap: 10px;
  align-items: center;
  animation: toast 0.35s var(--ease);
}
.toast .ico {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--green);
}
.toast.bad .ico {
  color: var(--red);
}
@keyframes toast {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.notice {
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--orange) 14%, var(--glass));
  margin-bottom: 16px;
}
.notice .ico {
  width: 20px;
  height: 20px;
  color: var(--orange);
  flex: none;
}
.ico {
  display: inline-block;
  vertical-align: middle;
  width: 1.1em;
  height: 1.1em;
  flex: none;
}
.grid > .card,
.grid > section {
  margin-top: 0 !important;
}

/* Handy: Seitenleiste wird zur Tableiste wie in iOS */
.tabbar,
.more-sheet {
  display: none;
}
@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
  }
  .head h1 {
    font-size: 26px;
  }
  .grid.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat .v {
    font-size: 24px;
  }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--sidebar);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    border-top: 0.5px solid var(--separator);
  }
  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 500;
    color: var(--label-2);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 4px 0;
    min-height: 44px;
    cursor: pointer;
  }
  .tabbar .ico {
    width: 24px;
    height: 24px;
  }
  .tabbar .on {
    color: var(--tint);
  }
  .more-sheet.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.35);
  }
  .more-sheet .sheet {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    padding: 8px;
    animation: enter 0.25s var(--ease);
    max-height: 70vh;
    overflow-y: auto;
  }
  .more-sheet .sheet a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--label);
    font-weight: 500;
  }
  .more-sheet .sheet a .ico {
    width: 20px;
    height: 20px;
    color: var(--tint);
  }
  .builder,
  .settings {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview,
  .settings nav {
    position: static;
    max-height: none;
  }
  .player {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .artwork {
    width: min(260px, 70vw);
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .discord .e-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .chart .bar {
    fill: CanvasText;
  }
  .switch span {
    border: 1px solid CanvasText;
  }
}

/* ---------- Limited Bot: Serverauswahl, Server-Wechsel, Schnell-Aktionen, Rechtliches ---------- */
.servers {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.topbar .brand {
  padding: 0;
  margin: 0;
}
.topbar .me {
  border: 0;
  padding: 0;
}
.grow {
  flex: 1;
  min-width: 0;
}
.servers-head h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.servers-head .row {
  margin: 14px 0 22px;
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.server-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
}
.server-card b,
.server-switch b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-card small,
.server-switch small {
  display: block;
  color: var(--label-2);
  font-size: 12px;
  text-transform: capitalize;
}
.server-card img,
.server-switch img,
.server-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex: none;
  object-fit: cover;
}
.server-icon {
  display: grid;
  place-items: center;
  background: var(--tint-soft);
  color: var(--tint);
  font-weight: 700;
  font-size: 18px;
}
.server-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 14px;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--label);
  text-decoration: none;
}
.server-switch img,
.server-switch .server-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 14px;
}
.server-switch .ico {
  color: var(--label-2);
}
.nav-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--tint);
  text-decoration: none;
  font-size: 14px;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--label);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: transform 0.2s var(--ease);
}
.quick-action:hover {
  transform: translateY(-1px);
}
.quick-action .ico {
  color: var(--tint);
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding: 14px 8px 4px;
  font-size: 12px;
  color: var(--label-3);
}
.legal-links a {
  color: var(--label-2);
  text-decoration: none;
}
.legal-links a:hover {
  text-decoration: underline;
}
dialog.legal {
  max-width: min(640px, calc(100vw - 32px));
  max-height: 80vh;
  overflow: auto;
  border: 0;
  border-radius: var(--radius);
  padding: 24px;
  color: var(--label);
  background: var(--glass-strong);
  box-shadow: var(--shadow-pop);
}
dialog.legal::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}
dialog.legal p {
  white-space: pre-wrap;
  line-height: 1.5;
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.matrix th,
.matrix td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--separator);
  text-align: center;
}
.matrix th:first-child,
.matrix td:first-child {
  text-align: left;
}
.matrix input {
  width: 18px;
  height: 18px;
  accent-color: var(--tint);
}
.matrix-wrap {
  overflow-x: auto;
}
@media (max-width: 860px) {
  .servers-head h1 {
    font-size: 24px;
  }
  .topbar .me div {
    display: none;
  }
}
.grid.two {
  align-items: start;
}

/* Limited-Bot-Module: kopierbare Adressen und Transkripte */
code.copy {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill, rgba(127, 127, 127, 0.12));
  font-size: 13px;
  overflow-wrap: anywhere;
  user-select: all;
}
pre.transcript {
  margin-top: 14px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
  border-radius: 12px;
  background: var(--fill, rgba(127, 127, 127, 0.12));
  white-space: pre-wrap;
  font-size: 13px;
}

/* Ticket-Kategorien-Manager */
.cat-list {
  display: grid;
  gap: 12px;
}
.cat-list .cat {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--fill-strong);
  font-size: 13px;
}
.chip button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.hidden-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill);
}

/* Ticket-Bewertungen */
.rating-bars {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.rating-bar {
  display: grid;
  grid-template-columns: 44px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.rating-bar .track {
  height: 8px;
  border-radius: 99px;
  background: var(--fill);
  overflow: hidden;
}
.rating-bar .fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #ffcc00;
}

.guild-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--fill-strong);
  font-weight: 600;
  object-fit: cover;
}
