:root {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1f2330;
  --surface-3: #282d3c;
  --border: #2c3243;
  --text: #e9e6df;
  --muted: #979eae;
  --accent: #e0b24f;
  --accent-2: #f0c96b;
  --accent-ink: #1d1503;
  --danger: #e2585b;
  --ok: #4fbf7a;
  --warn: #e3a13a;
  --tank: #6a9bf4;
  --healer: #4fcf86;
  --dps: #ec6a5e;
  --raid: #ff8a3d;
  --mplus: #3fc7b0;
  --other: #9aa3b8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #23283a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
svg { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: calc(.6rem + var(--safe-top)) 1rem .6rem;
  background: rgba(15, 17, 23, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem; border-radius: 999px; color: var(--muted); font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.nav svg { width: 18px; height: 18px; }

main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

@media (max-width: 799px) {
  /* backdrop-filter würde die fixierte Bottom-Nav in der Kopfzeile "einfangen" */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #12141b; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    justify-content: space-around; gap: 0;
    padding: .35rem .25rem calc(.35rem + var(--safe-bottom));
    background: rgba(18, 20, 27, .95);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .nav a { flex-direction: column; gap: .1rem; padding: .35rem .1rem; font-size: .68rem; border-radius: 10px; flex: 1 1 0; min-width: 0; max-width: 90px; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a.active { background: none; color: var(--accent); }
  .nav svg { width: 22px; height: 22px; }
  .nav .nav-admin { display: none; }
  main { padding-bottom: calc(var(--nav-h) + 2rem + var(--safe-bottom)); }
  h1 { font-size: 1.4rem; }
}

.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.splash img { width: 72px; height: 72px; border-radius: 16px; }
.loading { display: grid; place-items: center; padding: 4rem 0; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Karten & Überschriften ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, #151821 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.section-title { margin: 1.5rem 0 .75rem; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.link { font-size: .9rem; }
.back { display: inline-block; margin-bottom: .75rem; color: var(--muted); }
.error-card { border-color: var(--danger); }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.dash-grid > .card { margin: 0; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 3fr 2fr; align-items: start; } }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; margin-bottom: 1rem;
  background: linear-gradient(90deg, rgba(224, 178, 79, .14), rgba(224, 178, 79, .04));
  border: 1px solid rgba(224, 178, 79, .35); border-radius: var(--radius);
}
.callout p { margin: .15rem 0 0; }
.callout.warn { background: linear-gradient(90deg, rgba(255, 138, 61, .14), rgba(255, 138, 61, .04)); border-color: rgba(255, 138, 61, .4); }

/* ---------- Buttons & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .5rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger-outline { background: transparent; border-color: rgba(226, 88, 91, .6); color: #ff8e90; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; }
.btn.icon { width: 40px; padding: 0; font-size: 1.3rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.btn-row:empty { display: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .35rem .5rem; border-radius: 8px; }
.icon-btn:hover { color: var(--danger); background: var(--surface-3); }

.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); font-weight: 500; min-width: 0; }
.row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.row > * { min-width: 0; }
input, select, textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 42px; padding: .55rem .7rem;
  background: #10131a; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; /* verhindert Zoom auf iOS */
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(224, 178, 79, .5); outline-offset: 1px; border-color: var(--accent); }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
/* Versteckte Eingaben für eigene Schalter/Segmente – dürfen keine Breite erzeugen */
.seg-item input, .switch input, .main-pick input {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0;
  opacity: 0; pointer-events: none;
}
.check { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: .5rem !important; color: var(--text) !important; cursor: pointer; }

.seg { display: flex; background: #10131a; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg-item { flex: 1; display: block !important; cursor: pointer; position: relative; min-width: 0; }
.seg-item span { display: block; text-align: center; padding: .5rem; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg-item input:checked + span { background: var(--surface-3); color: var(--text); }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); }

.switch { display: flex !important; grid-auto-flow: column; align-items: center; gap: .75rem !important; color: var(--text) !important; font-size: .95rem !important; cursor: pointer; padding: .35rem 0; position: relative; }
.switch span { position: relative; flex: none; width: 44px; height: 26px; background: var(--surface-3); border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); }
.toggles { display: grid; gap: .25rem; margin-top: .75rem; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: .5rem 0 1.25rem; text-align: center; }
.auth-brand img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; background: #10131a; padding: 3px; border-radius: var(--radius-sm); }
.tab { flex: 1; padding: .55rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; border-radius: 7px; cursor: pointer; }
.tab.active { background: var(--surface-3); color: var(--text); }

/* ---------- Badges, Rollen, Charaktere ---------- */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: .75rem; font-weight: 600; }
.badge.type-raid { background: rgba(255, 138, 61, .18); color: var(--raid); }
.badge.type-mplus { background: rgba(63, 199, 176, .18); color: var(--mplus); }
.badge.type-other { background: rgba(154, 163, 184, .18); color: var(--other); }
.role-badge { background: rgba(224, 178, 79, .18); color: var(--accent); }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }

