/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #151922;
  --muted: #667085;
  --accent: #5865f2;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-contrast: #ffffff;
  --ok: #12a150;
  --warn: #c98200;
  --danger: #d92d3a;
  --ok-soft: color-mix(in srgb, var(--ok) 14%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 13%, transparent);
  --sidebar: #12151c;
  --sidebar-text: #aab2c0;
  --sidebar-active: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.18);
  --radius: 12px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  color-scheme: light;
}
:root[data-panel="22"] { --accent: #0d9488; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #161a21; --surface-2: #1d222b; --border: #272d38;
    --text: #eceff5; --muted: #98a2b3; --accent-contrast: #ffffff;
    --ok: #3ec27a; --warn: #e0a928; --danger: #f0616b;
    --sidebar: #0a0c10; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
  :root[data-panel="22"]:not([data-theme="light"]) { --accent: #2dd4bf; --accent-contrast: #04211e; }
  :root[data-panel="mf"]:not([data-theme="light"]) { --accent: #7983f5; }
}
:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #161a21; --surface-2: #1d222b; --border: #272d38;
  --text: #eceff5; --muted: #98a2b3; --accent-contrast: #ffffff;
  --ok: #3ec27a; --warn: #e0a928; --danger: #f0616b;
  --sidebar: #0a0c10; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
:root[data-theme="dark"][data-panel="22"] { --accent: #2dd4bf; --accent-contrast: #04211e; }
:root[data-theme="dark"][data-panel="mf"] { --accent: #7983f5; }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(60% 50% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(50% 40% at 90% 90%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px; text-align: center; box-shadow: var(--shadow-lg); display: grid; gap: 14px;
}
.logo {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast);
}
.logo svg.i { width: 26px; height: 26px; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column;
  padding: 16px 12px; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; margin: 0; }
.brand .logo svg.i { width: 18px; height: 18px; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--sidebar-text); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: inherit;
  text-decoration: none; font-weight: 500; transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--sidebar-active); }
