/* ==========================================================================
   Elvuro Designsystem – Variablen, Themes, Basiskomponenten
   ========================================================================== */
:root {
  /* Inter und JetBrains Mono sind gebündelt (css/fonts.css) → überall identische Metriken, inkl. Umlaute/ß.
     Emoji-Schriften stehen vor der generischen Familie, damit Emojis farbig statt als Kästchen erscheinen. */
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla", "EmojiOne Color";
  --font-sans: "Inter Variable", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, var(--font-emoji), sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", "Fira Code", Consolas, "DejaVu Sans Mono", "Courier New", var(--font-emoji), monospace;
  --accent: #7c5cff;
  --accent-2: #2ec5ff;
  --accent-contrast: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --danger: #ff4d6d;
  --success: #2fd27a;
  --warning: #ffb020;
  --online: #2fd27a;
  --idle: #ffb020;
  --dnd: #ff4d6d;
  --offline: #7d7f99;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --radius-xl: 24px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-s: 0 4px 14px rgba(0, 0, 0, .25);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: .15s;
  --t: .25s;
  --font-scale: 1;

  /* Dunkles Theme (Standard) */
  --bg-0: #0b0c16;
  --bg-1: #10111e;
  --bg-2: #161728;
  --bg-3: #1d1e33;
  --bg-4: #26284180;
  --bg-hover: rgba(255, 255, 255, .06);
  --bg-active: rgba(255, 255, 255, .1);
  --border: rgba(255, 255, 255, .08);
  --text-1: #f1f1fb;
  --text-2: #b8b9d0;
  --text-3: #8486a3;
  --input-bg: #0d0e1a;
  --mention-bg: rgba(255, 176, 32, .1);
  --mention-border: #ffb020;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg-0: #e6e8f2;
  --bg-1: #eef0f7;
  --bg-2: #f6f7fb;
  --bg-3: #ffffff;
  --bg-4: #e3e5f0;
  --bg-hover: rgba(20, 20, 60, .06);
  --bg-active: rgba(20, 20, 60, .1);
  --border: rgba(20, 20, 60, .1);
  --text-1: #1a1b2e;
  --text-2: #464866;
  --text-3: #6d6f8c;
  --input-bg: #eceef6;
  --shadow: 0 10px 30px rgba(30, 30, 80, .15);
  --shadow-s: 0 4px 14px rgba(30, 30, 80, .1);
  --mention-bg: rgba(255, 176, 32, .15);
  color-scheme: light;
}
[data-theme="midnight"] {
  --bg-0: #000000;
  --bg-1: #050507;
  --bg-2: #0a0a0f;
  --bg-3: #111118;
  --bg-4: #1a1a22;
  --input-bg: #08080c;
}
[data-contrast="high"] {
  --border: rgba(255, 255, 255, .35);
  --text-2: #e6e6f0;
  --text-3: #c8c8d8;
}
[data-theme="light"][data-contrast="high"] {
  --border: rgba(0, 0, 0, .45);
  --text-2: #1a1a1a;
  --text-3: #333;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { font-size: calc(16px * var(--font-scale)); }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.dyslexia { --font-sans: "OpenDyslexic", "Comic Neue", Verdana, var(--font-emoji), sans-serif; font-family: var(--font-sans); letter-spacing: .02em; word-spacing: .08em; }
body.underline-links a { text-decoration: underline; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 0; border-radius: var(--radius-s); cursor: pointer;
  background: var(--accent); color: var(--accent-contrast); font-weight: 600; font-size: .92rem;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast), background var(--t-fast), box-shadow var(--t);
  white-space: nowrap; user-select: none;
}
.btn:hover { filter: brightness(1.1); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }
.btn.secondary { background: var(--bg-4); color: var(--text-1); }
.btn.secondary:hover { background: var(--bg-active); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text-1); box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { box-shadow: 0 6px 18px rgba(255, 77, 109, .35); }
.btn.success { background: var(--success); color: #062; }
.btn.small { padding: 6px 12px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn.gradient { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn .spinner { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  flex-shrink: 0; position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.icon-btn.danger-on { color: var(--danger); }
.icon-btn svg { width: 20px; height: 20px; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.field[hidden] { display: none; }
.field .hint { font-size: .78rem; color: var(--text-3); }
.field .error-text { font-size: .8rem; color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text-1); font: inherit; font-size: .95rem; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--danger); }
textarea.input { resize: vertical; min-height: 80px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--text-3); }
.small-text { font-size: .82rem; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.or-sep { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--text-3); font-size: .78rem; font-weight: 600; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Toggle-Schalter */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider, .switch > span { position: absolute; inset: 0; background: var(--bg-4); border-radius: 24px; cursor: pointer; transition: background var(--t); }
.switch .slider::before, .switch > span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform var(--t) var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .slider, .switch input:checked + span { background: var(--accent); }
.switch input:checked + .slider::before, .switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + .slider, .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .title { font-weight: 600; }
.setting-row .desc { font-size: .82rem; color: var(--text-3); margin-top: 2px; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="color"] { width: 42px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* Spinner & Laden */
.spinner { width: 28px; height: 28px; border: 3px solid var(--bg-4); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-3), var(--bg-4), var(--bg-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-0); z-index: 1000; transition: opacity .4s; }
.loading-screen .logo-big { width: 84px; height: 84px; animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .75; } }

/* Toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2000; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--bg-3); color: var(--text-1); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); animation: toastIn .3s var(--ease); font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(12px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(30px); opacity: 0; } }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 5, 15, .65); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 1500; animation: fadeIn .2s; padding: 16px; }
.modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: var(--shadow); width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: modalIn .28s var(--ease); overflow: hidden; }
.modal.wide { width: min(720px, 100%); }
.modal-header { padding: 20px 22px 8px; }
.modal-header h2 { margin: 0; font-size: 1.25rem; }
.modal-header p { margin: 6px 0 0; color: var(--text-3); font-size: .9rem; }
.modal-body { padding: 12px 22px; overflow-y: auto; }
.modal-footer { padding: 14px 22px; background: var(--bg-1); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { transform: translateY(16px) scale(.97); opacity: 0; } }

/* Kontextmenü / Popover */
.popover { position: fixed; z-index: 1600; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 200px; max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; animation: popIn .15s var(--ease); }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: .88rem; text-align: left; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger); color: #fff; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* Tooltip */
.tooltip { position: fixed; z-index: 1700; background: #05050c; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600; pointer-events: none; box-shadow: var(--shadow-s); animation: popIn .12s var(--ease); max-width: 260px; }

/* Avatare & Rahmen */
.avatar { position: relative; flex-shrink: 0; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #fff; user-select: none; background: var(--accent); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .initials { font-size: .9em; }
.avatar .status-dot { position: absolute; right: -2px; bottom: -2px; width: 34%; height: 34%; min-width: 10px; min-height: 10px; border-radius: 50%; border: 3px solid var(--bg-2); background: var(--offline); }
.status-dot.online { background: var(--online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }
.status-dot.offline { background: var(--offline); }
.avatar.frame-ring { box-shadow: 0 0 0 3px var(--frame, var(--accent)); }
.avatar.frame-glow { box-shadow: 0 0 0 2px var(--frame, var(--accent)), 0 0 16px 3px var(--frame, var(--accent)); }
.avatar.frame-gold { box-shadow: 0 0 0 3px #d4af37, 0 0 10px rgba(212, 175, 55, .6); }
.avatar.frame-neon { box-shadow: 0 0 0 2px #00f0ff, 0 0 12px #ff00e6, 0 0 22px #00f0ff; }
.avatar.frame-dashed { outline: 3px dashed var(--frame, var(--accent)); outline-offset: 2px; }
.avatar.frame-rainbow::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(#ff3b3b, #ff9f1c, #ffe600, #3ddc84, #2ec5ff, #7b5cff, #ff4fd8, #ff3b3b); z-index: -1; animation: spin 4s linear infinite; }
.avatar.frame-rainbow { isolation: isolate; }
.no-anim .avatar.frame-rainbow::before { animation: none; }

/* Namensstile */
.cc-name { font-weight: 600; }
.cc-name.grad { background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; background-size: 200% auto; }
.cc-name.grad.anim { animation: ccFlow var(--speed, 6s) linear infinite; }
@keyframes ccFlow { to { background-position: 200% center; } }
.cc-name.fx-glow { filter: drop-shadow(0 0 6px var(--glow, var(--accent))); }
.cc-name.fx-shadow { filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .55)); }
.cc-name.fx-outline { -webkit-text-stroke: .6px rgba(0, 0, 0, .65); }
.cc-name.fx-caps { font-variant: small-caps; letter-spacing: .03em; }
.cc-name.solid-anim { animation: ccHue var(--speed, 6s) linear infinite; }
@keyframes ccHue { to { filter: hue-rotate(360deg); } }
.cc-name.fx-shine { animation: ccShine calc(var(--speed, 6s) * .6) linear infinite; }
@keyframes ccShine { from { background-position: 160% 0, 0 center; } to { background-position: -60% 0, 200% center; } }
.cc-name.fx-pulse { animation: ccPulse calc(var(--speed, 6s) * .4) ease-in-out infinite; }
.cc-name.grad.anim.fx-pulse { animation: ccFlow var(--speed, 6s) linear infinite, ccPulse calc(var(--speed, 6s) * .4) ease-in-out infinite; }
@keyframes ccPulse { 50% { filter: brightness(1.35) drop-shadow(0 0 6px var(--glow, var(--accent))); } }
.no-anim .cc-name.grad.anim, .no-anim .cc-name.solid-anim, .no-anim .anim-bg, .no-anim .cc-name.fx-shine, .no-anim .cc-name.fx-pulse { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .cc-name.grad.anim, .cc-name.solid-anim, .cc-name.fx-shine, .cc-name.fx-pulse { animation: none !important; } }
/* Server-Tag neben dem Namen (global getragen) */
.server-tag { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; padding: 0 5px; height: 16px; border-radius: 4px; vertical-align: 1px;
  font: 700 10.5px/16px var(--font-sans); letter-spacing: .03em; white-space: nowrap; color: var(--text); background: color-mix(in srgb, var(--tag, #7c5cff) 26%, var(--bg-3, #1d1e33));
  border: 1px solid color-mix(in srgb, var(--tag, #7c5cff) 55%, transparent); cursor: default; flex-shrink: 0; }
.server-tag .st-badge { color: var(--tag, #7c5cff); font-size: 11px; line-height: 1; font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", var(--font-sans); }
.server-tag.lg { height: 22px; font-size: 13px; padding: 0 8px; border-radius: 6px; }
.server-tag.lg .st-badge { font-size: 14px; }
/* Plattform-Abzeichen (Owner, Staff, Developer …) – neben Namen im Chat/Listen und groß im Profil */
.ubadges { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 5px; vertical-align: -2px; flex-shrink: 0; }
.ubadge { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; background: var(--ub, #7c5cff); color: #fff; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.25); cursor: default; }
.ubadge svg { width: 12px; height: 12px; display: block; }
.ubadge.lg { width: 24px; height: 24px; border-radius: 7px; }
.ubadge.lg svg { width: 17px; height: 17px; }
.ubadges.lg { gap: 6px; margin: 0; flex-wrap: wrap; vertical-align: 0; }
.ubadge-more { font-size: 10px; font-weight: 700; color: var(--text-3); padding: 0 2px; line-height: 16px; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.18); width: fit-content; max-width: 100%; }
[data-theme="light"] .pc-badges { background: rgba(0,0,0,.06); }
@media (forced-colors: active) { .ubadge { border: 1px solid CanvasText; } }
.server-tag.clickable { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: filter .15s ease, transform .15s ease, box-shadow .15s ease; }
.server-tag.clickable:hover { filter: brightness(1.18); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tag, #7c5cff) 70%, transparent); }
.server-tag.clickable:active { transform: scale(.96); }
.server-tag.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (pointer: coarse) { .server-tag.clickable { position: relative; } .server-tag.clickable::after { content: ""; position: absolute; inset: -8px -4px; } }
.role-name { font-weight: 600; }
.anim-bg { background-size: 200% 200% !important; animation: ccBg var(--speed, 8s) ease infinite; }
@keyframes ccBg { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Badges */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 5px; font-size: .65rem; font-weight: 800; text-transform: uppercase; background: var(--accent); color: #fff; vertical-align: middle; letter-spacing: .02em; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-4); font-size: .8rem; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--bg-1); padding: 4px; border-radius: var(--radius); }
.tab { flex: 1; padding: 9px 12px; border: 0; background: transparent; color: var(--text-2); border-radius: 9px; cursor: pointer; font-weight: 600; transition: background var(--t), color var(--t); }
.tab:hover { color: var(--text-1); }
.tab.active { background: var(--bg-3); color: var(--text-1); box-shadow: var(--shadow-s); }

/* Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
.reduced-motion * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* ---------- Typografie-Grundlagen (Ursachen statt Symptome) ----------
   1. Gebündelte Schriften (fonts.css) → gleiche Metriken auf allen Systemen, keine Ersatzschrift mit anderer Breite.
   2. Flex-Kinder mit Text brauchen min-width:0, sonst schieben lange Namen das Layout auseinander.
   3. Kursive/verzierte Namen ragen über ihre Box hinaus → etwas Innenabstand, damit overflow:hidden nichts abschneidet.
   4. Lange Wörter/URLs/Namen ohne Leerzeichen dürfen umbrechen. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; text-rendering: optimizeLegibility; font-synthesis: none; font-kerning: normal; }
body { overflow-wrap: break-word; }
input, textarea, select, button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.25; overflow-wrap: anywhere; }
.cc-name { overflow-wrap: anywhere; }
.cc-name.it { padding-inline-end: .14em; }
.cc-name.grad { padding-block: .04em; }
.btn { min-width: 0; max-width: 100%; white-space: normal; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.menu-item > span:not(.icon) { min-width: 0; overflow-wrap: anywhere; }
.toast > *, .modal-header h2, .modal-header p { min-width: 0; overflow-wrap: anywhere; }
.setting-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field > label .small-text, .field > label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Runde 4: Menüs (Untermenüs, Umschalter, Abschnitte) & Bottom-Sheets ---------- */
.menu { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.menu-header { padding: 8px 10px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.menu-item .mi-label { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.menu-item .mi-label small { font-size: .74rem; opacity: .75; font-weight: 400; }
.menu-item .mi-arrow { margin-inline-start: auto; opacity: .7; }
.menu-item .mi-check { margin-inline-start: auto; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-strong, var(--text-3)); display: grid; place-items: center; flex-shrink: 0; }
.menu-item[aria-checked="true"] .mi-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu-item[aria-checked="true"] .mi-check .icon { width: 12px; height: 12px; }
.menu-item:disabled { opacity: .55; cursor: progress; }
.menu-item.menu-back { font-weight: 700; color: var(--text); }
.menu-item .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 1590; background: rgba(0, 0, 0, .5); animation: fadeIn .15s ease; }
.sheet { position: fixed; z-index: 1600; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-2); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .45); padding: 6px 10px calc(12px + env(safe-area-inset-bottom));
  animation: sheetUp .22s var(--ease, ease); transition: transform .15s ease; }
.sheet.menu { min-width: 0; max-height: 82vh; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: .5; margin: 4px auto 8px; }
.sheet-title { font-weight: 700; padding: 0 10px 8px; color: var(--text); }
.sheet .menu-item { min-height: 48px; font-size: 1rem; padding: 10px 12px; border-radius: 10px; }
.sheet .menu-item:hover { background: var(--bg-4, var(--bg-3)); color: var(--text); }
.sheet .menu-item.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.pressing { background: color-mix(in srgb, var(--accent) 14%, transparent) !important; transition: background .3s; }
.no-anim .sheet, .no-anim .sheet-backdrop, .no-anim .popover { animation: none !important; }

/* v7: Standard-Avatar (Initialen) und Zuschnitt-Vorschau */
.avatar .initials { font-size: .9em; letter-spacing: .01em; text-shadow: 0 1px 2px rgba(0, 0, 0, .28); line-height: 1; }
.crop-previews { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.crop-previews > .muted { align-self: center; }
.crop-previews figure { margin: 0; display: grid; justify-items: center; gap: 4px; }
.crop-previews figcaption { font-size: .72rem; color: var(--text-3); }
.crop-prev { position: relative; display: block; border-radius: 50%; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--border); }
.crop-prev img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; pointer-events: none; }
@media (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }
}
/* 7.4 – Plattform-Rollen (Chips im Profil/Admin-Panel, Prefix-Etikett im Chat) und Emoji-Symbole in Abzeichen */
.ub-emoji { font-size: 11px; line-height: 1; display: block; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.ubadge.lg .ub-emoji { font-size: 15px; }
.prole { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px;
  background: color-mix(in srgb, var(--bg-3, #1d1e33) 88%, transparent); border: 1px solid rgba(255,255,255,.08); color: var(--text-1); }
[data-theme="light"] .prole { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
.prole-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pr); flex-shrink: 0; }
.prole .prole-ic { width: 14px; height: 14px; color: var(--text-2); flex-shrink: 0; --ub: var(--bg-2, #1d1e33); }
.prole .ub-emoji.prole-ic { font-size: 12px; width: auto; height: auto; }
.prole-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-proles { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.prole-tag { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; padding: 0 5px; height: 16px; border-radius: 4px; background: var(--pr); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; line-height: 16px; vertical-align: 1px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.35); cursor: default; flex-shrink: 0; }
.prole-tag .prole-ic { width: 11px; height: 11px; --ub: rgba(0,0,0,.35); }
.prole-tag .ub-emoji.prole-ic { font-size: 10px; width: auto; height: auto; }
@media (forced-colors: active) { .prole-tag, .prole-dot { border: 1px solid CanvasText; } }
