/* Panel admin du bot Pixelar — reprend la charte de pixelar.fr (tokens, Barlow, vert néon). */
@font-face { font-family: Barlow; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-regular.ttf') format('truetype'); }
@font-face { font-family: Barlow; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-medium.ttf') format('truetype'); }
@font-face { font-family: Barlow; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-semibold.ttf') format('truetype'); }
@font-face { font-family: Barlow; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-bold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-bold.ttf') format('truetype'); }

:root {
  color-scheme: dark;
  --px-bg: #070908;
  --px-bg-soft: #0b0e0c;
  --px-surface: #101411;
  --px-surface-raised: #151a16;
  --px-surface-hover: #192019;
  --px-border: #2c362f;
  --px-border-soft: rgba(236, 245, 237, .08);
  --px-border-strong: #526959;
  --px-text: #f3f5ed;
  --px-text-soft: #bec9bf;
  --px-muted: #a0afa4;
  --px-green: #4bc84b;
  --px-green-bright: #70ee70;
  --px-green-soft: rgba(75, 200, 75, .12);
  --px-glow: 0 0 24px rgba(75, 200, 75, .24);
  --px-danger: #ef7777;
  --px-warning: #e5b765;
  --px-blue: #74a9ef;
  --px-font-body: Barlow, 'Segoe UI', system-ui, sans-serif;
  --px-font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --px-shell: min(1320px, calc(100% - 64px));
  --px-header-height: 72px;
  --px-radius: 11px;
  --px-ease: cubic-bezier(.2, .75, .25, 1);
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
  --discord-text: #dbdee1;
  --discord-muted: #949ba4;
  --discord-link: #00a8fc;
}

* { box-sizing: border-box; }
html { background: var(--px-bg); }
body { margin: 0; min-height: 100vh; background: var(--px-bg); color: var(--px-text); font-family: var(--px-font-body); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--px-green-bright); }
h1, h2, h3 { font-family: var(--px-font-display); font-weight: 700; margin: 0; line-height: 1.05; }
:is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--px-green-bright); outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(75, 200, 75, .16); background: rgba(7, 9, 8, .94); backdrop-filter: blur(12px); }
.nav-wrap { width: var(--px-shell); min-height: var(--px-header-height); margin: 0 auto; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--px-text); text-decoration: none; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand-word { font-family: var(--px-font-display); font-size: 1.45rem; letter-spacing: .02em; text-transform: uppercase; }
.brand-suffix { padding: 2px 6px; border: 1px solid rgba(112, 238, 112, .4); color: var(--px-green-bright); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav-links { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; color: #b9c3bb; font-size: .9375rem; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color .16s ease, background-color .16s ease; }
.nav-links button:hover { color: var(--px-text); background: rgba(255, 255, 255, .05); }
.nav-links button[aria-current="page"] { color: var(--px-green-bright); box-shadow: inset 0 -2px var(--px-green); background: transparent; }
.nav-count { margin-left: 7px; padding: 0 6px; border-radius: 999px; background: var(--px-green-soft); color: var(--px-green-bright); font-size: .75rem; }
.auth-area { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border: 1px solid var(--px-border); border-radius: 999px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--px-surface-raised); }
.user-chip span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: .9rem; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--px-muted); cursor: pointer; }
.icon-btn:hover { color: var(--px-text); background: var(--px-surface-hover); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid var(--px-border-strong); border-radius: 5px; background: transparent; color: var(--px-text); font-size: .9375rem; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .16s var(--px-ease), background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.btn:hover { transform: translateY(-2px); background: var(--px-surface-hover); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { border-color: rgba(112, 238, 112, .4); background: var(--px-green); color: #071008; font-weight: 600; box-shadow: var(--px-glow); }
.btn-primary:hover { border-color: var(--px-green-bright); background: var(--px-green-bright); box-shadow: 0 0 36px rgba(75, 200, 75, .4); }
.btn-danger { border-color: rgba(239, 119, 119, .35); color: #f3a0a0; }
.btn-danger:hover { background: rgba(239, 119, 119, .1); border-color: var(--px-danger); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.btn-ghost { border-color: transparent; color: var(--px-text-soft); }
.btn-ghost:hover { border-color: var(--px-border); }

/* ---------- Mise en page ---------- */
.shell { width: var(--px-shell); margin: 0 auto; padding-block: 34px 80px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.eyebrow { color: var(--px-green-bright); font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
.view-head h1 { font-size: clamp(2rem, 4vw, 2.75rem); text-transform: uppercase; letter-spacing: .01em; }
.view-head p { margin: 8px 0 0; color: var(--px-muted); max-width: 62ch; }

/* ---------- Hero tableau de bord ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; margin-bottom: 26px; padding: clamp(34px, 6vw, 72px) clamp(24px, 5vw, 60px); border: 1px solid var(--px-border); border-radius: 18px; background: var(--px-bg-soft); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url('https://pixelar.fr/assets/img/hero-24.webp') center 35% / cover no-repeat; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(7, 9, 8, .97) 0%, rgba(7, 9, 8, .82) 46%, rgba(7, 9, 8, .35) 100%), radial-gradient(circle at 12% 0%, rgba(75, 200, 75, .18), transparent 40%); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); text-transform: uppercase; max-width: 14ch; text-shadow: 0 2px 30px #000; }
.hero h1 em { font-style: normal; color: var(--px-green-bright); }
.hero p { max-width: 52ch; margin: 18px 0 26px; color: #d7ddd5; font-size: 1.0625rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { padding: 18px 20px; border: 1px solid var(--px-border); border-radius: var(--px-radius); background: linear-gradient(180deg, var(--px-surface), var(--px-bg-soft)); }
.stat-card span { display: block; color: var(--px-muted); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 6px; font-family: var(--px-font-display); font-size: 2.1rem; line-height: 1; }
.stat-card small { display: block; margin-top: 6px; color: var(--px-muted); font-size: .8125rem; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--px-green-bright); box-shadow: 0 0 10px rgba(112, 238, 112, .8); vertical-align: middle; }
.status-dot.off { background: var(--px-danger); box-shadow: 0 0 10px rgba(239, 119, 119, .6); }

.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel-card { border: 1px solid var(--px-border); border-radius: var(--px-radius); background: var(--px-surface); overflow: hidden; }
.panel-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--px-border-soft); }
.panel-card > header h2 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: .02em; }
.panel-card .card-body { padding: 8px 20px 16px; }
.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--px-border-soft); background: transparent; text-align: left; cursor: pointer; }
.quick-link:last-child { border-bottom: 0; }
.quick-link strong { display: block; font-weight: 600; }
.quick-link span { color: var(--px-muted); font-size: .875rem; }
.quick-link:hover strong { color: var(--px-green-bright); }
.quick-link .arrow { color: var(--px-muted); font-size: 1.1rem; }

/* ---------- Liste + éditeur ---------- */
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.list-pane { position: sticky; top: calc(var(--px-header-height) + 18px); display: flex; flex-direction: column; max-height: calc(100vh - var(--px-header-height) - 36px); border: 1px solid var(--px-border); border-radius: var(--px-radius); background: var(--px-surface); overflow: hidden; }
.list-tools { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--px-border-soft); }
.list-items { overflow-y: auto; padding: 8px; }
.list-group-title { padding: 12px 10px 6px; color: var(--px-green-bright); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.list-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.list-item:hover { background: var(--px-surface-hover); }
.list-item.active { border-color: rgba(75, 200, 75, .35); background: var(--px-green-soft); }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--px-muted); font-size: .8125rem; }
.list-empty { padding: 26px 12px; color: var(--px-muted); text-align: center; font-size: .9rem; }
.cmd-name { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92rem; }

.badge { flex-shrink: 0; padding: 2px 7px; border-radius: 999px; background: rgba(160, 175, 164, .12); color: var(--px-muted); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.badge.green { background: var(--px-green-soft); color: var(--px-green-bright); }
.badge.warn { background: rgba(229, 183, 101, .12); color: var(--px-warning); }
.badge.off { background: rgba(239, 119, 119, .1); color: #f3a0a0; }

.editor-pane { min-width: 0; border: 1px solid var(--px-border); border-radius: var(--px-radius); background: var(--px-surface); }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-bottom: 1px solid var(--px-border-soft); }
.editor-head h2 { font-size: 1.7rem; text-transform: uppercase; }
.editor-head h2.cmd-name { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.5rem; text-transform: none; }
.editor-head p { margin: 4px 0 0; color: var(--px-muted); font-size: .9rem; max-width: 70ch; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.editor-form { min-width: 0; padding: 20px 22px 26px; border-right: 1px solid var(--px-border-soft); display: grid; gap: 18px; align-content: start; }
.editor-preview { min-width: 0; padding: 20px 22px 26px; }
.preview-sticky { position: sticky; top: calc(var(--px-header-height) + 20px); }
.editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--px-border-soft); background: var(--px-bg-soft); border-radius: 0 0 var(--px-radius) var(--px-radius); position: sticky; bottom: 0; z-index: 5; }
.editor-actions .spacer { flex: 1; }
.dirty-flag { color: var(--px-warning); font-size: .875rem; }
.editor-empty { padding: 70px 30px; text-align: center; color: var(--px-muted); }
.editor-empty strong { display: block; margin-bottom: 6px; color: var(--px-text); font-family: var(--px-font-display); font-size: 1.6rem; text-transform: uppercase; }

/* ---------- Formulaires ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 -6px; color: var(--px-green-bright); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { display: flex; justify-content: space-between; gap: 10px; color: var(--px-text-soft); font-size: .875rem; font-weight: 500; }
.counter { color: var(--px-muted); font-size: .75rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--px-danger); }
.hint { margin: 0; color: var(--px-muted); font-size: .8125rem; }
.input, .select, .textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--px-border); border-radius: 5px; background: var(--px-bg-soft); color: var(--px-text); outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(75, 200, 75, .12); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.textarea.tall { min-height: 150px; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--px-border); border-right: 0; border-radius: 5px 0 0 5px; background: var(--px-surface-raised); color: var(--px-green-bright); font-family: ui-monospace, monospace; }
.prefix-input .input { border-radius: 0 5px 5px 0; }
.color-input { display: flex; gap: 8px; }
.color-input input[type="color"] { flex: 0 0 44px; height: 42px; padding: 3px; border: 1px solid var(--px-border); border-radius: 5px; background: var(--px-bg-soft); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--px-text-soft); font-size: .9rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--px-green); flex-shrink: 0; }
.check small { display: block; color: var(--px-muted); font-size: .8125rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--px-border); border-radius: 7px; background: var(--px-bg-soft); }
.embed-block { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--px-border); border-left: 3px solid var(--px-green); border-radius: 7px; background: rgba(11, 14, 12, .7); }
.embed-field-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--px-border-soft); border-radius: 7px; background: var(--px-surface); }
.embed-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--px-muted); font-size: .8125rem; }
.embed-field-head .tools { display: flex; gap: 2px; }
.mini-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--px-muted); cursor: pointer; font-size: .8125rem; }
.mini-btn:hover { color: var(--px-text); border-color: var(--px-border); background: var(--px-surface-hover); }
.mini-btn.danger:hover { color: #f3a0a0; border-color: rgba(239, 119, 119, .35); }
.image-input { display: flex; gap: 8px; align-items: center; }
.image-input .input { flex: 1; min-width: 0; }
.image-picked { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--px-border); border-radius: 6px; background: var(--px-surface); }
.image-picked img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.image-picked span { flex: 1; min-width: 0; color: var(--px-text-soft); font-size: .875rem; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.image-tile { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--px-border); border-radius: 6px; background: var(--px-surface); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile .mini-btn { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .65); color: #fff; }
.field.dropping { outline: 2px dashed var(--px-green); outline-offset: 4px; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; text-align: left; padding: 4px 10px; border: 1px solid var(--px-border); border-radius: 999px; background: var(--px-bg-soft); color: var(--px-text-soft); font-size: .8125rem; cursor: pointer; }
.chip:hover { border-color: var(--px-green); color: var(--px-green-bright); }
.chip code { font-family: ui-monospace, monospace; color: var(--px-green-bright); }
.chip.role { cursor: default; }
.chip.role button { border: 0; background: transparent; color: var(--px-muted); cursor: pointer; padding: 0; }
.chip.role button:hover { color: var(--px-danger); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--px-muted); }
.error-box { padding: 11px 14px; border: 1px solid rgba(239, 119, 119, .4); border-radius: 7px; background: rgba(239, 119, 119, .08); color: #f3b4b4; font-size: .9rem; }

/* ---------- Aperçu Discord ---------- */
.preview-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--px-muted); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.discord { padding: 16px 16px 18px; border-radius: 8px; background: var(--discord-bg); color: var(--discord-text); font-family: 'gg sans', 'Noto Sans', 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.375; overflow-wrap: break-word; }
.dc-message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #1e1f22; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-name { color: #f2f3f5; font-weight: 600; }
.dc-tag { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; }
.dc-time { color: var(--discord-muted); font-size: 12px; }
.dc-content { white-space: normal; }
.dc-trigger { margin-bottom: 12px; color: var(--discord-muted); font-size: 13px; }
.dc-trigger code { padding: 1px 5px; border-radius: 4px; background: #1e1f22; color: var(--discord-text); }
.dc-embed { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; max-width: 520px; margin-top: 6px; padding: 10px 16px 16px 12px; border-left: 4px solid #1e1f22; border-radius: 4px; background: var(--discord-embed); }
.dc-embed-main { min-width: 0; display: grid; gap: 8px; padding-top: 2px; }
.dc-embed-author { display: flex; align-items: center; gap: 8px; color: #f2f3f5; font-size: 14px; font-weight: 600; }
.dc-embed-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-embed-title { color: #f2f3f5; font-size: 16px; font-weight: 600; }
.dc-embed-title.link { color: var(--discord-link); }
.dc-embed-desc { font-size: 14px; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.dc-field { grid-column: 1 / -1; min-width: 0; font-size: 14px; }
.dc-field.inline { grid-column: span 1; }
.dc-field-name { margin-bottom: 2px; color: #f2f3f5; font-weight: 600; }
.dc-thumb { width: 80px; height: 80px; margin: 6px 0 0 16px; border-radius: 4px; object-fit: cover; }
.dc-image { grid-column: 1 / -1; max-width: 100%; max-height: 300px; margin-top: 16px; border-radius: 4px; object-fit: contain; justify-self: start; }
.dc-attachments { display: grid; gap: 4px; max-width: 520px; margin-top: 6px; }
.dc-attachments img { max-width: 100%; max-height: 300px; border-radius: 8px; object-fit: contain; }
.dc-attachments.multi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dc-attachments.multi img { width: 100%; height: 160px; object-fit: cover; }
.dc-footer { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin-top: 8px; color: var(--discord-muted); font-size: 12px; }
.dc-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-empty { color: var(--discord-muted); font-style: italic; font-size: 14px; }
.md-line { min-height: 1.375em; }
.md-h1 { font-size: 1.5em; font-weight: 700; margin: 6px 0 2px; color: #f2f3f5; }
.md-h2 { font-size: 1.25em; font-weight: 700; margin: 6px 0 2px; color: #f2f3f5; }
.md-h3 { font-size: 1em; font-weight: 700; margin: 6px 0 2px; color: #f2f3f5; }
.md-sub { color: var(--discord-muted); font-size: 12px; }
.md-quote { padding-left: 12px; border-left: 4px solid #4e5058; }
.md-li { display: flex; gap: 8px; padding-left: 4px; }
.md-li::before { content: "•"; color: var(--discord-text); }
.md-code { padding: 0 3px; border-radius: 4px; background: #1e1f22; font-family: ui-monospace, Consolas, monospace; font-size: 85%; }
.md-codeblock { margin: 4px 0; padding: 8px; border: 1px solid #1e1f22; border-radius: 4px; background: #2b2d31; font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre-wrap; }
.dc-embed .md-codeblock { background: #1e1f22; }
.md-spoiler { border-radius: 3px; background: #1e1f22; color: transparent; cursor: pointer; }
.md-spoiler.open { background: rgba(255, 255, 255, .1); color: inherit; }
.md-link { color: var(--discord-link); text-decoration: none; }
.md-mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; }
.md-time { padding: 0 2px; border-radius: 3px; background: rgba(255, 255, 255, .06); }

/* ---------- Journal ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--px-border); border-radius: var(--px-radius); background: var(--px-surface); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--px-border-soft); text-align: left; vertical-align: top; }
th { color: var(--px-muted); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; background: var(--px-bg-soft); }
tr:last-child td { border-bottom: 0; }
td.muted { color: var(--px-muted); white-space: nowrap; font-size: .875rem; }

/* ---------- Connexion / modales / toasts ---------- */
.login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: linear-gradient(180deg, rgba(7, 9, 8, .6), rgba(7, 9, 8, .95)), url('https://pixelar.fr/assets/img/hero-18.webp') center / cover, var(--px-bg); }
.login-card { width: min(440px, 100%); padding: 40px 34px; border: 1px solid var(--px-border-strong); border-radius: var(--px-radius); background: rgba(7, 9, 8, .9); backdrop-filter: blur(16px); box-shadow: 0 32px 90px rgba(0, 0, 0, .48); text-align: center; }
.login-card img { width: 84px; height: 84px; object-fit: contain; }
.login-card h1 { margin: 16px 0 10px; font-size: 2.3rem; text-transform: uppercase; }
.login-card p { margin: 0 0 24px; color: var(--px-muted); }
.login-card .btn { width: 100%; }
.loading-screen { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: var(--px-bg); color: var(--px-muted); }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid var(--px-border); border-top-color: var(--px-green-bright); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal { width: min(460px, 100%); padding: 24px; border: 1px solid var(--px-border-strong); border-radius: var(--px-radius); background: var(--px-surface); box-shadow: 0 32px 90px rgba(0, 0, 0, .5); }
.modal h3 { font-size: 1.6rem; text-transform: uppercase; }
.modal p { margin: 10px 0 22px; color: var(--px-text-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; width: min(420px, calc(100% - 32px)); padding: 13px 16px; border: 1px solid rgba(75, 200, 75, .45); border-radius: 7px; background: var(--px-surface-raised); box-shadow: 0 16px 50px rgba(0, 0, 0, .45); }
.toast.error { border-color: rgba(239, 119, 119, .5); }
.role-picker { position: relative; }
.role-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto; padding: 6px; border: 1px solid var(--px-border-strong); border-radius: 7px; background: var(--px-surface-raised); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.role-option { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; text-align: left; cursor: pointer; }
.role-option:hover { background: var(--px-green-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-form { border-right: 0; border-bottom: 1px solid var(--px-border-soft); }
  .preview-sticky { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --px-shell: calc(100% - 32px); --px-header-height: 64px; }
  .nav-wrap { flex-wrap: wrap; gap: 6px 16px; padding-block: 8px; }
  .nav-links { order: 3; width: 100%; }
  .user-chip span { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .list-pane { position: static; max-height: 340px; }
  .cards-2, .row-2 { grid-template-columns: minmax(0, 1fr); }
  .shell { padding-block: 22px 60px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .auth-area .btn { display: none; }
  .editor-head, .editor-form, .editor-preview, .editor-actions { padding-inline: 16px; }
  .dc-fields { grid-template-columns: minmax(0, 1fr); }
}
