/* =====================================================================
   App „Rollen & Ränge“ (Discord-Stil)
   ===================================================================== */
.rr-wrap { height: 100%; display: flex; flex-direction: column; padding: 14px 0 0; }
.rr-wrap > .tabs-wrap { display: flex; flex-direction: column; height: 100%; }
.rr-wrap > .tabs-wrap > .tabs { margin: 0 24px; }
.rr-wrap > .tabs-wrap > .tab-content { flex: 1; min-height: 0; }
.rr-wrap > .tabs-wrap > .tab-content > .tab-panel { height: 100%; }
.rr-split { height: 100%; }
.rr-split .split-list { width: 310px; }
.rr-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rr-list-head .btn { white-space: nowrap; flex: none; }
.rr-detail input[type="color"] { width: 60px; height: 36px; padding: 2px; cursor: pointer; }
.rr-list { flex: 1; overflow-y: auto; padding: 8px 8px 14px; }
.rr-empty { padding: 14px 8px; }
.rr-role {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 14px;
  text-align: left; cursor: pointer;
}
.rr-role:hover { background: var(--hover); }
.rr-role.selected { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.rr-role.dragging { opacity: .4; }
.rr-role.drop-target { box-shadow: 0 -2px 0 var(--text) inset; }
.rr-role.locked { opacity: .7; }
.rr-handle { color: var(--text-faint); width: 14px; letter-spacing: -2px; cursor: grab; flex: none; }
.rr-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--line-strong); }
.rr-dot.big { width: 18px; height: 18px; }
.rr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-count { display: inline-flex; align-items: center; gap: 2px; color: var(--text-dim); font-size: 12px; }
.rr-lock { color: var(--text-dim); display: inline-flex; }

.rr-detail { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 28px 90px; position: relative; }
.rr-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.rr-detail-head h2 { margin: 0; font-size: 22px; flex: 1; }

.rr-swatches { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rr-swatches input[type="color"] { width: 46px; height: 34px; padding: 2px; }
.rr-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.rr-swatch:hover { box-shadow: 0 0 0 2px var(--text); }

.rr-perm-group { margin-bottom: 22px; }
.rr-perm-group h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 4px; }
.rr-perm {
  display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.rr-perm.disabled { cursor: default; }
.rr-perm.disabled .rr-perm-text strong { color: var(--text-dim); }
.rr-perm-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rr-perm-text strong { font-weight: 600; }
.rr-perm.danger strong { color: var(--danger); }
.rr-hint { color: var(--warn); }

/* Schalter */
input.switch {
  appearance: none; -webkit-appearance: none; width: 42px; height: 24px; flex: none; padding: 0;
  border-radius: 999px; background: var(--line-strong); border: none; position: relative; cursor: pointer; transition: background .15s;
  box-shadow: none;
}
input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); background: var(--accent-fg); }
input.switch:disabled { opacity: .4; cursor: not-allowed; }
input.switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.rr-members { display: flex; flex-direction: column; gap: 4px; }
.rr-member { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; }
.rr-member:hover { background: var(--hover); }
.start-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 14px; background: var(--accent); color: var(--accent-fg);
}
.start-avatar.sm { width: 32px; height: 32px; font-size: 12px; }

.rr-savebar {
  position: sticky; bottom: 12px; margin-top: 20px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px;
  background: var(--accent); color: var(--accent-fg); border-radius: 999px; box-shadow: var(--shadow);
}
.rr-savebar span { flex: 1; }
.rr-savebar .btn { background: transparent; color: var(--accent-fg); border-color: transparent; }
.rr-savebar .btn:hover { background: rgba(127, 127, 127, .2); }
.rr-savebar .btn-primary { background: var(--accent-fg); color: var(--accent); border-color: var(--accent-fg); }
.rr-savebar .btn-primary:hover { background: var(--accent-fg); opacity: .88; }
.rr-savebar[hidden] { display: none; }
.rr-detail .tabs { margin-top: 0; }

.role-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.role-chip .rr-dot { width: 9px; height: 9px; }
.check .rr-dot { width: 10px; height: 10px; display: inline-block; }

@container (max-width: 680px) {
  .rr-split .split-list { width: 100%; }
  .rr-detail { padding: 18px 18px 90px; }
}
