/* Thème « DJ Mia » : nuit violette, verre dépoli, accent orchidée (voir E:\THEME-DJ-MIA.md) */
:root {
  color-scheme: dark;
  --ink-950: #0b0616; --ink-900: #120a24; --ink-800: #1a1032; --ink-700: #241545; --ink-600: #2f1d58;
  --violet-500: #8b5cf6; --violet-400: #a78bfa; --violet-300: #c4b5fd; --orchid: #e879f9;
  --danger: #fb7185; --ok: #86efac;
  --text: #f5f0ff; --text-dim: #b3a5d6; --text-faint: #7d6ea3;
  --line: rgba(196, 181, 253, 0.14);
  --glass: rgba(26, 16, 50, 0.62); --glass-strong: rgba(18, 10, 36, 0.88);
  --radius-s: 8px; --radius-m: 14px; --radius-l: 22px;
  --topbar-h: 60px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink-950); color: var(--text); font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); height: 100dvh; overflow: hidden;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
a { color: var(--violet-300); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet-300); outline-offset: 2px; border-radius: 6px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.86em; color: var(--violet-300); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 600px at 18% -5%, rgba(139, 92, 246, 0.32), transparent 62%),
    radial-gradient(900px 500px at 100% 100%, rgba(232, 121, 249, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(11, 6, 22, 0.5), rgba(11, 6, 22, 0.92));
}

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 24px; height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 10, 36, 0.8), rgba(18, 10, 36, 0.4));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.1rem; font-weight: 750; letter-spacing: -0.01em; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px var(--violet-500), 0 0 18px rgba(139, 92, 246, 0.55); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--text-dim); font-weight: 650; transition: background .2s, color .2s; }
.nav a:hover { background: rgba(167, 139, 250, 0.1); color: var(--text); }
.nav a.is-active { background: rgba(139, 92, 246, 0.24); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4); color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.me-name { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { overflow-y: auto; outline: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 120px; display: flex; flex-direction: column; gap: 22px; }
.page--wide { max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dim { color: var(--text-dim); }
.hint { font-size: 0.8rem; color: var(--text-faint); }
.loading { color: var(--text-dim); padding: 40px 0; text-align: center; }
.grow { flex: 1; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 650; white-space: nowrap; color: var(--text);
  background: rgba(167, 139, 250, 0.14); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn:hover { background: rgba(167, 139, 250, 0.24); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--primary { color: #fff; background: linear-gradient(135deg, #8b5cf6, #a855f7); box-shadow: 0 6px 22px rgba(139, 92, 246, .4); }
.btn--primary:hover { background: linear-gradient(135deg, #9b72ff, #b66bff); }
.btn--danger { color: var(--danger); background: rgba(251, 113, 133, .1); box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .3); }
.btn--ghost { background: transparent; }
.btn--small { height: 34px; padding: 0 12px; font-size: .9rem; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-dim);
  transition: background .2s, color .2s, transform .15s var(--ease);
}
.icon-btn:hover { background: rgba(167, 139, 250, 0.16); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn--danger:hover { color: var(--danger); background: rgba(251, 113, 133, .12); }
.icon-btn--small { width: 32px; height: 32px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row--center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- Avatars, puces ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; line-height: 1;
  background: linear-gradient(135deg, #8b5cf6, #e879f9); color: #fff; font-weight: 750;
}
.avatar--square { border-radius: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: var(--violet-300); background: rgba(139, 92, 246, .16); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25); white-space: nowrap;
}
.chip--dim { color: var(--text-faint); background: rgba(11, 6, 22, .45); }
.chip--x { padding-right: 4px; }
.chip--x button { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-dim); }
.chip--x button:hover { background: rgba(251, 113, 133, .2); color: var(--danger); }
.chip--ban, .chip--kick { color: var(--danger); background: rgba(251, 113, 133, .1); box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .3); }
.chip--unban, .chip--untimeout { color: var(--ok); background: rgba(134, 239, 172, .08); box-shadow: inset 0 0 0 1px rgba(134, 239, 172, .25); }
.chip--automod { color: var(--orchid); background: rgba(232, 121, 249, .1); box-shadow: inset 0 0 0 1px rgba(232, 121, 249, .25); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.badge--live { background: var(--orchid); color: #1a0a2a; box-shadow: 0 0 14px var(--orchid); }

/* ---------- Panneaux ---------- */
.panel {
  padding: 20px; border-radius: var(--radius-l); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 14px;
}
.panel-head { display: flex; flex-direction: column; gap: 4px; }
.panel-head .dim { font-size: .9rem; }
.info { font-size: .84rem; color: var(--text-dim); padding: 10px 12px; border-radius: var(--radius-s); background: rgba(232, 121, 249, .08); box-shadow: inset 0 0 0 1px rgba(232, 121, 249, .22); }
.info--danger { color: #ffd3da; background: rgba(251, 113, 133, .1); box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .3); }
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { color: var(--text-dim); }
.empty-small { color: var(--text-faint); padding: 12px 4px; }

/* ---------- Accueil ---------- */
.hero { text-align: center; padding: 48px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-logo { width: 104px; height: 104px; border-radius: 50%; box-shadow: 0 0 0 3px var(--violet-500), 0 0 60px rgba(139, 92, 246, .6); animation: float 6s var(--ease) infinite; }
.hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero-sub { color: var(--text-dim); max-width: 620px; font-size: 1.05rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.feature { gap: 8px; }
.feature p { color: var(--text-dim); font-size: .9rem; }
.feature-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--violet-300); background: rgba(139, 92, 246, .18); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .3); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Grille des serveurs ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.tile {
  padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text);
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius-m);
  transition: background .2s, transform .3s var(--ease);
}
.tile:hover { background: rgba(56, 33, 104, .6); transform: translateY(-3px); }
.tile--off { opacity: .7; }
.tile--off .avatar { filter: grayscale(.7); }
.tile-name { font-weight: 650; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Tableau de bord ---------- */
.guild-head { display: flex; align-items: center; gap: 16px; }
.guild-head .avatar { box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .4); }
.guild-switch { margin-left: auto; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: var(--radius-l); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.side-link {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text-dim);
  font-weight: 650; text-align: left; transition: background .2s, color .2s;
}
.side-link:hover { background: rgba(167, 139, 250, .1); color: var(--text); }
.side-link.is-active { background: rgba(139, 92, 246, .24); color: var(--text); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .4); }
.side-link.is-active::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--orchid); box-shadow: 0 0 14px var(--orchid); }
.content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: .86rem; font-weight: 650; color: var(--text-dim); }
.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-s);
  background: rgba(11, 6, 22, .55); border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--violet-400); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }
.input::placeholder { color: var(--text-faint); }
.input:disabled { opacity: .6; }
.textarea { height: auto; min-height: 42px; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.input--num { max-width: 160px; }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3a5d6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.select option { background: var(--ink-800); color: var(--text); }
.select--small { height: 36px; max-width: 280px; font-size: .9rem; }
.input-suffix { display: flex; align-items: center; gap: 10px; }
.input-suffix span { color: var(--text-dim); font-size: .9rem; }
.color { width: 64px; height: 42px; padding: 4px; border-radius: var(--radius-s); background: rgba(11, 6, 22, .55); border: 1px solid var(--line); cursor: pointer; }
.picker { display: flex; flex-direction: column; gap: 8px; }

.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 6px 8px; cursor: text;
  border-radius: var(--radius-s); background: rgba(11, 6, 22, .55); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s;
  max-height: 220px; overflow-y: auto;
}
.tag-input:focus-within { border-color: var(--violet-400); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }
.tag-field { flex: 1; min-width: 180px; height: 30px; background: none; border: 0; outline: none; padding: 0 6px; }
.tag-field::placeholder { color: var(--text-faint); }

/* Interrupteur */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: var(--radius-m); background: rgba(11, 6, 22, .3); }
.switch-label { font-weight: 650; cursor: pointer; }
.switch { position: relative; flex: none; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, box-shadow .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-dim); transition: transform .25s var(--ease), background .2s, box-shadow .2s; }
.switch input:checked + .switch-track { background: rgba(139, 92, 246, .6); box-shadow: inset 0 0 0 1.5px rgba(196, 181, 253, .65); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: #fff; box-shadow: 0 0 10px rgba(232, 121, 249, .8); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--violet-300); outline-offset: 2px; }

.vars summary, .more summary { cursor: pointer; color: var(--violet-300); font-size: .86rem; font-weight: 650; }
.vars-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .82rem; color: var(--text-dim); }
.more > .field, .more > .vars { margin-top: 12px; }

/* ---------- Cartes de liste ---------- */
.card {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 8px 8px 8px 12px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(36, 21, 69, .82), rgba(26, 16, 50, .62)); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s, box-shadow .2s;
}
.card:hover { background: linear-gradient(90deg, rgba(56, 33, 104, .9), rgba(36, 21, 69, .7)); }
.card.is-live { box-shadow: inset 0 0 0 1.5px rgba(232, 121, 249, .5), 0 0 24px rgba(232, 121, 249, .2); }
.card.is-off { opacity: .6; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: .86rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ic { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--violet-300); background: rgba(139, 92, 246, .18); }
.card--case { min-height: 60px; }
.card--case .chip { min-width: 96px; justify-content: center; }

