/* ════════════ Design system — style « John-Bot » : gris plat, rail de serveurs, sidebar à bannière, accents rouges ════════════ */
:root {
  --rail: #111214;
  --side: #2b2d31;
  --bg: #1e1f22;
  --top: #2b2d31;
  --card: #2b2d31;
  --card-2: #313338;
  --input: #1e1f22;
  --hover: #35373c;
  --line: #3f4147;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --dim: #80848e;
  --accent: #f23f42; /* rouge des tuiles */
  --blue: #5865f2;
  --blue-2: #7983f5;
  --green: #23a559;
  --warn: #f0b132;
  --danger: #f23f42;
  --radius: 4px;
  --rail-w: 76px;
  --side-w: 304px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #454545; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
.ico { display: inline-flex; flex: none; align-items: center; justify-content: center; }
.ico svg { display: block; }

/* ───── Boutons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius); border: 0; background: #4e5058; color: var(--text);
  cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, transform .05s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: #6d6f78; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.red { background: var(--accent); color: #fff; }
.btn.red:hover { background: #f05a5f; }
.btn.danger { background: transparent; box-shadow: inset 0 0 0 1px rgba(237,66,69,.6); color: #ff7b7d; }
.btn.danger:hover { background: rgba(237,66,69,.14); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn.discord { background: #5865f2; color: #fff; padding: 14px 28px; font-size: 16px; }
.btn.discord:hover { background: #6b77f5; }

/* ───── Formulaires ───── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: #666; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
textarea.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; tab-size: 2; white-space: pre; overflow: auto; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=color] { width: 40px; height: 36px; padding: 2px; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; flex: none; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.grow { flex: 1 1 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.colorpick { display: flex; gap: 8px; align-items: center; }
.colorpick input[type=text] { width: 100px; font-family: ui-monospace, Consolas, monospace; }
.rangebox { display: flex; gap: 12px; align-items: center; }
.rangebox output { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; background: #4a4a4a; border-radius: 24px; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }

.seg { display: inline-flex; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 3px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--blue); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: #3a3a3a; font-size: 12.5px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 15px; line-height: 1; }
.chip button:hover { color: var(--danger); }
.chip.click { cursor: pointer; font-family: ui-monospace, Consolas, monospace; background: #333; }
.chip.click:hover { background: var(--blue); color: #fff; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #3a3a3a; color: var(--muted); }
.pill.on { background: rgba(59,165,93,.18); color: #59d98a; }
.pill.off { background: #3a3a3a; color: var(--muted); }
.pill.warn { background: rgba(240,160,32,.18); color: #ffc45c; }
.badge { background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 3px; margin-left: auto; }

/* ───── Cartes ───── */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card > h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.card > .sub { color: var(--muted); margin-bottom: 18px; font-size: 14px; }
.card > h3:not(:has(+ .sub)) { margin-bottom: 16px; }
.notice { background: rgba(47,107,255,.12); border-left: 3px solid var(--blue); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; }
.notice.warn { background: rgba(240,160,32,.1); border-color: var(--warn); }
.notice.err { background: rgba(237,66,69,.1); border-color: var(--danger); }
.notice.ok { background: rgba(59,165,93,.1); border-color: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 28px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ───── Layout dashboard ───── */
.app { display: grid; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); height: 100vh; overflow: hidden; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-logo { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.rail-sep { width: 32px; border-top: 2px solid #2e2e2e; margin: 2px 0; flex: none; }
.rail-item { position: relative; width: 52px; height: 52px; border-radius: 50%; background: #313338; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 700; font-size: 15px; flex: none; transition: border-radius .15s, background .15s; cursor: pointer; text-decoration: none !important; }
.rail-item:hover { border-radius: 16px; background: #5865f2; color: #fff; }
.rail-item.on { border-radius: 16px; outline: 2px solid var(--blue); outline-offset: 2px; }
.rail-item img { width: 100%; height: 100%; object-fit: cover; }
.rail-item.add { color: var(--green); background: #2b2b2b; }
.rail-item.add:hover { background: var(--green); color: #fff; }

.side { background: var(--side); display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }
.banner { position: relative; height: 158px; flex: none; overflow: hidden; background: linear-gradient(135deg, #3b3b55, #23232f); }
.banner .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) brightness(.75) saturate(1.3); }
.banner .gicon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78px; height: 78px; border-radius: 50%; border: 3px solid rgba(255,255,255,.9); background: #333; font-size: 26px; }
.gicon { display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; background: #3a3a3a; border-radius: 12px; width: 44px; height: 44px; }
.gicon img { width: 100%; height: 100%; object-fit: cover; }

.nav { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; border-radius: var(--radius); color: var(--text); font-weight: 500; text-decoration: none !important; cursor: pointer; }
.nav-item .ico { color: #bdbdbd; }
.nav-item:hover { background: #35373c; }
.nav-item.on { background: #404249; }
.nav-item.on .ico { color: #fff; }
.nav-group { margin-top: 14px; }
.nav-group-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; user-select: none; color: #ddd; }
.nav-group-h .ico { transition: transform .2s; }
.nav-group.closed .nav-group-h .ico { transform: rotate(180deg); }
.nav-group.closed .nav-group-items { display: none; }
.nav-foot { margin-top: auto; padding: 14px; border-top: 1px solid #333; }

.work { overflow-y: auto; min-width: 0; height: 100vh; scroll-behavior: smooth; }
.top { position: sticky; top: 0; z-index: 30; height: 80px; background: var(--top); display: flex; align-items: center; justify-content: space-between; padding: 0 36px 0 36px; gap: 16px; }
.top-l, .top-r { display: flex; align-items: center; gap: 28px; }
.top a, .top .lnk { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; cursor: pointer; background: none; border: 0; padding: 0; font-size: 15px; text-decoration: none !important; }
.top a:hover, .top .lnk:hover { color: #fff; opacity: .85; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #444; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; font-weight: 700; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; right: 30px; top: 70px; background: #333; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 220px; padding: 6px; z-index: 40; }
.menu .who { padding: 10px 12px; color: var(--muted); font-size: 13px; border-bottom: 1px solid #444; margin-bottom: 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; background: none; border: 0; border-radius: 3px; cursor: pointer; text-align: left; }
.menu button:hover { background: #444; }
.hamb { display: none; }

.content { padding: 44px 56px 110px; max-width: 1480px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .02em; font-size: 22px; font-weight: 400; text-align: center; color: #e2e2e2; }
.title { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 42px; font-weight: 700; text-align: center; margin: 8px 0 44px; flex-wrap: wrap; }
.title .gicon { width: 46px; height: 46px; border-radius: 50%; font-size: 16px; }
.page-head { margin-bottom: 34px; }
.page-head .eyebrow { text-align: left; font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .1em; }
.page-head h1 { font-size: 32px; font-weight: 700; margin-top: 4px; }
.page-head p { color: var(--muted); margin: 8px 0 0; max-width: 780px; }
.h2 { font-size: 26px; font-weight: 700; margin: 34px 0 20px; }

.savebar { position: fixed; bottom: 22px; left: calc(var(--rail-w) + var(--side-w) + (100vw - var(--rail-w) - var(--side-w)) / 2); transform: translateX(-50%); width: min(760px, calc(100vw - var(--rail-w) - var(--side-w) - 40px)); background: #303030; border: 1px solid var(--blue); border-radius: 6px; padding: 12px 16px 12px 20px; display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 60; animation: rise .18s ease; }
.savebar span { flex: 1; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ───── Tuiles de fonctionnalités & cartes d'infos ───── */
.kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.kv { background: var(--card); border-radius: var(--radius); padding: 20px 22px; min-height: 100px; }
.kv .k { display: flex; justify-content: space-between; align-items: center; font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.kv .v { color: var(--muted); overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.kv .copy { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
.kv .copy:hover { color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.tile { position: relative; display: flex; background: var(--card); border-radius: var(--radius); overflow: hidden; min-height: 132px; color: var(--text); text-decoration: none !important; transition: background .15s, transform .15s; cursor: pointer; }
.tile:hover { background: #313338; transform: translateY(-2px); }
.tile-ico { width: 58px; flex: none; background: var(--accent); display: grid; place-items: center; color: #fff; }
.tile-body { flex: 1; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-body h4 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tile-body p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tile.blue .tile-ico { background: var(--blue); }
.tile.green .tile-ico { background: var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px; }
.stat b { font-size: 28px; display: block; }
.stat span { color: var(--muted); }
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.status-row:last-child { border: 0; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tablewrap { overflow-x: auto; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--input); padding: 1px 7px; border-radius: 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 18px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; display: flex; align-items: center; gap: 8px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: #fff; border-color: var(--blue); }

/* ───── Serveurs / accueil ───── */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 480px at 78% -8%, rgba(229,72,77,.16), transparent), radial-gradient(800px 500px at 5% 105%, rgba(47,107,255,.14), transparent), var(--bg); }
.l-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 48px; }
.l-nav b { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.l-hero { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 24px 20px; }
.l-hero h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.l-hero h1 em { font-style: normal; color: var(--accent); }
.l-hero p.lead { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0 auto 32px; }
.l-stats { display: flex; gap: 46px; justify-content: center; margin: 36px 0 8px; flex-wrap: wrap; }
.l-stats b { display: block; font-size: 34px; }
.l-stats span { color: var(--muted); }
.l-feats { max-width: 1180px; margin: 30px auto 60px; padding: 0 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; text-align: left; width: 100%; }
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.server { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.server .cover { height: 92px; background: linear-gradient(135deg, #3b3b55, #23232f); position: relative; overflow: hidden; }
.server .cover i { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(16px) brightness(.7); }
.server .body { padding: 0 20px 20px; margin-top: -30px; position: relative; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.server .gicon { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--card); font-size: 20px; }
.server b { font-size: 17px; }
.topline { display: flex; justify-content: space-between; align-items: center; padding: 18px 40px; background: var(--top); }

/* ───── Designer bienvenue ───── */
.wd { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
.wd-side { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 4px; }
.stage-wrap { background: repeating-conic-gradient(#222 0% 25%, #1b1b1b 0% 50%) 0 0 / 20px 20px; border-radius: var(--radius); padding: 12px; }
.stage { position: relative; width: 100%; aspect-ratio: 1024 / 450; border-radius: 3px; overflow: hidden; user-select: none; touch-action: none; background: #000; }
.stage img.preview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.stage.loading::after { content: ''; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.handle { position: absolute; border: 1.5px dashed rgba(255,255,255,.35); cursor: move; border-radius: 3px; outline: none; }
.handle:hover { border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.handle.sel { border: 2px solid var(--blue-2); background: rgba(47,107,255,.14); }
.handle.sel::before { content: attr(data-label); position: absolute; bottom: 100%; left: -2px; margin-bottom: 2px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.guide-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-left: 1px dashed #ff6bd6; display: none; pointer-events: none; }
.guide-v.on { display: block; }
.layers { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.layer { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--input); cursor: pointer; overflow: hidden; border: 1px solid transparent; }
.layer:hover { border-color: var(--line); }
.layer.sel { border-color: var(--blue); background: rgba(47,107,255,.12); }
.layer > span:not(.ico) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector { border-top: 1px solid var(--line); padding-top: 16px; }
.inspector h4 { margin: 0 0 14px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #000; }
.thumb.on { border-color: var(--blue); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; border: 0; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; display: none; }
.thumb:hover button { display: block; }
.dropzone { border: 2px dashed #4a4a4a; border-radius: var(--radius); padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--blue); color: var(--text); background: rgba(47,107,255,.08); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { aspect-ratio: 16 / 9; border-radius: 3px; border: 2px solid transparent; cursor: pointer; display: grid; place-items: end start; padding: 5px 7px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.preset:hover { border-color: #fff; }

/* ───── Éditeur de messages (style Discohook) ───── */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sticky { position: sticky; top: 100px; }
.ecard { background: var(--card-2); border-radius: var(--radius); margin-bottom: 14px; border-left: 4px solid #555; }
.ecard > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; user-select: none; }
.ecard > summary::-webkit-details-marker { display: none; }
.ecard > summary .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecard > summary .chev { transition: transform .15s; color: var(--muted); }
.ecard[open] > summary .chev { transform: rotate(180deg); }
.ecard .inner { padding: 4px 16px 16px; }
.esec { border-top: 1px solid #454545; margin-top: 10px; padding-top: 4px; }
.esec > summary { cursor: pointer; padding: 8px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.esec > summary::-webkit-details-marker { display: none; }
.frow { background: var(--card); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.frow-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.mtabs { display: flex; gap: 4px; margin-bottom: 14px; }
.mtabs button { background: var(--card-2); border: 0; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-weight: 600; color: var(--muted); }
.mtabs button.on { background: var(--blue); color: #fff; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* aperçu Discord */
.dc { background: #313338; border-radius: 6px; padding: 16px; color: #dbdee1; font-family: 'gg sans', 'Noto Sans', 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.dc .msg { display: flex; gap: 14px; }
.dc .av { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; overflow: hidden; }
.dc .av img { width: 100%; height: 100%; object-fit: cover; }
.dc .who { font-weight: 600; color: #fff; margin-bottom: 2px; }
.dc .who .tag { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.dc .body { min-width: 0; flex: 1; }
.dc .content { white-space: pre-wrap; margin-bottom: 6px; }
.dc .embed { display: grid; max-width: 520px; background: #2b2d31; border-left: 4px solid #1e1f22; border-radius: 4px; padding: 8px 16px 16px 12px; margin-top: 4px; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
.dc .embed > * { grid-column: 1; }
.dc .embed .thumb-img { grid-column: 2; grid-row: 1 / 8; width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.dc .e-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #fff; }
.dc .e-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc .e-title { margin-top: 8px; font-weight: 700; font-size: 16px; color: #fff; }
.dc .e-title a { color: #00a8fc; }
.dc .e-desc { margin-top: 8px; font-size: 14px; white-space: pre-wrap; }
.dc .e-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.dc .e-field { grid-column: 1 / -1; font-size: 14px; }
.dc .e-field.inline { grid-column: span 4; }
.dc .e-field b { display: block; color: #fff; font-size: 14px; margin-bottom: 2px; }
.dc .e-image { margin-top: 16px; max-width: 100%; border-radius: 4px; display: block; }
.dc .e-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #b5bac1; }
.dc .e-foot img { width: 20px; height: 20px; border-radius: 50%; }
.dc .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc .dbtn.primary { background: #5865f2; }
.dc .dbtn.secondary { background: #4e5058; }
.dc .dbtn.success { background: #23a559; }
.dc .dbtn.danger { background: #da373c; }
.dc .dbtn { background: #4e5058; color: #fff; border-radius: 3px; padding: 6px 14px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.dc h1, .dc h2, .dc h3 { color: #fff; margin: 8px 0 2px; }
.dc h1 { font-size: 24px; } .dc h2 { font-size: 20px; } .dc h3 { font-size: 16px; }
.dc .quote { border-left: 4px solid #4e5058; padding-left: 12px; margin: 2px 0; }
.dc .sub { font-size: 12px; color: #b5bac1; }
.dc pre { background: #1e1f22; border: 1px solid #1a1b1e; padding: 8px; border-radius: 4px; margin: 4px 0; white-space: pre-wrap; font-size: 13px; }
.dc code { background: #1e1f22; padding: 0 4px; }
.dc a { color: #00a8fc; }
.dc .mention { background: rgba(88,101,242,.3); color: #c9cdfb; padding: 0 3px; border-radius: 3px; font-weight: 500; }
.dc img.emoji { width: 22px; height: 22px; vertical-align: -5px; }

/* ───── Tableau de liaison à câbles ───── */
.cboard { position: relative; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(70px, 150px) minmax(260px, 1.1fr); align-items: start; }
.ccol { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 2; min-width: 0; }
.ccables { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.ccable { fill: none; stroke-width: 3; stroke-linecap: round; opacity: .9; pointer-events: stroke; cursor: pointer; transition: stroke-width .1s; }
.ccable:hover { stroke-width: 6; opacity: 1; }
.ccable.temp { stroke: #fff; stroke-dasharray: 6 6; pointer-events: none; }
.citem { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--card-2); border-radius: 4px; cursor: pointer; border: 1px solid transparent; user-select: none; }
.citem:hover { border-color: var(--line); }
.citem.sel { border-color: var(--blue); background: rgba(88,101,242,.14); }
.citem.over { border-color: #fff; }
.citem .dot, .wrow .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #111; flex: none; }
.cport { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid #6d6f78; flex: none; cursor: crosshair; touch-action: none; }
.cport:hover { border-color: var(--blue); }
.ctarget { position: relative; background: var(--card-2); border-radius: 4px; border-left: 4px solid var(--c, #555); padding: 12px 14px 12px 24px; cursor: pointer; }
.ctarget.over { outline: 2px solid #fff; }
.ctarget .cport.in { position: absolute; left: -12px; top: 18px; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 820px) { .cboard { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); } }

/* ───── Permissions : cases à cocher, matrice d'accès, différences ───── */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); flex: none; }
.permgroup { margin-bottom: 16px; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.matrix th { padding: 4px 8px; white-space: nowrap; border: 0; }
.matrix td { padding: 10px 8px; background: var(--card-2); border: 0; vertical-align: top; }
.matrix td:first-child { border-radius: 4px 0 0 4px; }
.matrix td:last-child { border-radius: 0 4px 4px 0; }
select.lvl { padding: 7px 28px 7px 10px; font-size: 13px; font-weight: 600; min-width: 140px; }
select.lvl-keep { color: #b5bac1; }
select.lvl-none { color: #ff8a8c; border-color: rgba(242,63,66,.55); }
select.lvl-read { color: #7ecbff; border-color: rgba(126,203,255,.45); }
select.lvl-talk { color: #59d98a; border-color: rgba(89,217,138,.45); }
select.lvl-manage { color: #c9a7ff; border-color: rgba(201,167,255,.5); }
select.lvl-reset { color: #f0b132; border-color: rgba(240,177,50,.5); }
.chip.pos { background: rgba(35,165,89,.2); color: #59d98a; }
.chip.neg { background: rgba(242,63,66,.18); color: #ff8a8c; }
.chip.neu { background: #3a3d44; color: #b5bac1; }

/* ───── Palette de commandes (Ctrl+K) ───── */
#palette { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200; display: grid; place-items: start center; padding-top: 14vh; }
.pal { width: min(560px, 92vw); background: #2f2f2f; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; }
.pal input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; background: transparent; }
.pal-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; cursor: pointer; }
.pal-item.on, .pal-item:hover { background: #3f3f3f; }

/* ───── Toasts (en bas à gauche, comme John-Bot) ───── */
#toasts { position: fixed; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast { position: relative; display: flex; align-items: center; gap: 12px; background: #3a3a3a; padding: 16px 22px 18px; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 420px; min-width: 300px; overflow: hidden; animation: pop .22s ease; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: #e6e6e6; width: 100%; transform-origin: left; animation: shrink linear forwards; }
.toast.ok .bar { background: var(--green); }
.toast.err .bar { background: var(--danger); }
@keyframes shrink { to { transform: scaleX(0); } }
@keyframes pop { from { transform: translateX(-16px); opacity: 0; } }

/* ───── Responsive ───── */
@media (max-width: 1180px) {
  .wd { grid-template-columns: 1fr; }
  .wd-side { position: static; max-height: none; }
  .two { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .content { padding: 34px 28px 110px; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .side { position: fixed; z-index: 90; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.5); }
  .app.open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80; }
  .hamb { display: inline-flex; }
  .top { padding: 0 16px; }
  .top-r .hide-s { display: none; }
  .content { padding: 26px 16px 110px; }
  .title { font-size: 30px; }
  .eyebrow { font-size: 17px; }
  .savebar { left: 16px; right: 16px; width: auto; transform: none; animation: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .l-nav { padding: 16px 20px; }
}

/* Permissions : accès réel */
.slotopts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 10px; }
.slotopts .switch-row, .slotopts label { font-size: 12.5px; }
.accbox { background: var(--card-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.verdict { padding: 9px 12px; border-radius: 4px; margin-bottom: 10px; font-size: 13.5px; border-left: 3px solid var(--line); background: rgba(255,255,255,.04); }
.verdict.ok { background: rgba(59,165,93,.12); border-color: var(--green); color: #b6f0cb; }
.verdict.warn { background: rgba(240,160,32,.12); border-color: var(--warn); color: #ffd98a; }
.verdict.err { background: rgba(237,66,69,.13); border-color: var(--danger); color: #ffb3b5; }
.accrows { display: flex; flex-direction: column; gap: 2px; }
.accrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 8px 10px; border-radius: 4px; }
.accrow:nth-child(odd) { background: rgba(255,255,255,.03); }
.accrow.stray { background: rgba(237,66,69,.1); }
.accname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.accname .grow { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accname .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.accval { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.why { grid-column: 1 / -1; font-size: 12.5px; color: #ffb3b5; padding-left: 18px; }
.lvbadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.lv-none { background: rgba(242,63,66,.16); color: #ff8a8c; }
.lv-read { background: rgba(126,203,255,.15); color: #7ecbff; }
.lv-talk { background: rgba(89,217,138,.16); color: #59d98a; }
.lv-manage { background: rgba(201,167,255,.16); color: #c9a7ff; }
.lv-admin { background: rgba(240,177,50,.16); color: #f0b132; }
.plandet summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.plandet summary:hover { color: var(--text); }

/* Salons stats & salutation vocale */
.hint.good { color: #59d98a; }
.hint.bad { color: #ff8a8c; }
.statrow { background: var(--card-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.statname { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.statname .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statprev { font-size: 12.5px; color: #7ecbff; min-height: 1em; word-break: break-word; }
.statprev.err { color: #ffb3b5; }
.vargrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px 18px; }
.varrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.varrow .chip { flex: none; }
.memrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; background: var(--card-2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.memrow > input { grid-column: 1 / -1; grid-row: 2; }
.memwho { display: flex; align-items: center; gap: 10px; min-width: 0; }
.memwho b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memav { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: #444; }
.memav.ph { display: grid; place-items: center; font-weight: 700; }
.memact { display: flex; align-items: center; gap: 8px; }
.memact select { width: 170px; }
.dropwrap { position: relative; }
.dropdown { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.45); max-height: 320px; overflow: auto; }
.dropitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; background: transparent; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.dropitem:hover { background: rgba(255,255,255,.07); }
@media (max-width: 800px) { .memrow { grid-template-columns: 1fr; } .memrow > input { grid-row: auto; } .memact { flex-wrap: wrap; } .vargrid { grid-template-columns: 1fr; } }
