/* Squadlink – eigene visuelle Identität: dunkles "Tactical"-Design mit Amber-Akzent und Grün für Sicherheit. */
:root {
  --bg: #0d1015;
  --bg-2: #11151c;
  --surface: #161b23;
  --surface-2: #1c222c;
  --surface-3: #242b37;
  --border: #2a3240;
  --text: #e8edf3;
  --muted: #9aa6b4;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --accent-soft: rgba(245, 165, 36, .14);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .13);
  --warn: #ffcc4d;
  --warn-soft: rgba(255, 204, 77, .13);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .13);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; display: flex; align-items: center; gap: .4rem; }
h2.inline { display: inline-flex; margin: 0; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
code { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.noscript { padding: 2rem; text-align: center; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Layout ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem;
  background: var(--bg-2); border-bottom: 1px solid var(--border); flex: none;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .95rem; }
.conn { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.on .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.wait .dot { background: var(--warn); }
.conn.off { color: var(--danger); }
.conn.off .dot { background: var(--danger); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--border); }
.user-chip:hover { background: var(--surface-2); }

.banner { padding: .6rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--border); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }

.shell { flex: 1; display: grid; grid-template-columns: 320px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--border); background: var(--bg-2); overflow-y: auto; padding: .75rem; }
.main { overflow-y: auto; min-width: 0; position: relative; }
.main:focus { outline: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer;
  font-weight: 600; font-size: .9rem; min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #210404; }
.btn.danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn.small { padding: .3rem .65rem; min-height: 32px; font-size: .82rem; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 0; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .icon { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: inherit; }
.back-mobile { display: none; }

/* ---------- Helpers ---------- */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.italic { font-style: italic; }
.danger { color: var(--danger); }
.center { text-align: center; }
.pad { padding: 1rem; }
.pad-sm { padding: .5rem; }
.row { display: flex; align-items: center; }
.row.end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; }
.gap { gap: .6rem; }
.gap-sm { gap: .4rem; }
.stack { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.pill { min-width: 20px; height: 20px; padding: 0 .4rem; border-radius: 999px; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.pill.accent { background: var(--accent); color: var(--accent-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.avatar {
  --h: 200;
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: hsl(var(--h) 45% 26%); color: hsl(var(--h) 85% 82%); font-weight: 800;
}
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar-spacer { width: 38px; flex: none; }

.clan-badge {
  --g: var(--accent);
  flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .35rem;
  border-radius: 10px; font-weight: 900; font-size: .78rem; letter-spacing: .04em;
  color: var(--g); background: color-mix(in srgb, var(--g) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--g) 45%, transparent);
  font-family: var(--mono);
}
.clan-badge.sm { min-width: 32px; height: 26px; font-size: .66rem; border-radius: 6px; }
.clan-badge.lg { min-width: 52px; height: 52px; font-size: .9rem; }
.clan-badge.xl { min-width: 84px; height: 84px; font-size: 1.3rem; border-radius: 16px; }
.game-cod { --g: #9bd14b; }
.game-gta { --g: #4fc3f7; }
.game-bf { --g: #ff8a3d; }
.game-apex { --g: #ff5252; }
.game-valorant { --g: #ff4f6d; }
.game-cs2 { --g: #f5c542; }
.game-r6 { --g: #8fa3ff; }
.game-pubg { --g: #f2a541; }
.game-fortnite { --g: #b47cff; }
.game-tarkov { --g: #c9b48a; }
.game-other { --g: #9aa6b4; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

.state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.state[role=status] { flex-direction: row; justify-content: center; }
.state-empty h3 { color: var(--text); }
.state-error { color: var(--danger); }

/* ---------- Sidebar ---------- */
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.side-actions .btn { padding-inline: .5rem; }
.side-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: .75rem .25rem .5rem; }
.side-section { margin-top: 1rem; }
.side-section p { padding: 0 .25rem; }
.clan-list, .req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.clan-item { display: flex; gap: .7rem; align-items: center; padding: .6rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.clan-item:hover { background: var(--surface); }
.clan-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.clan-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.clan-item-top, .clan-item-bottom { display: flex; align-items: center; gap: .4rem; }
.clan-item-name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clan-item-time { font-size: .72rem; color: var(--muted); }
.clan-item-preview { flex: 1; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); font-size: .9rem; }
.req-item span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-item:hover { background: var(--surface); }

/* ---------- Seiten ---------- */
.page { padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.narrow-page { max-width: 760px; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 240px; }
.page-head:empty { display: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.center-wrap { min-height: 100%; display: grid; place-items: center; padding: 1.5rem 1rem; }
.form { display: flex; flex-direction: column; gap: .9rem; }
.form.narrow { width: 100%; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.field > span { font-weight: 600; }
input:not([type=checkbox]), select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .75rem; color: var(--text); font-size: .95rem; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check.small { font-size: .8rem; color: var(--muted); }
.form-error { color: var(--danger); margin: 0; font-size: .88rem; }
.form-error:empty { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
details summary::before { content: "▸"; color: var(--muted); }
details[open] summary::before { content: "▾"; }
details[open] summary { margin-bottom: 1rem; }

/* Entdecken */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.filters .field { flex: 1 1 140px; }
.filters .check { flex: 0 0 auto; min-height: 42px; }
.search-box { flex: 2 1 260px; position: relative; display: flex; align-items: center; }
.search-box .icon { position: absolute; left: .75rem; color: var(--muted); }
.search-box input { padding-left: 2.3rem; }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.clan-card { display: flex; flex-direction: column; gap: .7rem; height: 100%; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.clan-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.clan-card-head { display: flex; gap: .75rem; align-items: center; }
.clan-card-title { min-width: 0; }
.clan-card-title h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clan-card-desc { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; flex: 1; }
.clan-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.clan-card-foot .muted { display: inline-flex; align-items: center; gap: .3rem; }

/* Clan-Profil */
.hero {
  --g: var(--accent);
  display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; padding: 1.5rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--g) 12%, var(--surface)), var(--surface) 60%);
}
.hero-body { flex: 1 1 280px; min-width: 0; }
.hero-body h1 { overflow-wrap: anywhere; }
.hero-action { flex: 1 1 260px; max-width: 360px; }
.join-form { display: flex; flex-direction: column; gap: .6rem; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-item { display: flex; gap: .75rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.list-item:first-child { border-top: 0; }
.list-item.top { align-items: flex-start; }
.request-msg { background: var(--bg-2); border-radius: var(--radius-sm); padding: .5rem .7rem; margin: .4rem 0 0; font-size: .9rem; }
.devices { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.device { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .7rem; display: flex; flex-direction: column; gap: .3rem; }
.device.changed { border-color: var(--danger); }
.device-head { display: flex; gap: .5rem; align-items: center; justify-content: space-between; font-size: .85rem; flex-wrap: wrap; }
.fp { font-family: var(--mono); font-size: .9rem; letter-spacing: .08em; color: var(--ok); word-spacing: .3em; }
.fp.big { display: block; font-size: 1.15rem; padding: .75rem; background: var(--bg-2); border-radius: var(--radius-sm); text-align: center; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* ---------- Chat ---------- */
.chat { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg-2); flex: none; }
.chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; color: var(--text); text-decoration: none; }
.chat-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-actions { display: flex; align-items: center; gap: .4rem; }
.e2e-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; border: 0; cursor: pointer; white-space: nowrap; }
.e2e-badge .icon { width: 14px; height: 14px; }
.e2e-badge.ok { background: var(--ok-soft); color: var(--ok); }
.e2e-badge.wait { background: var(--warn-soft); color: var(--warn); }
.e2e-badge.bad { background: var(--danger-soft); color: var(--danger); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 1rem clamp(.5rem, 2vw, 1.5rem); display: flex; flex-direction: column; gap: 2px;
  background: radial-gradient(circle at 20% 0%, rgba(245, 165, 36, .04), transparent 40%), var(--bg); }
.day-sep { text-align: center; margin: 1rem 0 .5rem; }
.day-sep span { font-size: .74rem; color: var(--muted); background: var(--surface); padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--border); }
.msg { display: flex; gap: .5rem; align-items: flex-end; max-width: min(720px, 92%); position: relative; margin-top: .6rem; }
.msg.grouped { margin-top: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .avatar-spacer { display: none; }
.bubble { background: var(--surface-2); border: 1px solid var(--border); padding: .45rem .7rem .3rem; border-radius: 14px 14px 14px 4px; min-width: 80px; max-width: 100%; }
.msg.mine .bubble { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 14px 14px 4px 14px; }
.msg.is-pending .bubble { opacity: .7; }
.msg-author { font-size: .78rem; font-weight: 800; color: hsl(var(--h) 80% 72%); margin-bottom: .1rem; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: .7rem; color: var(--muted); text-align: right; margin-top: .15rem; display: flex; justify-content: flex-end; gap: .25rem; flex-wrap: wrap; }
.msg-status { margin-left: .4rem; }
.msg-status.failed { color: var(--danger); }
.msg-actions { display: flex; opacity: 0; transition: opacity .1s; align-self: center; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.quote { border-left: 3px solid var(--accent); background: rgba(0, 0, 0, .2); padding: .25rem .5rem; border-radius: 4px; margin-bottom: .3rem; font-size: .82rem; display: flex; flex-direction: column; }
.quote strong { font-size: .75rem; }
.quote span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.composer-wrap { border-top: 1px solid var(--border); background: var(--bg-2); padding: .6rem 1rem calc(.5rem + env(safe-area-inset-bottom)); flex: none; }
.composer { display: flex; gap: .5rem; align-items: flex-end; }
.composer textarea { resize: none; min-height: 44px; max-height: 180px; border-radius: 22px; padding: .65rem 1rem; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; padding: 0; flex: none; }
.composer-ctx { display: flex; gap: .6rem; align-items: center; padding: .4rem .6rem; margin-bottom: .5rem; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 6px; font-size: .85rem; }
.composer-ctx .grow { display: flex; flex-direction: column; }
.composer-ctx .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-hint { font-size: .72rem; color: var(--muted); margin: .35rem 0 0; display: flex; align-items: center; gap: .2rem; }
.composer-hint .icon { width: 12px; height: 12px; color: var(--ok); }

/* ---------- Dialoge & Toasts ---------- */
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; max-width: min(520px, calc(100vw - 2rem)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, .6); }
.bullets { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .92rem; }
.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--surface-3); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: .7rem .9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: .9rem; transition: opacity .3s, transform .3s; }
.toast-success { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-error { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- Abzeichen, Rollen, Logos ---------- */
.with-badges { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; min-width: 0; }
.verified { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.15em; }
.verified .seal { fill: #3b9eff; }
.verified .tick { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.flag { font-size: 1.05em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.sub-badge { display: inline-flex; align-items: center; font-size: .62rem; font-weight: 900; letter-spacing: .06em; padding: .08rem .4rem; border-radius: 4px; white-space: nowrap; line-height: 1.4; }
.sub-plus { background: linear-gradient(135deg, #f5a524, #ffcf6b); color: #2a1a00; }
.sub-elite { background: linear-gradient(135deg, #8f5bff, #ff4fd8); color: #fff; }
.clan-tag-mini { font-family: var(--mono); font-size: .75em; font-weight: 800; color: var(--g, var(--accent)); text-decoration: none; }
.clan-tag-mini:hover { text-decoration: underline; }
.user-link { color: inherit; text-decoration: none; }
.user-link:hover { text-decoration: underline; }
.name-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .25rem; }
.role-chip { --rc: var(--accent); display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap;
  color: color-mix(in srgb, var(--rc) 70%, #fff); background: color-mix(in srgb, var(--rc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.mini-rank { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: .02rem .35rem; border-radius: 4px; }
.mini-role { font-size: .85rem; }
.msg-author { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.msg-author .uname { color: hsl(var(--h) 80% 72%); }
.section-head { margin-bottom: .5rem; }
.section-head h2 { margin: 0; }
.perm-line { margin: .3rem 0 0; }
.perm-set { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .45rem; margin: 0; }
.perm-set legend { padding: 0 .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.icon-grid { display: flex; flex-wrap: wrap; gap: .35rem; }
.icon-pick { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); font-size: 1.15rem; cursor: pointer; }
.icon-pick.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.color-input { padding: 4px !important; height: 42px; cursor: pointer; }
.role-check { padding: .3rem 0; }
.dialog.wide { width: min(560px, calc(100vw - 2rem)); }
.clan-badge.has-logo { padding: 0; overflow: hidden; background: var(--surface-2); }
.clan-badge.has-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clan-badge.has-logo.sm { width: 32px; }
.clan-badge.has-logo:not(.sm) { width: 44px; }
.clan-badge.has-logo.lg { width: 52px; }
.clan-badge.has-logo.xl { width: 84px; }
.logo-picker { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .8rem; background: var(--bg-2); border: 1px dashed var(--border); border-radius: var(--radius); }
.logo-preview { width: 84px; height: 84px; display: grid; place-items: center; }
.logo-preview img { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; }
.logo-picker p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar.xl { width: 84px; height: 84px; font-size: 2rem; }
.chip.info { background: rgba(59, 158, 255, .15); color: #7cc0ff; }
.link-row { color: var(--text); text-decoration: none; border-radius: var(--radius-sm); }
.link-row:hover { background: var(--surface-2); }
.badge-preview { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .6rem .8rem; background: var(--bg-2); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.bullets.small li { display: block; }
.device-details summary { margin-top: .3rem; }
.device-details[open] summary { margin-bottom: .3rem; }
h1.with-badges { display: flex; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; }
  .shell.main-active .sidebar { display: none; }
  .shell:not(.main-active) .main { display: none; }
  .back-mobile { display: inline-flex; }
  .hide-mobile { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
  .msg-actions { opacity: 1; }
  .hero-action { max-width: none; }
  .e2e-badge { font-size: 0; gap: 0; padding: .4rem; }
  .e2e-badge .icon { width: 16px; height: 16px; }
  .toasts { left: 1rem; right: 1rem; bottom: 5.5rem; max-width: none; }
}

/* ---------- Chat-Befehle ---------- */
.composer-wrap { position: relative; }
.cmd-suggest { position: absolute; left: 0; right: 0; bottom: 100%; margin: 0 0 .4rem; padding: .3rem; list-style: none;
  background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .35); max-height: 260px; overflow-y: auto; z-index: 20; }
.cmd-suggest[hidden] { display: none; }
.cmd-suggest li { display: flex; align-items: baseline; gap: .5rem; padding: .45rem .6rem; border-radius: 7px; cursor: pointer; flex-wrap: wrap; }
.cmd-suggest li.active, .cmd-suggest li:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cmd-suggest code { color: var(--accent); font-weight: 600; }
.cmd-args { color: var(--muted); font-size: .8rem; font-family: ui-monospace, monospace; }
.cmd-desc { color: var(--muted); font-size: .82rem; margin-left: auto; }
.cmd-help { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .55rem; }
.cmd-help li { display: grid; gap: .1rem; }
.cmd-help code { color: var(--accent); font-weight: 600; }
.chat-flag { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; padding: .2rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: transparent; cursor: default; }
button.chat-flag { cursor: pointer; }
.chat-flag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.chat-flag .icon { width: 13px; height: 13px; }
.muted-ico { display: inline-flex; color: var(--muted); }
.muted-ico .icon { width: 14px; height: 14px; }
.pill.dim { background: var(--border); color: var(--muted); }

/* ---------- MetaBot ---------- */
.dialog.wide { width: min(640px, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 2rem); overflow-y: auto; }
.msg.bot .bubble { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); max-width: min(560px, 100%); }
.bot-avatar { background: var(--surface-3); font-size: 1.1rem; }
.meta-card { display: grid; gap: .55rem; padding: .7rem; margin-top: .4rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.meta-head { display: flex; gap: .5rem; align-items: flex-start; }
.meta-weapon { font-size: 1.05rem; }
.meta-img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; background: #000; display: block; }
.meta-img[hidden] { display: none; }
.meta-atts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0; font-size: .88rem; }
.meta-atts dt { color: var(--muted); }
.meta-atts dd { margin: 0; font-weight: 600; }
.meta-code { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .6rem; border-radius: 8px; background: var(--surface-3); }
.meta-code code { font-size: 1rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); user-select: all; }
.meta-code .btn { margin-left: auto; }
.meta-notes { margin: 0; font-size: .88rem; white-space: pre-wrap; }
.meta-foot { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.meta-rows { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; gap: .3rem; }
.meta-row { display: flex; gap: .5rem; align-items: center; width: 100%; text-align: left; padding: .45rem .55rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; flex-wrap: wrap; }
.meta-row:hover { border-color: var(--accent); }
.grow-r { margin-left: auto; }
.bot-shared { margin-bottom: .1rem; }
.tier { display: inline-flex; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
.tier-meta { background: var(--accent); color: #111; }
.tier-s { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.tier-a { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.tier-b { background: var(--surface-3); color: var(--muted); }
.att-rows { display: grid; gap: .4rem; margin-bottom: .4rem; }
.att-row { display: grid; grid-template-columns: minmax(110px, 150px) 1fr auto; gap: .4rem; align-items: center; }
.gap-sm { gap: .35rem; }
fieldset.field { border: 1px solid var(--border); border-radius: 8px; padding: .6rem; }

/* ---------- Profilfotos ---------- */
.avatar.has-img { background: var(--surface-3); overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-preview { flex: none; }

/* ---------- CoD Companion ---------- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: 1rem 0; border-bottom: 1px solid var(--border); }
.tab { padding: .5rem .8rem; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tab.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.attribution { margin: .4rem 0; font-size: .9rem; font-weight: 600; }
.attribution a { color: var(--accent); }
.shop-bar { margin: .6rem 0 1rem; }
.shop-bar input[type=search] { flex: 1 1 220px; }
.shop-section h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin: 1.2rem 0 .6rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.shop-item { --rc: var(--border); display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--rc); }
.shop-item.sold { opacity: .55; }
.shop-item img, .shop-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-3); }
.shop-ph { display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--rc); }
.shop-info { display: flex; flex-direction: column; gap: .3rem; padding: .6rem; }
.shop-price { font-weight: 800; color: var(--accent); }
.chip.rarity { background: color-mix(in srgb, var(--rc) 25%, transparent); color: var(--rc); }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.content-grid h3 { margin: 0 0 .3rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.table-wrap { overflow-x: auto; }
.tracker-table { width: 100%; border-collapse: collapse; }
.tracker-table th { text-align: left; font-size: .8rem; color: var(--muted); padding: .3rem; }
.tracker-table td { padding: .25rem .3rem; }
.tracker-table input:not([type=checkbox]) { width: 100%; }
.center { text-align: center; }
.codmunity-link { display: inline-block; margin-top: .45rem; font-weight: 700; color: var(--accent); }
.codmunity-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* ---------- Installierte App (PWA): Notch, Dynamic Island, Fenster-Titelleiste ---------- */
.topbar { padding-top: calc(.6rem + env(safe-area-inset-top)); padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right)); }
.toasts { bottom: calc(1rem + env(safe-area-inset-bottom)); right: calc(1rem + env(safe-area-inset-right)); }
@media (display-mode: standalone) {
  html, body { overscroll-behavior: none; }
  .skip-link { display: none; }
}
@media (display-mode: window-controls-overlay) {
  /* Desktop-App (Windows/macOS) mit eigener Titelleiste: Platz für die Fensterknöpfe lassen */
  .topbar { padding-left: max(1rem, env(titlebar-area-x, 0px));
    padding-right: max(1rem, calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw)));
    -webkit-app-region: drag; app-region: drag; }
  .topbar a, .topbar button { -webkit-app-region: no-drag; app-region: no-drag; }
}
.install-steps { margin: .4rem 0 0; padding-left: 1.2rem; }
.install-steps + p { margin-top: .6rem; }

/* ---------- Clan-Verifizierung ---------- */
.verify-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .4rem; font-size: .9rem; }
.verify-line .verified { width: 18px; height: 18px; flex: none; }
.operator-card { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.operator-card .btn .verified { width: 16px; height: 16px; }
label.check .verified { width: 15px; height: 15px; }
.clan-item-name { display: flex !important; align-items: center; gap: .3rem; min-width: 0; }
.clan-item-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clan-item-name .verified { width: 15px; height: 15px; flex: none; }
.chat-title .verified { width: 16px; height: 16px; }

/* ---------- Impressum & Datenschutz ---------- */
.legal-links { margin-top: auto; padding: 1rem; font-size: .8rem; color: var(--muted); }
.legal-links a { color: var(--muted); }
.legal-text h2 { margin-top: 1.2rem; }
.legal-text h3 { margin: 1rem 0 .3rem; font-size: 1rem; }
.legal-text p, .legal-text li { line-height: 1.6; }
label.check.consent { align-items: flex-start; gap: .5rem; font-size: .88rem; }
label.check.consent input { margin-top: .25rem; }
