:root {
    --night: #0e1013;     /* fond */
    --dusk: #15181d;      /* surfaces */
    --dusk-2: #1c2026;    /* champs, éléments surélevés */
    --line: #262a32;      /* bordures */
    --silver: #e7e9ec;    /* texte */
    --haze: #8a919c;      /* texte secondaire */
    --moon: #eceef1;      /* action principale (bouton clair) */
    --lilac: #6f8dff;     /* accent : focus, sélection, liens */
    --danger: #f07171;
    --ok: #4fbf87;
    --discord: #5865f2;
    --display: 'Geist', system-ui, sans-serif;
    --sans: 'Geist', system-ui, sans-serif;
    --mono: 'Geist Mono', ui-monospace, monospace;
    --r-sm: 6px;
    --r: 10px;
    --r-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--night);
    color: var(--silver);
    font: 15px/1.55 var(--sans);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.muted { color: var(--haze); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.upper { text-transform: uppercase; }
.strong-link { color: var(--lilac); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--lilac) 40%, transparent); }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* Contrôles */
input, textarea, button, .btn {
    font: inherit;
    color: inherit;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--dusk-2);
    padding: 9px 12px;
}
textarea { resize: vertical; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--lilac); }
input[type=datetime-local] { color-scheme: dark; }
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer;
    background: var(--moon);
    color: var(--night);
    border-color: transparent;
    font-weight: 600;
    white-space: nowrap;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button.ghost, .btn.ghost { background: transparent; color: var(--silver); border-color: var(--line); font-weight: 600; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--haze); filter: none; }
button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); font-weight: 600; }
button.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); filter: none; }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
button.wide { width: 100%; }
button.icon { background: transparent; color: var(--haze); border-color: var(--line); padding: 0; width: 38px; font-size: 18px; font-weight: 400; }
button.icon:hover { color: var(--danger); }

.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--dusk-2); }

.tag {
    display: inline-block; font-size: 12px; font-weight: 600;
    padding: 1px 8px; border-radius: 99px; vertical-align: 1px;
}
.tag-on { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tag-off { color: var(--haze); background: var(--dusk-2); }

.flash {
    max-width: 880px; margin: 16px auto 0; padding: 10px 14px;
    border-radius: var(--r); border: 1px solid;
}
.flash-success { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* ---------- Site membre ---------- */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 24px;
    background: color-mix(in srgb, var(--night) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 600; font-size: 18px; white-space: nowrap; letter-spacing: -.02em; }
.brand-sub { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--haze); margin-left: 8px; letter-spacing: 0; }
.join { display: flex; gap: 8px; margin-left: auto; }
.join input { width: 200px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.join input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--sans); }
.me { display: flex; align-items: center; gap: 10px; }
.logout { color: var(--haze); font-size: 18px; padding: 0 4px; }
.logout:hover { color: var(--danger); }
.pill {
    font-size: 13px; font-weight: 500;
    padding: 3px 10px; border-radius: 99px;
    border: 1px solid var(--line); color: var(--silver);
}
.pill:hover { background: var(--dusk-2); }

main { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }

.hero { padding: 14vh 0 10vh; }
.hero h1 {
    font-size: clamp(40px, 8vw, 76px);
    line-height: .98; letter-spacing: -.035em;
    margin: 0 0 20px; max-width: 11ch;
    color: var(--moon);
}
.hero-text { font-size: 17px; color: var(--haze); max-width: 46ch; margin: 0; }
.btn-discord {
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 32px; padding: 12px 20px;
    background: var(--discord); color: #fff; font-weight: 600;
    border-radius: var(--r);
}
.btn-discord:hover { filter: brightness(1.1); }

.empty { padding: 8vh 0; }
.empty h1 { font-size: 32px; margin: 0 0 8px; }

.my-communities { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.community-chip {
    font-size: 13px; font-weight: 500; padding: 4px 12px;
    border-radius: 99px; background: var(--dusk); border: 1px solid var(--line); color: var(--silver);
}

.feed { margin-bottom: 40px; }
.feed-title { font-size: 15px; font-family: var(--sans); color: var(--haze); font-weight: 600; margin: 0 0 12px; }
.poll-card {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center;
    padding: 16px 18px; margin-bottom: 8px;
    background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r);
}
.poll-card:hover { border-color: var(--haze); }
.poll-card-title { font-weight: 700; font-size: 16px; }
.poll-card-meta { grid-column: 1; font-size: 13px; color: var(--haze); }
.poll-card-cta, .poll-card-state { grid-column: 2; grid-row: 1 / span 2; font-size: 13px; font-weight: 700; }
.poll-card-cta { color: var(--night); background: var(--moon); padding: 6px 14px; border-radius: var(--r-sm); font-weight: 600; }
.poll-card-state { color: var(--haze); }


/* Page sondage */
.poll h1 { font-size: clamp(28px, 5vw, 40px); margin: 16px 0 10px; }
.back-link { color: var(--haze); font-size: 14px; }
.back-link::before { content: '‹ '; }
.back-link:hover { color: var(--silver); }
.poll-description { font-size: 16px; max-width: 60ch; white-space: normal; }
.vote-form { display: grid; gap: 8px; margin: 24px 0; }
.choice {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; cursor: pointer;
    background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r);
}
.choice:hover { border-color: var(--haze); }
.choice:has(input:checked) { border-color: var(--moon); background: color-mix(in srgb, var(--moon) 7%, var(--dusk)); }
.choice input { accent-color: var(--lilac); width: 18px; height: 18px; margin: 0; }
.vote-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.voted-note { margin: 24px 0; padding: 16px 18px; background: var(--dusk); border-radius: var(--r); }
.voted-note p { margin: 0 0 4px; }

