/* GitDoc — thème « Forge » : graphite, accent émeraude, bannières et logos de projets. */
:root {
    color-scheme: light;
    --hue: 160;
    --primary: #047857;
    --primary-dark: #065f46;
    --secondary: #0e7490;
    --tint: #ecf5f0;
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-soft: #f4f4f5;
    --surface-raised: #ffffff;
    --control-border: #17171724;
    --accent-border: #04785740;
    --accent-fill: #047857;
    --accent-hover: #065f46;
    --accent-gradient: var(--accent-fill);
    --on-accent: #ffffff;
    --focus: #047857;
    --danger: #dc2626;
    --danger-border: #dc262640;
    --danger-bg: #dc26260f;
    --draft-bg: #f4f4f5;
    --draft-text: #525252;
    --published-bg: #ecf5f0;
    --published-text: #047857;
    --code-bg: #141415;
    --code-text: #e4e4e7;
    --text: #171717;
    --muted: #5c5c63;
    --faint: #737373;
    --border: #17171714;
    --header-bg: #fafafae6;
    --series-1: #059669;
    --series-2: #7c3aed;
    --ring: #04785729;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px #0000000d;
    --shadow: 0 1px 2px #0000000d;
    --shadow-lg: 0 8px 24px #00000014;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-family: "Inter", ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --primary: #34d399;
    --primary-dark: #6ee7b7;
    --secondary: #67e8f9;
    --tint: #34d3991a;
    --bg: #141415;
    --surface: #19191b;
    --surface-soft: #1f1f22;
    --surface-raised: #232325;
    --control-border: #ededed1f;
    --accent-border: #34d39947;
    --accent-fill: #10b981;
    --accent-hover: #34d399;
    --on-accent: #03140d;
    --focus: #34d399;
    --danger: #f07178;
    --danger-border: #e5484d4d;
    --danger-bg: #e5484d1a;
    --draft-bg: #232325;
    --draft-text: #a1a1a6;
    --published-bg: #34d3991a;
    --published-text: #6ee7b7;
    --code-bg: #0f0f10;
    --code-text: #e4e4e7;
    --text: #ededed;
    --muted: #a1a1a6;
    --faint: #85858b;
    --border: #ededed14;
    --header-bg: #141415e6;
    --series-1: #0f9f72;
    --series-2: #8b6ff0;
    --ring: #34d39933;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 16px 40px #00000073;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    color: var(--text); background: var(--bg); line-height: 1.6; font-size: 15px;
}
::selection { background: var(--accent-fill); color: var(--on-accent); }
main { flex: 1; }
h1, h2, h3, p, figure, ul, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.15; overflow-wrap: anywhere; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); letter-spacing: -.02em; }
h2 { font-size: 1.25rem; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
a { color: var(--primary); text-decoration: none; overflow-wrap: anywhere; transition: color .15s var(--ease); }
a:hover { color: var(--primary-dark); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
code, pre, kbd { font-family: var(--mono); }
:not(pre) > code { font-size: .86em; padding: .12em .4em; border-radius: 4px; background: var(--surface-soft); border: 1px solid var(--border); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 30; padding: .55rem .8rem; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.container, .shell { width: min(100% - 3rem, 1240px); margin-inline: auto; }
.shell { padding-block: 2.5rem 5rem; }
.muted { color: var(--muted); }
.icon { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pre-line { white-space: pre-line; }

/* ---------- En-tête ---------- */
.gitbook-header {
    position: sticky; top: 0; z-index: 10; background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}
.gitbook-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.logo:hover { color: var(--text); }
.logo-mark {
    display: block; width: 28px; height: 28px; border-radius: 8px; object-fit: cover; background: #000;
}
.top-nav, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.header-controls { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.theme-toggle { width: 36px; height: 36px; min-height: 36px; flex-shrink: 0; padding: 0; line-height: 1; }
.top-nav .nav-docs { color: var(--muted); margin-right: 4px; font-size: .875rem; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.top-nav .nav-docs:hover { color: var(--text); background: var(--surface-soft); }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: 2rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); padding-block: 2.25rem; font-size: .88rem; }
.site-footer .container { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-brand p { margin-top: .6rem; max-width: 22rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--text); }

/* ---------- Boutons ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 36px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
    white-space: normal; font-size: .875rem; font-weight: 500; text-decoration: none; line-height: 1.2;
    transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.button:active:not(:disabled) { transform: scale(.98); }
.button.large { min-height: 44px; padding-inline: 20px; font-size: .9375rem; border-radius: 10px; }
.primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: inset 0 1px 0 #ffffff26; }
.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.secondary { background: var(--surface); color: var(--text); border-color: var(--control-border); box-shadow: var(--shadow-sm); }
.secondary:hover { background: var(--surface-soft); color: var(--text); }
.quiet { background: transparent; color: var(--muted); }
.quiet:hover { background: var(--surface-soft); color: var(--text); }
.danger { border-color: var(--danger-border); color: var(--danger); background: var(--surface); }
.danger:hover { background: var(--danger-bg); color: var(--danger); }
.file-button { position: relative; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Logos et bannières de projets ---------- */
.project-logo {
    position: relative; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
    width: 44px; aspect-ratio: 1; border-radius: 10px;
    background: hsl(var(--hue) 38% 34%);
    color: #fff; font-weight: 600; font-size: .95rem;
    box-shadow: inset 0 0 0 1px #ffffff14;
}
.project-logo img { width: 100%; height: 100%; object-fit: cover; }
.project-logo:has(img) { background: var(--surface); }
.project-logo.sm { width: 28px; border-radius: 6px; font-size: .68rem; }
.project-logo.lg { width: 56px; border-radius: 12px; font-size: 1.15rem; }
.project-logo.xl { width: 96px; border-radius: 20px; font-size: 1.9rem; }
.project-banner {
    position: relative; overflow: hidden; aspect-ratio: 16 / 5;
    background: linear-gradient(180deg, hsl(var(--hue) 16% 24%), hsl(var(--hue) 12% 15%));
}
.project-banner i { display: none; }
.project-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Accueil ---------- */
.hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
    padding: clamp(24px, 5vw, 64px); border: 1px solid var(--border); border-radius: 20px;
    background: var(--surface); box-shadow: var(--shadow);
}
.eyebrow { margin: 0; color: var(--muted); font-size: .875rem; font-weight: 500; }
.hero h1 { margin-top: 16px; max-width: 13ch; font-size: clamp(2.5rem, 5.2vw, 4rem); line-height: 1.04; font-weight: 500; letter-spacing: -.03em; }
.hero-copy > p { margin-top: 20px; max-width: 36rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.125rem); line-height: 1.6; }
.hero-copy .actions { margin-top: 32px; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.hero-stats div { min-width: 0; }
.hero-stats dt { color: var(--muted); font-size: .8125rem; }
.hero-stats dd { margin-top: 4px; font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.featured {
    position: relative; display: flex; flex-direction: column; overflow: hidden; color: var(--text);
    border: 1px solid var(--border); border-radius: 16px; background: var(--surface-raised); box-shadow: var(--shadow-lg);
    transition: border-color .15s var(--ease);
}
.featured:hover { color: var(--text); border-color: var(--control-border); }
.featured-label {
    position: absolute; z-index: 2; top: 12px; left: 12px; padding: 2px 8px; border-radius: 6px;
    background: #000000b3; color: #ededed; font-size: .75rem; font-weight: 500;
}
.featured-banner { aspect-ratio: 16 / 7; }
.featured-body { display: flex; align-items: flex-start; gap: .85rem; margin-top: -28px; padding: 0 1.25rem; position: relative; }
.featured-body .project-logo { box-shadow: 0 0 0 4px var(--surface-raised), var(--shadow); }
.featured-body div { display: grid; min-width: 0; margin-top: 34px; }
.featured-body strong { font-size: 1.0625rem; font-weight: 600; }
.featured-body small { color: var(--muted); font-size: .8rem; }
.featured > p { padding: .85rem 1.25rem 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-cta { padding: 16px 20px 20px; color: var(--primary); font-weight: 500; font-size: .875rem; }

/* ---------- Catalogue ---------- */
.catalog { margin-top: 3.5rem; scroll-margin-top: 80px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.25rem; }
.section-head p { color: var(--muted); margin-top: .35rem; overflow-wrap: anywhere; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.toolbar .search { flex: 1 1 260px; }
.toolbar .search input { border-color: transparent; background-color: var(--surface-soft); }
.segmented { display: inline-flex; align-items: center; padding: 2px; gap: 2px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--border); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 500; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.project-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.project-card:hover { border-color: var(--control-border); color: var(--text); }
.card-banner { aspect-ratio: 16 / 6; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 0 20px 16px; }
.card-top { display: flex; align-items: flex-end; justify-content: space-between; margin-top: -24px; margin-bottom: 12px; position: relative; }
.card-top .project-logo { box-shadow: 0 0 0 4px var(--surface), var(--shadow); }
.card-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: .85rem; transition: color .15s var(--ease); }
.project-card:hover .card-arrow { color: var(--text); }
.project-card h3 { font-size: 1.0625rem; }
.card-owner { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.project-card p { color: var(--muted); font-size: .875rem; margin-block: 8px 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); color: var(--faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-meta .icon { width: 14px; height: 14px; vertical-align: 0; }
.card-meta time { margin-left: auto; }
.project-grid.list { grid-template-columns: 1fr; gap: .6rem; }
.project-grid.list .project-card { flex-direction: row; align-items: stretch; }
.project-grid.list .card-banner { width: 180px; aspect-ratio: auto; flex-shrink: 0; }
.project-grid.list .card-body { padding: 1rem 1.25rem; }
.project-grid.list .card-top { margin-top: 0; position: absolute; top: 1rem; right: 1.25rem; }
.project-grid.list .card-top .project-logo { display: none; }
.project-grid.list .project-card p { -webkit-line-clamp: 1; margin-block: .35rem .6rem; }
.project-grid.list .card-meta { border: 0; padding-top: 0; }
.empty { padding: 1.75rem; border: 1px dashed var(--control-border); border-radius: var(--radius); color: var(--muted); background: var(--surface-soft); text-align: center; }

/* ---------- Page projet ---------- */
.project-cover { position: relative; overflow: hidden; margin-bottom: 40px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.cover-banner { aspect-ratio: auto; height: clamp(150px, 22vw, 260px); }
.project-cover.compact .cover-banner { height: 92px; }
.cover-body { display: flex; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; padding: 0 clamp(1.1rem, 3vw, 2rem) 1.35rem; margin-top: -48px; position: relative; }
.project-cover.compact .cover-body { margin-top: -30px; padding-bottom: 1rem; }
.cover-body > .project-logo { box-shadow: 0 0 0 5px var(--surface), var(--shadow-lg); }
.cover-text { flex: 1; min-width: 220px; padding-top: 3.3rem; }
.project-cover.compact .cover-text { padding-top: 2.1rem; }
.cover-text .breadcrumb { margin-bottom: .35rem; }
.cover-text h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cover-title { color: var(--text); font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.cover-title:hover { color: var(--primary); }
.cover-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .45rem; color: var(--muted); font-size: .85rem; }
.cover-meta strong { color: var(--text); }
.cover-body .project-links { margin: 0; }
.cover-description { padding: 0 clamp(1.1rem, 3vw, 2rem) 1.5rem; color: var(--muted); max-width: 70ch; }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 190px; gap: clamp(1.5rem, 4vw, 3.25rem); }
.gitbook-sidebar, .toc { position: sticky; top: 88px; max-height: calc(100vh - 108px); align-self: start; overflow: auto; scrollbar-width: thin; }
.gitbook-sidebar li, .toc li { list-style: none; padding: 0; }
.gitbook-sidebar ul, .toc ul { padding: 0; }
.mobile-contents { display: none; }
.back-link, .breadcrumb { color: var(--muted); font-size: .84rem; }
.back-link { display: inline-flex; margin-bottom: 1.2rem; font-weight: 600; }
.back-link:hover { color: var(--text); }
.project-name { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.project-name:hover { color: var(--primary); }
.nav-group { margin-top: 24px; }
.nav-group h2, .toc h2 { font-size: .8125rem; font-weight: 500; color: var(--faint); margin-bottom: 8px; padding-left: 12px; }
.toc h2 { padding-left: 0; }
.nav-link { position: relative; display: flex; align-items: center; min-height: 34px; margin-bottom: 2px; color: var(--muted); border-radius: 8px; padding: 6px 12px; font-size: .875rem; font-weight: 400; transition: background .15s var(--ease), color .15s var(--ease); }
.nav-link:hover { background: var(--surface-soft); color: var(--text); }
.nav-link[aria-current] { background: var(--surface-soft); color: var(--text); font-weight: 500; box-shadow: inset 0 0 0 1px var(--border); }
.nav-link[aria-current]::before { content: ""; position: absolute; left: 0; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: var(--accent-fill); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.document { min-width: 0; max-width: 780px; }
.document > .section-head { margin-bottom: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.document > .section-head p { font-size: 1.06rem; }
.overview-title { font-size: 1.5rem; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .9rem; }
.overview-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
.overview-card h3 { font-size: .8125rem; font-weight: 500; color: var(--faint); margin-bottom: 8px; }
.prose .overview-list { list-style: none; padding: 0; display: grid; gap: .55rem; }
.prose .overview-list li { margin: 0; }
.prose .overview-list a { font-weight: 500; text-decoration: none; }
.overview-list p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.prose { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.78; }
.prose > * { margin-bottom: 1.2rem; }
.prose h2 { margin-top: 40px; scroll-margin-top: 90px; font-size: 1.5rem; letter-spacing: -.015em; }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-border); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li::marker { color: var(--faint); }
.prose li + li { margin-top: .35rem; }
.prose img, .prose video, .video-frame { display: block; max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.prose video, .video-frame { width: 100%; }
.video-frame { aspect-ratio: 16 / 9; background: #000; }
.prose figcaption { margin-top: .55rem; color: var(--muted); font-size: .86rem; text-align: center; }
.prose pre { position: relative; overflow: auto; border-radius: var(--radius-sm); padding: 16px 20px; background: var(--code-bg); color: var(--code-text); font-size: .84rem; line-height: 1.65; border: 1px solid var(--border); }
.callout { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); padding: 16px 20px 16px 24px; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-fill); }
.download { display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface); padding: 12px 16px; font-weight: 500; text-decoration: none !important; transition: background-color .15s var(--ease); }
.download:hover { background: var(--surface-soft); }
.toc { padding-left: 1rem; border-left: 1px solid var(--border); }
.toc button { display: block; text-align: left; background: none; border: 0; color: var(--muted); font-size: .84rem; padding: .28rem 0; overflow-wrap: anywhere; }
.toc button:hover { color: var(--text); }
.page-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 3rem; }
.page-links a { display: grid; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; background: var(--surface); font-weight: 500; transition: border-color .15s var(--ease); }
.page-links a:last-child:not(:first-child) { text-align: right; }
.page-links a:hover { border-color: var(--control-border); }
.page-links small { color: var(--muted); font-weight: 500; font-size: .76rem; }

/* ---------- Communauté ---------- */
.community { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.75rem; }
.community input, .community textarea { width: 100%; }
.community .section-head { flex-wrap: wrap; gap: .6rem; }
.comment-form, .community-auth { margin-bottom: 1.25rem; }
.comment-form { display: grid; gap: .6rem; }
.comment-list { list-style: none; padding: 0; margin-bottom: 1rem; display: grid; gap: .65rem; }
.comment { padding: .95rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow-wrap: anywhere; }
.comment-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-bottom: .35rem; font-size: .92rem; }
.comment-heading time, .like-count { color: var(--muted); font-size: .8rem; }
.comment-heading button { margin-left: auto; min-height: 28px; padding: .15rem .55rem; font-size: .8rem; }
.like-button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent-border); color: var(--primary); }

/* ---------- Administration ---------- */
.admin-nav { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 1.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.admin-nav a { padding: .4rem .9rem; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: .88rem; }
.admin-nav a:hover { background: var(--surface-soft); color: var(--text); }
.admin-columns, .editor-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.editor-layout { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
.stack { display: grid; gap: .9rem; min-width: 0; align-content: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.05rem, 2.6vw, 1.6rem); box-shadow: var(--shadow-sm); min-width: 0; }
.panel .section-head, .panel > h2 { margin-bottom: .75rem; }
.panel .section-head p { font-size: .88rem; }
.record-project { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.identity-preview { position: relative; margin-bottom: 2.2rem; }
.identity-preview .project-banner { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.identity-preview > .project-logo { position: absolute; left: 1rem; bottom: -2.2rem; width: 72px; border-radius: 18px; box-shadow: 0 0 0 4px var(--surface), var(--shadow); }
.identity-slot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.identity-head { display: grid; }
.identity-head small { font-size: .78rem; }
.auth { max-width: 440px; margin-inline: auto; margin-top: clamp(0rem, 4vw, 2.5rem); }
.auth.panel { padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-lg); }
.auth form { display: grid; gap: .95rem; margin-block: 1.5rem .75rem; }
.auth h1 { font-size: 1.75rem; letter-spacing: -.02em; }
.auth .primary { width: 100%; min-height: 44px; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: 6px; font-size: .8125rem; font-weight: 500; min-width: 0; }
.field :is(input, textarea, select) { font-weight: 400; font-size: .93rem; }
.check { font-size: .92rem; display: flex; align-items: center; gap: .5rem; }
input, textarea, select { max-width: 100%; border: 1px solid var(--control-border); border-radius: 8px; background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease); }
input:not([type="checkbox"]), textarea, select { padding: .6rem .8rem; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-fill); box-shadow: 0 0 0 3px var(--ring); background-color: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--accent-fill); }
textarea { resize: vertical; line-height: 1.55; }
input[type="file"]:not(.sr-only) { font-size: .85rem; padding: .45rem; background: var(--surface-soft); border-style: dashed; }
input[type="file"]::file-selector-button { margin-right: .7rem; padding: .35rem .75rem; border: 1px solid var(--control-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.search input { width: 100%; padding-left: 2.4rem; background: var(--surface) no-repeat .85rem center / 1rem url("search.svg"); }
.form-notice { font-size: .85rem; color: var(--danger); font-weight: 600; overflow-wrap: anywhere; }
.form-notice:empty, #project-public:empty, #page-public:empty { display: none; }
.form-notice.success, #media-notice { color: var(--muted); }

/* ---------- Listes, statuts ---------- */
.record-list { list-style: none; padding: 0; }
.record-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .25rem; border-bottom: 1px solid var(--border); }
.record-list li:last-child { border-bottom: 0; }
.record-list a { font-weight: 500; color: var(--text); }
.record-list a:hover { color: var(--primary); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 500; white-space: nowrap; background: var(--draft-bg); color: var(--draft-text); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.published { background: var(--published-bg); color: var(--published-text); }
.group-title { margin-top: 16px; color: var(--faint); font-size: .8125rem; font-weight: 500; }
.category { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem .95rem; background: var(--surface); }
.category[open] { border-color: var(--control-border); }
.category summary { cursor: pointer; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.category summary:hover { color: var(--primary); }
.category small { color: var(--muted); font-weight: 450; }
.category form { margin-top: .8rem; }

/* ---------- Éditeur de blocs ---------- */
.block { display: grid; gap: .65rem; padding: 1rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.block:focus-within { border-color: var(--control-border); }
.block-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .88rem; }
.block-head button { padding: .25rem .55rem; border: 1px solid var(--control-border); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: .82rem; }
.block-head button:hover:not(:disabled) { color: var(--primary); border-color: var(--accent-border); }
.preview { padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.error-panel { max-width: 640px; margin: 2rem auto 0; text-align: center; }
.error-panel .section-head { justify-content: center; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.invitation-links { margin-block: 1rem .25rem; }
.share-member { border-top: 1px solid var(--border); padding-top: .9rem; }

/* ---------- Dépôt de fichiers (façon GitHub) ---------- */
.repo-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.repo-title { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.repo-title .breadcrumb { margin-bottom: .15rem; }
.repo-title h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.repo-tabs { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.repo-tabs a { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1rem; color: var(--muted); font-weight: 500; font-size: .9rem; white-space: nowrap; }
.repo-tabs a:hover { color: var(--text); }
.repo-tabs a[aria-current] { color: var(--text); }
.repo-tabs a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-fill); }
.count { display: inline-grid; place-items: center; min-width: 20px; padding: 0 6px; border-radius: 6px; background: var(--surface-soft); color: var(--faint); font-family: var(--mono); font-size: .75rem; font-weight: 400; line-height: 20px; }
.repo-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: .9rem; }
.repo-path { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 1.02rem; font-weight: 500; }
.repo-path a { color: var(--text); }
.repo-path span { color: var(--muted); }
.repo-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1.25rem; }
.repo-box-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .8rem 1rem; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: .88rem; }
.repo-stats { font-size: .8rem; }
.commit-line { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; min-width: 0; font-size: .88rem; }
.commit-message { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.commit-message:hover { color: var(--primary); text-decoration: underline; }
.commit-count { color: var(--text); font-weight: 500; font-size: .85rem; }
.commit-count:hover { color: var(--primary); }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; vertical-align: middle;
    background: hsl(var(--hue) 30% 36%); color: #fff; font-size: .6rem; font-weight: 600; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .6rem 1rem; background: var(--tint); border-bottom: 1px solid var(--accent-border); font-size: .88rem; }
.repo-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.repo-table th { padding: 8px 16px; text-align: left; color: var(--faint); font-size: .8125rem; font-weight: 500; border-bottom: 1px solid var(--border); }
.repo-table td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.repo-table tr:last-child td { border-bottom: 0; }
.repo-table tbody tr { transition: background .12s var(--ease); }
.repo-table tbody tr:hover { background: var(--surface-soft); }
.repo-table tbody tr:has(input:checked) { background: var(--tint); }
.repo-table .pick { width: 2.4rem; padding-right: 0; }
.repo-table .name a { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 500; }
.repo-table .name a:hover { color: var(--primary); text-decoration: underline; }
.repo-table .last-commit { color: var(--muted); max-width: 0; width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-table .last-commit a { color: var(--muted); }
.repo-table .last-commit a:hover { color: var(--primary); }
.repo-table .when { white-space: nowrap; text-align: right; font-size: .8rem; }
.repo-empty { margin: 1rem; display: grid; gap: .4rem; }
.repo-icon { display: inline-block; flex-shrink: 0; width: .9rem; height: .72rem; border: 1.5px solid currentColor; border-radius: 2px; position: relative; color: var(--muted); }
.repo-icon.folder { color: var(--muted); background: var(--surface-soft); }
.repo-icon.folder::before { content: ""; position: absolute; left: -1.5px; top: -.26rem; border: 1.5px solid currentColor; border-bottom: 0; width: .4rem; height: .22rem; border-radius: 2px 2px 0 0; }
.repo-icon.file { width: .68rem; height: .84rem; }
.repo-feedback { margin-bottom: 1rem; padding: .75rem 1rem; border: 1px solid var(--accent-border); border-radius: var(--radius-sm); background: var(--tint); overflow-wrap: anywhere; font-size: .9rem; }
.repo-note { padding: .6rem 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.repo-more { margin-top: .5rem; justify-content: center; }
.repo-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .75rem; }
.repo-edit { margin-top: 1rem; }
.repo-edit summary { color: var(--primary); font-weight: 500; cursor: pointer; }
.repo-edit form { margin-top: .8rem; }
.upload-panel { margin-bottom: 1.25rem; border-color: var(--accent-border); }
.dropzone { display: grid; place-items: center; gap: .25rem; padding: 1.75rem 1rem; border: 2px dashed var(--control-border); border-radius: var(--radius-sm); background: var(--surface-soft); text-align: center; cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent-fill); background: var(--tint); }
.dropzone span { color: var(--muted); font-size: .88rem; }
.dropzone small { color: var(--primary); font-weight: 500; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent-fill); transform-origin: left; transform: scaleX(0); transition: transform .2s var(--ease); }
.file-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .55rem 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.file-bar .button { min-height: 32px; padding: .3rem .7rem; font-size: .82rem; }
.lang-pill { display: inline-flex; padding: 1px 6px; border-radius: 4px; background: var(--surface-soft); color: var(--muted); font-family: var(--mono); font-size: .75rem; }
.image-view { display: grid; place-items: center; padding: 1.5rem; background-image: conic-gradient(var(--surface-soft) 25%, transparent 0 50%, var(--surface-soft) 0 75%, transparent 0); background-size: 20px 20px; }
.image-view img { max-width: 100%; max-height: 70vh; border-radius: 8px; box-shadow: var(--shadow); }
.binary-view { margin: 1rem; display: grid; justify-items: center; gap: .6rem; }
.code-view { overflow: auto; max-height: 75vh; background: var(--surface); }
.code-table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .82rem; line-height: 1.6; tab-size: 4; }
.code-table .ln { width: 1%; min-width: 3rem; padding: 0 .9rem 0 1rem; text-align: right; color: var(--muted); opacity: .6; user-select: none; vertical-align: top; }
.code-table .ln::before { content: attr(data-line); }
.code-table .lc { padding: 0 1rem 0 .5rem; white-space: pre; }
.code-table tr:hover .lc, .code-table tr:hover .ln { background: var(--surface-soft); }
.code-table tr:first-child td { padding-top: .75rem; }
.code-table tr:last-child td { padding-bottom: .75rem; }
.tok-comment { color: #6b7280; }
.tok-string { color: #0b8a5f; }
.tok-keyword { color: #a3359a; }
.tok-number { color: #b45309; }
.tok-tag { color: #0369a1; }
.tok-function { color: #1d4ed8; }
:root[data-theme="dark"] .tok-comment { color: #6b8576; }
:root[data-theme="dark"] .tok-string { color: #6ee7b7; }
:root[data-theme="dark"] .tok-keyword { color: #f0abfc; }
:root[data-theme="dark"] .tok-number { color: #fdba74; }
:root[data-theme="dark"] .tok-tag { color: #7dd3fc; }
:root[data-theme="dark"] .tok-function { color: #93c5fd; }
.markdown-body { padding: 1.5rem clamp(1rem, 3vw, 2rem); line-height: 1.75; overflow-wrap: anywhere; }
.markdown-body > * + * { margin-top: .9rem; }
.markdown-body h2 { font-size: 1.6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1rem; margin-top: 1.25rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4rem; }
.markdown-body li::marker { color: var(--primary); }
.markdown-body a { text-decoration: underline; text-underline-offset: .2em; }
.markdown-body blockquote { margin-inline: 0; padding: .2rem 1rem; border-left: 4px solid var(--accent-border); color: var(--muted); }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); }
.markdown-body .code-view { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.markdown-body .code-table tr:hover td { background: transparent; }
.readme .repo-box-head { font-size: .9rem; }
pre.plain { margin: 0; white-space: pre-wrap; font-family: var(--mono); font-size: .85rem; }
.path-input { flex: 1 1 280px; }
.path-input input { width: 100%; font-family: var(--mono); font-size: .88rem; }
.code-editor { display: block; width: 100%; min-height: 55vh; border: 0; border-radius: 0; padding: 1rem; resize: vertical; background: var(--surface); font-family: var(--mono); font-size: .85rem; line-height: 1.6; tab-size: 4; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.code-editor:focus { box-shadow: inset 0 0 0 2px var(--ring); }
.commit-panel { border-color: var(--accent-border); }
.commit-list { list-style: none; padding: 0; margin: 0; }
.commit-day { padding: .55rem 1rem; background: var(--surface-soft); border-bottom: 1px solid var(--border); color: var(--muted); font-size: .78rem; font-weight: 500; }
.commit-day::first-letter { }
.commit-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.commit-row:last-child { border-bottom: 0; }
.commit-row:hover { background: var(--surface-soft); }
.commit-row .avatar { width: 32px; height: 32px; font-size: .72rem; }
.commit-row > div { display: grid; min-width: 0; }
.commit-row .commit-message { font-weight: 500; white-space: nowrap; }
.commit-row small { font-size: .78rem; }
.commit-id { font-family: var(--mono); font-size: .8rem; }
.commit-hero { padding: 1.25rem 1rem; background: var(--surface-soft); border-bottom: 1px solid var(--border); display: grid; gap: .6rem; }
.commit-hero h2 { font-size: 1.3rem; }
.commit-id-pill { margin-left: auto; padding: .1rem .55rem; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-family: var(--mono); font-size: .8rem; }
.change-summary { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: .75rem; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge.add { background: #dcf7ea; color: #04704c; border-color: #a7e3c9; }
.badge.mod { background: #fff4d6; color: #8a5a00; border-color: #f5d98a; }
.badge.del { background: #ffe8ec; color: #b4233f; border-color: #f5c0cb; }
.badge.ren { background: #e3f2fd; color: #0b5a91; border-color: #b6dbf7; }
.badge.latest { background: var(--tint); color: var(--primary); border-color: var(--accent-border); }
:root[data-theme="dark"] .badge.add { background: #0f2a20; color: #6ee7b7; border-color: #1f5a43; }
:root[data-theme="dark"] .badge.mod { background: #2b2210; color: #fcd34d; border-color: #5b4513; }
:root[data-theme="dark"] .badge.del { background: #2a1219; color: #fda4b4; border-color: #5b2030; }
:root[data-theme="dark"] .badge.ren { background: #0e2233; color: #93c5fd; border-color: #1e3f5c; }
.change-list { list-style: none; padding: 0; margin: 0; }
.change-list li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.change-list li:last-child { border-bottom: 0; }
.change-list .badge { justify-self: start; }
.change-path { font-family: var(--mono); font-size: .84rem; overflow-wrap: anywhere; }
.change-path s { color: var(--muted); }
.change-size { font-size: .78rem; white-space: nowrap; }
.change-list .button { min-height: 30px; padding: .2rem .6rem; font-size: .8rem; }
.release-new { margin-bottom: 1.5rem; }
.release-new > summary { cursor: pointer; font-weight: 500; color: var(--primary); }
.release-new form { margin-top: 1rem; }
.release { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.release-side { display: grid; align-content: start; justify-items: start; gap: .4rem; padding-top: .9rem; }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--tint); border: 1px solid var(--accent-border); font-family: var(--mono); font-size: .8125rem; font-weight: 500; color: var(--primary); font-variant-numeric: tabular-nums; }
.release-main { margin: 0; }
.release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.release-head h2 { font-size: 1.375rem; margin-bottom: 4px; }
.release-head small { display: inline-flex; align-items: center; gap: .4rem; }
.release .markdown-body { border-bottom: 1px solid var(--border); }
.assets { padding: 1rem 1.25rem; }
.assets h3 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-bottom: .6rem; }
.assets ul { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.assets li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 1rem; padding: .55rem .85rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.assets li:last-child { border-bottom: 0; }
.assets li:hover { background: var(--surface-soft); }
.assets a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.assets .muted { display: inline-flex; align-items: center; gap: 4px; }
.assets .muted { font-size: .8rem; white-space: nowrap; }
.assets .button { min-height: 28px; padding: .1rem .5rem; }
.release-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-soft); }
.release-tools .form-notice { flex-basis: 100%; }
.release-edit { flex-basis: auto; }
.release-edit[open] { flex-basis: 100%; order: 10; }
.release-edit > summary { list-style: none; }
.release-edit > summary::-webkit-details-marker { display: none; }
.release-edit form { margin-top: .75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- Chat ---------- */
.chat-widget { position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 15; display: grid; justify-items: end; gap: .75rem; pointer-events: none; }
.chat-widget > * { pointer-events: auto; }
.chat-toggle { width: 52px; height: 52px; border-radius: 16px; padding: 0; background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--shadow-lg), inset 0 1px 0 #ffffff26; }
.chat-toggle:hover { color: var(--on-accent); background: var(--accent-hover); }
.chat-toggle .icon { width: 22px; height: 22px; }
.chat-icon { position: relative; display: grid; place-items: center; width: 24px; height: 18px; border: 1.5px solid currentColor; border-radius: 7px; font-size: .59rem; letter-spacing: 1px; line-height: 1; }
.chat-icon::after { position: absolute; bottom: -4px; left: 4px; width: 5px; height: 5px; content: ""; background: #0fb39a; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: skewY(-42deg); }
.chat-panel { display: flex; flex-direction: column; width: min(24rem, calc(100vw - 2.5rem)); height: min(34rem, calc(100dvh - 6.6rem)); color: var(--text); background: var(--surface); border: 1px solid var(--control-border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: chat-in .22s var(--ease); }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } }
.chat-header, .chat-form, .chat-guest { padding: .8rem 1rem; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.chat-header h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.chat-header h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #22c55e33; }
.chat-close { font-size: 1.4rem; line-height: 1; min-height: 32px; width: 32px; padding: 0; border-radius: 9px; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .9rem 1rem; scrollbar-width: thin; }
.chat-history { display: grid; gap: .6rem; list-style: none; padding: 0; }
.chat-message { justify-self: start; max-width: 86%; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: .5rem .75rem; font-size: .88rem; min-width: 0; overflow-wrap: anywhere; }
.chat-message.mine { justify-self: end; background: var(--accent-fill); border-color: transparent; color: var(--on-accent); border-radius: 14px 4px 14px 14px; }
.chat-message.mine :is(time, .chat-remove) { color: inherit; opacity: .75; }
.chat-message-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .12rem .45rem; margin-bottom: .15rem; font-size: .74rem; font-weight: 500; }
.chat-message time, .chat-remove { color: var(--muted); font-weight: 400; }
.chat-remove { padding: 0; font-size: .72rem; border: 0; text-decoration: underline; background: transparent; }
.chat-form { display: flex; align-items: end; gap: .5rem; border-top: 1px solid var(--border); }
.chat-form textarea { width: 100%; resize: none; font-size: .88rem; border-radius: 12px; }
.chat-form button { flex-shrink: 0; min-height: 42px; border-radius: 12px; }
.chat-guest { border-top: 1px solid var(--border); font-size: .88rem; text-align: center; }
.chat-status { padding: .35rem 1rem; color: var(--muted); font-size: .8rem; }
.chat-status:empty { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .doc-layout { grid-template-columns: 210px minmax(0, 1fr); }
    .toc { grid-column: 2; grid-row: 1; position: static; max-height: none; margin-bottom: .25rem; }
    .doc-layout:has(.toc) .document { grid-column: 2; grid-row: 2; }
    .doc-layout:has(.toc) .gitbook-sidebar { grid-row: 1 / 3; }
}
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .featured { transform: none; max-width: 520px; }
}
@media (max-width: 750px) {
    .admin-columns, .editor-layout { grid-template-columns: 1fr; }
    .doc-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .gitbook-sidebar { position: static; max-height: none; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
    .mobile-contents { display: inline-flex; }
    .gitbook-sidebar .back-link { margin-bottom: .65rem; }
    .mobile-contents + nav { margin-top: .8rem; }
    .mobile-contents[aria-expanded="false"] + nav { display: none; }
    .doc-layout .toc, .doc-layout:has(.toc) .document, .doc-layout:has(.toc) .gitbook-sidebar { grid-row: auto; grid-column: auto; }
    .doc-layout .toc { order: 0; }
    .doc-layout .document { order: 1; }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-grid.list .card-banner { width: 96px; }
    .repo-table .last-commit, .repo-table th.last-commit { display: none; }
    .release { grid-template-columns: 1fr; gap: .5rem; }
    .release-side { grid-auto-flow: column; padding-top: 0; align-items: center; }
    .change-list li { grid-template-columns: auto minmax(0, 1fr); }
    .change-list li > .change-size, .change-list li > .actions { grid-column: 2; }
    .assets li { grid-template-columns: minmax(0, 1fr) auto; }
    .cover-body { margin-top: -40px; }
    .project-logo.xl { width: 76px; border-radius: 20px; font-size: 1.5rem; }
    .cover-text { padding-top: 0; flex-basis: 100%; }
}
@media (max-width: 490px) {
    body { font-size: 15px; }
    .container, .shell { width: calc(100% - 1.5rem); }
    .shell { padding-block: 1.25rem 3rem; }
    .top-nav .nav-docs { display: none; }
    .top-nav { justify-content: flex-end; }
    .top-nav .button { font-size: .8rem; padding-inline: .55rem; min-height: 34px; }
    .header-controls, .top-nav { gap: .35rem; }
    .theme-toggle { width: 34px; height: 34px; min-height: 34px; }
    .hero { padding: 24px; border-radius: 16px; }
    .toolbar .segmented { flex: 1; }
    .toolbar .segmented button { flex: 1; }
    .page-links { grid-template-columns: 1fr; }
    .page-links a:last-child:not(:first-child) { text-align: left; }
    .project-grid.list .card-banner { display: none; }
    .repo-table td:nth-child(4), .repo-table th:nth-child(4) { display: none; }
    .repo-table td, .repo-table th { padding-inline: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Carte de présentation Nexo ---------- */
.nexo-banner { aspect-ratio: 3 / 1; background: #000; }
.nexo-card .featured-label { left: auto; right: .85rem; top: .7rem; }
.nexo-logo, .nexo-logo:has(img) { background: #000; }
.nexo-features { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: .85rem 1.25rem 0; margin: 0; }
.nexo-features li { padding: 2px 8px; border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: .75rem; }
.featured > a.featured-cta { align-self: flex-start; }
.featured > a.featured-cta:hover { color: var(--primary-dark); }
.nexo-card > p { -webkit-line-clamp: unset; display: block; }

/* ---------- Tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px;
    border: 1px solid transparent; background: var(--surface-soft); color: var(--muted);
    font-size: .75rem; font-weight: 500; line-height: 1.45; white-space: nowrap;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
a.tag-chip:hover, button.tag-chip:hover { color: var(--text); border-color: var(--control-border); }
.tag-chip.more { background: var(--surface-soft); border-color: var(--border); color: var(--muted); }
.tag-chip small { font-family: var(--mono); font-size: .6875rem; color: var(--faint); }
button.tag-chip { cursor: pointer; min-height: 28px; padding-inline: 10px; background: transparent; border-color: var(--border); color: var(--muted); }
button.tag-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
button.tag-chip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.project-card .tag-list { margin: -.35rem 0 .95rem; }
.cover-text .tag-list { margin-top: .7rem; }

/* ---------- Aperçu du dépôt ---------- */
.overview-block { margin-bottom: 2rem; }
.overview-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.overview-head h2 { font-size: 1.15rem; }
.overview-block .release { margin-bottom: 0; }

/* ---------- Signalements ---------- */
.badge.st-ouvert { background: #dcf7ea; color: #04704c; border-color: #a7e3c9; }
.badge.st-en_cours { background: #fff4d6; color: #8a5a00; border-color: #f5d98a; }
.badge.st-corrige { background: #ede7ff; color: #5b21b6; border-color: #cdbdfc; }
.badge.st-ferme { background: var(--surface-soft); color: var(--muted); border-color: var(--border); }
:root[data-theme="dark"] .badge.st-ouvert { background: #0f2a20; color: #6ee7b7; border-color: #1f5a43; }
:root[data-theme="dark"] .badge.st-en_cours { background: #2b2210; color: #fcd34d; border-color: #5b4513; }
:root[data-theme="dark"] .badge.st-corrige { background: #221a3d; color: #c4b5fd; border-color: #3f3170; }
.badge.type { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
.tag-pill.small { padding: .05rem .45rem; font-size: .72rem; }
.member-link { color: inherit; font-weight: 500; }
.member-link:hover { color: var(--primary); text-decoration: underline; }
.issue-list { list-style: none; padding: 0; margin: 0; }
.issue-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .85rem; align-items: start; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.issue-list li:last-child { border-bottom: 0; }
.issue-list li:hover { background: var(--surface-soft); }
.issue-icon { color: var(--faint); line-height: 1.4; }
.issue-icon .icon { width: 18px; height: 18px; }
.issue-replies { display: inline-flex; align-items: center; gap: 6px; }
.issue-main { display: grid; gap: .3rem; min-width: 0; }
.issue-title { color: var(--text); font-weight: 500; font-size: .9375rem; }
.issue-title:hover { color: var(--primary); }
.issue-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; font-size: .85rem; }
.issue-main small { font-size: .8rem; }
.issue-replies { font-size: .82rem; white-space: nowrap; }
.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: .6rem; }
.type-option { position: relative; display: block; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-option span { display: grid; gap: .15rem; padding: .8rem .9rem; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface-soft); transition: border-color .15s var(--ease), background .15s var(--ease); }
.type-option small { color: var(--muted); font-size: .78rem; }
.type-option input:checked + span { border-color: var(--accent-fill); background: var(--tint); }
.type-option input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.issue-head { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); display: grid; gap: .6rem; }
.issue-head h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
.issue-thread { display: grid; gap: 1rem; min-width: 0; }
.issue-post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; }
.issue-post > .avatar { width: 36px; height: 36px; font-size: .75rem; margin-top: .2rem; }
.issue-bubble { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; min-width: 0; }
.issue-bubble header { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .55rem .9rem; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: .85rem; }
.issue-bubble .markdown-body { padding: .9rem 1rem; }
.reply-delete { margin-left: auto; min-height: 26px; padding: .1rem .5rem; font-size: .78rem; }
.issue-side { display: grid; gap: .75rem; position: sticky; top: 88px; }
.issue-side h3 { font-size: .8125rem; font-weight: 500; color: var(--faint); }
.release-fixes { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.release-fixes h3 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-bottom: .5rem; }
.release-fixes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; font-size: .9rem; }
.release-fixes li { display: flex; gap: .5rem; }

/* ---------- Profils ---------- */
.profile-avatar { position: relative; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; width: 44px; aspect-ratio: 1; border-radius: 50%;
    background: hsl(var(--hue) 30% 36%); color: #fff; font-weight: 600; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar.xl { width: 112px; font-size: 2.2rem; box-shadow: 0 0 0 5px var(--surface), var(--shadow-lg); }
.profile-cover .cover-body { margin-top: -56px; }
.profile-cover .cover-text { padding-top: 3.8rem; }
.profile-bio { padding: 0 clamp(1.1rem, 3vw, 2rem) 1rem; max-width: 75ch; }
.profile-links { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0 clamp(1.1rem, 3vw, 2rem) 1.5rem; margin: 0; }
.profile-links .button { min-height: 34px; font-size: .84rem; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.profile-stats div, .kpi { padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.profile-stats dt, .kpi dt { color: var(--muted); font-size: .8125rem; }
.profile-stats dd, .kpi dd { font-size: 1.75rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.profile .catalog { margin-top: 2rem; }
.links-fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem; display: grid; gap: .5rem; margin: 0; }
.links-fieldset legend { padding: 0 .35rem; font-size: .84rem; font-weight: 500; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .5rem; }
.profile-preview > .profile-avatar { position: absolute; left: 1rem; bottom: -2.2rem; width: 72px; font-size: 1.4rem; box-shadow: 0 0 0 4px var(--surface), var(--shadow); }
.profile-preview .project-banner { aspect-ratio: 16 / 5; }

/* ---------- Statistiques ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; margin: 0 0 1.25rem; }
.kpi { display: grid; gap: .25rem; }
.kpi small { font-size: .78rem; }
.trend { font-weight: 500; color: var(--text); }
.trend.down { color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.chart-head h2 { font-size: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: 0; font-size: .8rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: .4rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.swatch.s1, .hbar.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.chart-box { position: relative; min-height: 220px; }
.chart-svg { display: block; overflow: visible; font-family: inherit; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.s1, .chart-svg .dot.s1 { stroke: var(--series-1); }
.chart-svg .line.s2, .chart-svg .dot.s2 { stroke: var(--series-2); }
.chart-svg .dot { stroke-width: 0; }
.chart-svg .dot.s1 { fill: var(--series-1); }
.chart-svg .dot.s2 { fill: var(--series-2); }
.chart-svg .dot { paint-order: stroke; stroke: var(--surface) !important; stroke-width: 2; }
.chart-svg .area.s1 { fill: var(--series-1); opacity: .1; }
.chart-svg .bar.s1 { fill: var(--series-1); }
.chart-svg .end-label { fill: var(--text); font-size: 11px; font-weight: 500; }
.chart-svg .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 2; display: grid; gap: .2rem; min-width: 150px; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-raised); box-shadow: var(--shadow-lg); font-size: .8rem; pointer-events: none; }
.chart-tip strong { font-size: .78rem; color: var(--muted); font-weight: 500; }
.chart-tip span { display: flex; align-items: center; gap: .45rem; }
.chart-tip b { margin-left: auto; padding-left: .8rem; font-variant-numeric: tabular-nums; }
.chart-data { margin-top: .5rem; font-size: .82rem; }
.chart-data summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.table-scroll { max-height: 220px; overflow: auto; margin-top: .5rem; border: 1px solid var(--border); border-radius: 8px; }
.chart-data table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-data th, .chart-data td { padding: .3rem .6rem; text-align: right; border-bottom: 1px solid var(--border); }
.chart-data th:first-child, .chart-data td:first-child { text-align: left; }
.chart-data thead th { position: sticky; top: 0; background: var(--surface-soft); }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; align-items: center; }
.hbar-label { grid-column: 1 / -1; display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .85rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hbar-track { display: block; height: 14px; }
.hbar { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; }
.hbars b { font-variant-numeric: tabular-nums; font-size: .9rem; }
.issue-stats { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .5rem; }
.issue-stats li { display: flex; align-items: center; justify-content: space-between; padding: .45rem .1rem; border-bottom: 1px solid var(--border); }
.stats-note { margin-top: 1.25rem; font-size: .8rem; }
@media (max-width: 900px) {
    .issue-layout, .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 750px) {
    .profile-cover .cover-text { padding-top: 0; }
    .profile-avatar.xl { width: 88px; font-size: 1.8rem; }
    .link-row { grid-template-columns: 1fr; }
    .issue-side { position: static; }
}

/* ---------- Page API ---------- */
.api-hero { padding: clamp(24px, 4vw, 48px); margin-bottom: 32px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: .9rem; justify-items: start; }
.api-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; letter-spacing: -.03em; }
.api-hero p { color: var(--muted); max-width: 46rem; font-size: 1.05rem; }
.api-layout { grid-template-columns: 220px minmax(0, 1fr); }
.prose-api { max-width: 900px; line-height: 1.7; }
.doc-section { padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); scroll-margin-top: 84px; display: grid; gap: .9rem; }
.doc-section:last-child { border-bottom: 0; }
.doc-section h2 { font-size: 1.5rem; }
.doc-section h3 { font-size: 1.05rem; margin-top: .6rem; }
.doc-section ol, .doc-section ul { padding-left: 1.3rem; margin: 0; display: grid; gap: .35rem; }
.doc-section li::marker { color: var(--faint); }
.callout.warn { border-color: #f5d98a; background: #fff8e6; }
:root[data-theme="dark"] .callout.warn { border-color: #5b4513; background: #221b0c; }
.callout.warn::before { background: #f59e0b; }
.base-url { display: inline-block; margin-top: .3rem; font-size: .95rem; word-break: break-all; }
.doc-code { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.doc-code-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.doc-code-head .button { min-height: 28px; padding: .15rem .6rem; font-size: .78rem; text-transform: none; letter-spacing: 0; }
.doc-code .code-view { max-height: 460px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.doc-table th, .doc-table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.doc-table th { color: var(--faint); font-size: .8125rem; font-weight: 500; }
.endpoint-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.endpoint { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.endpoint:last-child { border-bottom: 0; }
.endpoint p { grid-column: 2 / -1; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.endpoint-path { font-size: .86rem; font-weight: 500; overflow-wrap: anywhere; background: none !important; border: 0 !important; padding: 0 !important; }
.method { justify-self: start; padding: 1px 6px; border-radius: 4px; font-family: var(--mono); font-size: .75rem; font-weight: 500; border: 1px solid transparent; }
.m-get { background: #dcf7ea; color: #04704c; border-color: #a7e3c9; }
.m-post { background: #e3f2fd; color: #0b5a91; border-color: #b6dbf7; }
.m-patch { background: #fff4d6; color: #8a5a00; border-color: #f5d98a; }
.m-delete { background: #ffe8ec; color: #b4233f; border-color: #f5c0cb; }
:root[data-theme="dark"] .m-get { background: #0f2a20; color: #6ee7b7; border-color: #1f5a43; }
:root[data-theme="dark"] .m-post { background: #0e2233; color: #93c5fd; border-color: #1e3f5c; }
:root[data-theme="dark"] .m-patch { background: #2b2210; color: #fcd34d; border-color: #5b4513; }
:root[data-theme="dark"] .m-delete { background: #2a1219; color: #fda4b4; border-color: #5b2030; }
.keys-table { max-height: none; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.keys-table .button { min-height: 30px; padding: .2rem .6rem; font-size: .8rem; }
.key-value { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .6rem; }
.key-value code { font-size: .92rem; padding: .4rem .6rem; word-break: break-all; user-select: all; }
@media (max-width: 750px) {
    .api-layout { grid-template-columns: 1fr; }
    .api-layout .gitbook-sidebar { display: none; }
    .endpoint { grid-template-columns: auto minmax(0, 1fr); }
    .endpoint > .badge { grid-column: 2; justify-self: start; }
}

/* ---------- Messagerie ---------- */
.chat-panel { width: min(25rem, calc(100vw - 2.5rem)); height: min(38rem, calc(100dvh - 6.6rem)); }
.chat-header { min-height: 56px; padding: .55rem .6rem .55rem .9rem; gap: .4rem; }
.chat-header h2::before { display: none; }
.chat-header h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.chat-title { flex: 1; min-width: 0; }
.chat-header .button { min-height: 34px; width: 34px; padding: 0; border-radius: 9px; font-size: 1rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #22c55e33; }
.chat-tabs { display: flex; gap: 2px; padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.chat-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.chat-tabs button:hover { color: var(--text); background: var(--surface-soft); }
.chat-tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border); }
.tab-count { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 100px; background: #e5484d; color: #fff; font-size: .68rem; font-weight: 600; }
.chat-tools { display: flex; gap: .4rem; padding: .6rem .7rem .3rem; }
.chat-tools .search { flex: 1; }
.chat-tools input { padding-block: .45rem; font-size: .86rem; }
.chat-tools .button { min-height: 36px; padding-inline: .7rem; font-size: .8rem; white-space: nowrap; }
.user-results { list-style: none; margin: .2rem .7rem .4rem; padding: .25rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow); max-height: 220px; overflow: auto; font-size: .86rem; }
.user-results li.muted { padding: .5rem; }
.user-result { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .4rem .5rem; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.user-result:hover { background: var(--surface-soft); }
.user-result > span:nth-child(2) { flex: 1; min-width: 0; }
.online-text { color: #16a34a; font-size: .72rem; font-weight: 500; }
.button.small, .small { font-size: .75rem; }
.button.small { min-height: 26px; padding: .1rem .5rem; }
.profile-avatar.sm { width: 32px; font-size: .7rem; }
.profile-avatar.md { width: 44px; font-size: .85rem; }
.group-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; color: #fff; font-size: .7rem; font-weight: 600;
    background: hsl(var(--hue) 30% 36%); }
.conv-list { list-style: none; margin: 0; padding: .3rem; }
.conv-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; width: 100%; padding: .55rem .5rem; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.conv-item:hover { background: var(--surface-soft); }
.conv-avatar { position: relative; display: inline-flex; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px var(--surface); }
.conv-text { display: grid; min-width: 0; }
.conv-text strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-text small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.unread .conv-text strong, .conv-item.unread .conv-text small { color: var(--text); font-weight: 600; }
.conv-meta { display: grid; justify-items: end; gap: .2rem; font-size: .72rem; color: var(--muted); }
.chat-empty-state { padding: 2rem 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .35rem; font-size: .88rem; }
.chat-empty-state strong { color: var(--text); }
.friend-title { margin: 16px 16px 4px; font-size: .8125rem; font-weight: 500; color: var(--faint); }
.friend-list { list-style: none; margin: 0; padding: 0 .4rem; }
.friend-row { position: relative; display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 10px; }
.friend-row:hover { background: var(--surface-soft); }
.friend-row > .online-dot { left: 30px; right: auto; bottom: 6px; }
.friend-name { flex: 1; min-width: 0; color: var(--text); font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-actions { display: flex; align-items: center; gap: .2rem; }
.friend-actions .button { min-height: 30px; padding: .15rem .5rem; font-size: .8rem; }
.friend-empty { padding: .3rem .9rem; font-size: .85rem; }
.group-form, .group-settings { padding: .9rem; display: grid; gap: .8rem; align-content: start; }
.pick-friends { border: 1px solid var(--border); border-radius: 12px; padding: .5rem; margin: 0; display: grid; gap: .2rem; max-height: 220px; overflow: auto; }
.pick-friends legend { font-size: .84rem; font-weight: 500; padding: 0 .3rem; }
.pick-friend { display: flex; align-items: center; gap: .55rem; padding: .3rem .4rem; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.pick-friend:hover { background: var(--surface-soft); }
.inline-form { display: flex; gap: .4rem; }
.inline-form input { flex: 1; min-width: 0; }
.dm-head { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--text); }
.dm-head:hover { color: var(--text); }
.dm-head > span:last-child { display: grid; min-width: 0; line-height: 1.25; }
.dm-head strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-head small { color: var(--muted); font-size: .74rem; }
.dm-scroll { padding: .6rem .7rem; }
.dm-more { display: block; margin: 0 auto .5rem; font-size: .78rem; min-height: 28px; }
.dm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.dm-message { display: flex; align-items: flex-end; gap: .45rem; margin-top: .45rem; }
.dm-message.grouped { margin-top: 0; }
.dm-message.mine { justify-content: flex-end; }
.dm-avatar { width: 32px; flex-shrink: 0; }
.dm-bubble { position: relative; max-width: 78%; padding: .45rem .7rem .35rem; border-radius: 16px 16px 16px 5px; background: var(--surface-soft); border: 1px solid var(--border); font-size: .88rem; overflow-wrap: anywhere; }
.dm-message.mine .dm-bubble { border-radius: 16px 16px 5px 16px; background: var(--accent-fill); border-color: transparent; color: var(--on-accent); }
.dm-message.mine .dm-bubble a { color: inherit; text-decoration: underline; }
.dm-author { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.dm-bubble p { margin: 0; }
.dm-bubble time { display: block; text-align: right; font-size: .65rem; opacity: .65; margin-top: .1rem; }
.dm-system { text-align: center; margin: .6rem 0; }
.dm-system span { display: inline-block; padding: .2rem .7rem; border-radius: 100px; background: var(--surface-soft); color: var(--muted); font-size: .74rem; }
.dm-seen { text-align: right; font-size: .68rem; color: var(--muted); padding-right: .2rem; }
/* Avatars des messages privés non lus, à gauche de la bulle */
.chat-dock { display: flex; align-items: center; gap: .55rem; pointer-events: auto; }
.chat-heads { display: flex; flex-direction: row-reverse; gap: .45rem; }
.chat-head { position: relative; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: var(--shadow-lg); animation: head-in .35s var(--ease); }
.chat-head .profile-avatar, .chat-head .group-icon { width: 48px; height: 48px; border-radius: 50%; font-size: .9rem; box-shadow: 0 0 0 3px var(--surface); }
.head-count { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .3rem; border-radius: 100px; background: #e5484d; color: #fff; font-size: .68rem; font-weight: 600; box-shadow: 0 0 0 2px var(--surface); }
@keyframes head-in { from { opacity: 0; transform: translateX(8px); } }
.chat-toggle { position: relative; }
.chat-badge { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .35rem; border-radius: 100px; background: #e5484d; color: #fff; font-size: .72rem; font-weight: 600; box-shadow: 0 0 0 2px var(--bg); }
.online-pill { display: inline-flex; vertical-align: middle; margin-left: .4rem; padding: .15rem .55rem; border-radius: 100px; background: #dcfce7; color: #15803d; font-size: .75rem; font-weight: 600; letter-spacing: 0; }
:root[data-theme="dark"] .online-pill { background: #0f2a1a; color: #4ade80; }
/* Appels */
.call-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1rem; background: #05080799; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.call-card { position: relative; display: grid; place-items: center; gap: 16px; width: min(26rem, 100%); min-height: 24rem; padding: 32px 20px 24px; border-radius: 20px; overflow: hidden; color: #fff;
    background: #141415; box-shadow: 0 30px 80px #000a; border: 1px solid #ffffff1a; }
.call-card.video { width: min(56rem, 100%); aspect-ratio: 16 / 10; min-height: 0; padding: 0; }
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.local-video { position: absolute; right: 1rem; top: 1rem; width: 26%; max-width: 200px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 2px solid #ffffff33; background: #111; transform: scaleX(-1); }
.call-person { position: relative; display: grid; justify-items: center; gap: .5rem; text-align: center; }
.call-card.video .call-person { position: absolute; left: 1rem; top: 1rem; grid-auto-flow: column; align-items: center; gap: .6rem; padding: .35rem .8rem .35rem .35rem; border-radius: 100px; background: #0009; }
.call-card.video .call-person .profile-avatar { width: 36px; font-size: .8rem; box-shadow: none; }
.call-person strong { font-size: 1.2rem; }
.call-card.video .call-person strong { font-size: .9rem; }
.call-state { color: #ffffffb3; font-size: .9rem; font-variant-numeric: tabular-nums; }
.call-controls { position: relative; display: flex; gap: .9rem; }
.call-card.video .call-controls { position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%); }
.call-btn { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; background: #ffffff1f; color: #fff; transition: transform .15s var(--ease), background-color .15s var(--ease); }
.call-btn:hover { background: #ffffff33; }
.call-btn:active { transform: scale(.96); }
.call-btn .icon { width: 22px; height: 22px; }
.call-btn.accept { background: #16a34a; animation: ring 1.2s infinite; }
.call-btn.decline { background: #e5484d; }
.call-btn.off { background: #fff; color: #111; }
@keyframes ring { 50% { box-shadow: 0 0 0 10px #16a34a33; } }
@media (max-width: 490px) {
    .chat-head .profile-avatar, .chat-head .group-icon { width: 42px; height: 42px; }
    .chat-heads .chat-head:nth-child(n + 3) { display: none; }
    .call-card.video { aspect-ratio: 9 / 16; max-height: 90dvh; }
}

/* ---------- Appels de groupe ---------- */
.live-call { color: #16a34a; font-size: .72rem; font-weight: 600; }
.group-call-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--tint); border-bottom: 1px solid var(--border); font-size: .8125rem; font-weight: 500; }
.group-call-banner > span { display: inline-flex; align-items: center; gap: .4rem; }
.group-call-banner .button { min-height: 30px; padding: .15rem .65rem; font-size: .8rem; }
.call-toast { pointer-events: auto; display: grid; gap: 4px; width: min(20rem, calc(100vw - 2.5rem)); padding: 12px 16px; border-radius: 14px; background: var(--surface-raised); border: 1px solid var(--control-border); box-shadow: var(--shadow-lg); font-size: .86rem; animation: chat-in .25s var(--ease); }
.call-toast span { color: var(--muted); }
.toast-actions { display: flex; gap: .4rem; margin-top: .2rem; }
.toast-actions .button { min-height: 32px; font-size: .82rem; }
.group-call { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .8rem; padding: 1rem; color: #fff;
    background: #0f0f10f5; }
.gc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gc-head > div { display: grid; }
.gc-head small { display: inline-flex; align-items: center; gap: .4rem; color: #ffffffa6; font-size: .8rem; }
.gc-quality { color: #fcd34d; }
.call-btn.small { width: 36px; height: 36px; }
.call-btn.small .icon { width: 18px; height: 18px; }
.gc-grid { display: grid; gap: .6rem; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); grid-auto-rows: minmax(140px, 1fr); overflow: auto; align-content: center; }
.gc-grid[data-count="1"] { grid-template-columns: minmax(0, 720px); justify-content: center; }
.gc-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gc-grid[data-count="many"] { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: 130px; align-content: start; }
.gc-tile { position: relative; display: grid; place-items: center; min-height: 140px; border-radius: 16px; overflow: hidden; background: #19191b; border: 2px solid transparent; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.gc-tile.speaking { border-color: #4cc38a; }
.gc-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.gc-tile.has-video video { opacity: 1; }
.gc-tile.me video { transform: scaleX(-1); }
.gc-tile audio { display: none; }
.gc-avatar { display: grid; place-items: center; width: 100%; }
.gc-avatar .profile-avatar.xl { width: clamp(56px, 32%, 112px); font-size: 1.6rem; box-shadow: none; }
.gc-tile.has-video .gc-avatar { visibility: hidden; }
.gc-name { position: absolute; left: .6rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 100px; background: #000a; font-size: .8rem; font-weight: 500; }
.gc-controls { justify-content: center; }
.group-call.mini { inset: auto auto 1.25rem 1.25rem; width: 300px; grid-template-rows: auto auto auto; padding: .7rem; border-radius: 20px; box-shadow: 0 20px 50px #000a; border: 1px solid #ffffff1f; }
.group-call.mini .gc-grid { grid-template-columns: repeat(auto-fill, 52px) !important; grid-auto-rows: 52px; gap: .35rem; max-height: 120px; }
.group-call.mini .gc-tile { min-height: 0; border-radius: 50%; }
.group-call.mini .gc-name, .group-call.mini .gc-quality { display: none; }
.group-call.mini .gc-avatar .profile-avatar.xl { width: 100%; font-size: .8rem; }
.group-call.mini .call-btn { width: 44px; height: 44px; font-size: 1rem; }
@media (max-width: 600px) {
    .gc-grid[data-count="2"] { grid-template-columns: 1fr; }
    .group-call.mini { left: .75rem; right: .75rem; width: auto; bottom: 5.5rem; }
}

/* ---------- Icônes dans les contrôles ---------- */
.button .icon { margin-inline: -2px; }
.chat-header .button .icon, .friend-actions .button .icon, .gc-name .icon { width: 16px; height: 16px; }
.segmented .icon { width: 16px; height: 16px; }
.type-option strong { display: inline-flex; align-items: center; gap: 8px; }
.badge.type .icon, .issue-badges .icon { width: 14px; height: 14px; }
.readme .repo-box-head strong { display: inline-flex; align-items: center; gap: 8px; }
.tag-pill .icon { width: 13px; height: 13px; vertical-align: 0; }
.commit-count { display: inline-flex; align-items: center; gap: 6px; }
.prose .overview-list a { color: var(--text); }
.prose .overview-list a:hover { color: var(--primary); }

/* ---------- Téléchargement des archives ---------- */
.download-toasts { position: fixed; left: max(20px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; display: grid; gap: 8px; width: min(22rem, calc(100vw - 40px)); }
.download-toast { display: grid; gap: 8px; padding: 12px 12px 12px 16px; border: 1px solid var(--control-border); border-radius: 14px; background: var(--surface-raised); box-shadow: var(--shadow-lg); animation: chat-in .3s var(--ease); }
.download-toast-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.download-toast-head > .icon { color: var(--muted); }
.download-toast-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 500; }
.download-toast-head .button { min-height: 28px; width: 28px; padding: 0; }
.download-toast.finished .download-toast-head .button, .download-toast.failed .download-toast-head .button { visibility: hidden; }
.download-toast small { display: flex; justify-content: space-between; gap: 12px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.download-toast [data-percent] { font-family: var(--mono); color: var(--text); }
.download-bar { position: relative; height: 6px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.download-bar span { position: absolute; inset: 0; background: var(--accent-fill); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform .2s var(--ease); }
.download-bar.waiting span { width: 30%; transform: none; animation: download-wait 1.2s var(--ease) infinite; }
@keyframes download-wait { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.download-toast.failed .download-bar span { background: var(--danger); }
.download-toast.failed [data-done] { color: var(--danger); }

/* ==========================================================================
   Mélange : la base sobre (gris neutres, icônes, typographie) avec le caractère
   de la première version (lueur émeraude, dégradé de marque, carte penchée).
   Tout est regroupé ici pour être réglé facilement.
   ========================================================================== */
:root {
    --brand-gradient: linear-gradient(120deg, #059669 0%, #0891b2 100%);
    --glow: #10b9811f;
    --glow-2: #06b6d414;
}
:root[data-theme="dark"] {
    --bg: #111312;
    --surface: #171a19;
    --surface-soft: #1d201f;
    --surface-raised: #212524;
    --header-bg: #111312e6;
    --brand-gradient: linear-gradient(120deg, #34d399 0%, #22d3ee 100%);
    --glow: #10b9811c;
    --glow-2: #06b6d414;
}

/* Lueur douce en haut de page */
body {
    background-image:
        radial-gradient(48rem 26rem at 8% -10rem, var(--glow), transparent 70%),
        radial-gradient(40rem 24rem at 96% -8rem, var(--glow-2), transparent 70%);
    background-repeat: no-repeat;
}

/* Logo et titres un peu plus affirmés */
.logo { font-weight: 650; }
.logo-mark { box-shadow: 0 4px 14px -4px #10b98166; }
h1, h2, h3 { font-weight: 650; }
.hero h1 { font-weight: 600; }

/* Accueil : grille légère, pastille, dégradé sur la fin du titre */
.hero { isolation: isolate; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 60% 75% at 85% 30%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 75% at 85% 30%, #000, transparent 70%);
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 100px;
    border: 1px solid var(--accent-border); background: var(--tint); color: var(--primary); font-size: .8125rem; font-weight: 500;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 0 3px var(--ring); }
.hero h1 { max-width: 14ch; }
.hero h1 em, .api-hero h1 em {
    font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Carte « Projet Nexo » légèrement penchée, elle se redresse au survol */
.featured { transform: rotate(1deg); transition: transform .3s var(--ease), border-color .15s var(--ease); }
.featured:hover { transform: rotate(0deg); }
.featured-label { border-radius: 100px; padding: 2px 10px; }
@media (max-width: 900px) { .featured { transform: none; } }

/* Cartes de projet : petite montée et bordure émeraude au survol */
.project-card { transition: transform .2s var(--ease), border-color .2s var(--ease); }
.project-card:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.project-card:hover .card-arrow { color: var(--on-accent); background: var(--accent-fill); }

/* Tags : gris au repos, émeraude au survol et une fois choisis */
.tag-chip { border-radius: 100px; padding-inline: 10px; }
a.tag-chip:hover, button.tag-chip:hover { color: var(--primary); border-color: var(--accent-border); }
button.tag-chip[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.nexo-features li { border-radius: 100px; padding-inline: 10px; border: 1px solid var(--accent-border); background: var(--tint); color: var(--primary); }

/* Navigation latérale et onglets : trait de marque */
.nav-link[aria-current]::before, .repo-tabs a[aria-current]::after, .callout::before { background: var(--brand-gradient); }
.nav-link[aria-current] { color: var(--primary); }

/* Bouton du chat en dégradé de marque, avec une lueur discrète */
.chat-toggle { background: var(--brand-gradient); color: #fff; box-shadow: 0 10px 26px -8px #10b98199, inset 0 1px 0 #ffffff33; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.chat-toggle:hover { background: var(--brand-gradient); color: #fff; transform: translateY(-1px); box-shadow: 0 14px 30px -8px #10b981b3, inset 0 1px 0 #ffffff33; }
:root[data-theme="dark"] .chat-toggle, :root[data-theme="dark"] .chat-toggle:hover { color: #03140d; }

/* Bouton principal : légère lueur au survol */
.primary:hover { box-shadow: 0 6px 18px -6px #10b98180, inset 0 1px 0 #ffffff26; }

/* Barres de progression en dégradé de marque */
.download-bar span, .progress span { background: var(--brand-gradient); }
.download-bar.waiting span { background: var(--accent-fill); }

/* Bannières par défaut : teinte du projet un peu plus vivante, sans motif */
.project-banner { background: linear-gradient(135deg, hsl(var(--hue) 40% 26%), hsl(calc(var(--hue) + 30) 30% 14%)); }
.project-logo { background: linear-gradient(135deg, hsl(var(--hue) 50% 40%), hsl(calc(var(--hue) + 30) 50% 30%)); }

@media (prefers-reduced-motion: reduce) {
    .featured, .featured:hover, .project-card:hover, .chat-toggle:hover { transform: none; }
}

.avatar.has-image { overflow: hidden; background: var(--surface-soft); }
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Connexion avec Discord ---------- */
.auth-discord { display: grid; gap: 8px; margin-top: 24px; }
.auth-discord p { font-size: .8125rem; text-align: center; }
.discord-button { width: 100%; gap: 10px; background: #5865f2; color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 #ffffff26; }
.discord-button:hover { background: #4752c4; color: #fff; }
.discord-button .icon { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; color: var(--faint); font-size: .8125rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-divider + form { margin-top: 16px; }
.auth-error { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--danger-border); border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-size: .875rem; }

/* ---------- Serveur Discord ---------- */
.nav-discord { width: 36px; padding: 0; }
.nav-discord .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.nav-discord:hover { color: #5865f2; }
.featured-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 20px; }
.featured-actions .featured-cta { padding: 0; }
.featured-actions .discord-button { width: auto; min-height: 34px; padding: 6px 14px; font-size: .8125rem; }
.featured-actions .discord-button .icon { width: 16px; height: 16px; }
@media (max-width: 490px) { .nav-discord { display: none; } }

/* ---------- Partage ---------- */
.share-dialog { width: min(30rem, calc(100vw - 32px)); padding: 0; border: 1px solid var(--control-border); border-radius: 16px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-lg); }
.share-dialog::backdrop { background: #0000008c; }
.share-dialog[open] { animation: chat-in .25s var(--ease); }
.share-box { display: grid; gap: 12px; padding: 20px; }
.share-box header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-box h2 { font-size: 1.0625rem; overflow-wrap: anywhere; }
.share-box header .button { width: 32px; min-height: 32px; padding: 0; }
.share-box > p.muted { font-size: .8125rem; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .8125rem; background: var(--surface-soft); }
.share-more { justify-self: start; }
.share-status { min-height: 1.2em; font-size: .8125rem; color: var(--primary); }
.share-status:empty { min-height: 0; }

/* ==========================================================================
   Page Communauté : fil de publications et messagerie intégrée
   ========================================================================== */
.community-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.community-head p { margin-top: 6px; }
.community-tabs, .feed-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.community-tabs a, .feed-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.community-tabs a:hover, .feed-tabs a:hover { color: var(--text); }
.community-tabs a[aria-current], .feed-tabs a[aria-current] { background: var(--surface-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.community-tabs a[aria-current] .icon { color: var(--primary); }
.feed-column { width: min(100%, 640px); margin-inline: auto; display: grid; gap: 16px; }
.feed-tabs { justify-self: start; }

/* Rédaction */
.composer { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.composer-guest { grid-template-columns: 1fr auto; align-items: center; }
.composer-guest p { display: grid; gap: 2px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-row .avatar { width: 40px; height: 40px; font-size: .8rem; }
.composer textarea { flex: 1; min-height: 44px; resize: none; border: 0; background: transparent; padding: 8px 0; font-size: 1rem; line-height: 1.5; }
.composer textarea:focus { box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.composer-pick { cursor: pointer; color: var(--primary); }
.composer-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.composer-count { margin-left: auto; font-family: var(--mono); font-size: .75rem; }
.composer-bar .primary { margin-left: auto; }
.composer-count:not(:empty) + .primary { margin-left: 0; }
.composer-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.composer-preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.composer-preview img, .composer-preview video { width: 100%; height: 100%; object-fit: cover; }
.composer-preview .button { position: absolute; top: 6px; right: 6px; width: 28px; min-height: 28px; padding: 0; border-radius: 50%; background: #000000b3; color: #fff; }
.composer-progress { height: 6px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.composer-progress span { display: block; height: 100%; background: var(--brand-gradient, var(--accent-fill)); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform .2s var(--ease); }

/* Publication */
.post-list { display: grid; gap: 16px; }
.post { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.post-avatar .avatar { width: 40px; height: 40px; font-size: .8rem; }
.post-avatar.sm .avatar { width: 32px; height: 32px; font-size: .7rem; }
.post-author { display: grid; min-width: 0; line-height: 1.3; }
.post-author a { color: var(--text); }
.post-author a.muted { color: var(--faint); font-size: .8125rem; }
.post-author a:hover { text-decoration: underline; }
.post-menu { position: relative; margin-left: auto; }
.post-menu > .button { width: 34px; padding: 0; }
.post-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; min-width: 190px; padding: 4px; border: 1px solid var(--control-border); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
.post-menu-list button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: .875rem; }
.post-menu-list button:hover { background: var(--surface-soft); }
.post-menu-list .danger-text { color: var(--danger); }
.post-text { padding: 10px 16px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.post-text a { text-decoration: underline; text-underline-offset: .15em; }
.post-media { display: grid; gap: 2px; margin-top: 12px; background: var(--surface-soft); }
.post-media.grid-2, .post-media.grid-4 { grid-template-columns: 1fr 1fr; }
.post-media.grid-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media.grid-3 .post-image:first-child { grid-row: span 2; }
.post-image { display: block; padding: 0; border: 0; background: var(--surface-soft); cursor: zoom-in; aspect-ratio: 1; overflow: hidden; }
.post-media.grid-1 .post-image { aspect-ratio: auto; max-height: 560px; }
.post-media.grid-2 .post-image, .post-media.grid-4 .post-image { aspect-ratio: 4 / 3; }
.post-media.grid-3 .post-image { aspect-ratio: auto; min-height: 150px; }
.post-image img { width: 100%; height: 100%; max-height: 560px; object-fit: cover; display: block; }
.post-media.grid-1 .post-image img { object-fit: contain; background: #000; }
.post-media.video { background: #000; max-height: 600px; }
.post-media.video video { width: 100%; height: 100%; max-height: 600px; display: block; }
.post-actions { display: flex; gap: 4px; padding: 8px 10px; }
.post-action { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; transition: color .15s var(--ease), background-color .15s var(--ease); }
.post-action .icon { width: 18px; height: 18px; }
.post-action:hover { background: var(--surface-soft); color: var(--text); }
.post-action.liked { color: #e5484d; }
.post-action.liked .icon { fill: currentColor; }
.post-action[data-share-post] { margin-left: auto; }
.post-comments { padding: 4px 16px 16px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.post-comments > .muted { padding-top: 12px; font-size: .875rem; }
.comment-thread { list-style: none; padding: 12px 0 0; margin: 0; display: grid; gap: 10px; }
.comment-thread li { display: flex; gap: 10px; align-items: flex-start; }
.comment-bubble { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-soft); font-size: .875rem; }
.comment-bubble a { color: var(--text); }
.comment-bubble .muted { font-size: .75rem; margin-left: 6px; }
.comment-bubble p { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.link-button { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--faint); font-size: .75rem; text-decoration: underline; }
.comment-compose { display: flex; gap: 8px; }
.comment-compose input { flex: 1; min-width: 0; border-radius: 999px; padding-inline: 14px; }
.post-more { display: grid; justify-items: center; padding: 8px 0 24px; }
.post-more .muted { font-size: .8125rem; }
.single-post .feed { width: min(100%, 640px); margin-inline: auto; }
.single-post .back-link { display: inline-flex; align-items: center; gap: 4px; }

/* Visionneuse d'images */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000000e6; display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 92vw; max-height: 88dvh; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; }
.lightbox button:hover { background: #ffffff38; }
.lightbox .icon { width: 22px; height: 22px; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #ffffffcc; font-family: var(--mono); font-size: .8125rem; }

/* Signalements (administrateurs) */
.report-item { display: grid; gap: 8px; }
.report-reasons { display: grid; gap: 4px; padding: 12px 16px; border: 1px solid var(--danger-border); border-radius: 12px; background: var(--danger-bg); font-size: .875rem; }
.report-reasons .button { justify-self: start; margin-top: 6px; }

/* Profil : publications et abonnements */
.profile-posts { margin-top: 40px; }
.profile-posts > .section-head { width: min(100%, 640px); margin-inline: auto; margin-bottom: 16px; }
.profile-posts > .feed { width: min(100%, 640px); margin-inline: auto; }
.follow-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .875rem; }

/* Messagerie en grand dans la page */
.messenger-host { width: min(100%, 880px); margin-inline: auto; }
.chat-panel.embedded { width: 100%; height: min(76dvh, 820px); animation: none; box-shadow: none; border-color: var(--border); }
.chat-panel.embedded .chat-close { display: none; }
.chat-widget.messenger-embedded .chat-toggle { display: none; }
@media (max-width: 600px) {
    .composer-guest { grid-template-columns: 1fr; }
    .community-tabs { width: 100%; }
    .community-tabs a { flex: 1; justify-content: center; }
    .chat-panel.embedded { height: calc(100dvh - 220px); }
}
.ask-dialog textarea { width: 100%; resize: vertical; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ask-dialog .button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ask-dialog .button.danger:hover { filter: brightness(1.08); }

/* ==========================================================================
   Grades du staff et tableau de bord
   ========================================================================== */
.grade-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor;
    font-size: .6875rem; font-weight: 600; line-height: 1.5; letter-spacing: .01em; vertical-align: 1px; white-space: nowrap; background: color-mix(in srgb, currentColor 12%, transparent); }
h1 .grade-badge { font-size: .8125rem; vertical-align: 6px; padding: 2px 10px; }
.grade-createur { color: #d4a017; }
:root[data-theme="dark"] .grade-createur { color: #f5c542; }
.grade-administrateur { color: #dc2626; }
:root[data-theme="dark"] .grade-administrateur { color: #f87171; }
.grade-moderateur { color: #2563eb; }
:root[data-theme="dark"] .grade-moderateur { color: #60a5fa; }
.grade-support { color: #9333ea; }
:root[data-theme="dark"] .grade-support { color: #c084fc; }
.chat-message.mine .grade-badge, .dm-message.mine .grade-badge { color: inherit; }

.dashboard-body { display: grid; gap: 20px; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.dash-tile { display: grid; gap: 4px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.dash-tile dt { color: var(--muted); font-size: .8125rem; }
.dash-tile dd { margin: 0; font-size: 1.75rem; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dash-tile small { font-size: .75rem; }
.dash-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-columns > :only-child { grid-column: 1 / -1; }
.dash-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.dash-bar { flex: 1; min-width: 4px; height: calc(var(--h, 0) * 100%); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent-fill); opacity: .85; }
.dash-bar:hover { opacity: 1; }
.dash-list { list-style: none; padding: 0; margin: 0; display: grid; }
.dash-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.dash-list li:last-child { border-bottom: 0; }
.dash-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--danger-border); border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-weight: 500; }
.dash-toolbar { display: flex; align-items: center; gap: 16px; }
.dash-toolbar .search { flex: 1; max-width: 420px; }
.dash-status { min-height: 1.2em; font-size: .875rem; color: var(--primary); }
.dash-status:empty { display: none; }
.dash-table-wrap { padding: 0; overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.dash-table th { padding: 10px 16px; text-align: left; color: var(--faint); font-weight: 500; font-size: .8125rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dash-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table tbody tr:hover { background: var(--surface-soft); }
.dash-table select { padding: 6px 8px; font-size: .8125rem; }
.dash-member { display: grid; }
.dash-member small { font-size: .75rem; }
.dash-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.danger-text { color: var(--danger) !important; }
.grades-table th { white-space: normal; min-width: 110px; font-size: .75rem; }
.grades-table th:first-child { min-width: 180px; }
.grade-check { text-align: center; }
.grade-check input { width: 18px; height: 18px; }
.grade-name { display: block; margin-top: 6px; width: 100%; max-width: 180px; padding: 4px 8px; font-size: .8125rem; }
.dash-save { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px; }
.dash-note { margin-top: 12px; font-size: .8125rem; }
@media (max-width: 900px) { .dash-columns { grid-template-columns: 1fr; } }
