/* Guild Glory — sombre par défaut (clair sur demande), monochrome + accent turquoise, Geist (servie localement). */
/* Polices : /static/css/fonts.css (Geist, Geist Mono, DM Sans), chargé avant ce fichier. */

:root {
  color-scheme: light;
  --bg: #ECEDF0; --surface: #F4F5F7; --surface-2: #E8EAED; --input: #F8F9FA; --hover: rgb(24 28 38 / .06);
  --line: #DBDDE2; --line-2: #CBCED5; --line-3: #A9ADB6; --text: #1B1D21; --text-2: #40434A; --muted: #575B63; --faint: #5F636B;
  --accent: #1B1D21; --accent-hover: #33363C; --accent-ink: #F6F7F8; --accent-soft: rgb(24 28 38 / .06); --accent-line: rgb(24 28 38 / .3);
  --ok: #1E6E33; --ok-bg: rgb(30 110 51 / .1); --ok-line: rgb(30 110 51 / .35);
  --warn: #865000; --warn-bg: rgb(134 80 0 / .1); --warn-line: rgb(134 80 0 / .38);
  --bad: #B3261E; --bad-bg: rgb(179 38 30 / .09); --bad-line: rgb(179 38 30 / .38);
  --info: #0B5AB8; --info-bg: rgb(11 90 184 / .09); --info-line: rgb(11 90 184 / .32);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6;
  --chart-grid: #DBDDE2; --backdrop: rgb(24 28 38 / .42); --header-bg: rgb(236 237 240 / .88);
  --ring: 0 0 0 1px rgb(24 28 38 / .11), 0 1px 2px rgb(24 28 38 / .04);
  --shadow: 0 1px 2px rgb(24 28 38 / .04); --shadow-lg: 0 18px 40px -14px rgb(24 28 38 / .24);
  --shadow-btn: 0 2px 6px rgb(24 28 38 / .18);
  --radius: 14px; --radius-sm: 6px;
  --font: 'Geist', 'DM Sans', system-ui, sans-serif; --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a; --surface: #111111; --surface-2: #1a1a1a; --input: #0a0a0a; --hover: rgb(255 255 255 / .08);
  --line: #2e2e2e; --line-2: #383838; --line-3: #454545; --text: #ededed; --text-2: #b4b4b4; --muted: #9a9a9a; --faint: #8f8f8f;
  /* Thème vert/rouge (inspiré du dashboard) : vert = action/positif, rouge = négatif, fond neutre très sombre */
  --accent: #22c55e; --accent-hover: #34d36f; --accent-ink: #04210f; --accent-soft: rgb(34 197 94 / .12); --accent-line: rgb(34 197 94 / .42);
  --ok: #3ddc84; --ok-bg: rgb(61 220 132 / .12); --ok-line: rgb(61 220 132 / .38);
  --warn: #f97316; --warn-bg: rgb(249 115 22 / .12); --warn-line: rgb(249 115 22 / .4);
  --bad: #ef4444; --bad-bg: rgb(239 68 68 / .13); --bad-line: rgb(239 68 68 / .42);
  --info: #4ade80; --info-bg: rgb(74 222 128 / .1); --info-line: rgb(74 222 128 / .34);
  --s1: #22c55e; --s2: #ef4444; --s3: #10b981; --s4: #f43f5e; --s5: #4ade80; --s6: #fb7185;
  --chart-grid: #242824; --backdrop: rgb(0 0 0 / .62); --header-bg: rgb(10 10 10 / .85);
  --ring: 0 0 0 1px rgb(34 197 94 / .22);
  --shadow: none; --shadow-lg: 0 24px 50px -12px rgb(0 0 0 / .72); --shadow-btn: 0 8px 24px rgb(34 197 94 / .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.ico.sm { width: 15px; height: 15px; }

/* ---------- coquille ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 10px; min-height: 60px; max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--text); }
.nx-logo { display: block; flex-shrink: 0; width: 72px; aspect-ratio: 628 / 210; background: currentColor; color: var(--text); -webkit-mask: url("/static/img/thug4-logo.svg") center / contain no-repeat; mask: url("/static/img/thug4-logo.svg") center / contain no-repeat; }
.nx-brand-tag { flex: none; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line-3); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pill-credits { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 36px; border-radius: 6px; border: 1px solid var(--line-2); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.pill-credits:hover { border-color: var(--accent-line); }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.nav-toggle { display: none; }
.nx-lang { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; background: transparent; border: 1px solid var(--line-2); border-radius: 6px; color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 12px; }
.nx-lang:hover { background: var(--hover); }
html[lang="en"] .nx-lang::after { content: "RU"; }
html[lang="ru"] .nx-lang::after { content: "EN"; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 20px 0 32px; }
.side-group { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.side a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 550; }
.side a:hover { background: var(--hover); color: var(--text); }
.side a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); font-weight: 650; }
.side a .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.backdrop { display: none; }
main { min-width: 0; padding: 24px 0 72px; }
.view { display: flex; flex-direction: column; gap: 16px; animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 4vw, 32px); font-weight: 450; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 13.5px; }
.back:hover { color: var(--text); }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; margin-left: -8px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(290px, 86vw); max-height: none; padding: 16px 10px; background: var(--surface); border-right: 1px solid var(--line-2); transform: translateX(-102%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s; }
  .side.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .backdrop.open { display: block; position: fixed; inset: 0; z-index: 50; background: var(--backdrop); }
}

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.tile { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); flex: 0 0 auto; }
.sub-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: var(--surface); }
.sub-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }
.sub-title.accent { color: var(--ok); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: clamp(22px, 3.4vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.accent .kpi-value { color: var(--text); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .16s, border-color .16s, transform .16s; }
.btn:hover { border-color: var(--faint); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-btn); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }
.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn.block { width: 100%; min-height: 54px; font-size: 15.5px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block:disabled { opacity: 1; background: var(--surface-2); border-color: var(--line-2); color: var(--muted); }

/* ---------- formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.label.plain { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; justify-content: space-between; }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, textarea.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); transition: border-color .16s, box-shadow .16s; }
textarea.input { padding: 12px 14px; min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(127 127 127 / .12); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--surface); }
.input.code { text-align: center; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 8px; }
.stepper button { min-height: 48px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 18px; font-weight: 600; cursor: pointer; }
.stepper button:hover { border-color: var(--faint); }
.stepper .input { text-align: center; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 6px; background: var(--accent-soft); flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 4px; background: none; color: var(--text-2); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--ring); }
.choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.choice button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--input); text-align: left; cursor: pointer; }
.choice button b { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.choice button span { color: var(--muted); font-size: 12.5px; }
.choice button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice button[aria-pressed="true"] span { color: var(--accent-ink); opacity: .72; }
.choice button[aria-pressed="true"] a { color: var(--accent-ink); }
.choice button:disabled { opacity: .5; cursor: not-allowed; }
.paylogos { display: inline-flex; align-items: center; gap: 5px; }
.paylogo { height: 20px; width: auto; max-width: 48px; display: block; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; box-sizing: content-box; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.cost { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.cost b { font-weight: 650; }
.cost .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.clans { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.clan-input { position: relative; }
.clan-input .tag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--faint); pointer-events: none; }
.clan-input .input { padding-left: 74px; }

/* ---------- bandeaux, puces ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.notice .ico { margin-top: 2px; }
.notice.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.notice.info { border-color: var(--info-line); background: var(--info-bg); color: var(--text-2); }
.notice.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--text-2); }
.notice.bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; border: 1px solid var(--line-2); color: var(--muted); background: var(--hover); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.chip.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip.live i { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.region { display: inline-grid; place-items: center; min-width: 30px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 11px; font-weight: 750; letter-spacing: .04em; }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--hover); }
.t .num { text-align: right; }
.t th.num { text-align: right; }
.t input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.cell-main { display: flex; flex-direction: column; min-width: 0; }
.cell-main small { color: var(--muted); font-size: 12px; }
.rank-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rank-ic { vertical-align: middle; object-fit: contain; flex: none; }
#site-banner:empty { display: none; }
.sbanner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.sbanner.warn { background: color-mix(in srgb, var(--warn, #e0a500) 14%, var(--surface)); color: var(--text); }
.sbanner.info { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--text); }
.sbanner .ico { flex: none; }
.sep-line { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
/* ---- annonce (fenêtre modale) ---- */
dialog.ann { width: min(92vw, 420px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); overflow: hidden; position: relative; box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog.ann::backdrop { background: rgb(0 0 0 / .55); }
.ann-x { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .35); color: #fff; cursor: pointer; }
.ann-img { display: block; }
.ann-img img { display: block; width: 100%; height: auto; max-height: 50vh; object-fit: cover; }
.ann-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.ann-body h2 { margin: 0; font-size: 20px; }
.ann-body p { margin: 0; color: var(--text-2, var(--muted)); font-size: 14.5px; white-space: pre-wrap; }
.ann-body .btn { align-self: flex-start; }
.ann-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: ann-countdown linear forwards; }
@keyframes ann-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .ann-bar { animation: none; } }
/* ---- documentation API ---- */
.docs-wrap { overflow: hidden; }
.docs { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: start; }
.doc-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 96px); overflow: auto; }
.doc-nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.doc-nav a:hover { background: var(--hover); color: var(--text); }
.doc-body { min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.doc-sec { scroll-margin-top: 80px; }
.doc-sec h2 { margin: 0 0 10px; font-size: 19px; }
.doc-sec h3.doc-grp { margin: 18px 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-sec p { margin: 0 0 10px; color: var(--text-2, var(--muted)); font-size: 14.5px; line-height: 1.6; }
.doc-sec ul, .doc-sec ol { margin: 0 0 10px; padding-left: 20px; color: var(--text-2, var(--muted)); font-size: 14.5px; line-height: 1.7; }
.doc-sec code { font-family: var(--mono, ui-monospace, monospace); font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.ep { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2); }
.ep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ep-path { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; overflow-wrap: anywhere; background: none; padding: 0; }
.ep-sub { font-weight: 650; font-size: 12.5px; margin: 10px 0 4px; }
.ep pre.code, .doc-sec pre.code, .code-block pre.code { max-width: 100%; overflow: auto; white-space: pre; }
.code-block { position: relative; }
.code-block .btn { position: absolute; top: 8px; right: 8px; }
.code-tabs .seg { margin-bottom: 8px; }
.doc-steps li { margin-bottom: 6px; }
.doc-faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.doc-faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.doc-faq details p { margin: 8px 0 0; }
@media (max-width: 820px) {
    .docs { grid-template-columns: 1fr; gap: 14px; }
    .doc-nav { position: static; flex-direction: row; max-height: none; overflow-x: auto; gap: 6px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--line); }
    .doc-nav a { background: var(--surface-2); flex: none; }
}
.op-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.op-row .input { flex: 1 1 120px; min-width: 0; }
.op-row .check { flex: none; }
@media (max-width: 720px) {
  table.t.stackable thead { display: none; }
  table.t.stackable tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.t.stackable td { padding: 0; border: 0; }
  table.t.stackable td.num { text-align: right; }
  table.t.stackable td.full { grid-column: 1 / -1; }
}

/* ---------- vides, chargement ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; color: var(--faint); }
.empty b { color: var(--text-2); font-weight: 600; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- groupes ---------- */
.glist { display: grid; gap: 12px; }
.gcard { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: inherit; transition: border-color .16s; }
.gcard:hover { border-color: var(--line-3); background: var(--surface-2); }
.gcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gcard-title { font-weight: 650; display: flex; align-items: center; gap: 8px; min-width: 0; }
.gcard-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gcard-meta b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--text); transition: width .5s var(--ease); }
.squads { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.squad { display: flex; flex-direction: column; gap: 12px; }
.squad-head { display: flex; align-items: flex-start; gap: 12px; }
.squad-swatch { width: 10px; height: 10px; border-radius: 3px; margin-top: 6px; flex: 0 0 auto; }
.squad-name { font-weight: 500; font-size: 15.5px; }
.squad-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.squad-stats div { padding: 10px; border-radius: 6px; background: var(--surface-2); }
.squad-stats small { display: block; color: var(--muted); font-size: 11.5px; }
.squad-stats b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bots { display: grid; gap: 6px; }
.bot { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.bot-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.honor { font-variant-numeric: tabular-nums; font-weight: 650; }
.honor.low { color: var(--bad); }
.log { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); max-height: 200px; overflow: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.log div { padding: 3px 0; }
.log time { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* ---------- graphiques ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .lbl { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12.5px; transform: translate(-50%, calc(-100% - 12px)); }
.tip b { display: block; margin-bottom: 4px; font-weight: 650; }
.tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- résultats (images du chef) ---------- */
.results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.results figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.results canvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #0c0a18; }
.results figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.res-nav { margin-bottom: 10px; gap: 8px; }
/* ---- résultat de match en grand (zoom plein écran) ---- */
.results canvas { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgb(0 0 0 / .88); animation: zoom-in .16s var(--ease, ease-out); }
.zoom-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #f2f3f7; }
.zoom-bar .iconbtn { color: #f2f3f7; }
.zoom-title { font-size: 14px; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 16px; }
.zoom-body canvas { width: auto; height: auto; max-width: min(100%, 1400px); max-height: 100%; border-radius: 12px; background: #0c0a18; }
.zoom-nav { flex: none; width: 44px; height: 64px; border: 1px solid rgb(255 255 255 / .2); border-radius: 10px; background: rgb(255 255 255 / .08); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.zoom-nav:hover:not(:disabled) { background: rgb(255 255 255 / .16); }
.zoom-nav:disabled { opacity: .25; cursor: default; }
.zoom-nav:focus-visible, .zoom-bar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) { .zoom-nav { display: none; } .zoom-body { padding: 0 6px 12px; } }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zoom { animation: none; } }

/* ---------- identifiants ---------- */
.cred { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px; border-radius: 6px; background: var(--surface-2); }
.cred .mono { overflow-wrap: anywhere; }
.secret { filter: blur(5px); transition: filter .16s; cursor: pointer; }
.secret.shown { filter: none; }

/* ---------- journal ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.feed-ic.ok { color: var(--ok); } .feed-ic.warning { color: var(--warn); } .feed-ic.error { color: var(--bad); }
.feed-item b { font-weight: 600; }
.feed-item p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.feed-item time { color: var(--faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- QR plein écran ---------- */
.qr-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s ease; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.qr-overlay.open { opacity: 1; }
.qr-overlay-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; }
.qr-overlay-wrap img { max-width: min(90vw, 90vh, 500px); max-height: min(80vh, 500px); border-radius: 16px; background: #fff; padding: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.4); object-fit: contain; }
.qr-close { color: #fff !important; border-color: rgba(255,255,255,.3) !important; }

/* ---------- dialogues, toasts, menu ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--backdrop); }
dialog[open] { animation: pop .26s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
dialog h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
dialog .row.end { margin-top: 18px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 550; animation: pop .26s var(--ease) both; }
.toast.ok .ico { color: var(--ok); } .toast.bad { border-color: var(--bad-line); } .toast.bad .ico { color: var(--bad); }
.menu { position: absolute; right: 16px; top: 56px; z-index: 40; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px 14px; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-weight: 650; border-bottom: 1px solid var(--line); }
.unread { position: relative; }
.unread::before { content: ""; position: absolute; left: -9px; top: 18px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

pre.code { margin: 0; padding: 14px; border-radius: 10px; background: var(--input); border: 1px solid var(--line); font: 12.5px/1.55 var(--mono); overflow-x: auto; white-space: pre; }
.endpoint { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.endpoint:last-child { border-bottom: 0; }
.method { font: 700 11px var(--mono); padding: 2px 6px; border-radius: 5px; text-align: center; align-self: start; background: var(--info-bg); color: var(--info); }
.method.post { background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