.results { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; gap: 8px; }
.results li {
    position: relative; overflow: hidden;
    display: flex; justify-content: space-between; gap: 16px;
    padding: 12px 14px; border-radius: var(--r-sm);
    background: var(--dusk-2);
}
.results .bar {
    position: absolute; inset: 0 auto 0 0; width: var(--pct);
    background: color-mix(in srgb, var(--silver) 8%, transparent);
    transition: width .6s ease-out;
}
.results li.mine .bar { background: color-mix(in srgb, var(--lilac) 30%, transparent); }
.results .label, .results .pct { position: relative; }
.results .pct { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.results small { font-weight: 500; color: var(--haze); }
.results li.mine small { color: var(--lilac); }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 28px;
    padding: 24px 16px;
    background: var(--dusk); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 0 10px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a {
    padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--haze); font-weight: 600;
}
.sidebar nav a:hover { color: var(--silver); background: var(--dusk-2); }
.sidebar nav a[aria-current] { color: var(--silver); background: var(--dusk-2); box-shadow: inset 2px 0 0 var(--lilac); }
.sidebar-foot {
    margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line);
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
    font-size: 14px;
}
.sidebar-foot .username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sidebar-foot .back { grid-column: 2; color: var(--haze); font-size: 13px; }
.sidebar-foot .back:hover { color: var(--silver); }

.admin-main { padding: 36px 40px 80px; max-width: 1080px; width: 100%; }
.admin-main > .flash { margin: 0 0 20px; max-width: none; }
.admin-title { font-size: 34px; margin: 0 0 8px; letter-spacing: -.025em; }
.lede { color: var(--haze); margin: 0 0 28px; }
.description { max-width: 70ch; margin: -12px 0 28px; }

.panel {
    background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 22px 24px; margin-bottom: 20px;
}
.panel h2 { font-size: 18px; margin: 0 0 14px; }
.panel h2 + * { margin-top: 0; }
.panel aside h2:not(:first-child), .panel > h2:not(:first-child) { margin-top: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 24px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--dusk); padding: 20px 22px; display: grid; gap: 2px; }
.stat:hover { background: var(--dusk-2); }
.stat strong { font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--silver); }
.stat span { color: var(--haze); font-size: 14px; }

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }
.split > .panel { margin-bottom: 0; }
.split + .panel { margin-top: 20px; }

.list, .plain, .people { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list a { font-weight: 600; }
.list a:hover { color: var(--lilac); }
.list .muted { white-space: nowrap; font-size: 14px; }
.plain li { padding: 4px 0; }
.people { display: grid; gap: 10px; }
.people li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.people .muted { font-size: 13px; }
.vstack { display: grid; gap: 8px; }

.voters { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.voters h3 { font-size: 15px; font-family: var(--sans); margin: 0 0 10px; color: var(--silver); }

/* Communautés */
.inline-create {
    display: flex; align-items: end; gap: 12px; flex-wrap: wrap;
    padding: 18px 20px; margin: 20px 0 24px;
    background: var(--dusk); border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; color: var(--haze); padding: 0; }
.field small { font-weight: 500; opacity: .8; }
.field.grow { flex: 1 1 240px; }
.field.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.stack { display: grid; gap: 10px; }
.row-card { background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg); }
.row-card[open] { border-color: color-mix(in srgb, var(--haze) 50%, var(--line)); }
.row-card summary {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 16px 20px; cursor: pointer; list-style: none;
}
.row-card summary::-webkit-details-marker { display: none; }
.row-card summary::after { content: '›'; margin-left: auto; color: var(--haze); font-size: 20px; line-height: 1; transition: transform .15s; }
.row-card[open] summary::after { transform: rotate(90deg); }
.row-name { font-weight: 700; font-size: 16px; }
.row-meta { color: var(--haze); font-size: 14px; }
.row-card.is-off .row-name { color: var(--haze); }
.row-body { padding: 4px 20px 20px; display: grid; gap: 18px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar form { margin: 0; display: flex; gap: 8px; }
.toolbar button { padding: 6px 12px; font-size: 13px; }
.rename input { padding: 6px 10px; font-size: 14px; width: 200px; }

.code-chip, .id-chip {
    font-family: var(--mono); font-weight: 500;
    background: var(--dusk-2); color: var(--silver);
    border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 3px 9px; font-size: 14px; letter-spacing: .05em;
    position: relative;
}
.id-chip { display: block; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--haze); font-size: 12px; letter-spacing: 0; }
.code-chip:hover, .id-chip:hover { filter: none; color: var(--silver); }
.code-chip.copied::after, .id-chip.copied::after {
    content: 'Copié'; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    margin-left: 8px; font-family: var(--sans); font-size: 12px; color: var(--ok); letter-spacing: 0;
}

.blank { padding: 40px 0; }
.blank p { margin: 0 0 4px; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--dusk); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--haze); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--dusk-2) 60%, transparent); }
.person { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* Formulaire sondage */
.form-panel { padding: 26px 28px; }
.poll-form { display: grid; gap: 22px; max-width: 640px; }
.poll-form input:not([type=checkbox]) { width: 100%; }
.options { display: grid; gap: 8px; margin-bottom: 4px; }
.option-row { display: flex; gap: 8px; }
.option-row input { flex: 1; }
.poll-form [data-add-option] { justify-self: start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.checks .check { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--dusk-2); font-size: 14px; }
.checks .check:has(input:checked) { border-color: var(--lilac); color: var(--silver); }
.check input { accent-color: var(--lilac); width: 16px; height: 16px; margin: 0; }
.settings { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r); background: var(--dusk-2); }
.settings .field.inline input { width: auto; }
.poll-form > button { justify-self: start; padding: 11px 20px; }

