:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel-2: #313338;
  --border: #3f4147;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --faint: #80848e;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --danger: #da373c;
  --success: #23a55a;
  --embed: #2b2d31;
  --mention-bg: rgba(88, 101, 242, 0.3);
  --radius: 10px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f3f5;
    --panel: #ffffff;
    --panel-2: #ebedef;
    --border: #d4d7dc;
    --text: #060607;
    --muted: #4e5058;
    --faint: #6d6f78;
    --embed: #f2f3f5;
    --mention-bg: rgba(88, 101, 242, 0.15);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "gg sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: #00a8fc; }
button, input, select, textarea { font: inherit; color: inherit; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ─── Connexion ─────────────────────────────────────────── */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-card h1 { margin: 12px 0 6px; font-size: 24px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-logo { font-size: 48px; }
.error-banner {
  background: rgba(218, 55, 60, 0.15);
  border: 1px solid var(--danger);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ─── Boutons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--panel-2);
  color: var(--text);
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); filter: none; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; filter: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-discord { background: #5865f2; color: #fff; padding: 12px 20px; font-size: 16px; width: 100%; }

/* ─── Mise en page ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 57px);
}
.layout > * { min-width: 0; } /* empêche les onglets d'élargir la page */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
}
.sidebar h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 0 8px 10px;
}
.guild {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
}
a.guild { text-decoration: none; }
.guild:hover { background: var(--panel-2); color: var(--text); }
.guild.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.guild .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}
.guild-icon img { width: 100%; height: 100%; }
.guild .invite { font-size: 12px; color: var(--accent); font-weight: 600; }
.guild.absent { opacity: 0.6; }