.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-confirmed { background: rgba(79, 191, 122, .18); color: var(--ok); }
.st-tentative { background: rgba(227, 161, 58, .18); color: var(--warn); }
.st-bench { background: rgba(106, 155, 244, .18); color: var(--tank); }
.st-declined { background: rgba(226, 88, 91, .18); color: var(--danger); }

.role-icon { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 6px; flex: none; }
.role-icon svg { width: .95em; height: .95em; }
.role-tank { color: var(--tank); background: rgba(106, 155, 244, .14); }
.role-healer { color: var(--healer); background: rgba(79, 207, 134, .14); }
.role-dps { color: var(--dps); background: rgba(236, 106, 94, .14); }

.char { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .45rem; min-width: 0; }
.char-name { color: var(--cc); font-weight: 700; }
.char-spec { color: var(--muted); font-size: .8rem; }
.char-ilvl { font-size: .72rem; font-weight: 700; color: var(--accent); background: rgba(224, 178, 79, .12); padding: 0 .35rem; border-radius: 5px; }
.star { color: var(--accent); font-size: .8rem; font-weight: 700; }

.comp { display: inline-flex; align-items: center; gap: .25rem; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.comp .role-icon { margin-left: .15rem; }
.comp.big { font-size: 1rem; }
.count { display: inline-block; min-width: 1.5em; padding: 0 .4rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .75rem; text-align: center; }

/* ---------- Terminliste ---------- */
.event-list { display: grid; gap: .5rem; }
.event-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem .75rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--other);
  color: var(--text); transition: background .15s, transform .1s;
}
.event-item:hover { background: var(--surface-3); }
.event-item.type-raid { border-left-color: var(--raid); }
.event-item.type-mplus { border-left-color: var(--mplus); }
.event-item.past { opacity: .55; }
.ev-date { display: grid; justify-items: center; min-width: 2.6rem; line-height: 1.1; }
.ev-day { font-size: 1.35rem; font-weight: 800; }
.ev-wd { font-size: .72rem; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.ev-body { flex: 1; min-width: 0; }
.ev-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-meta { font-size: .8rem; color: var(--muted); }
.ev-side { display: grid; justify-items: end; gap: .3rem; }
@media (max-width: 520px) {
  .event-item { flex-wrap: wrap; }
  .ev-side { width: 100%; display: flex; justify-content: space-between; padding-left: 3.4rem; }
}

/* ---------- Kalender ---------- */
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays span { padding: .5rem; text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; background: var(--surface-2); }
.day {
  min-height: 104px; padding: .35rem; text-align: left; vertical-align: top;
  display: flex; flex-direction: column; gap: .2rem;
  background: transparent; color: var(--text); font: inherit;
  border: 0; border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  cursor: pointer; min-width: 0;
}
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--surface-2); }
.day.outside { color: #5c6274; background: rgba(0, 0, 0, .15); }
.day .num { font-size: .85rem; font-weight: 700; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; }
.day.today .num { background: var(--accent); color: var(--accent-ink); }
.day.selected { background: rgba(224, 178, 79, .1); box-shadow: inset 0 0 0 2px var(--accent); }
.day-evs { display: grid; gap: 2px; min-width: 0; }
.cal-ev {
  display: block; font-size: .72rem; padding: 1px 5px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(154, 163, 184, .2); color: var(--text); border-left: 3px solid var(--other);
}
.cal-ev.type-raid { background: rgba(255, 138, 61, .18); border-left-color: var(--raid); }
.cal-ev.type-mplus { background: rgba(63, 199, 176, .18); border-left-color: var(--mplus); }
.cal-ev.mine { box-shadow: inset 0 0 0 1px rgba(79, 191, 122, .7); }
.more { font-size: .7rem; color: var(--muted); padding-left: 4px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 1rem; font-size: .8rem; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--other); }
.lg.type-raid { background: var(--raid); }
.lg.type-mplus { background: var(--mplus); }