.nav a.active svg.i { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, 0.1); color: #fff; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.user { display: flex; align-items: center; gap: 10px; padding: 0 4px; color: #fff; min-width: 0; }
.user b { display: block; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user span { font-size: 11.5px; color: var(--sidebar-text); }
.foot-actions { display: flex; gap: 6px; }
.foot-actions .btn { flex: 1; background: rgba(255, 255, 255, 0.06); border-color: transparent; color: #d7dce6; }
.foot-actions .btn:hover { background: rgba(255, 255, 255, 0.12); }
.topbar { display: none; }
.scrim { display: none; }
.content { min-width: 0; padding: 28px 32px 64px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; align-content: start; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.tile { padding: 16px 18px; display: grid; gap: 4px; }
.tile .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tile .value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.tile .sub { color: var(--muted); font-size: 12px; }
.tile .label svg.i { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); background: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 8px; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field { display: grid; gap: 6px; font-weight: 550; font-size: 13px; }
.field > .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.form { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 600; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 550; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ status */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ok .dot { animation: pulse 2s ease-in-out infinite; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.checks li:last-child { border-bottom: 0; }
.checks .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.checks .ic svg.i { width: 13px; height: 13px; stroke-width: 3; }
.checks .ok .ic { background: var(--ok-soft); color: var(--ok); }
.checks .bad .ic { background: var(--warn-soft); color: var(--warn); }
.checks b { font-weight: 550; display: block; }

/* ------------------------------------------------------------------ lists / table */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; object-fit: cover; overflow: hidden; }
.avatar.lg { width: 40px; height: 40px; }
.avatar.sq { border-radius: 9px; }
.sidebar .avatar { background: rgba(255, 255, 255, 0.1); color: #fff; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.people li:last-child { border-bottom: 0; }
.people .who { min-width: 0; flex: 1; }
.people .who b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .who span { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty svg.i { width: 28px; height: 28px; opacity: .6; }
.empty b { color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .body { min-width: 0; flex: 1; }
.timeline .body b { font-weight: 600; }
.timeline .detail { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.timeline time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.picker { position: relative; }
.picker-list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; padding: 4px; }
.picker-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.picker-list button:hover, .picker-list button:focus-visible { background: var(--surface-2); }
.picker-list small { color: var(--muted); font-family: var(--mono); }
.chosen { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.chosen .grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ logs */
.logs { background: #0b0d12; color: #d6dbe6; font: 12px/1.6 var(--mono); padding: 14px 16px; border-radius: 0 0 var(--radius) var(--radius); height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.logs .ln { display: block; }
.logs .ln.warn { color: #f0c05a; }
.logs .ln.err { color: #ff7b86; }
.logs .ln.dim { color: #7c8596; }
.logs mark { background: #5b4b00; color: #fff; border-radius: 3px; }

/* ------------------------------------------------------------------ messages */
.discord-msg { display: flex; gap: 12px; background: #313338; color: #dbdee1; padding: 14px 16px; border-radius: 10px; font-family: "gg sans", "Segoe UI", system-ui, sans-serif; }
.discord-msg .avatar { width: 40px; height: 40px; background: #5865f2; color: #fff; }
.discord-msg .name { font-weight: 600; color: #fff; }
.discord-msg .tag { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; font-weight: 600; }
.discord-msg .text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; min-height: 22px; }
.discord-msg .text.ph { color: #80848e; font-style: italic; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); }

/* ------------------------------------------------------------------ stats config */
.group-title { padding: 12px 18px 4px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 8px 18px 18px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.toggle:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.toggle.on { border-color: var(--accent); background: var(--accent-soft); }
.counter-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.counter-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-weight: 500; }
.counter-list svg.i { width: 16px; height: 16px; color: var(--muted); }
.savebar { position: sticky; bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); margin-top: 16px; flex-wrap: wrap; }
.savebar .btn.ghost { color: inherit; }

/* ------------------------------------------------------------------ overlay */
.modal-back { position: fixed; inset: 0; background: rgba(8, 10, 14, 0.55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-lg); display: grid; gap: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal pre { margin: 0; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; font: inherit; max-height: 160px; overflow: auto; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 60; max-width: calc(100vw - 36px); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: rise .18s; max-width: 380px; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok svg.i { color: var(--ok); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-tile { height: 92px; border-radius: var(--radius); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .sidebar { transform: none; }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 15; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .topbar b { font-size: 15px; }
  .content { padding: 20px 16px 56px; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cols-4 { grid-template-columns: 1fr 1fr; }
  .tile .value { font-size: 20px; }
  .toasts { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-size: 13.5px; }
.callout > svg.i { margin-top: 2px; }
.callout p { margin-top: 6px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.callout.warn > svg.i, .callout.warn b:first-child { color: var(--warn); }
.discord-msg .sig { font-size: 12px; color: #949ba4; margin-top: 4px; }
.embed-prev { border-left: 4px solid #5865f2; background: #2b2d31; border-radius: 4px; padding: 10px 12px; margin-top: 6px; display: grid; gap: 6px; word-break: break-word; }
.embed-prev .btn-prev { display: inline-block; justify-self: start; background: #5865f2; color: #fff; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.perm-section { margin-bottom: 24px; }
.perm-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px 2px; }
.acc { display: grid; gap: 8px; }
.acc details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.acc details[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.acc summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-radius: var(--radius); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: var(--surface-2); }
.acc summary .chev { transition: transform .15s; color: var(--muted); }
.acc details[open] > summary .chev { transform: rotate(90deg); }
.acc summary code { font-size: 13px; padding: 2px 8px; }
.acc summary .grow { flex: 1; min-width: 0; }
.acc-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.acc-body p { margin-top: 10px; }
.acc-body .toggles { padding: 0; }
@media (max-width: 600px) { .acc summary .grow { display: none; } }
/* Roulette verticale : les longues listes (rôles) défilent dans leur cadre */
.scroll-list { max-height: 260px; overflow-y: auto; padding: 4px 6px 4px 0 !important; grid-template-columns: 1fr !important; scrollbar-width: thin; }
.tabs-seg { margin-bottom: 16px; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.tabs-seg button { white-space: nowrap; }
.mod-panel { max-width: 820px; }
.perm-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.perm-list { max-height: calc(100vh - 260px); min-height: 320px; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.perm-group + .perm-group { margin-top: 14px; }
.perm-list .perm-title { padding: 6px 10px 4px; margin: 0; position: sticky; top: -8px; background: var(--surface); z-index: 1; }
.perm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.perm-item:hover { background: var(--surface-2); }
.perm-item.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.perm-item code { font-size: 13px; }
.perm-item .grow { flex: 1; }
.perm-detail { position: sticky; top: 16px; }
@media (max-width: 900px) { .perm-layout { grid-template-columns: 1fr; } .perm-list { max-height: 320px; } .perm-detail { position: static; } }
button.toggle { font: inherit; color: var(--text); text-align: left; width: 100%; }

/* ================================================================== polish : look & confort d'usage */
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, 0.2);
}
:root[data-panel="22"] { --accent: #0f9d8a; --accent-2: #3b82f6; }
:root[data-panel="mf"] { --accent-2: #8b5cf6; }
@media (prefers-color-scheme: dark) {
  :root[data-panel="22"]:not([data-theme="light"]) { --accent: #2dd4bf; --accent-2: #60a5fa; }
  :root:not([data-theme="light"]) { --bg: #0b0e13; --surface: #131820; --surface-2: #1a2029; --border: #242b36; --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25); }
}
:root[data-theme="dark"] { --bg: #0b0e13; --surface: #131820; --surface-2: #1a2029; --border: #242b36; --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25); }
:root[data-theme="dark"][data-panel="22"] { --accent: #2dd4bf; --accent-2: #60a5fa; }

body {
  background:
    radial-gradient(1000px 420px at 88% -8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    radial-gradient(700px 380px at 0% 100%, color-mix(in srgb, var(--accent-2, var(--accent)) 7%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
html { scroll-behavior: smooth; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* Roulettes discrètes partout */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 38%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); background-clip: padding-box; border: 3px solid transparent; }

/* ---- barre latérale */
.shell { transition: grid-template-columns .22s var(--ease); }
.sidebar {
  background:
    radial-gradient(260px 200px at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    linear-gradient(180deg, #111925, #0a0f16);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.brand { align-items: center; padding: 4px 4px 16px; }
.brand .grow { flex: 1; min-width: 0; }
.brand .logo { background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent))); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 38%, transparent); }
.mini-toggle { color: var(--sidebar-text); padding: 6px; }
.mini-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav { flex: 1; min-height: 0; overflow-y: auto; align-content: start; gap: 2px; padding-right: 2px; margin-right: -2px; }
.nav-label { font-size: 10.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: #5f6b7c; padding: 16px 12px 6px; white-space: nowrap; }
.nav-label:first-child { padding-top: 4px; }
.nav a { position: relative; padding: 9px 12px; border-radius: 10px; white-space: nowrap; }
.nav a svg.i { transition: transform .18s var(--ease); }
.nav a:hover svg.i { transform: scale(1.1); }
.nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); }
.sidebar-foot { margin-top: 12px; }
.foot-actions .btn { border-radius: 10px; }

@media (min-width: 821px) {
  .shell.mini { grid-template-columns: 76px minmax(0, 1fr); }
  .shell.mini .sidebar { padding: 16px 10px; }
  .shell.mini .brand { flex-direction: column; gap: 10px; padding-bottom: 12px; }
  .shell.mini .brand .grow, .shell.mini .nav .lbl, .shell.mini .user > div { display: none; }
  .shell.mini .nav-label { font-size: 0; padding: 0; height: 1px; margin: 10px 10px; background: rgba(255, 255, 255, 0.08); }
  .shell.mini .nav a { justify-content: center; padding: 11px 0; }
  .shell.mini .nav a.active::before { left: -10px; }
  .shell.mini .user { justify-content: center; padding: 0; }
  .shell.mini .foot-actions { flex-direction: column; }
  .shell.mini .foot-actions .btn { font-size: 0; gap: 0; padding: 9px 0; }
}
@media (max-width: 820px) { .mini-toggle { display: none; } }

/* ---- contenu */
.content { padding: 32px 36px 72px; }
.page-head { margin-bottom: 26px; align-items: center; }
.page-head h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.025em; }
.page-head h1::after { content: ""; display: block; width: 34px; height: 3px; border-radius: 3px; margin-top: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); }
.page-head p { margin-top: 8px; max-width: 70ch; }
#view > * { animation: enter .38s var(--ease) both; }
#view > *:nth-child(2) { animation-delay: .05s; }
#view > *:nth-child(3) { animation-delay: .1s; }
#view > *:nth-child(n+4) { animation-delay: .14s; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* ---- cartes repliables */
.card { border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .25s var(--ease), border-color .25s; }
.card-head { padding: 16px 20px; flex-wrap: nowrap; }
.card-head > div:not(.ch-title) { flex: none; }
.card-head .ch-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.card-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.005em; }
.card.collapsible > .card-head { border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; user-select: none; transition: background .15s; }
.card.collapsible > .card-head:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.card-head .chev { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); color: var(--muted); flex: none; transform: rotate(90deg); transition: transform .22s var(--ease), background .15s, color .15s; }
.card-head .chev svg.i { width: 15px; height: 15px; }
.card.collapsible > .card-head:hover .chev { background: var(--accent-soft); color: var(--accent); }
.card.collapsed .chev { transform: rotate(0deg); }
.card.collapsed > .card-head { border-bottom-color: transparent; border-radius: var(--radius); }
.card.collapsed > .card-body { display: none; }
.card-body { padding: 20px; animation: fade .2s; }
.card-body.flush { padding: 0; }
.collapse-all { color: var(--muted); }

/* ---- tuiles de la vue d'ensemble */
.tile { position: relative; overflow: hidden; padding: 18px 20px; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 14%, transparent), transparent); pointer-events: none; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.tile .label svg.i { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.tile .value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }

/* ---- contrôles */
.btn { border-radius: 10px; padding: 9px 16px; box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04); transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s, filter .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn.sm { padding: 6px 11px; border-radius: 9px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--accent-2, var(--accent)))); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn.danger { box-shadow: 0 6px 16px color-mix(in srgb, var(--danger) 25%, transparent); }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
input, select, textarea { border-radius: 10px; padding: 10px 13px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="checkbox"] { width: auto; }
select { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
.field { gap: 7px; }
.seg { border-radius: 12px; padding: 4px; }
.seg button { border-radius: 9px; padding: 7px 14px; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover:not(.on) { color: var(--text); }
.seg button.on { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 2px 8px rgba(16, 24, 40, 0.06); }
.tabs-seg { position: sticky; top: 10px; z-index: 6; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface-2) 85%, transparent); border: 1px solid var(--border); }
.switch { width: 42px; height: 24px; }
.switch i::after { top: 3px; left: 3px; width: 18px; height: 18px; transition: transform .2s var(--ease); }
.switch input:checked + i::after { transform: translateX(18px); }
.toggle { border-radius: 12px; padding: 11px 14px; }
.toggle.on { box-shadow: inset 0 0 0 1px var(--accent); }
.pill, .badge { letter-spacing: .005em; }

/* ---- listes, tables, fil d'activité */
.people li, .timeline li { transition: background .15s; }
.people li:hover, .timeline li:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.avatar { box-shadow: 0 0 0 2px var(--surface); }
.empty { padding: 44px 18px; }
.empty svg.i { width: 34px; height: 34px; padding: 8px; box-sizing: content-box; border-radius: 50%; background: var(--surface-2); opacity: 1; }
.picker-list { border-radius: 12px; }

/* ---- menus dépliants dans les formulaires (ex. rôles d'une réaction) */
.field > details, .form > details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.field > details > summary, .form > details > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-weight: 550; display: flex; align-items: center; gap: 8px; border-radius: 12px; }
.field > details > summary::-webkit-details-marker, .form > details > summary::-webkit-details-marker { display: none; }
.field > details > summary::before, .form > details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .18s var(--ease); margin-right: 4px; }
.field > details[open] > summary::before, .form > details[open] > summary::before { transform: rotate(45deg); }
.field > details[open] > summary, .form > details[open] > summary { border-bottom: 1px solid var(--border); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.field > details > .toggles, .form > details > .toggles { margin: 10px 8px 4px; padding: 4px 6px 4px 0; }
.field > details > .muted { display: block; padding: 0 14px 12px; }

/* ---- barre d'enregistrement, fenêtres, notifications */
.savebar { border-radius: 14px; padding: 12px 18px; bottom: 18px; backdrop-filter: blur(10px); animation: enter .25s var(--ease); }
.modal { border-radius: 18px; animation: enter .2s var(--ease); }
.modal-back { backdrop-filter: blur(3px); }
.toast { border-radius: 12px; }

/* ---- bouton « haut de page » */
.to-top { position: fixed; right: 22px; bottom: 84px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease), background .15s; z-index: 30; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }

/* ---- connexion */
.login-card { border-radius: 22px; padding: 38px 30px; }
.logo { background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent))); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }

@media (max-width: 820px) {
  .content { padding: 22px 16px 64px; }
  .topbar { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
  .tabs-seg { top: 62px; }
  .page-head h1 { font-size: 23px; }
  .to-top { right: 16px; bottom: 76px; }
}
@media (max-width: 520px) { .card-head { padding: 14px 16px; } .card-body { padding: 16px; } }

/* ---- petits écrans : rien ne doit dépasser */
.card, .stack, .grid > *, #view, .content { min-width: 0; }
.people .who span { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .card-head { flex-wrap: wrap; }
  .card-head .ch-title { flex: 1 1 220px; }
  .people li { flex-wrap: wrap; }
  .people li .who { flex: 1 1 100%; }
  .page-head { align-items: flex-start; }
}

/* ---- sanctions par personne */
.sanc-split { grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr); }
.person-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.person-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.person-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.people-pick li { cursor: pointer; }
.people-pick li.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.people-pick { max-height: 520px; overflow-y: auto; }
.act-group { display: grid; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--border); }
.act-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--accent); }
@media (max-width: 1000px) { .sanc-split { grid-template-columns: 1fr; } }

/* ---- ordre des compteurs (glisser-déposer) */
.counter-list li.sortable { cursor: grab; transition: background .15s, box-shadow .15s, opacity .15s; }
.counter-list li.sortable .grow { flex: 1; min-width: 0; }
.counter-list li.sortable .grip { color: var(--muted); font-size: 16px; line-height: 1; letter-spacing: -2px; }
.counter-list li.sortable .btn.icon { padding: 3px; }
.counter-list li.sortable .btn.icon svg.i { width: 15px; height: 15px; }
.counter-list li.sortable .btn.down svg.i { transform: rotate(180deg); }
.counter-list li.sortable.dragging { opacity: .45; }
.counter-list li.sortable.over { box-shadow: 0 -2px 0 var(--accent); background: var(--accent-soft); }

/* ---- mini-jeux */
.howto { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.howto li::marker { color: var(--accent); font-weight: 700; }
code.cmd { font-size: 12.5px; padding: 3px 9px; background: var(--accent-soft); color: var(--accent); border-radius: 8px; }

/* ---- cartes à collectionner */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card-tile { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card-tile:hover:not(.static) { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-tile.static { cursor: default; }
.card-tile.off { opacity: .55; }
.card-img { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--surface-2); aspect-ratio: 2 / 3; object-fit: cover; }
.tile-info { display: grid; gap: 3px; padding: 0 2px 2px; min-width: 0; }
.tile-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; align-items: start; }
.editor-side { display: grid; gap: 8px; justify-items: center; text-align: center; position: sticky; top: 16px; }
.editor-preview { max-width: 240px; box-shadow: var(--shadow-lg); }
.give-preview { display: grid; place-items: center; min-height: 150px; }
.give-preview .card-img { max-width: 180px; }
.theme-chip { display: inline-flex; align-items: center; gap: 8px; cursor: default; padding: 5px 6px 5px 11px; }
.theme-chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip-btn { border: 0; background: transparent; cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 6px; color: var(--muted); }
.chip-btn:hover { background: var(--surface); color: var(--text); }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; } .editor-side { position: static; order: -1; } }
.card .row > select { width: auto; min-width: 150px; flex: 0 1 190px; }

/* ---- profil du bot */
.profile-preview { background: #111214; color: #dbdee1; border-radius: 14px; overflow: hidden; font-family: "gg sans", "Segoe UI", system-ui, sans-serif; max-width: 340px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.pp-banner { height: 110px; background: linear-gradient(135deg, #5865f2, #3b82f6) center / cover; }
.pp-avatar-wrap { position: relative; width: 88px; height: 88px; margin: -44px 0 0 16px; }
.pp-avatar { width: 88px; height: 88px; border-radius: 50%; border: 6px solid #111214; object-fit: cover; background: #5865f2; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #fff; }
.pp-status { position: absolute; right: 2px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; border: 5px solid #111214; }
.pp-body { padding: 8px 16px 16px; display: grid; gap: 8px; }
.pp-name { font-size: 20px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.pp-name .tag { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; font-weight: 600; }
.pp-activity { font-size: 13px; color: #b5bac1; }
.pp-body hr { border: 0; border-top: 1px solid #2e3035; margin: 4px 0; width: 100%; }
.pp-title { font-size: 12px; color: #fff; }
.pp-bio { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.sticky-col { position: sticky; top: 16px; align-self: start; }
@media (max-width: 1000px) { .sticky-col { position: static; } }

/* Éditeur de recadrage des illustrations de cartes */
.crop-modal { max-width: 640px; }
.crop-stage { position: relative; line-height: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.crop-canvas { display: block; width: 100%; height: auto; aspect-ratio: 680 / 500; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-canvas.grabbing { cursor: grabbing; }
.crop-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  background:
    linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% + .5px), transparent calc(66.666% + .5px)); }
.crop-stage:hover .crop-grid, .crop-stage:focus-within .crop-grid { opacity: 1; }
.crop-tools { align-items: center; gap: 8px; }
.crop-zoom { flex: 1; min-width: 120px; accent-color: var(--accent); }
.crop-percent { min-width: 48px; text-align: right; }
/* Permissions : groupes dépliants (sanctions, salons, protection et logs, communauté, musique…) */
.perm-search { position: sticky; top: -8px; z-index: 2; padding: 0 0 10px; background: var(--surface); }
.perm-search input { width: 100%; }
.perm-list details.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 2px; background: var(--surface); }
.perm-list details.perm-group + details.perm-group { margin-top: 8px; }
.perm-list details.perm-group[open] { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.perm-group > summary { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; border-radius: 8px; font-weight: 600; list-style: none; user-select: none; }
.perm-group > summary::-webkit-details-marker { display: none; }
.perm-group > summary::after { content: ''; width: 7px; height: 7px; margin-left: 4px; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.perm-group[open] > summary::after { transform: rotate(45deg); }
.perm-group > summary:hover { background: var(--surface-2); }
.perm-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.perm-ico { width: 22px; text-align: center; flex: none; }
.perm-name { flex: 1; min-width: 0; }
.perm-count { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.perm-group > .perm-item { margin: 1px 0; }