/* ---------- Éditeur de commandes perso ---------- */
.editor { display: flex; flex-direction: column; gap: 14px; }
.editor-title { margin-top: 6px; color: var(--violet-300); }
.actions-list { display: flex; flex-direction: column; gap: 10px; }
.action-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius-m); background: rgba(11, 6, 22, .4); box-shadow: inset 0 0 0 1px var(--line); }
.action-head { display: flex; align-items: center; gap: 8px; }
.action-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #8b5cf6, #e879f9); }
.embed-edit { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-left: 4px solid var(--violet-500); border-radius: var(--radius-s); background: rgba(11, 6, 22, .35); }

/* ---------- Barre d'enregistrement ---------- */
.savebar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30; width: min(720px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 12px 10px 20px;
  border-radius: 999px; background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 0 1px var(--line), 0 0 30px rgba(139, 92, 246, .3);
  font-weight: 650; animation: pop .22s var(--ease);
}

/* ---------- Modale ---------- */
.modal-back { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(8, 4, 18, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .18s; }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; border-radius: var(--radius-l);
  background: var(--ink-800); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px var(--line); animation: pop .22s var(--ease);
}
.modal--wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 22px; }
.modal-body { padding: 8px 22px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 11px 16px; border-radius: 999px; background: var(--ink-700); font-size: .92rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--line); animation: pop .22s var(--ease); transition: opacity .3s; }
.toast--error { color: #ffd3da; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(251, 113, 133, .5); }
.toast--out { opacity: 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes rise { from { transform: translateY(100%); } }
.savebar { animation-name: savebar-in; }
@keyframes savebar-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- Statistiques ---------- */
.stack--lg { gap: 18px; }
.cols--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius-m); background: rgba(11, 6, 22, .45); box-shadow: inset 0 0 0 1px var(--line); }
.stat-label { font-size: .85rem; color: var(--text-dim); }
.stat-value { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: var(--text-faint); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(11, 6, 22, .55); box-shadow: inset 0 0 0 1px var(--line); }
.segmented button { padding: 7px 14px; border-radius: 999px; font-size: .92rem; font-weight: 650; color: var(--text-dim); transition: background .2s, color .2s; }
.segmented button[aria-pressed="true"] { background: var(--violet-500); color: #fff; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart-grid { stroke: rgba(196, 181, 253, .08); }
.chart-base { stroke: rgba(196, 181, 253, .22); }
.chart-axis { fill: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-hl { fill: rgba(167, 139, 250, .08); }
.chart-cross { stroke: rgba(196, 181, 253, .35); stroke-dasharray: 3 3; }
.chart-dot { stroke: var(--ink-800); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 0; min-width: 150px; padding: 8px 10px; border-radius: 10px; pointer-events: none; z-index: 2;
  background: var(--ink-800); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--line); font-size: .84rem;
}
.chart-tip strong { display: block; margin-bottom: 4px; font-weight: 650; }
.chart-tip strong::first-letter { text-transform: uppercase; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.chart-tip-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .86rem; color: var(--text-dim); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rank-name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.rank-bar > span { display: block; height: 100%; border-radius: 8px; background: var(--violet-500); }
.rank-val { font-size: .86rem; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.table-view summary { cursor: pointer; color: var(--violet-300); font-weight: 650; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.table-wrap th { color: var(--text-dim); font-weight: 650; }
.chip--toggle { cursor: pointer; color: var(--text-dim); background: rgba(11, 6, 22, .45); }
.chip--toggle.is-on { background: var(--violet-500); color: #fff; box-shadow: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  :root { --topbar-h: 54px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .brand span, .me-name { display: none; }
  .page { padding: 18px 14px 120px; }
  .hero h1 { font-size: 1.8rem; }
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .side { position: static; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 999px; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side-link { flex: none; padding: 8px 12px; border-radius: 999px; }
  .side-link.is-active::before { display: none; }
  .guild-head { flex-wrap: wrap; }
  .guild-switch { margin-left: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
  .modal-back { place-items: end stretch; padding: 0; }
  .modal, .modal--wide { width: 100%; max-height: 92dvh; border-radius: var(--radius-l) var(--radius-l) 0 0; animation: rise .25s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .savebar { border-radius: var(--radius-l); bottom: 12px; }
  .card { min-height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
