:root {
  --bg: #060907;
  --bg-2: #0a0f0b;
  --panel: #0f1611;
  --panel-2: #152019;
  --panel-3: #1b2a20;
  --line: #1f2e24;
  --line-2: #2b4233;
  --text: #eef6f0;
  --muted: #8fa596;
  --soft: #b9cbbe;
  --green: #0cfc02;
  --green-light: #a9fc9e;
  --accent: #19d64b;
  --red: #ef4444;
  --gold: #fbbf24;
  --blurple: #5865f2;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--green-light); }
img { display: block; }
.icon { display: inline-grid; place-items: center; flex: none; }

/* ---- Boutons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px; color: #021407; text-decoration: none;
  background: linear-gradient(135deg, var(--green), var(--accent)); box-shadow: 0 6px 20px rgba(12, 252, 2, .2);
  transition: transform .2s var(--ease), filter .2s, box-shadow .2s, background .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--soft); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 20px rgba(239, 68, 68, .25); }
.btn-soft-red { background: transparent; color: #fca5a5; border-color: rgba(239, 68, 68, .35); box-shadow: none; }
.btn-soft-red:hover { background: rgba(239, 68, 68, .12); }
.btn-discord { background: var(--blurple); color: #fff; font-size: 16px; padding: 14px 24px; box-shadow: 0 8px 24px rgba(88, 101, 242, .35); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---- Champs ------------------------------------------------------------------ */
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:hover, select:hover, textarea:hover { border-color: #3a5a44; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(25, 214, 75, .15); }
input[type="color"] { padding: 4px; height: 46px; cursor: pointer; }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
select { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 14px; font-weight: 800; color: var(--soft); display: flex; align-items: center; gap: 8px; }
.changed { font-style: normal; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); background: rgba(251, 191, 36, .12); padding: 2px 7px; border-radius: 99px; }
.help { color: var(--muted); font-size: 13px; line-height: 1.45; }
.with-unit { display: flex; align-items: stretch; }
.with-unit input { border-radius: 12px 0 0 12px; }
.unit { display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 12px 12px 0; background: var(--panel-2); color: var(--muted); font-weight: 800; font-size: 13px; white-space: nowrap; }

.switch { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 48px; height: 28px; border-radius: 99px; background: #2b3a30; position: relative; transition: background .25s; flex: none; margin-top: 1px; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(25, 214, 75, .25); }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text b { font-weight: 800; }
.switch-text small { color: var(--muted); font-size: 13px; }

/* ---- Connexion ---------------------------------------------------------------- */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 20% 0%, rgba(25, 214, 75, .2), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(10, 125, 44, .25), transparent 60%), var(--bg);
}
.login-card { width: min(460px, 100%); text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 40px 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.login-glasses { width: 150px; filter: drop-shadow(0 10px 26px rgba(25, 214, 75, .45)); animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
.login-brand { font-size: 32px; font-weight: 900; letter-spacing: -.02em; text-decoration: none; background: linear-gradient(90deg, var(--green), var(--green-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login h1 { margin: 0; font-size: 18px; color: var(--muted); }
.login p { margin: 0; color: var(--muted); }
.login small { color: var(--muted); }
.login-error { color: #fecaca !important; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .4); padding: 10px 14px; border-radius: 12px; }

/* ---- Structure ------------------------------------------------------------------ */
.app { display: flex; min-height: 100%; background: radial-gradient(900px 600px at 100% 0%, rgba(25, 214, 75, .07), transparent 60%), var(--bg); }
.sidebar { width: 290px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 10px; font-weight: 900; font-size: 21px; color: var(--text); text-decoration: none; }
.side-brand img { width: 50px; filter: drop-shadow(0 4px 12px rgba(25, 214, 75, .45)); transition: transform .3s var(--ease); }
.side-brand:hover img { transform: rotate(-6deg) scale(1.08); }
.guild { display: flex; gap: 12px; align-items: center; margin: 10px 16px 6px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.guild img { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); }
.guild strong { display: block; font-weight: 900; font-size: 15px; }
.guild span { color: var(--muted); font-size: 13px; }
nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 3px; }
nav .group { color: var(--muted); font-size: 11.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; padding: 16px 12px 6px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--soft); text-decoration: none; font-weight: 800; font-size: 15px; transition: background .2s, color .2s; }
nav a .icon { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); color: var(--muted); transition: background .2s, color .2s; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.active { background: linear-gradient(90deg, rgba(25, 214, 75, .16), rgba(25, 214, 75, .02)); color: #fff; }
nav a.active .icon { background: var(--accent); color: #021407; box-shadow: 0 4px 14px rgba(25, 214, 75, .4); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.sidebar-foot img { width: 38px; height: 38px; border-radius: 50%; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who strong { font-weight: 900; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: var(--muted); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 36px; border-bottom: 1px solid var(--line); background: rgba(6, 9, 7, .82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.crumbs { flex: 1; color: var(--muted); font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.crumbs b { color: var(--text); }
.menu-btn { display: none; }
.page { padding: 34px 36px 140px; max-width: 1060px; width: 100%; }

/* En-tête de page et sous-onglets */
.page-head { display: flex; gap: 18px; align-items: center; margin-bottom: 24px; }
.page-ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, rgba(25, 214, 75, .3), rgba(25, 214, 75, .06)); border: 1px solid var(--line-2); color: var(--green-light); }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; max-width: 720px; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 26px; padding: 6px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.subtabs button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: 14.5px; padding: 9px 14px; border-radius: 11px; cursor: pointer; transition: background .2s, color .2s; }
.subtabs button:hover { color: var(--text); }
.subtabs button.on { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.section-title { margin: 36px 0 14px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { margin: 0; font-size: 19px; font-weight: 900; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

/* Cartes */
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 20px; transition: border-color .25s, box-shadow .25s; }
.card.dirty, .cal-day.dirty { border-color: rgba(251, 191, 36, .5); box-shadow: 0 0 0 3px rgba(251, 191, 36, .08); }
.card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-head .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--panel-2); color: var(--green-light); border: 1px solid var(--line); }
.card-title { flex: 1; min-width: 160px; }
.card-title h3 { margin: 0; font-size: 18px; font-weight: 900; }
.card-title p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.card-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.fields { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.fields.one { grid-template-columns: 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.row > .btn, .row > .icon-btn { flex: none; min-width: 0; }
.row.tight > select { max-width: 130px; }
.muted { color: var(--muted); }
.note { display: flex; gap: 12px; align-items: flex-start; background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .25); color: #fde68a; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; }
.note.info { background: rgba(25, 214, 75, .06); border-color: var(--line-2); color: var(--soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 900; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.on { background: rgba(25, 214, 75, .14); color: var(--green-light); }
.badge.off { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.badge.gold { background: rgba(251, 191, 36, .13); color: #fde68a; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; border: 1px dashed var(--line-2); border-radius: 14px; }
.empty-state p { margin: 0; }

/* Accueil du dashboard */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: center; }
.stat .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--panel-2); color: var(--green-light); }
.stat b { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.stat span { color: var(--muted); font-weight: 700; font-size: 13.5px; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.tile .icon { width: 46px; height: 46px; border-radius: 13px; background: var(--panel-2); color: var(--green-light); }
.tile b { display: block; font-weight: 900; }
.tile span { color: var(--muted); font-size: 13.5px; }

/* Sélecteurs de rôles / salons */
.picker { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 6px 6px 12px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 800; font-size: 14px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip button { display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 50%; }
.chip button:hover { color: #fff; background: var(--red); }
.chips .empty { color: var(--muted); font-size: 14px; font-style: italic; }

/* Listes (membres, paliers, multiplicateurs…) */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 160px; }
.list-row .grow b { display: block; font-weight: 900; }
.list-row .grow span { color: var(--muted); font-size: 13.5px; }
.list-row .num-in { max-width: 130px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); flex: none; }
.member-card { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kv { display: flex; gap: 22px; flex-wrap: wrap; }
.kv div { display: flex; flex-direction: column; }
.kv b { font-size: 22px; font-weight: 900; }
.kv span { color: var(--muted); font-size: 13px; font-weight: 700; }

/* Choix d'une option (pastilles) */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--soft); border-radius: 12px; padding: 9px 14px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.segmented button:hover { border-color: var(--accent); }
.segmented button.on { background: rgba(25, 214, 75, .16); border-color: var(--accent); color: #fff; }
.vars { display: flex; flex-wrap: wrap; gap: 8px; }
.vars button { border: 1px dashed var(--line-2); background: var(--bg-2); border-radius: 9px; padding: 5px 10px; font: 700 13px ui-monospace, Consolas, monospace; color: var(--green-light); cursor: pointer; }
.vars button:hover { border-style: solid; border-color: var(--accent); }

/* Tableau chance → montant */
.rows { display: flex; flex-direction: column; gap: 10px; }
.rows .head { color: var(--muted); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pct { flex: none !important; min-width: 64px !important; font-weight: 900; color: var(--green-light); text-align: right; }

/* Calendrier */
.cal-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .25s, box-shadow .25s; }
.cal-day.big { border-color: rgba(251, 191, 36, .45); background: linear-gradient(160deg, rgba(214, 40, 57, .2), var(--panel)); }
.cal-day header { display: flex; align-items: center; gap: 12px; }
.cal-day .num { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #fff; background: linear-gradient(135deg, #d62839, #ff6b6b); flex: none; }
.cal-day h4 { margin: 0; font-size: 15px; font-weight: 900; }
.cal-day small { color: var(--muted); }
.cal-day .grow { flex: 1; min-width: 0; }
.cal-day .edit summary { font-size: 14px; }
.cal-fields { display: flex; flex-direction: column; gap: 14px; }
.cal-day-preview img { width: 100%; border-radius: 12px; }
.cal-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cal-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cal-swatch { border: 2px solid transparent; border-radius: 12px; min-width: 120px; height: 54px; padding: 0 12px; display: flex; align-items: flex-end; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); transition: transform .15s, border-color .15s; }
.cal-swatch span { padding-bottom: 6px; }
.cal-swatch.small { min-width: 86px; height: 40px; }
.cal-swatch:hover { transform: translateY(-2px); }
.cal-swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.cal-preview-box { margin-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.cal-preview-box input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.cal-preview-box .check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.cal-custom { margin-top: 12px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 18px; }
.cal-msg h4 { margin: 0 0 8px; font-size: 15px; font-weight: 900; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 16px 0; }
.cal-preview { width: 100%; max-width: 900px; border-radius: 16px; }

/* Boutique, événements */
.item { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.item .emoji { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--panel-2); font-size: 24px; flex: none; color: var(--green-light); }
.item .info { flex: 1; min-width: 180px; }
.item .info b { display: block; font-weight: 900; font-size: 17px; }
.item .info span { color: var(--muted); font-size: 14px; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
details.edit { border-top: 1px solid var(--line); padding-top: 18px; }
details.edit summary { cursor: pointer; color: var(--soft); font-weight: 800; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] summary { margin-bottom: 18px; }
.runs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.run { border: 1px solid rgba(25, 214, 75, .4); background: linear-gradient(145deg, rgba(25, 214, 75, .1), var(--panel)); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.run b { font-size: 17px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green-light); font-weight: 900; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(12, 252, 2, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(12, 252, 2, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 252, 2, 0); } }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; font-weight: 700; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: rgba(25, 214, 75, .08); }
.preview { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); }
.preview img { width: 100%; }

/* Barre d'enregistrement */
.savebar {
  position: fixed; left: 50%; bottom: 22px; z-index: 30; display: flex; align-items: center; gap: 22px; width: min(720px, calc(100% - 32px));
  padding: 14px 16px 14px 22px; border-radius: 18px; background: #101812; border: 1px solid rgba(251, 191, 36, .45); box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  transform: translate(-50%, 160%); transition: transform .4s var(--ease);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar-text { flex: 1; display: flex; flex-direction: column; }
.savebar-text strong { font-weight: 900; }
.savebar-text span { color: var(--muted); font-size: 13px; }
.savebar-actions { display: flex; gap: 10px; }

/* Notifications et fenêtre de confirmation */
.toasts { position: fixed; right: 22px; top: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 800; max-width: 400px; animation: toast-in .35s var(--ease); transition: opacity .4s, transform .4s; }
.toast .icon { color: var(--green-light); }
.toast.error { border-left-color: var(--red); }
.toast.error .icon { color: #fca5a5; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 40; padding: 20px; backdrop-filter: blur(4px); }
.modal-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; padding: 28px; width: min(460px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.modal-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(25, 214, 75, .12); color: var(--green-light); }
.modal-ico.danger { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.modal-box h3 { margin: 0; font-size: 20px; font-weight: 900; }
.modal-box p { margin: 0; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.loading { display: grid; place-items: center; padding: 100px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Apparition douce des pages */
.page > * { animation: page-in .45s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: .04s; }
.page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- Téléphone ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .page { padding: 22px 16px 140px; }
  .grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 24px; }
  .savebar { flex-direction: column; align-items: stretch; gap: 12px; }
  .savebar-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.rot { transform: rotate(-90deg); }
.crumbs .icon { color: var(--muted); }

/* ---- Boutique : icônes, couleurs, édition limitée, aperçu ---- */
.item .emoji:has(.shop-tile) { background: none; }
.shop-tile { border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 40%, transparent); }
.icon-picker { display: grid; gap: 10px; }
.icon-current { display: flex; gap: 12px; align-items: center; }
.icon-current small { display: block; color: var(--muted); }
.icon-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-cats button { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.icon-cats button.on { background: var(--green); color: #04150a; border-color: transparent; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.icon-grid button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: transform .12s, background .12s; }
.icon-grid button:hover { transform: translateY(-2px); border-color: var(--c); }
.icon-grid button.on { background: var(--c); color: #fff; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 45%, transparent); }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--green); }
.chip-above { font-style: normal; font-size: 11px; font-weight: 900; color: var(--green-light); background: rgba(12, 252, 2, .12); padding: 1px 7px; border-radius: 99px; }
.color-or { color: var(--muted); font-size: 13px; font-weight: 800; margin: 0 2px; }

/* ---- Sélecteur de couleur (panneau dans la page) ---- */
.cp { position: relative; display: inline-block; }
.cp-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; transition: border-color .2s, background .2s; }
.cp-trigger:hover, .cp.open .cp-trigger { border-color: var(--accent); background: var(--panel-3); }
.cp-dot { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.cp-code { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.cp-chev { transform: rotate(90deg); color: var(--muted); transition: transform .2s; }
.cp.open .cp-chev { transform: rotate(-90deg); }
.cp-panel { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: 250px; padding: 14px; border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; animation: cp-in .18s var(--ease); }
@keyframes cp-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.cp-area { position: relative; height: 150px; border-radius: 12px; cursor: crosshair; touch-action: none; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue, red)); }
.cp-area-knob { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transform: translate(-50%, -50%); pointer-events: none; }
.cp-hue { position: relative; height: 14px; border-radius: 99px; cursor: pointer; touch-action: none; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-hue-knob { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transform: translate(-50%, -50%); pointer-events: none; }
.cp-row { display: flex; gap: 8px; align-items: center; }
.cp-preview { width: 38px; height: 38px; border-radius: 11px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.cp-hex { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.cp-swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cp-swatch { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cp-swatch.on { border-color: #fff; }
.limited-box { margin-top: 10px; padding: 14px; border-radius: 14px; border: 1px solid rgba(245, 183, 0, .45); background: rgba(245, 183, 0, .06); }
.card.is-limited { border-color: rgba(245, 183, 0, .5); }
.limited-pill { display: inline-block; margin-left: 8px; vertical-align: middle; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: linear-gradient(90deg, #ffd84a, #f59e0b); color: #3a2400; }
.shop-preview { display: block; width: 100%; max-width: 760px; border-radius: 16px; margin-top: 6px; }
.promo-pill { display: inline-block; margin-left: 8px; vertical-align: middle; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: linear-gradient(90deg, #ff4d6d, #ff7a59); color: #fff; }
.item .info .promo-pill { color: #fff; }
.item .info .limited-pill { color: #3a2400; }
.promo-box { margin-top: 10px; padding: 14px; border-radius: 14px; border: 1px solid rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .06); }
.promo-result { margin: 0; color: var(--muted); }
/* ---- Membres : cadeaux ---- */
.gift-box { margin-top: 16px; padding: 16px; border-radius: 16px; border: 1px solid rgba(25, 214, 75, .35); background: linear-gradient(160deg, rgba(25, 214, 75, .07), rgba(255, 255, 255, .01)); }
.gift-title { display: flex; align-items: center; gap: 8px; color: var(--green-light); }
.gift-title b { color: var(--text); font-size: 15.5px; }

/* ---- Sauvegardes et remise à zéro ---- */
.backup-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.backup-stats div { padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.backup-stats b { display: block; font-size: 18px; font-weight: 900; }
.backup-stats span { color: var(--muted); font-size: 13px; font-weight: 700; }
.backup-stats .warn { border-color: rgba(251, 191, 36, .5); }
.backup-stats .warn b { color: #fde68a; }
.moments { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.moment { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.moment b { font-weight: 900; }
.moment small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.moment.on { border-color: var(--accent); background: rgba(25, 214, 75, .12); }
.moment:disabled { opacity: .4; cursor: not-allowed; }
.parts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.part { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.part > span:first-child, .part > svg { flex: none; margin-top: 2px; opacity: 0; transition: opacity .15s; }
.part b { display: block; font-weight: 900; font-size: 14.5px; }
.part small { color: var(--muted); font-size: 12px; font-weight: 700; }
.part.on { border-color: var(--accent); background: rgba(25, 214, 75, .1); }
.part.on > span:first-child, .part.on > svg { opacity: 1; color: var(--green); }
.part.all { align-items: center; }
.modal-box.verify { max-width: 460px; text-align: left; }
.modal-box.verify h3, .modal-box.verify > p { text-align: center; }
.code-input { font-size: 22px !important; letter-spacing: .35em; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.sure { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 14px; cursor: pointer; }
.sure input { margin-top: 3px; accent-color: var(--red); width: 18px; height: 18px; flex: none; }
.verify-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(239, 68, 68, .14); color: #fca5a5; font-weight: 800; font-size: 14px; }

/* ---- Test et maintenance ---- */
.card.is-danger { border-color: rgba(239, 68, 68, .55); background: linear-gradient(160deg, rgba(239, 68, 68, .1), var(--panel)); }
.until { display: flex; flex-direction: column; gap: 8px; }
.until .quick { display: flex; flex-wrap: wrap; gap: 6px; }
.features { display: flex; flex-direction: column; gap: 10px; }
.feature { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; transition: border-color .2s, background .2s; }
.feature.paused { border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .05); }
.feature-head { display: flex; align-items: center; gap: 12px; }
.features.compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.features.compact .feature-body { grid-template-columns: 1fr; }
.feature-head .switch { flex: 1; }
.feature-body { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 12px; }
.state { flex: none; font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.state.on { color: var(--green-light); background: rgba(12, 252, 2, .1); }
.state.off { color: #fde68a; background: rgba(251, 191, 36, .15); }
.user-picker input[type=search] { width: 100%; }
.user-results { display: flex; flex-direction: column; gap: 4px; }
.user-result { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.user-result:hover { border-color: var(--accent); }
.user-result img { width: 26px; height: 26px; border-radius: 50%; }
.user-result small { color: var(--muted); font-weight: 700; }
.chip-avatar { width: 18px; height: 18px; border-radius: 50%; }
.status-preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #1e1f22; border: 1px solid var(--line); }
.status-preview .status-dot { width: 38px; height: 38px; border-radius: 50%; flex: none; background: url('/glasses.svg') center / 70% no-repeat, linear-gradient(135deg, #0cfc02, #0a7d2c); box-shadow: inset 0 0 0 3px #1e1f22, 0 0 0 0 transparent; position: relative; }
.status-preview .status-dot::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #23a55a; border: 3px solid #1e1f22; }
.status-preview b { display: block; font-size: 15px; }
.status-preview span { color: #b5bac1; font-size: 13.5px; }

/* ---- Messages : lieux et variantes ---- */
.places { display: flex; flex-direction: column; gap: 12px; }
.place { border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, .015); transition: border-color .2s, background .2s; }
.place.on { border-color: rgba(25, 214, 75, .45); background: linear-gradient(160deg, rgba(25, 214, 75, .06), rgba(255, 255, 255, .01)); }
.place-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.place-head .switch { flex: 1; }
.place-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--muted); background: rgba(255, 255, 255, .05); transition: color .2s, background .2s; }
.place-head.on .place-ico { color: #fff; background: linear-gradient(135deg, var(--green), var(--accent)); color: #04140a; }
.place-body { padding: 0 14px 14px; }
.freq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); }
.freq-label { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.freq-range { flex: 1; min-width: 120px; appearance: none; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(255, 255, 255, .1) var(--p, 50%)); outline: none; }
.freq-range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.freq-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.freq-word { font-weight: 900; font-size: 13.5px; min-width: 84px; }
.freq-pct { font-size: 12.5px; font-weight: 800; color: var(--green-light); background: rgba(12, 252, 2, .1); padding: 3px 9px; border-radius: 99px; }
.rules-box { padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); gap: 12px; }
.promo-result s { opacity: .7; }
.promo-result b { color: var(--text); }
.cat-row { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); }
.cat-row .info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cat-row .info input { width: 100%; max-width: 320px; font-weight: 700; }
.cat-row .info span { font-size: 13px; color: var(--muted); }
.cat-row .edit { margin-top: 10px; }
.list-row.to-remove { opacity: .5; text-decoration: line-through; }
.card.to-delete { opacity: .55; border-color: rgba(239, 68, 68, .6); }
.card.to-delete .edit { display: none; }
.delete-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(239, 68, 68, .1); color: #fca5a5; font-size: 14px; }
.delete-note .txt { flex: 1; min-width: 200px; }
.delete-note > svg { flex: none; }

/* ---- Plusieurs messages (bienvenue, MP) ---- */
.text-list { display: grid; gap: 12px; }
.text-item { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.text-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.text-item-head b { font-size: 14px; }

/* ---- Règlement : éditeur + aperçu Discord ---- */
.rules-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 20px; align-items: start; }
.rules-side { position: sticky; top: 84px; }
@media (max-width: 1180px) { .rules-layout { grid-template-columns: minmax(0, 1fr); } .rules-side { position: static; order: -1; } }
.emb-card > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 15px; }
.emb-card > summary::-webkit-details-marker { display: none; }
.emb-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.emb-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 13px; }
.emb-tools { justify-content: flex-end; margin: 10px 0; }
.emb-field { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); display: grid; gap: 8px; }
.stack.tight { gap: 10px; }
.dc-preview { background: #313338; border-radius: 14px; padding: 14px 12px; color: #dbdee1; font-family: "gg sans", "Noto Sans", "Segoe UI", sans-serif; font-size: 15px; line-height: 1.375; max-height: 72vh; overflow: auto; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 2px 4px; }
.dc-msg.cont { margin-top: 6px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; }
.dc-time-side { font-size: 11px; color: #949ba4; text-align: right; padding-top: 4px; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-head b { color: #fff; font-weight: 600; }
.dc-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-content { margin: 2px 0 4px; overflow-wrap: anywhere; }
.dc-embed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; max-width: 520px; margin-top: 6px; background: #2b2d31; border-left: 4px solid var(--ec, #1e1f22); border-radius: 4px; padding: 10px 14px 14px 12px; }
.dc-embed-body { min-width: 0; display: grid; gap: 6px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #fff; }
.dc-author img, .dc-footer img { width: 22px; height: 22px; border-radius: 50%; }
.dc-title { color: #fff; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.dc-title.link { color: #00a8fc; }
.dc-desc, .dc-fv { font-size: 14px; overflow-wrap: anywhere; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 2px; }
.dc-field { flex: 1 1 100%; min-width: 0; }
.dc-field.inline { flex: 1 1 140px; }
.dc-fn { font-weight: 700; color: #fff; font-size: 14px; margin-bottom: 2px; }
.dc-image { max-width: 100%; border-radius: 6px; margin-top: 6px; }
.dc-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b5bac1; margin-top: 4px; }
.dc-preview code { background: #1e1f22; border-radius: 4px; padding: 1px 4px; font-size: 85%; }
.dc-preview blockquote { margin: 2px 0; padding-left: 10px; border-left: 4px solid #4e5058; }
.dc-preview a { color: #00a8fc; }
.dc-h1 { display: block; font-size: 22px; font-weight: 800; color: #fff; margin: 6px 0 2px; }
.dc-h2 { display: block; font-size: 19px; font-weight: 800; color: #fff; margin: 6px 0 2px; }
.dc-h3 { display: block; font-size: 16px; font-weight: 800; color: #fff; margin: 6px 0 2px; }
.dc-sub { display: block; font-size: 12px; color: #949ba4; }
.dc-li { display: block; padding-left: 6px; }
.dc-mention { background: color-mix(in srgb, var(--mc, #5865f2) 25%, transparent); color: color-mix(in srgb, var(--mc, #c9cdfb) 70%, #fff); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-spoiler { background: #1e1f22; color: #1e1f22; border-radius: 3px; }
.dc-buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bc); color: #fff; font-size: 14px; font-weight: 500; padding: 6px 16px; border-radius: 6px; min-height: 32px; }
.dc-empty { color: #949ba4; font-style: italic; }

/* ---- Anniversaires ---- */
.mp { position: relative; flex: 1 1 220px; min-width: 0; }
.mp input { width: 100%; }
.mp-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 12px 30px rgba(0,0,0,.4); max-height: 280px; overflow: auto; }
.mp-results button { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; color: var(--text); border-radius: 8px; cursor: pointer; text-align: left; font: inherit; }
.mp-results button:hover { background: var(--panel-2); }
.mp-results img, .mp-chip img { width: 28px; height: 28px; border-radius: 50%; }
.mp-results small { color: var(--muted); margin-left: auto; }
.mp-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.mp-chip b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-row { flex-wrap: wrap; }
.date-row input[type=number] { width: 96px; flex: 0 0 auto; }
.date-row select { width: 140px; flex: 0 0 auto; }
.bd-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.bd-list { display: grid; gap: 8px; }
.bd-row, .bd-msg { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.bd-row img, .bd-msg img, .bd-h img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.bd-who { flex: 1 1 160px; min-width: 0; }
.bd-who b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bd-who small { color: var(--muted); }
.bd-who p { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.bd-row.removed, .bd-msg.removed { opacity: .45; }
.bd-row.new { border-color: var(--green); }
.bd-next { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.bd-next-item { flex: none; display: grid; justify-items: center; gap: 4px; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 120px; text-align: center; }
.bd-next-item img { width: 44px; height: 44px; border-radius: 50%; }
.bd-next-item small { color: var(--muted); font-size: 12px; }
.bd-history { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.bd-h { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.bd-h > div { flex: 1; min-width: 0; }
.bd-h small { display: block; color: var(--muted); }
.bd-h time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bd-h-ico { color: var(--green-light); }

/* ---- Badges (dashboard) ---- */
.badge-edit { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); padding: 10px 12px; }
.badge-edit > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.badge-edit > summary::-webkit-details-marker { display: none; }
.badge-edit > summary small { color: var(--muted); }
.badge-edit[open] > summary { margin-bottom: 12px; }
.badge-dot { width: 18px; height: 18px; border-radius: 6px; background: var(--bc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bc) 30%, transparent); flex: none; }

/* ---- Tous les écrans : rien ne dépasse ---- */
.savebar, .modal-box, .toast, .card, .field, input, select, textarea { box-sizing: border-box; }
.page-inner, .card, .stack, .fields > * { min-width: 0; }
img, svg, canvas { max-width: 100%; }
@media (max-width: 900px) {
  .card-head > .row, .card-head > div:last-child:not(.card-title):not(.ico) { flex: 1 1 100% !important; justify-content: flex-start; flex-wrap: wrap; }
  .toasts { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
  .fields { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 420px) {
  .page { padding-left: 12px !important; padding-right: 12px !important; }
  .card { padding: 16px !important; }
  .row { flex-wrap: wrap; }
  .segmented { flex-wrap: wrap; }
}
/* Écrans très larges : contenu centré, pas étiré. */
@media (min-width: 1900px) { .page-inner { max-width: 1500px; margin-inline: auto; } }
/* Écrans très bas (paysage de téléphone) : barre d'enregistrement plus compacte. */
@media (max-height: 520px) { .savebar { bottom: 8px; padding: 8px 12px; } .savebar-text span { display: none; } }

/* ---- Emojis du serveur dans les textes ---- */
.emoji-pick { position: relative; margin-top: 6px; }
.emoji-panel { position: absolute; z-index: 35; left: 0; top: calc(100% + 6px); width: min(360px, calc(100vw - 40px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px; box-shadow: 0 18px 40px rgba(0,0,0,.5); display: grid; gap: 8px; }
.emoji-panel input { width: 100%; box-sizing: border-box; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; }
.emoji-grid button { aspect-ratio: 1; border: 0; background: none; border-radius: 8px; cursor: pointer; display: grid; place-items: center; padding: 4px; }
.emoji-grid button:hover { background: var(--panel-2); }
.emoji-grid img { width: 30px; height: 30px; object-fit: contain; }
.dc-emoji-img { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.dc-h1 .dc-emoji-img { width: 30px; height: 30px; }
/* Aperçu mobile : écran de téléphone */
.dc-preview { transition: max-width .3s var(--ease); }
.dc-preview.mobile { max-width: 380px; margin-inline: auto; font-size: 14px; border-radius: 26px; border: 6px solid #1e1f22; padding: 12px 8px; }
.dc-preview.mobile .dc-msg { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.dc-preview.mobile .dc-avatar { width: 34px; height: 34px; }
.dc-preview.mobile .dc-embed { max-width: 100%; padding: 8px 10px 10px; gap: 10px; }
.dc-preview.mobile .dc-field.inline { flex-basis: 100%; }
.dc-preview.mobile .dc-thumb { width: 60px; height: 60px; }
.dc-preview.mobile .dc-btn { flex: 1 1 100%; justify-content: center; }
.dc-btn.link .icon { opacity: .8; }
/* Onglet Embed */
.embed-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.embed-bar .field { flex: 1 1 240px; margin: 0; }
.link-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .link-row { grid-template-columns: 70px minmax(0, 1fr) auto; } .link-row input:nth-child(3) { grid-column: 1 / -1; grid-row: 2; } }

/* ---- « @ » dans les textes : rôles, @everyone, @here, @time ---- */
.mention-menu { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 18px 44px rgba(0,0,0,.55); max-height: 300px; overflow-y: auto; display: grid; gap: 2px; animation: pop .16s var(--ease); }
.mention-menu > button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: var(--text); border-radius: 9px; cursor: pointer; font: inherit; text-align: left; }
.mention-menu > button.on, .mention-menu > button:hover { background: var(--panel-2); }
.mention-menu small { color: var(--muted); margin-left: auto; font-size: 12px; }
.mm-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mm-ico { color: var(--green-light); display: grid; }
.time-menu { padding: 12px; gap: 10px; max-height: none; }
.mt-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; color: var(--green-light); }
.mt-head b { color: var(--text); }
.mt-head small { grid-column: 1 / -1; color: var(--muted); }
.time-menu input { width: 100%; box-sizing: border-box; }
.mt-formats { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.mt-formats button { display: grid; text-align: left; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.mt-formats button.on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(25,214,75,.25); }
.mt-formats small { color: var(--muted); font-size: 12px; }
.mt-foot { display: flex; align-items: center; gap: 10px; }
.mt-preview { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-time-tag { background: rgba(255,255,255,.08); border-radius: 4px; padding: 0 3px; }
/* Anniversaires : variantes avec / sans âge côte à côte */
.age-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.age-pair h4 { margin: 0 0 8px; font-size: 14px; }
.mm-av { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.dc-select { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; max-width: 420px; padding: 9px 12px; border-radius: 8px; background: #1e1f22; border: 1px solid #3f4147; color: #b5bac1; font-size: 14px; }

/* ---- Aperçu Discord à la taille réelle d'un PC ---- */
.rules-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 760px); }
@media (max-width: 1500px) { .rules-layout { grid-template-columns: minmax(0, 1fr); } .rules-side { position: static; order: -1; } }
.dc-preview { font-size: 16px; line-height: 1.375rem; padding: 18px 16px; max-height: 80vh; }
.dc-embed { max-width: 640px; padding: 12px 16px 16px 14px; }
.dc-title { font-size: 17px; }
.dc-desc, .dc-fv, .dc-fn { font-size: 15px; }
.dc-h1 { font-size: 24px; } .dc-h2 { font-size: 20px; } .dc-h3 { font-size: 17px; }
.user-link { display: flex; align-items: center; gap: inherit; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: 12px; padding: 4px; margin: -4px; transition: background .2s; } .user-link:hover { background: rgba(255,255,255,.06); } .user-link .who span { color: var(--green-light); }

/* ---- Disposition éditeur + aperçu (correctif) : l'aperçu prend au plus ~45 % de la largeur ---- */
.rules-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, min(45%, 700px)); }
.rules-side { min-width: 0; }
.rules-side .card { min-width: 0; overflow: hidden; }
.rules-side .row { flex-wrap: wrap; }
.rules-side select { max-width: 100%; }
.dc-preview { overflow-x: hidden; }
.dc-embed { max-width: 100%; }
.dc-image { max-height: 300px; object-fit: contain; }
@media (max-width: 1200px) { .rules-layout { grid-template-columns: minmax(0, 1fr); } .rules-side { position: static; order: -1; } }

/* ---- Pages avec éditeur + aperçu : toute la largeur de l'écran ---- */
.page:has(.rules-layout) { max-width: none; }
@media (min-width: 1201px) {
  .rules-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, min(45%, 900px)); }
  .rules-side { position: sticky; order: 0; }
}
.dc-msg.no-avatar { grid-template-columns: minmax(0, 1fr); }

/* ---- Pages sans limite de largeur + aperçus Discord en taille réelle (mêmes mesures que Discord PC) ---- */
.page { max-width: none !important; }
.dc-preview { font-size: 16px; line-height: 1.375; }
.dc-content { font-size: 16px; }
.dc-embed { max-width: 520px !important; padding: 8px 16px 16px 12px; border-left-width: 4px; }
.dc-author { font-size: 14px; }
.dc-title { font-size: 16px; }
.dc-desc, .dc-fv { font-size: 14px; line-height: 1.125rem; }
.dc-fn { font-size: 14px; }
.dc-footer { font-size: 12px; }
.dc-h1 { font-size: 24px; } .dc-h2 { font-size: 20px; } .dc-h3 { font-size: 16px; }
.dc-thumb { width: 80px; height: 80px; }
.dc-image { max-width: 100%; max-height: 300px; }
.dc-emoji-img { width: 22px; height: 22px; }
.dc-h1 .dc-emoji-img, .dc-title .dc-emoji-img { width: 24px; height: 24px; }

/* L'aperçu doit avoir la largeur d'un vrai message Discord (72 + 520 + 48 px). */
@media (min-width: 1201px) { .rules-layout { grid-template-columns: minmax(0, 1fr) minmax(660px, min(48%, 900px)); } }
@media (max-width: 1400px) { .rules-layout { grid-template-columns: minmax(0, 1fr); } .rules-side { position: static; order: -1; } }