/* Responsive */
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .split, .split.even { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky; height: auto; z-index: 10;
        flex-direction: row; align-items: center; gap: 12px;
        padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
        overflow-x: auto;
    }
    .sidebar .brand { padding: 0; }
    .sidebar .brand-sub { display: none; }
    .sidebar nav { display: flex; gap: 4px; }
    .sidebar nav a { padding: 6px 10px; white-space: nowrap; font-size: 14px; }
    .sidebar-foot { display: none; }
    .admin-main { padding: 24px 16px 60px; }
    .admin-title { font-size: 26px; }
}
@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
    .join { order: 3; width: 100%; margin-left: 0; }
    .join input { flex: 1; width: auto; min-width: 0; }
    .me { margin-left: auto; }
    .username, .topbar .brand-sub { display: none; }
    main { padding: 24px 16px 60px; }
    .poll-card { grid-template-columns: 1fr; }
    .poll-card-cta, .poll-card-state { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
    .rename input { width: 100%; }
    .toolbar form.rename { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- Formulaires ---------- */
select {
    font: inherit; color: inherit;
    background: var(--dusk-2); border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 9px 36px 9px 12px; appearance: none;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%239a9ec2' stroke-width='1.6' d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center;
}
select:focus { outline: none; border-color: var(--lilac); }

/* Côté membre */
.answer-form { display: grid; gap: 14px; margin: 28px 0; }
.answer-form .q {
    padding: 20px 22px; background: var(--dusk);
    border: 1px solid var(--line); border-radius: var(--r-lg);
}
.answer-form .q.has-error { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.answer-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-label { display: block; font-weight: 700; font-size: 16px; margin-bottom: 10px; padding: 0; }
.q-help { color: var(--haze); font-size: 14px; margin: -6px 0 12px; }
.q .optional { font-weight: 500; font-size: 12px; color: var(--haze); margin-left: 6px; }
.q input:not([type=checkbox]):not([type=radio]):not([type=file]), .q textarea, .q select { width: 100%; }
.q input[type=date], .q input[type=time], .q input[type=datetime-local] { color-scheme: dark; max-width: 260px; }
.q-error { color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.choices { display: grid; gap: 8px; }
.choices .choice { padding: 11px 14px; }
.form-section { padding: 18px 2px 0; }
.form-section h2 { font-size: 22px; margin: 0 0 4px; }
.form-section p { color: var(--haze); margin: 0; }

.dropzone {
    position: relative; display: grid; gap: 2px; justify-items: center; text-align: center;
    padding: 22px 16px; cursor: pointer;
    border: 1.5px dashed var(--line); border-radius: var(--r);
    background: color-mix(in srgb, var(--dusk-2) 50%, transparent);
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--lilac); }
.dropzone.has-files { border-style: solid; border-color: var(--lilac); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-text { font-weight: 600; word-break: break-word; }
.dropzone-hint { font-size: 13px; color: var(--haze); }
.existing-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; padding: 8px 12px; background: var(--dusk-2); border-radius: var(--r-sm); }
.existing-file .remove { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--haze); cursor: pointer; }
.existing-file .remove input { accent-color: var(--danger); }
.file-link { display: inline-flex; align-items: baseline; gap: 6px; margin: 2px 12px 2px 0; color: var(--lilac); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--lilac) 35%, transparent); word-break: break-all; }
.file-link small { color: var(--haze); text-decoration: none; }

.answers { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 0; margin: 20px 0; }
.answers dt, .answers dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.answers dt { color: var(--haze); font-weight: 600; padding-right: 16px; }
.answers dd { word-break: break-word; }
.answers dt:first-of-type, .answers dt:first-of-type + dd { border-top: 0; }
.public-results { margin-top: 40px; }
.public-results h2 { font-size: 22px; }
.public-results h3 { font-size: 16px; font-family: var(--sans); margin: 24px 0 0; }

/* Admin */
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.page-actions form { margin: 0; }
.notice {
    padding: 12px 16px; margin-bottom: 20px; border-radius: var(--r);
    background: var(--dusk);
    border: 1px solid var(--line); border-left: 3px solid var(--lilac);
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a { padding: 10px 14px; color: var(--haze); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--silver); }
.tabs a[aria-current] { color: var(--silver); border-color: var(--lilac); }
.tabs .count { font-size: 12px; background: var(--dusk-2); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }

