/* ═══════════════════════════════════════════════════════════════════════════
   Wiki Slayers 2 FR
   Mise en page : menu latéral sombre + contenu clair ou sombre.
   Palette « glycine » : violet doux, or discret, beaucoup d'air.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Thème clair (par défaut) ─── */
:root {
    --bg:            #f2f0f7;
    --surface:       #ffffff;
    --surface-2:     #f7f5fb;
    --border:        #e4e0ef;
    --text:          #232138;
    --muted:         #6d6988;
    --accent:        #6b54b0;
    --accent-strong: #4d3c8c;
    --accent-soft:   #ece7f8;
    --gold:          #b08b4a;
    --danger:        #b54045;
    --shadow:        0 1px 2px rgb(35 33 56 / .04), 0 8px 24px -12px rgb(35 33 56 / .10);

    --st-verified:  #2d8558;
    --st-official:  #2f6aa8;
    --st-community: #94740f;
    --st-to_verify: #b0601c;
    --st-obsolete:  #b0393d;
    --st-conflict:  #b0601c;
    --st-unknown:   #77738f;

    /* Menu latéral : sombre dans les deux thèmes */
    --side-bg:     #1b1932;
    --side-bg-2:   #221f3d;
    --side-text:   #dcd8ee;
    --side-muted:  #8f8aab;
    --side-active: #2d2951;
    --side-line:   #2f2b4d;

    --font-title: "Zen Old Mincho", "Hiragino Mincho ProN", Georgia, serif;
    --font-text:  "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sidebar-w: 272px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* ─── Thème sombre ─── */
:root[data-theme="dark"] {
    --bg:            #121120;
    --surface:       #1a192b;
    --surface-2:     #201e33;
    --border:        #2c2944;
    --text:          #e8e5f4;
    --muted:         #9c98b7;
    --accent:        #a893e8;
    --accent-strong: #c6b8f4;
    --accent-soft:   #28243f;
    --gold:          #d0af74;
    --danger:        #e27a7c;
    --shadow:        0 1px 2px rgb(0 0 0 / .25), 0 10px 28px -14px rgb(0 0 0 / .55);

    --st-verified:  #63c28f;
    --st-official:  #72aee6;
    --st-community: #dcbc57;
    --st-to_verify: #e59a57;
    --st-obsolete:  #e0696c;
    --st-conflict:  #e59a57;
    --st-unknown:   #9491ad;

    --side-bg:     #16152a;
    --side-bg-2:   #1b1a31;
    --side-active: #27234a;
    --side-line:   #28254a;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 .975rem/1.6 var(--font-text);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: 5px; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; letter-spacing: .005em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { color: var(--muted); max-width: 62ch; margin-top: -.25rem; margin-bottom: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip:focus { left: .5rem; }
.icon { width: 1.1rem; height: 1.1rem; flex: none; }

/* ═══ Structure ═══ */
.shell { min-height: 100vh; }

/* ─── Menu latéral ─── */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text);
    border-right: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
}
.sidebar__head { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.6rem 1.4rem 1.3rem; border-bottom: 1px solid var(--side-line); }
.brand { display: grid; gap: .15rem; color: inherit; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo {
    width: 2.9rem; height: 2.9rem; margin-bottom: .8rem;
    display: grid; place-items: center; border-radius: 50%;
    font-family: var(--font-title); font-size: 1.25rem; color: #fff;
    background: radial-gradient(circle at 35% 30%, #9d86d6 0%, #5a469c 55%, #2b2452 100%);
    box-shadow: 0 0 0 2px var(--side-line), 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent);
}
.brand__name { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; color: #fff; }
.brand__sub { font-family: var(--font-title); font-style: italic; font-size: .78rem; color: var(--gold); }
.sidebar__close { display: none; }

.nav { flex: 1; overflow-y: auto; padding: .9rem .75rem; display: grid; align-content: start; gap: .1rem; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; }
.nav__link {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .58rem .8rem; border-radius: var(--radius-sm); border: 0; border-left: 3px solid transparent;
    background: none; color: var(--side-text); font: 500 .93rem/1.3 var(--font-text); text-align: left;
    text-decoration: none; cursor: pointer;
}
.nav__link:hover { background: color-mix(in srgb, var(--side-active) 60%, transparent); color: #fff; }
.nav__link.is-active { background: var(--side-active); color: #fff; font-weight: 700; border-left-color: #b8a5ee; }
.nav__link .icon { opacity: .85; }
.nav__chevron { margin-left: auto; width: 1rem; height: 1rem; transition: transform .18s ease; opacity: .6; }
.nav__group.is-open .nav__chevron { transform: rotate(180deg); }
.nav__sub { display: none; padding: .1rem 0 .3rem 1.1rem; margin-left: 1.15rem; border-left: 1px solid var(--side-line); }
.nav__group.is-open .nav__sub { display: grid; gap: .05rem; }
.nav__sub .nav__link { font-size: .89rem; padding: .45rem .7rem; }

.sidebar__foot { padding: .9rem .75rem 1.1rem; border-top: 1px solid var(--side-line); display: grid; gap: .1rem; }
.sidebar__foot form { margin: 0; }
.sidebar__label { margin: 0 .8rem .3rem; font-size: .75rem; color: var(--side-muted); font-weight: 600; }
.sidebar__note { margin: 0 .8rem; font-size: .78rem; line-height: 1.5; color: var(--side-muted); }

/* ─── Colonne principale ─── */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 2.25rem .6rem; }
.topbar__title { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.topbar .topbar__menu { display: none; }
.content { flex: 1; width: 100%; max-width: 78rem; margin: 0 auto; padding: 1.25rem 2.25rem 3rem; }
.footer { padding: 1.25rem 2.25rem 1.75rem; text-align: center; font-size: .82rem; color: var(--muted); }
.footer p { margin: .15rem 0; }

.icon-btn {
    width: 2.55rem; height: 2.55rem; display: grid; place-items: center; flex: none;
    border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--border));
    background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
    font: 700 .95rem var(--font-title); box-shadow: var(--shadow);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Interrupteur jour / nuit */
.theme-toggle {
    position: relative; width: 4rem; height: 2.2rem; flex: none; cursor: pointer; padding: 0;
    border-radius: 999px; border: 1px solid color-mix(in srgb, #fff 40%, transparent);
    background: linear-gradient(135deg, #bfe2f6 0%, #86c8ee 100%);
    box-shadow: inset 0 1px 3px rgb(0 0 0 / .12), var(--shadow);
}
.theme-toggle__knob {
    position: absolute; top: .2rem; left: .22rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    display: grid; place-items: center; transition: transform .25s ease, background .25s ease;
    background: radial-gradient(circle at 35% 35%, #fff4b0, #f6c83d 70%); color: #9a6a07;
    transform: translateX(1.8rem);
}
.theme-toggle .icon { width: .95rem; height: .95rem; }
.theme-toggle .icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle { background: linear-gradient(135deg, #2c2850 0%, #1b1936 100%); border-color: var(--border); }
:root[data-theme="dark"] .theme-toggle__knob { transform: translateX(0); background: radial-gradient(circle at 35% 35%, #f3f0ff, #c9c0ea 70%); color: #4d3f8a; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: block; }

.scrim { display: none; }

/* ═══ Composants ═══ */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* Bandeau d'accueil */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.6rem) clamp(1.5rem, 4.5vw, 3.2rem);
    background: linear-gradient(120deg, #1d1a37 0%, #2b2552 55%, #3f3375 100%);
    color: #f1eefb; margin-bottom: 1.75rem;
}
.hero::after {
    content: ""; position: absolute; z-index: -1; right: -8%; bottom: -45%;
    width: 55%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgb(168 147 232 / .38) 0%, transparent 65%);
}
.hero__eyebrow { margin: 0 0 .7rem; font-family: var(--font-title); font-style: italic; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: #d6b97e; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 2.9rem); margin-bottom: .6rem; }
.hero__text { max-width: 34rem; color: #d9d4ee; line-height: 1.75; margin-bottom: 1.75rem; }
.pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.pill {
    display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.05rem;
    border-radius: 999px; border: 1px solid rgb(255 255 255 / .26); background: rgb(255 255 255 / .04);
    color: #f1eefb; text-decoration: none; font-weight: 500; font-size: .9rem;
}
.pill:hover { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .4); }
.pill .icon { width: 1rem; height: 1rem; }

/* Cartes */
.card {
    background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent);
    border-radius: var(--radius); padding: 1.35rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.card__title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: 1rem; }
.card__title .icon { color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1.35rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }

/* Chiffres clés */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.stat {
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem;
    background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat__icon { width: 2.6rem; height: 2.6rem; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.stat__value { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.stat__label { margin: .15rem 0 0; font-size: .84rem; color: var(--muted); }
/* anciennes classes du tableau de bord */
.stats__item { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stats__item dt { color: var(--muted); font-size: .85rem; }
.stats__item dd { margin: .2rem 0 0; font-family: var(--font-title); font-weight: 700; font-size: 1.6rem; }

/* Liste d'accès rapides */
.quick { list-style: none; margin: 0; padding: 0; }
.quick li + li { border-top: 1px solid var(--border); }
.quick a { display: flex; align-items: center; gap: .9rem; padding: .75rem .2rem; color: var(--text); text-decoration: none; }
.quick a:hover { color: var(--accent); }
.quick__icon { width: 2.1rem; height: 2.1rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.quick__icon .icon { width: 1rem; height: 1rem; }
.quick__text { display: grid; }
.quick__hint { font-size: .82rem; color: var(--muted); }

/* Légende des statuts */
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.legend li { display: grid; gap: .25rem; font-size: .88rem; color: var(--muted); }

/* Badges de fiabilité */
.badge {
    display: inline-flex; align-items: center; gap: .35em; justify-self: start; white-space: nowrap;
    font-size: .78rem; font-weight: 600; padding: .18em .65em; border-radius: 999px;
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
    background: color-mix(in srgb, currentColor 10%, transparent);
}
.badge--verified  { color: var(--st-verified); }
.badge--official  { color: var(--st-official); }
.badge--community { color: var(--st-community); }
.badge--to_verify { color: var(--st-to_verify); }
.badge--obsolete  { color: var(--st-obsolete); }
.badge--conflict  { color: var(--st-conflict); }
.badge--unknown   { color: var(--st-unknown); }

/* Formulaires */
input, select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .75rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
label.check input { width: auto; accent-color: var(--accent); }
.form-grid { display: grid; gap: 1rem; max-width: 34rem; }
.form-error { margin: 0; color: var(--danger); font-size: .9rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: 600 .92rem/1.2 var(--font-text); cursor: pointer; text-decoration: none;
    padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--accent);
    background: var(--accent); color: #fff;
}
:root[data-theme="dark"] .btn { color: #16142a; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
:root[data-theme="dark"] .btn:hover { color: #16142a; }
.btn--ghost, :root[data-theme="dark"] .btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover, :root[data-theme="dark"] .btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn--danger, :root[data-theme="dark"] .btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn--danger:hover, :root[data-theme="dark"] .btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--small { font-size: .8rem; padding: .35rem .75rem; }
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; background: var(--surface-2); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr.is-disabled td { opacity: .5; }
td.actions { white-space: nowrap; }
td.actions form + form { margin-left: .35rem; }
td select { width: auto; padding: .3rem .55rem; }

/* Messages */
.flash { display: flex; gap: .6rem; padding: .8rem 1.1rem; margin: 0 0 1.25rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid; box-shadow: var(--shadow); }
.flash--success { border-left-color: var(--st-verified); }
.flash--error   { border-left-color: var(--danger); }
.flash--warning { border-left-color: var(--st-to_verify); }
.reveal { background: var(--surface); border: 1px solid color-mix(in srgb, var(--st-to_verify) 55%, var(--border)); border-radius: var(--radius); padding: 1.1rem 1.35rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.reveal p { margin: .3rem 0; }
.reveal__pw { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.reveal__pw code { font-size: 1.1rem; padding: .3em .7em; letter-spacing: .05em; }

/* Fenêtre de connexion */
dialog.modal {
    width: min(92vw, 25rem); padding: 0; border-radius: var(--radius);
    border: 1px solid var(--border); border-top: 3px solid var(--accent);
    background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -20px rgb(0 0 0 / .5);
}
dialog.modal::backdrop { background: rgb(15 13 30 / .55); backdrop-filter: blur(2px); }
.modal__body { display: grid; gap: .95rem; padding: 1.6rem; margin: 0; }
.modal__body h2 { margin: 0; font-size: 1.3rem; }
.modal__body p { margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }

/* ═══ Wiki ═══ */

/* Barre de recherche */
.search { position: relative; flex: 1; max-width: 26rem; margin-left: 1rem; }
.search__icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.4rem; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.search__suggest {
    position: absolute; z-index: 50; top: calc(100% + .35rem); left: 0; right: 0; margin: 0; padding: .35rem; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 16px 40px -16px rgb(0 0 0 / .35);
}
.search__suggest a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .65rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.search__suggest li[aria-selected="true"] a, .search__suggest a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.search__type { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.search__empty { padding: .5rem .65rem; font-size: .85rem; color: var(--muted); }
.search-page { display: flex; gap: .6rem; max-width: 40rem; margin-bottom: 1.5rem; }
kbd { font: 600 .8em var(--font-text); padding: .1em .45em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* Petits éléments */
.tag { display: inline-block; vertical-align: middle; font: 600 .72rem/1.5 var(--font-text); padding: .05em .55em; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); letter-spacing: .01em; }
.tag--draft { background: color-mix(in srgb, var(--st-to_verify) 16%, transparent); color: var(--st-to_verify); }
.tag--new { background: color-mix(in srgb, var(--st-verified) 16%, transparent); color: var(--st-verified); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-left: .3rem; vertical-align: middle; background: var(--st-unknown); }
.dot--verified { background: var(--st-verified); }
.dot--official { background: var(--st-official); }
.dot--community { background: var(--st-community); }
.dot--to_verify { background: var(--st-to_verify); }
.dot--obsolete { background: var(--st-obsolete); }
.dot--conflict { background: var(--st-conflict); }
.legend-inline { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: 1rem 0 0; }
.legend-inline .dot { margin: 0 .35rem 0 0; }
.legend__foot { margin: 1.1rem 0 0; }
.hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.danger-link { color: var(--danger); }
.delta--add { color: var(--st-verified); }
.delta--del { color: var(--st-obsolete); }
.empty { text-align: center; padding-block: 2rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.page-head .lead { margin-bottom: 1.25rem; }
.notice { background: color-mix(in srgb, var(--st-to_verify) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-to_verify) 35%, var(--border)); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.notice p { margin: .25rem 0; }
.notice form { margin-top: .6rem; }
.pager { display: flex; gap: .6rem; justify-content: space-between; }
a.stat--link { color: var(--text); text-decoration: none; }
a.stat--link:hover { border-color: var(--accent); }

/* Fiche */
.article__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.article__titles { flex: 1 1 28rem; }
.article__titles h1 { margin-bottom: .35rem; }
.article__titles h1 .tag { font-size: .75rem; margin-left: .4rem; }
.article__kind { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .4rem; font-size: .85rem; color: var(--muted); }
.article__kind .icon { color: var(--accent); width: 1rem; height: 1rem; }
.article__kind a { color: var(--muted); }
.article__summary { font-size: 1.05rem; max-width: 62ch; margin: .6rem 0 0; }
.page-tools { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .45rem; }
.page-tools .icon { width: .95rem; height: .95rem; }
.article__layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; grid-template-areas: "body box"; gap: 2rem; align-items: start; }
.article__layout--full { grid-template-columns: minmax(0, 1fr); grid-template-areas: "body"; }
.article__body { grid-area: body; min-width: 0; }
.article__foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); }

.infobox { grid-area: box; position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.infobox__title { margin: 0; padding: .8rem 1rem; font: 700 1.05rem/1.3 var(--font-title); text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.infobox__img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--border); }
.infobox__facts { margin: 0; }
.fact { padding: .7rem 1rem; border-bottom: 1px solid var(--border); border-left: 3px solid var(--st-unknown); }
.fact:last-child { border-bottom: 0; }
.fact--verified { border-left-color: var(--st-verified); }
.fact--official { border-left-color: var(--st-official); }
.fact--community { border-left-color: var(--st-community); }
.fact--to_verify, .fact--conflict { border-left-color: var(--st-to_verify); }
.fact--obsolete { border-left-color: var(--st-obsolete); }
.fact--obsolete .fact__value { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--st-obsolete) 60%, transparent); }
.fact dt { font-size: .78rem; font-weight: 600; color: var(--muted); }
.fact dd { margin: .1rem 0 0; display: grid; gap: .3rem; }
.fact__value { font-weight: 600; }
.fact__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: .76rem; }
.fact__meta .badge { font-size: .72rem; }
.fact__notes, .fact__candidates { font-size: .8rem; color: var(--muted); }
.ref { font-size: .7rem; margin-left: .15rem; }
.ref a { text-decoration: none; }

.toc { display: inline-block; min-width: 15rem; max-width: 100%; margin: 0 0 1.5rem; padding: .8rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toc summary { font: 700 .95rem var(--font-title); cursor: pointer; }
.toc ol { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.toc .toc__l3 { margin-left: 1rem; list-style: circle; }

.section { margin-top: 2rem; }
.sources ol { padding-left: 1.4rem; font-size: .9rem; }
.sources li { margin-bottom: .35rem; }
.sources li:target { background: var(--accent-soft); border-radius: 4px; }
.entity-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; }
.entity-grid li { display: grid; gap: .15rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.relations { margin: 0; display: grid; gap: .5rem; }
.relations > div { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 1rem; }
.relations dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.relations dd { margin: 0; }
.changes { padding-left: 1.2rem; }
.changes li { margin-bottom: .35rem; }
.change-kind { display: inline-block; font: 700 .72rem/1.6 var(--font-text); text-transform: uppercase; letter-spacing: .04em; padding: 0 .5em; border-radius: 4px; background: var(--accent-soft); color: var(--accent-strong); }
.change-kind--buff, .change-kind--new { background: color-mix(in srgb, var(--st-verified) 15%, transparent); color: var(--st-verified); }
.change-kind--nerf { background: color-mix(in srgb, var(--st-obsolete) 15%, transparent); color: var(--st-obsolete); }
.change-kind--fix { background: color-mix(in srgb, var(--st-official) 15%, transparent); color: var(--st-official); }

/* Texte des articles */
.wikitext { max-width: 72ch; line-height: 1.75; }
.wikitext h2 { font-size: 1.35rem; margin-top: 2rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.wikitext h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.wikitext h4 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.wikitext h2:first-child, .wikitext h3:first-child { margin-top: 0; }
.wikitext ul, .wikitext ol { padding-left: 1.4rem; margin: 0 0 1em; }
.wikitext li { margin-bottom: .2rem; }
.wikitext blockquote { margin: 0 0 1em; padding: .2rem 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.wikitext pre { overflow-x: auto; padding: .8rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; }
.wikitext pre code { border: 0; padding: 0; background: none; }
.wikitext hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.wikitext .table-wrap { margin: 0 0 1.2rem; }
.wikitable { background: var(--surface); border: 1px solid var(--border); }
.wikitable th, .wikitable td { border: 1px solid var(--border); }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.wiki-figure { margin: 1.2rem 0; display: table; max-width: 100%; }
.wiki-figure img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.wiki-figure figcaption { display: table-caption; caption-side: bottom; padding-top: .4rem; font-size: .85rem; color: var(--muted); }
.inline-img { max-height: 1.6em; vertical-align: middle; }
.missing-file { color: var(--danger); font-size: .88rem; }
a.wikilink { text-decoration-style: dotted; }
a.redlink { color: var(--danger); }
a.external::after { content: "\2197"; font-size: .75em; margin-left: .15em; opacity: .7; }
.callout { margin: 0 0 1.2rem; padding: .8rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; border-left-width: 4px; background: var(--surface); }
.callout__title { font-weight: 700; margin-bottom: .3rem; }
.callout > :last-child { margin-bottom: 0; }
.callout--info { border-color: color-mix(in srgb, var(--st-official) 45%, transparent); }
.callout--astuce { border-color: color-mix(in srgb, var(--st-verified) 45%, transparent); }
.callout--attention { border-color: color-mix(in srgb, var(--st-to_verify) 50%, transparent); }
.callout--danger { border-color: color-mix(in srgb, var(--st-obsolete) 50%, transparent); }

/* Listes, résultats, historique */
.list-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 1rem; margin-bottom: 1rem; }
.list-tools label { min-width: 12rem; }
.list-tools__filter { flex: 1; max-width: 24rem; }
.list-tools p { margin: 0; }
table.sortable th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
table.sortable th button::after { content: "\2195"; opacity: .35; font-size: .85em; }
table.sortable th[aria-sort="ascending"] button::after { content: "\2191"; opacity: 1; }
table.sortable th[aria-sort="descending"] button::after { content: "\2193"; opacity: 1; }
table.sortable th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.results li { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.results__title { font: 700 1.1rem var(--font-title); margin-right: .5rem; }
.results__snippet { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }
mark { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; padding: 0 .1em; border-radius: 2px; }
.recent-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.recent-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list__time { font-variant-numeric: tabular-nums; }
.recent-list__comment { flex-basis: 100%; font-size: .85rem; color: var(--muted); font-style: italic; padding-left: 3.1rem; }
table.history td { white-space: nowrap; }
table.history td:nth-child(5) { white-space: normal; }
.diff td { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .84rem; white-space: pre-wrap; word-break: break-word; padding: .2rem .6rem; border: 0; }
.diff__sign { width: 1.5rem; text-align: center; user-select: none; }
.diff__del td, tbody tr.diff__del:hover td { background: color-mix(in srgb, var(--st-obsolete) 13%, transparent); }
.diff__add td, tbody tr.diff__add:hover td { background: color-mix(in srgb, var(--st-verified) 14%, transparent); }
.diff__skip td { text-align: center; color: var(--muted); font-family: var(--font-text); font-style: italic; background: var(--surface-2); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.code-cell { white-space: nowrap; }
.code-cell code { font-size: .95rem; font-weight: 600; letter-spacing: .02em; }
.code-cell .btn { margin-left: .3rem; padding: .25rem .45rem; }
.btn.is-copied { border-color: var(--st-verified); color: var(--st-verified); }
.codes--expired code { text-decoration: line-through; opacity: .7; }

/* Formulaires d'édition */
.form-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; align-items: end; margin-bottom: 1rem; }
.form-cols--tight { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; margin: 0; }
.editor .card > label, .editor > label { margin-bottom: 1rem; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 .55rem; font-weight: 400; font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap; }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input--short { max-width: 7rem; }
.inline-label { margin-top: 1rem; max-width: 24rem; }
.rows { display: grid; gap: .8rem; margin-bottom: .8rem; }
.fact-row { margin: 0; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: .6rem; min-width: 0; }
.fact-row__main { display: grid; grid-template-columns: 1.1fr 1.6fr .6fr 1fr .9fr; gap: .6rem; align-items: end; }
.fact-row__main label, .fact-row__extra label { font-size: .8rem; }
.fact-row__more summary { font-size: .82rem; color: var(--accent); cursor: pointer; }
.fact-row__extra { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
.fact-row__actions { display: flex; gap: .35rem; justify-content: flex-end; }
.fact-row__actions .icon { width: .9rem; height: .9rem; }
.relation-row { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr auto; gap: .5rem; align-items: center; }
.relation-row--change { grid-template-columns: minmax(8rem, 10rem) minmax(10rem, 16rem) 1fr auto; }
.editor__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.editor__bar h2 { margin: 0; }
.editor__text { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9rem; line-height: 1.6; min-height: 22rem; resize: vertical; }
.editor__preview { min-height: 22rem; max-width: none; padding: 1rem 1.2rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.editor__save { position: sticky; bottom: 0; z-index: 5; display: grid; gap: .8rem; }
.editor__buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.tabs { display: inline-flex; padding: .2rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.tabs__tab { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: none; color: var(--muted); font: 600 .85rem var(--font-text); padding: .35rem .9rem; border-radius: 999px; cursor: pointer; }
.tabs__tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs__tab .icon { width: .9rem; height: .9rem; }
.syntax-help { margin-top: 1rem; font-size: .88rem; }
.syntax-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.syntax-help td { padding: .4rem .6rem; }
.type-picker { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.type-picker a { display: grid; gap: .35rem; height: 100%; margin: 0; color: var(--text); text-decoration: none; }
.type-picker a:hover { border-color: var(--accent); }
.type-picker .icon { color: var(--accent); width: 1.4rem; height: 1.4rem; }
dialog.modal--wide { width: min(94vw, 34rem); }
dialog.modal--wide .modal__body { max-height: 88vh; overflow-y: auto; }

/* Corrections et médias */
.correction__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.correction__head h2 { margin: 0; }
.correction .relations { margin: 1rem 0; }
.correction__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding-top: 1rem; border-top: 1px solid var(--border); }
.correction__actions > form:first-child:not(.inline) { flex-basis: 100%; }
.proof-thumb { max-width: 22rem; max-height: 14rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.media-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.media-item { margin: 0; padding: .8rem; display: grid; gap: .4rem; align-content: start; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface-2); border-radius: var(--radius-sm); }
.media-item p { margin: 0; }
.media-item__name { display: flex; align-items: center; gap: .3rem; }
.media-item__name code { font-size: .75rem; word-break: break-all; }
.media-item__alt { display: flex; gap: .3rem; }
.media-item__alt input { padding: .3rem .5rem; font-size: .82rem; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: .5rem !important; }
.footer__links a { color: var(--muted); }

/* ═══ Archive des objets ═══ */
:root {
    --r-common: #7d7a8c; --r-uncommon: #3f9a5c; --r-rare: #3a78c9; --r-epic: #8a4fd1;
    --r-legendary: #d08a1c; --r-mythic: #d0445f; --r-secret: #1f9f9a; --r-none: #a9a5b8;
    /* Case d'inventaire : toujours claire, pour que le fond blanc des icônes s'y fonde */
    --slot-bg: radial-gradient(circle at 50% 42%, #ffffff 0%, #f1eff6 62%, #e3dfec 100%);
}
:root[data-theme="dark"] {
    --r-common: #a6a3b5; --r-uncommon: #5fc27f; --r-rare: #6aa6f0; --r-epic: #b184f0;
    --r-legendary: #f0b24a; --r-mythic: #f07a90; --r-secret: #4fd0c9; --r-none: #6f6b86;
    --slot-bg: radial-gradient(circle at 50% 42%, #f4f2f8 0%, #dcd8e6 65%, #c9c4d6 100%);
}
.rarity--common { --r: var(--r-common); }
.rarity--uncommon { --r: var(--r-uncommon); }
.rarity--rare { --r: var(--r-rare); }
.rarity--epic { --r: var(--r-epic); }
.rarity--legendary { --r: var(--r-legendary); }
.rarity--mythic { --r: var(--r-mythic); }
.rarity--secret { --r: var(--r-secret); }
.rarity--none { --r: var(--r-none); }

.js-only { display: none; }
.js .js-only { display: block; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.notice--info { display: flex; align-items: center; gap: .6rem; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.notice--info .icon { color: var(--accent); }

.archive-tools { display: none; padding: 1.1rem 1.25rem; }
.js .archive-tools { display: grid; gap: .9rem; }
.archive-tools__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem; }
.archive-tools__row > label { flex: 0 1 12rem; }
.archive-tools__search { position: relative; flex: 1 1 18rem !important; align-self: flex-end; }
.archive-tools__icon { position: absolute; left: .75rem; bottom: .7rem; color: var(--muted); pointer-events: none; }
.archive-tools__search input { padding-left: 2.3rem; }
.archive-tools__count { margin: 0; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { display: grid; place-items: center; width: 2.6rem; height: 2.45rem; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button.is-active { background: var(--accent-soft); color: var(--accent-strong); }

.rarity-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.rarity-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; cursor: pointer;
    font: 600 .82rem var(--font-text); color: var(--text); background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--r) 45%, var(--border)); border-radius: 999px;
}
.rarity-chip:hover { border-color: var(--r); }
.rarity-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--r) 18%, var(--surface)); border-color: var(--r); box-shadow: inset 0 0 0 1px var(--r); }
.rarity-chip__n { font-weight: 500; color: var(--muted); }
.rarity-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--r); }
.rarity-pill { display: inline-block; font: 700 .72rem/1.6 var(--font-text); padding: 0 .55em; border-radius: 4px; color: var(--r); background: color-mix(in srgb, var(--r) 14%, transparent); letter-spacing: .02em; }

/* Grille de cartes */
.archive { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 1rem; }
.item-card {
    display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.item-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--r) 60%, var(--border)); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--r) 60%, transparent); }
.item-card__slot {
    position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; margin: .75rem .75rem 0;
    background: var(--slot-bg); border-radius: calc(var(--radius) - 3px);
    border: 2px solid color-mix(in srgb, var(--r) 70%, transparent);
    box-shadow: inset 0 0 22px -6px color-mix(in srgb, var(--r) 55%, transparent);
}
.item-card__slot img {
    width: 78%; height: 78%; object-fit: contain;
    mix-blend-mode: multiply;               /* le fond blanc de l'icône disparaît dans la case */
    transition: transform .2s ease;
}
.item-card:hover .item-card__slot img { transform: scale(1.06); }
.item-card__placeholder { width: 40%; height: 40%; color: color-mix(in srgb, var(--r) 70%, #8d88a3); opacity: .55; }
.item-card__body { padding: .7rem .9rem .9rem; display: grid; align-content: start; gap: .35rem; min-width: 0; }
.item-card__name { margin: 0; font-size: 1rem; line-height: 1.3; }
.item-card__name a { color: var(--text); text-decoration: none; }
.item-card__name a:hover { color: var(--accent); }
.item-card__meta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; margin: 0; font-size: .8rem; }
.item-card__cat { color: var(--muted); }
.item-card__line { margin: 0; font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.item-card__line .dot { margin-left: .2rem; }

/* Vue liste */
.archive.is-list { grid-template-columns: 1fr; gap: .5rem; }
.archive.is-list .item-card { grid-template-columns: 4.2rem 1fr; grid-template-rows: none; align-items: center; }
.archive.is-list .item-card:hover { transform: none; }
.archive.is-list .item-card__slot { margin: .5rem; border-width: 2px; }
.archive.is-list .item-card__body { grid-template-columns: minmax(10rem, 1.2fr) minmax(8rem, .8fr) minmax(0, 2fr); align-items: center; gap: .3rem 1rem; padding: .5rem 1rem .5rem 0; }
.archive.is-list .item-card__line { grid-column: 3; }
.archive.is-list .item-card__line ~ .item-card__line { grid-column: 3; }

@media (max-width: 640px) {
    .archive { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .7rem; }
    .item-card__body { padding: .6rem .7rem .75rem; }
    .archive.is-list .item-card__body { grid-template-columns: 1fr; }
    .archive.is-list .item-card__line { grid-column: auto; }
    .archive-tools__row > label { flex: 1 1 45%; }
}
@media (prefers-reduced-motion: reduce) {
    .item-card:hover, .item-card:hover .item-card__slot img { transform: none; }
}

.mini-slot { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; vertical-align: middle; background: var(--slot-bg); border: 2px solid color-mix(in srgb, var(--r) 70%, transparent); border-radius: 6px; }
.mini-slot img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.import-preview td { vertical-align: middle; }
/* Fiche d'un objet : l'image de l'infobox dans une case d'inventaire */
.infobox__slot { display: grid; place-items: center; aspect-ratio: 1 / 1; margin: 1rem 1rem 0; background: var(--slot-bg); border-radius: var(--radius-sm); border: 2px solid color-mix(in srgb, var(--r) 70%, transparent); box-shadow: inset 0 0 26px -6px color-mix(in srgb, var(--r) 55%, transparent); }
.infobox__slot img { width: 76%; height: 76%; object-fit: contain; mix-blend-mode: multiply; }
.infobox__rarity { text-align: center; margin: .6rem 0 .2rem; }

/* ═══ Responsive ═══ */
@media (max-width: 1100px) {
    .grid-2 { grid-template-columns: 1fr; }
    .fact-row__main { grid-template-columns: 1fr 1fr; }
    .fact-row__main label:nth-child(2) { grid-column: span 2; }
}
@media (max-width: 1000px) {
    /* L'infobox passe au-dessus du texte */
    .article__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "box" "body"; }
    .infobox { position: static; max-width: 30rem; }
    .topbar__title { display: none; }
    .search { margin-left: 0; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgb(0 0 0 / .4); }
    .sidebar.is-open { transform: none; }
    .sidebar__close { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--side-active); color: var(--side-text); cursor: pointer; }
    .scrim { position: fixed; inset: 0; z-index: 30; background: rgb(10 9 22 / .5); }
    .sidebar.is-open + .scrim { display: block; }
    .main { margin-left: 0; }
    .topbar { padding: 1rem 1.25rem .4rem; }
    .topbar .topbar__menu { display: grid; }
    .content { padding: 1rem 1.25rem 2.5rem; }
    .footer { padding: 1rem 1.25rem 1.5rem; }
}
@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .relations > div { grid-template-columns: 1fr; gap: 0; }
    .relation-row, .relation-row--change { grid-template-columns: 1fr auto; }
    .relation-row > :nth-child(3):not(button) { grid-column: 1 / -1; }
    .fact-row__main, .fact-row__extra { grid-template-columns: 1fr; }
    .fact-row__main label:nth-child(2) { grid-column: auto; }
    .search-page { flex-wrap: wrap; }
    .recent-list__comment { padding-left: 0; }
    .editor__save { position: static; }
}
@media (max-width: 480px) {
    .topbar__title { font-size: 1.1rem; }
    .hero .pills { gap: .45rem; }
    .pill { font-size: .85rem; padding: .5rem .9rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