@media (max-width: 700px) {
  .day { min-height: 54px; align-items: center; padding: .25rem .1rem; }
  .day-evs { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-ev { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--other); }
  .cal-ev.type-raid { background: var(--raid); }
  .cal-ev.type-mplus { background: var(--mplus); }
  .cal-ev.mine { box-shadow: 0 0 0 2px rgba(79, 191, 122, .8); }
  .more { display: none; }
}

/* ---------- Termin-Details ---------- */
.event-head { border-top: 4px solid var(--other); }
.event-head.type-raid { border-top-color: var(--raid); }
.event-head.type-mplus { border-top-color: var(--mplus); }
.event-head h1 { margin-bottom: .25rem; }
.when { font-weight: 600; color: var(--accent); margin: 0 0 .5rem; }
.desc { white-space: pre-wrap; color: #cfcbc2; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: .5rem; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: inherit; }
.roles-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: .75rem; }
.role-col { background: var(--surface-2); border-radius: var(--radius-sm); padding: .65rem; border: 1px solid var(--border); }
.role-col h3 { display: flex; align-items: center; gap: .4rem; font-size: .95rem; }
.sub { margin-top: 1.1rem; display: flex; align-items: center; gap: .4rem; font-size: .95rem; }
.signup-list { display: grid; gap: .35rem; }
.signup-row { display: flex; align-items: center; gap: .55rem; padding: .35rem 0; border-bottom: 1px solid rgba(44, 50, 67, .6); }
.signup-row:last-child { border-bottom: 0; }
.signup-main { flex: 1; min-width: 0; display: grid; }
.note { font-style: italic; }
.status-select { width: auto; min-height: 32px; padding: .2rem .4rem; font-size: .8rem; }
.class-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.class-tag { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; color: var(--cc); border: 1px solid var(--cc); background: rgba(0, 0, 0, .2); }