.summary-section { font-size: 22px; margin: 32px 0 14px; }
.summary-q h3 { font-size: 16px; font-family: var(--sans); margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.type-hint { font-size: 12px; font-weight: 500; color: var(--haze); white-space: nowrap; }
.answer-list { list-style: none; padding: 0; margin: 14px 0 6px; max-height: 420px; overflow-y: auto; }
.answer-list li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.answer-list li:first-child { border-top: 0; }
.answer-list .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-list .avatar { width: 22px; height: 22px; }
.answer-list .what { word-break: break-word; }

/* Éditeur */
.editor { display: grid; gap: 20px; max-width: 760px; }
.editor .panel { margin: 0; display: grid; gap: 16px; }
.editor .panel h2 { margin: 0; }
.editor .field input:not([type=checkbox]), .editor .field textarea { width: 100%; }
.builder { display: grid; gap: 12px; }
.builder-fields { display: grid; gap: 12px; }
.field-card {
    display: grid; gap: 10px; padding: 16px 18px 18px;
    background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.field-card:focus-within { border-color: color-mix(in srgb, var(--lilac) 60%, var(--line)); }
.field-card[data-kind=section] { background: transparent; border-style: dashed; }
.field-card-head { display: flex; align-items: center; gap: 10px; }
.field-num {
    flex: none; width: 28px; height: 28px; display: grid; place-items: center;
    border-radius: 50%; background: var(--dusk-2); color: var(--haze);
    font-family: var(--mono); font-weight: 500; font-size: 13px;
}
.f-type { padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.field-card-tools { margin-left: auto; display: flex; gap: 4px; }
.field-card-tools .icon { width: 32px; height: 32px; font-size: 15px; }
.field-card-tools .danger-icon:hover { color: var(--danger); border-color: var(--danger); }
.f-label { font-weight: 700; font-size: 16px; width: 100%; }
.f-help { font-size: 14px; resize: none; overflow: hidden; }
.sub-label { display: block; font-size: 12px; font-weight: 600; color: var(--haze); margin-bottom: 4px; }
.f-options { width: 100%; }
.file-settings { display: flex; gap: 12px; flex-wrap: wrap; }
.file-settings label { flex: 0 0 130px; }
.file-settings label.grow { flex: 1 1 220px; }
.file-settings input { width: 100%; }
.field-card .check { font-size: 14px; color: var(--haze); }
.field-card:not([data-kind=choice]) .only-choice,
.field-card:not([data-kind=file]) .only-file,
.field-card[data-kind=section] .not-section { display: none; }
.add-field {
    padding: 16px 18px; border: 1.5px dashed var(--line); border-radius: var(--r-lg);
}
.add-field p { margin: 0 0 10px; font-weight: 600; color: var(--haze); font-size: 14px; }
.add-field-types { display: flex; flex-wrap: wrap; gap: 6px; }
.builder-fields.is-empty + .add-field { border-color: #3a404b; }
.editor-actions { display: flex; align-items: center; gap: 16px; }
.editor-actions button { padding: 11px 22px; }

@media (max-width: 640px) {
    .answers { grid-template-columns: 1fr; }
    .answers dt { padding-bottom: 2px; }
    .answers dd { border-top: 0; padding-top: 0; }
    .answer-list li { grid-template-columns: 1fr; gap: 4px; }
    .field-card-head { flex-wrap: wrap; }
}

/* Cartes « À remplir » */
.kind-poll   { --kind: #7f9bff; }
.kind-survey { --kind: #b4bac4; }
.kind-upload { --kind: #6cc49a; }
.feed-title .count { font-size: 12px; background: var(--dusk-2); color: var(--silver); padding: 1px 8px; border-radius: 99px; margin-left: 4px; }
main:has(.todo-grid) { max-width: 960px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.todo-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px 20px 18px;
    background: var(--dusk);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    transition: border-color .15s, transform .15s;
}

.todo-card:hover { border-color: #3a404b; background: #171a20; }
.kind {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--kind);
    padding: 3px 10px 3px 8px; border-radius: 99px;
    background: color-mix(in srgb, var(--kind) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--kind) 22%, transparent);
}
.todo-title { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -.01em; }
.todo-desc {
    color: var(--haze); font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.todo-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.todo-facts span { font-size: 12px; font-weight: 600; color: var(--haze); background: var(--dusk-2); padding: 3px 9px; border-radius: var(--r-sm); }
.todo-facts .is-soon { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.todo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.todo-community { font-size: 13px; color: var(--haze); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-cta { flex: none; font-size: 13px; font-weight: 600; color: var(--night); background: var(--moon); padding: 6px 14px; border-radius: var(--r-sm); }
.kind-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; border-radius: 50%; color: var(--kind); background: color-mix(in srgb, var(--kind) 12%, transparent); }
.kind-dot svg { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .todo-card:hover { transform: none; } }

/* ---------- Présentation membres ---------- */
body { display: flex; flex-direction: column; }
body > main { flex: 1; width: 100%; }
.text-link { color: var(--haze); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.text-link:hover { color: var(--silver); text-decoration-color: var(--haze); }
.lead { font-size: 18px; line-height: 1.6; color: var(--haze); max-width: 54ch; margin: 0; }
.fine { font-size: 13px; color: var(--haze); max-width: 52ch; margin: 18px 0 0; }
.topbar-login { margin-left: auto; }

.site-footer {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    max-width: 1120px; width: 100%; margin: 0 auto; padding: 28px 24px 36px;
    border-top: 1px solid var(--line); color: var(--haze); font-size: 13px;
}

/* Accueil public */
main:has(.landing-hero) { max-width: 1120px; padding-top: 0; }
.landing-hero {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center;
    min-height: min(78vh, 720px); padding: 48px 0;
}
.landing-hero h1 {
    font-size: clamp(40px, 5.6vw, 66px); line-height: 1.02; letter-spacing: -.04em;
    margin: 0 0 24px; color: var(--silver); max-width: 12ch; font-weight: 600;
}
.cta-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 32px; }
.cta-row .btn-discord { margin: 0; }
.landing-visual { position: relative; display: grid; gap: 16px; padding: 12px 0; }
.landing-visual .todo-card { box-shadow: 0 20px 50px -20px rgb(0 0 0 / .6); }
.landing-visual .todo-card:first-child { margin-right: 48px; }
.landing-visual .todo-card:last-child { margin-left: 48px; }
.landing-visual .todo-card:hover { transform: none; }

.landing-section { padding: 72px 0; border-top: 1px solid var(--line); }
.landing-section h2 { font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 32px; letter-spacing: -.02em; }
.landing-section h3 { font-size: 19px; margin: 0 0 8px; }
.landing-section p { color: var(--haze); margin: 0; }

.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 0; margin: 0; }
.steps li { counter-increment: step; }
.steps li::before {
    content: counter(step); display: grid; place-items: center;
    width: 40px; height: 40px; margin-bottom: 18px; border-radius: 50%;
    font-family: var(--mono); font-weight: 500; font-size: 15px;
    color: var(--silver); background: var(--dusk-2); border: 1px solid var(--line);
}

.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kinds article { padding: 26px 24px; background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kind-icon {
    display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
    border-radius: 12px; color: var(--kind); background: color-mix(in srgb, var(--kind) 14%, transparent);
}
.kind-icon svg { width: 22px; height: 22px; }

.privacy { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.privacy h2 { margin-bottom: 12px; }
.privacy p { max-width: 58ch; }
.privacy .btn-discord { margin: 0; }

/* Espace membre */
main:has(.member-head) { max-width: 960px; }
.member-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.member-head h1 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 6px; letter-spacing: -.02em; }
.member-head p { margin: 0; }
.member-head .my-communities { margin: 0; }
.blank-state { padding: 48px 24px; text-align: center; color: var(--haze); border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.blank-state p { margin: 0; }

.onboarding { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.onboarding h1 { font-size: clamp(32px, 5vw, 44px); margin: 0 0 14px; letter-spacing: -.02em; }
.onboarding .lead { margin: 0 auto; }
.onboarding .fine { margin: 18px auto 0; }
.join-big { display: flex; gap: 10px; margin-top: 32px; }
.join-big input {
    flex: 1; min-width: 0; padding: 14px 18px; font-size: 20px; text-align: center;
    font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em;
}
.join-big input::placeholder { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 16px; }
.join-big button { padding: 0 24px; font-size: 16px; }

/* Page questionnaire */
.sheet { max-width: 720px; margin: 0 auto; }
.sheet-head { margin: 20px 0 32px; display: grid; gap: 14px; justify-items: start; }
.sheet-head h1 { font-size: clamp(30px, 5vw, 44px); margin: 0; letter-spacing: -.025em; }
.sheet .todo-facts { margin: 0; }
.progress {
    position: sticky; top: 72px; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px; margin-bottom: 16px;
    background: color-mix(in srgb, var(--night) 90%, transparent); backdrop-filter: blur(8px);
    border: 1px solid var(--line); border-radius: 99px;
}
.progress-track { flex: 1; height: 6px; background: var(--dusk-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--lilac); border-radius: 99px; transition: width .3s ease-out; }
.progress-text { font-size: 13px; font-weight: 700; color: var(--haze); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress.is-complete .progress-text { color: var(--ok); }
.answer-form { counter-reset: q; margin-top: 0; }
.answer-form .q { counter-increment: q; }
.answer-form .q-label::before { content: counter(q) '. '; color: var(--haze); }
.submit-bar { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.submit-bar button { padding: 13px 26px; font-size: 16px; }

.done {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 20px 22px; margin: 8px 0 24px;
    background: var(--dusk);
    border: 1px solid var(--line); border-radius: var(--r-lg);
}
.done > div { flex: 1; min-width: 200px; }
.done p { margin: 0; }
.done-icon {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 700; font-size: 18px;
}
.done-title { font-weight: 700; font-size: 17px; }
.done.is-closed { background: var(--dusk); border-color: var(--line); }
.recap-title { font-size: 20px; margin: 32px 0 0; }

/* Sondage plein écran */
body.is-stage main { max-width: 980px; display: flex; padding-top: 24px; }
.stage { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.stage-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; padding: 32px 0 48px; }
.stage-title { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; letter-spacing: -.035em; margin: 0; max-width: 18ch; }
.stage-question { font-size: 20px; font-weight: 600; margin: 0; }
.stage-desc { color: var(--haze); font-size: 17px; max-width: 56ch; margin: 0; }
.stage-meta { color: var(--haze); font-size: 14px; margin: 0; }

.tiles {
    width: 100%; max-width: 820px; margin-top: 18px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px;
}
.tiles.is-list { grid-template-columns: 1fr; max-width: 640px; }
.tile {
    position: relative; display: flex; align-items: center; gap: 16px; text-align: left;
    min-height: 76px; padding: 18px 20px; cursor: pointer;
    background: var(--dusk); border: 1.5px solid var(--line); border-radius: var(--r-lg);
    font-size: 18px; font-weight: 600;
    transition: border-color .15s, background-color .15s, transform .1s;
}
.tile:hover { border-color: #3a404b; }
.tile:active { transform: scale(.99); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:focus-visible) { outline: 2px solid var(--lilac); outline-offset: 2px; }
.tile-key {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px;
    border-radius: 9px; border: 1.5px solid var(--line);
    font-family: var(--mono); font-size: 14px; color: var(--haze);
}
.tile-label { flex: 1; word-break: break-word; }
.tile:has(input:checked) { border-color: var(--lilac); background: color-mix(in srgb, var(--lilac) 10%, var(--dusk)); }
.tile:has(input:checked) .tile-key { background: var(--lilac); border-color: var(--lilac); color: #fff; }
.stage-actions { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; }
.stage-actions button { min-width: 220px; padding: 14px 32px; font-size: 16px; }
.stage-actions button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.stage-hint { font-size: 13px; color: var(--haze); }

.big-results { list-style: none; padding: 0; margin: 18px 0 0; width: 100%; max-width: 680px; display: grid; gap: 10px; }
.big-results li {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 20px; border-radius: var(--r-lg); text-align: left;
    background: var(--dusk); border: 1.5px solid var(--line);
}
.big-results li.mine { border-color: var(--lilac); }
.big-results .bar {
    position: absolute; inset: 0 auto 0 0; width: var(--pct);
    background: color-mix(in srgb, var(--silver) 8%, transparent);
    animation: grow .8s cubic-bezier(.2, .7, .2, 1) both;
}
.big-results li.mine .bar { background: color-mix(in srgb, var(--lilac) 28%, transparent); }
@keyframes grow { from { width: 0; } }
.big-results .label { position: relative; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-results .label small { font-size: 12px; font-weight: 600; color: #fff; background: var(--lilac); padding: 2px 8px; border-radius: 99px; }
.big-results .pct { position: relative; font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage .done { text-align: left; max-width: 560px; width: 100%; margin: 18px 0 0; }

@media (max-width: 900px) {
    .landing-hero { grid-template-columns: 1fr; gap: 40px; min-height: 0; padding-top: 40px; }
    .landing-visual { max-width: 520px; }
    .steps, .kinds { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
    .landing-section { padding: 52px 0; }
    .landing-visual .todo-card:first-child { margin-right: 20px; }
    .landing-visual .todo-card:last-child { margin-left: 20px; }
    .member-head { align-items: flex-start; }
    .progress { top: 116px; }
    .join-big { flex-direction: column; }
    .join-big button { padding: 13px; }
    .stage { min-height: calc(100vh - 260px); }
    .stage-inner { padding-top: 12px; }
    .tile { min-height: 64px; font-size: 16px; padding: 14px 16px; }
    .stage-actions button { width: 100%; }
    .big-results .pct { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .big-results .bar { animation: none; } }
.todo-facts:not(:has(span)) { display: none; }

/* Correctifs : débordement mobile, badge centré, cases stylées */
body.is-stage main { min-width: 0; }
.stage, .stage-inner, .tiles { min-width: 0; max-width: 100%; }
.stage .kind { align-self: center; }
.choice input[type=radio], .choice input[type=checkbox], .check input[type=checkbox] {
    appearance: none; flex: none; display: grid; place-items: center;
    width: 20px; height: 20px; margin: 0; padding: 0;
    border: 1.5px solid var(--haze); background: transparent; cursor: pointer;
}
.choice input[type=radio] { border-radius: 50%; }
.choice input[type=checkbox], .check input[type=checkbox] { border-radius: 5px; }
.choice input[type=radio]::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .12s; }
.choice input[type=checkbox]::after, .check input[type=checkbox]::after {
    content: ''; width: 10px; height: 6px; margin-top: -3px;
    border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform .12s;
}
.choice input:checked, .check input:checked { background: var(--lilac); border-color: var(--lilac); }
.choice input[type=radio]:checked::after { transform: scale(1); }
.choice input[type=checkbox]:checked::after, .check input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
.choice:has(input:checked) { border-color: var(--lilac); background: color-mix(in srgb, var(--lilac) 8%, var(--dusk)); }
.answer-form .choice { background: var(--dusk-2); }
.tiles.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .tiles.cols-2, .tiles.cols-3 { grid-template-columns: 1fr; } }

/* Modale */
.modal {
    width: min(460px, calc(100vw - 32px)); padding: 28px; margin: auto;
    color: var(--silver); background: var(--dusk);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: 0 30px 80px -20px rgb(0 0 0 / .7);
}
.modal::backdrop { background: rgb(5 6 8 / .72); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--haze); }
.modal h2 { font-size: 22px; margin: 0 0 10px; }
.modal-text { margin: 0; color: var(--haze); font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.modal-actions form { margin: 0; }
.modal-actions .btn-discord { margin: 0; padding: 10px 16px; }
.modal-actions button { padding: 10px 20px; }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }

/* Admin : lien d'invitation */
.link-chip {
    font-size: 13px; font-weight: 500; padding: 3px 10px; position: relative;
    background: transparent; color: var(--lilac); border: 1px solid color-mix(in srgb, var(--lilac) 35%, transparent);
}
.link-chip:hover { background: color-mix(in srgb, var(--lilac) 10%, transparent); filter: none; }
.link-chip.copied::after {
    content: 'Copié'; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    margin-left: 8px; font-size: 12px; color: var(--ok);
}

/* Photos de communauté */
.c-avatar { flex: none; display: inline-grid; place-items: center; object-fit: cover; border-radius: 28%; background: var(--dusk-2); }
.c-avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.c-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.c-avatar-md { width: 48px; height: 48px; font-size: 17px; }
.c-avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.c-avatar-xl { width: 88px; height: 88px; font-size: 30px; }
.c-avatar.is-initials {
    font-weight: 600; letter-spacing: .02em; color: hsl(var(--hue) 45% 82%);
    background: hsl(var(--hue) 22% 22%); border: 1px solid hsl(var(--hue) 22% 30%);
}
.facepile { display: inline-flex; align-items: center; }
.facepile img, .facepile-more {
    width: 26px; height: 26px; border-radius: 50%; margin-left: -8px;
    border: 2px solid var(--dusk); background: var(--dusk-2);
}
.facepile img:first-child { margin-left: 0; }
.facepile-more { display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--haze); width: auto; min-width: 26px; padding: 0 6px; border-radius: 99px; }

.icon-editor { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-editor form { margin: 0; }
.icon-editor label.btn { cursor: pointer; }
.file-small { font-size: 13px; padding: 6px 8px; max-width: 220px; }
.file-small::file-selector-button { font: inherit; color: var(--silver); background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px; margin-right: 8px; cursor: pointer; }

/* Communautés côté membre */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.community-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; background: var(--dusk);
    border: 1px solid var(--line); border-radius: var(--r-lg);
}
.community-card-body { flex: 1; min-width: 0; }
.community-card h3 { font-size: 16px; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-card p { margin: 0; font-size: 13px; color: var(--haze); }
.todo-community { display: flex; align-items: center; gap: 8px; }
.todo-community-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-stack { display: inline-flex; flex: none; }
.c-stack .c-avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--dusk); }
.c-stack .c-avatar:first-child { margin-left: 0; }

.modal-community { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-community .facepile img, .modal-community .facepile-more { border-color: var(--dusk); }
.community-card { align-items: flex-start; }
.community-card .facepile { margin-top: 10px; }
.community-card .facepile img, .community-card .facepile-more { width: 24px; height: 24px; }
@media (max-width: 640px) {
    .modal { padding: 22px; }
    .modal-actions { flex-direction: column-reverse; align-items: stretch; }
    .modal-actions > *, .modal-actions form button { width: 100%; justify-content: center; }
}

/* Communautés dans le header */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar { gap: 20px; }
.cbar { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.cbar-item { position: relative; display: inline-flex; flex: none; border-radius: 30%; cursor: pointer; list-style: none; }
.cbar-item::-webkit-details-marker { display: none; }
.cbar-item .c-avatar { width: 36px; height: 36px; transition: border-radius .15s; }
.cbar-item:hover .c-avatar { border-radius: 22%; }
.cbar-item[aria-current] .c-avatar { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--lilac); }
.cbar-all .c-avatar { color: var(--haze); background: var(--dusk-2); border: 1px solid var(--line); }
.cbar-all[aria-current] .c-avatar { color: var(--silver); }
.cbar-plus { color: var(--haze); font-size: 20px; font-weight: 400; background: transparent; border: 1.5px dashed var(--line); }
.cbar-join[open] .cbar-plus, .cbar-item:hover .cbar-plus { color: var(--silver); border-color: var(--haze); }
.cbar-sep { width: 1px; height: 24px; background: var(--line); flex: none; }
.cbar-badge {
    position: absolute; right: -5px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 99px;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--lilac); box-shadow: 0 0 0 2px var(--night);
}
.cbar-dot { position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--lilac); box-shadow: 0 0 0 2px var(--night); }
/* Info-bulle du nom */
.cbar-item[data-tip]:hover::after, .cbar-item[data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    padding: 5px 9px; border-radius: var(--r-sm); white-space: nowrap; z-index: 20;
    font-size: 12px; font-weight: 500; color: var(--silver); background: #22262e; border: 1px solid var(--line);
    pointer-events: none;
}
.cbar-join { position: relative; }
.cbar-join[open] .cbar-item::after { display: none; }
.join-pop {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 280px;
    display: grid; gap: 8px; padding: 14px;
    background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: 0 20px 50px -20px rgb(0 0 0 / .7);
}
.join-pop label { font-size: 13px; font-weight: 600; color: var(--haze); }
.join-pop div { display: flex; gap: 8px; }
.join-pop input { flex: 1; min-width: 0; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.join-pop input::placeholder { text-transform: none; letter-spacing: 0; }
.topbar .me { margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--line); }

/* En-tête d'une communauté sélectionnée */
.community-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.community-head-text { flex: 1; min-width: 200px; }
.community-head .facepile img, .community-head .facepile-more { width: 30px; height: 30px; border-color: var(--night); }

@media (max-width: 640px) {
    .topbar { flex-wrap: nowrap; }
    .cbar { order: 3; flex: 1 1 100%; margin-left: 0; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
    .topbar { flex-wrap: wrap; }
    .topbar .me { margin-left: auto; border-left: 0; padding-left: 0; }
    .cbar-item[data-tip]:hover::after { display: none; }
    .cbar-join { position: static; }
    .join-pop { left: 16px; right: 16px; width: auto; top: auto; margin-top: 10px; }
}
.join-pop input { width: 100%; }
.join-pop button { flex: none; }

/* ---------- Modales centrées ---------- */
.modal-wide { width: min(560px, calc(100vw - 32px)); }
.modal h2 { line-height: 1.25; }
.modal-form { display: grid; gap: 14px; margin-top: 18px; }
.modal-form .modal-actions { margin-top: 8px; }
.modal-form .field input { width: 100%; }
.modal-notice { text-align: center; width: min(400px, calc(100vw - 32px)); padding-top: 32px; }
.modal-notice h2 { font-size: 19px; margin: 16px 0 0; }
.modal-notice .modal-actions { justify-content: center; }
.modal-notice .modal-actions button { min-width: 140px; }
.notice-icon {
    display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
    font-size: 24px; font-weight: 700;
}
.modal-notice.is-success .notice-icon { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.modal-notice.is-error .notice-icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.modal-confirm .modal-text { margin-top: 0; }
button.danger-solid { background: var(--danger); color: #fff; }
button.danger-solid:hover { filter: brightness(1.08); }

.code-input {
    width: 100%; padding: 14px 16px; font-size: 20px; text-align: center;
    font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em;
}
.code-input::placeholder { letter-spacing: .06em; text-transform: none; }
.code-input.is-invalid { border-color: var(--danger); }
.field-error { margin: -4px 0 0; color: var(--danger); font-size: 14px; }

button.cbar-add { padding: 0; background: none; border: 0; }
button.cbar-add:hover { filter: none; }

/* Création de communauté */
.photo-picker { display: flex; gap: 18px; align-items: flex-start; }
.photo-picker-fields { flex: 1; display: grid; gap: 14px; min-width: 0; }
.photo-drop {
    flex: none; position: relative; display: grid; place-items: center; overflow: hidden;
    width: 104px; height: 104px; border-radius: 28%; cursor: pointer;
    border: 1.5px dashed var(--line); background: var(--dusk-2);
    font-size: 12px; font-weight: 600; color: var(--haze); text-align: center; line-height: 1.3;
}
.photo-drop:hover { border-color: var(--haze); color: var(--silver); }
.photo-drop.has-photo { border-style: solid; }
.photo-drop.has-photo .photo-drop-empty { display: none; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Page communauté : actions */
.community-head-side { display: flex; align-items: center; gap: 16px; }
.community-head-side form { margin: 0; }

@media (max-width: 640px) {
    .photo-picker { flex-direction: column; align-items: center; }
    .photo-picker-fields { width: 100%; }
}

/* ---------- Formulaire en deux colonnes ---------- */
main:has(.sheet-split) { max-width: 1160px; }
.sheet-split {
    max-width: none; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 56px; align-items: start;
}
.sheet-side { position: sticky; top: 92px; display: grid; gap: 24px; max-height: calc(100vh - 112px); overflow-y: auto; padding-bottom: 8px; scrollbar-width: thin; }
.sheet-side .sheet-head { margin: 0; }
.sheet-side .sheet-head h1 { font-size: clamp(28px, 3vw, 38px); }
.sheet-side .lead { font-size: 16px; }
.sheet-side .done { margin: 0; }
.sheet-side > .btn { justify-self: start; }
.sheet-main { min-width: 0; padding-top: 34px; }
.sheet-main .answer-form { margin-top: 0; }
.sheet-main .recap-title { margin-top: 0; }

.side-progress { display: grid; gap: 10px; padding: 18px; background: var(--dusk); border: 1px solid var(--line); border-radius: var(--r-lg); }
.side-progress-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--haze); }
.side-progress.is-complete .progress-text { color: var(--ok); }
.q-nav { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: qn; }
.q-nav li { counter-increment: qn; }
.q-nav a {
    display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--haze);
}
.q-nav a:hover { background: var(--dusk-2); color: var(--silver); }
.q-nav-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); }
.q-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-nav-label::before { content: counter(qn) '. '; }
.q-nav li.is-done .q-nav-dot { background: var(--lilac); border-color: var(--lilac); }
.q-nav li.is-error .q-nav-dot { background: var(--danger); border-color: var(--danger); }
.q-nav li.is-current a { color: var(--silver); background: var(--dusk-2); }
.side-submit { display: flex; align-items: center; gap: 16px; }
.side-submit button { flex: 1; padding: 12px 18px; }
.answer-form .q { scroll-margin-top: 96px; }
.progress-mobile { display: none; }

@media (max-width: 960px) {
    .sheet-split { grid-template-columns: 1fr; gap: 24px; }
    .sheet-side { position: static; max-height: none; overflow: visible; }
    .side-progress, .side-submit { display: none; }
    .progress-mobile { display: flex; }
    .sheet-main { padding-top: 0; }
}

/* Un seul bouton d'envoi : à gauche sur grand écran, en bas sur mobile */
@media (min-width: 961px) { .sheet-split .submit-bar { display: none; } }