.main { padding: 28px; max-width: 1100px; width: 100%; }
.main-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.main-header h1 { margin: 0; font-size: 22px; }
.main-header .count { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 8px; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ─── Cartes d'alerte ───────────────────────────────────── */
.alerts { display: grid; gap: 12px; }
.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--platform, var(--accent));
  border-radius: var(--radius);
  padding: 14px 16px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--platform, var(--accent));
  white-space: nowrap;
}
.alert-info { min-width: 0; }
.alert-info .title { font-weight: 700; font-size: 16px; }
.alert-info .title a { color: inherit; text-decoration: none; }
.alert-info .title a:hover { text-decoration: underline; }
.alert-info .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.alert-info .msg { color: var(--faint); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ─── Formulaire ────────────────────────────────────────── */
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.editor h2 { margin: 0 0 16px; font-size: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 6px; }
.field .hint { color: var(--faint); font-size: 12px; margin-top: 4px; }
input[type="text"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  outline: none;
}
input[type="text"]:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled { opacity: 0.6; }
textarea { resize: vertical; min-height: 70px; }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented button {
  flex: 1;
  min-width: 90px;
  padding: 9px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
}
.segmented button.selected { border-color: var(--platform); background: var(--panel-2); }
.segmented button:disabled { cursor: not-allowed; opacity: 0.5; }
.chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-family: ui-monospace, Consolas, monospace;
}
.chip:hover { border-color: var(--accent); }
.field label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Aperçu façon Discord ──────────────────────────────── */
.preview-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.discord {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
}
.discord .avatar { width: 40px; height: 40px; border-radius: 50%; }
.discord .author { font-weight: 600; }
.discord .bot-tag { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.discord .content { margin: 2px 0 6px; word-wrap: break-word; }
.mention { background: var(--mention-bg); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
@media (prefers-color-scheme: light) { .mention { color: #505cdc; } }
.embed {
  background: var(--embed);
  border-left: 4px solid var(--platform);
  border-radius: 4px;
  padding: 10px 14px 12px;
  max-width: 440px;
}
.embed .e-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.embed .e-title { color: #00a8fc; font-weight: 600; margin-bottom: 8px; }
.embed .e-image {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--platform), #000);
  opacity: 0.6;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  margin-bottom: 8px;
}
.embed .e-footer { font-size: 12px; color: var(--muted); }
.link-button {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--border);
  font-size: 14px;
  font-weight: 500;
}

/* ─── Onglets des modules ───────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin: -8px 0 24px;
  scrollbar-width: thin;
}
.tabs button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ─── Cartes de réglages ────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card-desc { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.card > h2 + .field, .card > h2 + .switch-row { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }

input[type="number"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  outline: none;
}
input[type="number"]:focus { border-color: var(--accent); }

/* Interrupteur */
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; }
.switch-row span { display: grid; gap: 2px; font-weight: 600; }
.switch-row small { font-weight: 400; color: var(--faint); font-size: 12px; }
.switch {
  appearance: none;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--faint);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Étiquettes (salons / rôles ignorés…) */
.picklist { display: grid; gap: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-size: 13px;
  margin-left: 6px;
}
.tags .tag { margin-left: 0; }
.tag button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; }
.tag button:hover { color: var(--danger); }

/* Lignes (récompenses de niveau) */
.rows { display: grid; gap: 8px; margin-bottom: 12px; }
.row { display: grid; grid-template-columns: auto 90px auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.row-label { color: var(--muted); font-size: 14px; }

/* Boutique */
.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
}
.shop-item .price { color: var(--muted); }
.shop-form { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.money-preview { font-weight: 700; color: var(--text); }
.inline { display: flex; gap: 8px; }
.inline > * { flex: 1; min-width: 0; }
.e-desc { white-space: pre-line; }
.discord-button { background: var(--accent); color: #fff; }
.shop-item a { color: inherit; text-decoration: none; }
.shop-item a:hover { text-decoration: underline; }
.card .error-banner { margin: 0 0 12px; }

/* Staff & rôles */
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; }
.staff-level { display: grid; gap: 6px; padding: 12px; background: var(--bg); border-radius: 8px; }
.staff-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-head .hint { margin-left: 4px; }
.hint.warn { color: #f0b232; }
.role-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.role-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.role-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }
.login-avatar { width: 72px; height: 72px; border-radius: 50%; }
.login-invite { width: 100%; margin-top: 10px; border: 1px solid var(--border); }
.login-card .hint { margin: 12px 0 0; }

.save-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 4;
}

/* Embed de l'aperçu avec miniature à droite */
.embed-flex { display: flex; gap: 12px; align-items: flex-start; border-left-color: var(--platform, var(--accent)); }
.embed-body { flex: 1; min-width: 0; }
.e-desc { font-size: 14px; word-wrap: break-word; }
.e-thumb { width: 64px; height: 64px; border-radius: 4px; flex: none; }

/* ─── Espace staff ──────────────────────────────────────── */
.staff-badge { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grade-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.grade-badge { background: var(--grade); color: #fff; font-weight: 700; border-radius: 999px; padding: 4px 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.ladder-step { background: var(--bg); border-radius: 8px; padding: 10px 12px; border-top: 3px solid var(--grade); opacity: 0.55; display: grid; gap: 4px; align-content: start; }
.ladder-step.on { opacity: 1; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.action-btn {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 2px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.action-btn:hover:not(:disabled) { border-color: var(--accent); }
.action-btn.danger:hover:not(:disabled) { border-color: var(--danger); }
.action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.action-btn small { font-weight: 400; color: var(--faint); font-size: 12px; }
.action-emoji { font-size: 20px; }
.result { margin-top: 14px; border-left: 4px solid var(--success); background: var(--bg); border-radius: 6px; padding: 10px 14px; display: grid; gap: 10px; }
.result.fail { border-left-color: var(--danger); }
.result-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.member-picker { display: grid; gap: 6px; }
.member-results { display: grid; gap: 4px; }
.member-option { text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.member-option:hover { border-color: var(--accent); }
.member-chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.member-chip img { width: 24px; height: 24px; border-radius: 50%; }
.member-chip .tag { margin-left: 0; padding-right: 10px; }
.team-row { background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.team-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.team-main .role-info { flex: 1 1 240px; }
.team-main .alert-actions { align-items: center; }
.team-main select { width: auto; max-width: 220px; }
.team-journal:not(:empty) { margin-top: 10px; }
.team-journal .shop-item { background: var(--panel); }

/* Sujets des tickets */
.topic-row { background: var(--bg); border-radius: 8px; padding: 12px; display: grid; gap: 4px; }
.topic-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.topic-head > input:not(.topic-emoji) { flex: 1; min-width: 0; }
input.topic-emoji { width: 56px; flex: none; text-align: center; font-size: 18px; padding: 6px; }
.button-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.discord-button.secondary { background: #4e5058; margin-top: 0; }
.e-field { margin-top: 8px; }
.e-field-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }

/* Membres */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.member-row:hover { border-color: var(--accent); }
.member-row .role-info { display: grid; gap: 2px; }
.member-roles { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 40%; }
.member-roles .tag, .member-info + .tags .tag { margin-left: 0; padding-right: 10px; }
.member-title { display: inline-flex; align-items: center; gap: 10px; }
.member-title img { width: 40px; height: 40px; border-radius: 50%; }
.member-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin-top: 8px; }

/* Chat staff */
.chat-list { height: min(60vh, 560px); overflow-y: auto; display: grid; align-content: start; gap: 2px; background: var(--bg); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.chat-msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.chat-msg:hover { background: var(--panel-2); }
.chat-msg.mine { background: var(--mention-bg); }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.chat-body { min-width: 0; flex: 1; }
.chat-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-head .tag { margin-left: 0; padding-right: 10px; font-size: 11px; }
.chat-image { max-width: min(320px, 100%); max-height: 240px; border-radius: 6px; margin-top: 4px; display: block; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; }

/* Menu des comptes */
.user { position: relative; }
.account-button { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; color: var(--text); }
.account-button:hover { background: var(--panel-2); }
.account-button img, .account-item img { width: 28px; height: 28px; border-radius: 50%; }
.account-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; }
.caret { color: var(--muted); font-size: 12px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); padding: 8px; display: grid; gap: 2px; z-index: 30; }
.account-menu[hidden] { display: none; }
.account-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
.account-item { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; text-align: left; color: var(--text); }
.account-item:hover:not(:disabled) { background: var(--panel-2); }
.account-item.active { background: var(--mention-bg); cursor: default; }
.account-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-check { color: var(--success); font-weight: 700; }
.account-link { display: block; padding: 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.account-link:hover { background: var(--panel-2); }
.account-link.danger { color: var(--danger); }
.account-hint { padding: 4px 8px; margin: 0; }
.account-menu .account-title + .account-item { margin-top: 2px; }

/* ─── Notifications ─────────────────────────────────────── */
#toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: grid; gap: 8px; justify-items: end; z-index: 20; pointer-events: none; }
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  pointer-events: auto;
}
.toast.error { border-left-color: var(--danger); }

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { align-items: center; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; }
  .sidebar h2 { display: none; }
  .guild { width: auto; flex: none; }
  .guild .name { max-width: 140px; }
  .main { padding: 20px 16px; }
  .editor { grid-template-columns: 1fr; }
  .split, .grid2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto 70px auto minmax(0, 1fr) auto; }
  .shop-item { flex-direction: column; align-items: flex-start; }
  .alert { grid-template-columns: 1fr; }
  .alert-actions { justify-content: flex-start; }
  .account-button .name { display: none; }
}