/* ---------- M+ Gruppen ---------- */
.group-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.group-grid .card { margin: 0; }
.slots { display: grid; gap: .4rem; }
.slot { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); min-height: 52px; }
.slot.empty { border-style: dashed; background: transparent; }
.slot-main { flex: 1; min-width: 0; display: grid; }
.take-form { margin-top: .75rem; padding: .75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--accent); }
.edit-form { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.create-group summary { cursor: pointer; list-style: none; }
.create-group summary::-webkit-details-marker { display: none; }
.create-group[open] summary { margin-bottom: .75rem; }
.group-mini { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .75rem; margin-bottom: .5rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.slot-dots { display: flex; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; background: transparent !important; }
.dot.filled { background: currentColor !important; }
.dot.role-tank { color: var(--tank); }
.dot.role-healer { color: var(--healer); }
.dot.role-dps { color: var(--dps); }

/* ---------- Raidkader ---------- */
.callout.kader { background: linear-gradient(90deg, rgba(120, 150, 200, .18), rgba(120, 150, 200, .04)); border-color: rgba(140, 170, 220, .45); color: var(--text); }
a.callout { color: var(--text); }
.kader-round .when { margin-bottom: .25rem; }
.round-select { display: grid; gap: .3rem; max-width: 420px; margin-bottom: 1rem; font-size: .85rem; color: var(--muted); }
.kader-entries { display: grid; gap: .75rem; }
.kader-entry {
  padding: .75rem .85rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--cc);
}
.kader-entry.is-main { box-shadow: inset 0 0 0 1px rgba(224, 178, 79, .45); }
.kentry-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.main-pick { display: inline-flex !important; align-items: center; cursor: pointer; position: relative; }
.main-pick span { padding: .25rem .65rem; border-radius: 999px; font-weight: 700; font-size: .8rem; color: var(--muted); border: 1px dashed var(--border); }
.main-pick input:checked + span { color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.main-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.quick-char { width: auto; flex: 1; min-width: 200px; }
.kentries { display: grid; gap: .35rem; }
.kentry { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; padding: .4rem .6rem; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.kentry .char { min-width: 8rem; }
.kspecs { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-left: auto; font-size: .85rem; }
.kspec { display: inline-flex; align-items: center; gap: .3rem; }
.kspec.secondary { color: var(--muted); }
.star.dim { color: #5c6274; }
.kader-badge { display: inline-flex; align-items: center; gap: .3rem; background: rgba(0, 0, 0, .25); color: var(--cc); border: 1px solid var(--cc); }
.kader-badge .role-icon { width: 1.2em; height: 1.2em; }
.kapp-list { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.kapp { margin: 0; }
.kapp h3 { margin: 0; }
.kdecide { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.kstats { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kstats th, .kstats td { padding: .4rem .3rem; text-align: center; border-bottom: 1px solid var(--border); }
.kstats th:first-child, .kstats td:first-child { text-align: left; }
.kstats th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.filter-seg { min-width: min(100%, 420px); }
.filter-seg .seg-item span { padding: .4rem .3rem; font-size: .8rem; }
.inline-details { margin-top: .5rem; }
.inline-details > summary { list-style: none; display: inline-flex; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > summary { margin-bottom: .75rem; }

/* ---------- Gilde ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.stat { display: grid; justify-items: center; gap: .15rem; padding: .6rem .25rem; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.stat-n { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-l { font-size: .75rem; color: var(--muted); }
.class-bars { display: grid; gap: .3rem; }
.class-bar { display: grid; grid-template-columns: 7.5rem 1fr 2rem; align-items: center; gap: .5rem; font-size: .85rem; }
.cb-name { color: var(--cc); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.cb-track span { display: block; height: 100%; background: var(--cc); border-radius: inherit; }
.cb-n { text-align: right; color: var(--muted); }
.filters { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: center; margin-bottom: 1rem; }
.member-list { display: grid; gap: .5rem; }
.member { padding: .65rem .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.member-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.member-chars { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.member-char { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Profil ---------- */
.char-list { display: grid; gap: .4rem; margin-bottom: 1rem; }
.char-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); flex-wrap: wrap; }
.char-row-main { flex: 1; min-width: 140px; display: grid; }
.char-form { padding-top: 1rem; border-top: 1px solid var(--border); }
.char-form h3 { margin: 0; }

/* ---------- Admin ---------- */
.admin-list { display: grid; gap: .5rem; }
.admin-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-main { flex: 1; min-width: 180px; display: grid; }
.admin-row select { width: auto; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 1rem + var(--safe-bottom)); z-index: 100; display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 800px) { #toasts { bottom: 1.5rem; } }
.toast { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; animation: fade .2s ease-out; transition: opacity .4s, transform .4s; }
.toast.ok { border-color: var(--ok); }
.toast.error { border-color: var(--danger); background: #3a1d22; }
.toast.hide { opacity: 0; transform: translateY(8px); }
