/* ============================================================
   Bastion : glace et basalt.
   La seule couleur vive, c'est celle de chaque membre.
   ============================================================ */

:root {
    --bg: #e8edef;
    --surface: #f5f8f9;
    --ink: #182125;
    --ink-2: #4b5a60;
    --rule: #c3cfd3;
    --track: #b9c7cd;
    --danger: #a12d2d;

    --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    --body: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 4px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #11181c;
        --surface: #192227;
        --ink: #e7eef0;
        --ink-2: #9db0b7;
        --rule: #2c3a41;
        --track: #26333a;
        --danger: #ff9a9a;
    }
}
:root[data-theme="dark"] {
    --bg: #11181c;
    --surface: #192227;
    --ink: #e7eef0;
    --ink-2: #9db0b7;
    --rule: #2c3a41;
    --track: #26333a;
    --danger: #ff9a9a;
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Couleur du site choisie par chaque membre (par défaut : l'encre du thème) */
:root { --accent: var(--ink); --on-accent: var(--bg); --page-bg: url("/brand/bg"); }

*, *::before, *::after { box-sizing: border-box; }

/* Décor : la photo du groupe, floutée et très atténuée, derrière tout le contenu */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
body::before {
    inset: -24px;
    background: var(--page-bg) center / cover no-repeat;
    filter: blur(7px);
}
body::after {
    background: var(--bg);
    opacity: .88;
}
body { isolation: isolate; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 1rem/1.5 var(--body);
    font-variant-numeric: tabular-nums;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 10;
    padding: .6rem 1rem;
    background: var(--ink);
    color: var(--bg);
}
.skip:focus { left: 0; }

.muted { color: var(--ink-2); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Structure ---------- */

.shell { max-width: 1120px; margin: 0 auto; padding: 0 1rem 4rem; }

.top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--rule);
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: inherit;
    text-decoration: none;
    font: 800 1.8rem/1 var(--display);
    letter-spacing: .02em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
}

.tabs { display: flex; gap: .25rem; }

.tabs a {
    padding: .65rem .85rem;
    border-bottom: 3px solid transparent;
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.me { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.linkbtn {
    min-height: 44px;
    padding: .4rem;
    border: 0;
    background: none;
    color: var(--ink-2);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

.chip {
    display: inline-block;
    max-width: 100%;
    padding: .1rem .7rem;
    border-radius: 99px;
    background: var(--c);
    color: var(--on);
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* ---------- Semaine ---------- */

.weekbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 1rem 0 0; }

.step {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
}
.step:hover { border-color: var(--ink); }
.step[aria-disabled="true"] { opacity: .3; pointer-events: none; }

.weekbar-label { min-width: 13rem; font-weight: 600; text-align: center; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.5rem 0 1.25rem;
}

.hero-name { padding-left: 1rem; border-left: 10px solid var(--c); }

.hero h1 {
    margin: 0;
    font: 800 clamp(2.2rem, 6.5vw, 3.4rem)/1 var(--display);
    overflow-wrap: anywhere;
}

.hero-name p { margin: .35rem 0 0; }

.pay { text-align: right; }
.pay-amount { font: 800 clamp(2.4rem, 7vw, 4rem)/.9 var(--display); }

.banner {
    margin: 1rem 0 0;
    padding: .75rem 1rem;
    border-left: 4px solid var(--ink);
    background: var(--surface);
}
.banner a { color: inherit; font-weight: 600; }

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.side { position: sticky; top: 1rem; }

@media (max-width: 860px) {
    .grid { grid-template-columns: 1fr; gap: 0; }
    .side { position: static; }
    .hero { grid-template-columns: 1fr; }
    .pay { text-align: left; }
}

.block { padding: 1.25rem 0; border-top: 1px solid var(--rule); }

h2 { margin: 0 0 .8rem; font: 800 1.6rem/1.1 var(--display); letter-spacing: .01em; }
h3 { margin: 1.25rem 0 .25rem; font-size: 1rem; font-weight: 600; }

/* ---------- Bâtons de comptage (les quotas) ---------- */

.quota {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) 11rem;
    grid-template-areas: "name stave value" ". detail detail";
    align-items: center;
    gap: .15rem 1rem;
    padding: .65rem 0;
}

.quota-name { grid-area: name; font: 800 1.35rem/1 var(--display); letter-spacing: .02em; }
.quota-value { grid-area: value; text-align: right; line-height: 1.25; }
.quota-value strong { display: block; }
.quota-detail { grid-area: detail; font-size: .9rem; }

@media (max-width: 560px) {
    .quota {
        grid-template-columns: 1fr auto;
        grid-template-areas: "name value" "stave stave" "detail detail";
        gap: .35rem 1rem;
    }
}

.stave {
    --n: 20;
    grid-area: stave;
    position: relative;
    height: 26px;
    overflow: hidden;
    background: var(--track);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}

.stave-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: var(--c);
    transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.stave-fill.still { transition: none; }

/* Les encoches : de fines coupures dans la couleur, à intervalle régulier */
.stave::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent calc(100% / var(--n) - 2px),
        var(--bg) calc(100% / var(--n) - 2px),
        var(--bg) calc(100% / var(--n))
    );
}

@media (prefers-reduced-motion: reduce) {
    .stave-fill { transition: none; }
}

/* ---------- Formulaire d'ajout ---------- */

.compose {
    padding: 1.1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
}
.compose h2 { margin-bottom: .9rem; }

.seg-group { display: flex; margin-bottom: 1rem; }

.seg { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; inset: 0; }

.seg span {
    display: block;
    min-height: 44px;
    padding: .65rem .5rem;
    border: 1px solid var(--ink);
    margin-left: -1px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}
.seg:first-child span { margin-left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.seg:last-child span { border-radius: 0 var(--radius) var(--radius) 0; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .8rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field label { font-size: .9rem; font-weight: 600; }
.field small { color: var(--ink-2); }

input[type="text"], select {
    width: 100%;
    min-height: 44px;
    padding: .55rem .7rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
}
input[type="text"]:hover, input[type="search"]:hover, select:hover { border-color: var(--ink-2); }
input[type="color"] {
    width: 52px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
}
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ink); }

.btn {
    min-height: 44px;
    padding: 0 1.3rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--on-accent);
    font: 600 1rem var(--body);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn:hover { opacity: .88; }
.btn[disabled] { opacity: .5; cursor: progress; }

.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.form-error { margin: 0; color: var(--danger); font-weight: 600; }
.form-error:empty { display: none; }

/* ---------- Journal ---------- */

.entry {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--rule);
}
.entry-time { color: var(--ink-2); }
.entry-note { display: block; color: var(--ink-2); font-size: .9rem; }
.entry-value { font-weight: 600; text-align: right; }

.del {
    min-height: 44px;
    margin: -.6rem 0;
    padding: 0 .4rem;
    border: 0;
    background: none;
    color: var(--ink-2);
    font: inherit;
    font-size: .9rem;
    text-decoration: underline;
    cursor: pointer;
}
.del:hover { color: var(--ink); }
.del.confirm { color: var(--danger); font-weight: 600; }

.empty { margin: 0; color: var(--ink-2); }

/* ---------- Calcul du salaire ---------- */

.ledger { margin: 0; }

.line { display: flex; align-items: baseline; gap: .6rem; padding: .5rem 0; }
.line dt { flex: none; max-width: 62%; font-weight: 600; }
.line dt small { display: block; color: var(--ink-2); font-size: .85rem; font-weight: 400; line-height: 1.35; }
.line .leader { flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--rule); transform: translateY(-.3em); }
.line dd { margin: 0; font-weight: 600; text-align: right; }
.line.zero dd { color: var(--ink-2); font-weight: 400; }

.line.total {
    margin-top: .5rem;
    padding-top: .9rem;
    border-top: 2px solid var(--ink);
}
.line.total dt, .line.total dd { font: 800 1.9rem/1 var(--display); }
.line.total .leader { display: none; }
.line.total dd { margin-left: auto; }

/* ---------- Équipe ---------- */

.tablewrap { margin-top: 1.25rem; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
th { font-weight: 600; color: var(--ink-2); }
th.num, td.num { text-align: right; }

tbody tr:hover { background: var(--surface); }
td a { color: inherit; text-decoration: none; }
td a:hover .chip { text-decoration: underline; }

th:first-child, td:first-child { position: sticky; left: 0; background: var(--bg); padding-left: 0; }
tbody tr:hover td:first-child { background: var(--surface); }

tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 600; }
tfoot td:first-child { font: 800 1.2rem/1 var(--display); }

.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pip { width: 10px; height: 18px; background: var(--track); }
.pip.on { background: var(--c); }

.hint { margin: .75rem 0 0; }

/* ---------- Réglages ---------- */

fieldset { margin: 0 0 1.5rem; padding: 0; border: 0; }
legend { margin-bottom: .6rem; padding: 0; font: 800 1.35rem/1.1 var(--display); }

.settings-form { max-width: 46rem; }
.input-unit { display: flex; align-items: center; gap: .5rem; }
.input-unit span { color: var(--ink-2); }

.members { margin-top: 1rem; }
.member-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.2fr) auto minmax(8rem, 1fr) auto;
    align-items: center;
    gap: .75rem 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--rule);
}
.member-row.off .chip { opacity: .5; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }

@media (max-width: 640px) {
    .member-row { grid-template-columns: 1fr auto; }
    .member-row > :nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
}

/* ---------- Connexion ---------- */

.login {
    display: grid;
    place-content: center;
    gap: 1.25rem;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    max-width: 34rem;
    margin: 0 auto;
}
.login .stave { --n: 7; --c: var(--ink); height: 30px; }
.login .stave-fill { width: 72%; transition: none; }
.login h1 { margin: 0; font: 800 clamp(3.5rem, 16vw, 6.5rem)/.9 var(--display); letter-spacing: .01em; }
.login p { margin: 0; font-size: 1.1rem; }
.login .btn { justify-self: start; min-height: 52px; padding: 0 1.6rem; }

.alert {
    padding: .75rem 1rem;
    border-left: 4px solid var(--danger);
    background: var(--surface);
    font-weight: 600;
}

/* ---------- Message éphémère ---------- */

#toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 20;
    max-width: 90vw;
    padding: .7rem 1.1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
    #toast { transition: none; }
}

/* ---------- Braquages et listes ---------- */

.entries.plain { list-style: none; margin: 0; padding: 0; }

.heist {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--rule);
}
.heist-people { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

.badge {
    display: inline-block;
    margin-left: .6rem;
    padding: 0 .5rem;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
}
.badge.ok { background: var(--ink); color: var(--bg); }

.label-like { font-size: .9rem; font-weight: 600; }
.heists-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.picks { margin: 1rem 0 0; }
.picks legend { font: 600 .9rem var(--body); margin-bottom: .4rem; }
.pick-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick { position: relative; display: inline-flex; cursor: pointer; }
.pick input { position: absolute; opacity: 0; inset: 0; }
.pick .chip { opacity: .38; outline: 2px solid transparent; outline-offset: 2px; }
.pick input:checked + .chip { opacity: 1; outline-color: var(--ink); }
.pick input:focus-visible + .chip { outline: 3px solid var(--ink); outline-offset: 2px; }

.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; margin: 1rem 0; }
.lister h3 { margin: 0 0 .5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .7rem; padding: 0; list-style: none; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.tag span { padding: .2rem .2rem .2rem .6rem; }
.tag-x { min-width: 36px; min-height: 36px; border: 0; background: none; color: var(--ink-2); font-size: 1.2rem; cursor: pointer; }
.tag-x:hover { color: var(--danger); }
.add-row { display: flex; gap: .5rem; }
.btn.ghost { background: none; color: var(--ink); }

@media (max-width: 860px) { .heists-grid { grid-template-columns: 1fr; } }
.pick input:checked + .chip::before { content: "✓ "; }

.login-logo { width: 96px; height: 96px; border-radius: 12px; }

.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; margin-bottom: 1rem; max-width: 46rem; }
.quota-block { margin-bottom: 1rem; }
.quota-block .pips { margin-right: .6rem; }
.quota-block .pip { width: 8px; height: 14px; }
.picks small { display: block; margin-top: .6rem; }
.line .slot { flex-basis: 100%; margin: 0 0 .2rem; color: var(--danger); font-size: .9rem; font-weight: 600; text-align: left; }
.quota-block .line { flex-wrap: wrap; }

.hero.no-pay { grid-template-columns: 1fr; }

/* ---------- Labos ---------- */

.labo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(23rem, 1fr)); gap: 2.5rem; margin-top: 1.5rem; align-items: start; }
.labo-panel h2 { margin-bottom: .2rem; }
.tablewrap.flat { margin-top: .6rem; }
.grid24 th, .grid24 td { padding: .35rem .5rem; white-space: nowrap; }
.grid24 tbody th { width: 3.4rem; padding-left: 0; font-weight: 600; text-align: left; }
.grid24 th:first-child, .grid24 td:first-child { position: static; background: none; }
.grid24 tbody tr.now { background: var(--surface); box-shadow: inset 4px 0 0 var(--ink); }
.grid24 .free { font-size: .9rem; }
.grid24 .act { text-align: right; width: 1%; }
.grid24 .del { margin: 0; }
.grid24 td .entry-note { display: inline; margin-left: .5rem; }
.grid24 td.num { width: 8.5rem; }
input.qty { width: 7.5rem; min-height: 36px; padding: .25rem .5rem; text-align: right; }
.week-totals { margin-top: 1.25rem; }
.line.total.small { margin-top: .4rem; padding-top: .5rem; }
.line.total.small dt, .line.total.small dd { font: 800 1.25rem/1 var(--display); }

/* ---------- Drogue ---------- */

.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.day-block { padding: 1rem 0; border-top: 1px solid var(--rule); }
.day-block h2 { text-transform: capitalize; font-size: 1.35rem; }
.deal {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .5rem .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--rule);
}
.deal-main { display: flex; flex-direction: column; min-width: 0; }
.deal-main strong { overflow-wrap: anywhere; }
.status-select { background: var(--c, var(--track)); color: var(--on, var(--ink)); border-color: var(--c, var(--rule)); font-weight: 600; }
@media (max-width: 700px) {
    .deal { grid-template-columns: 1fr auto; }
    .deal-main { grid-column: 1 / -1; grid-row: 2; }
}
.member-flags { display: flex; flex-direction: column; }
.side .compose { margin-bottom: 1rem; }
.side { position: static; }
.grid24 tbody tr.now th { padding-left: .7rem; }
.tablewrap.flat th:first-child, .tablewrap.flat td:first-child { position: static; background: none; }
.tabs a { white-space: nowrap; }
@media (max-width: 700px) {
    .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; }
    .weekbar-label { min-width: 0; flex: 1; text-align: left; }
}

.crew { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .2rem 0; }
.driver-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .4rem; }
.driver-row { display: flex; gap: .4rem; align-items: center; }
.driver-row select { flex: 1; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field .label { font-weight: 600; font-size: .9rem; }
.field select + select, .field select + input { margin-top: .4rem; }
input.mini { width: 5.5rem; text-align: right; }
tr.archived { opacity: .55; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn.small { min-height: 34px; padding: 0 .8rem; font-size: .85rem; }
.side .tablewrap { overflow-x: auto; }
.side .tablewrap table { font-size: .9rem; }
.side .tablewrap th, .side .tablewrap td { padding-left: .4rem; padding-right: .4rem; }
.reste { display: block; font-size: .8rem; color: var(--muted, #666); }
[hidden] { display: none !important; }
.reste.btn { display: inline-block; margin-top: .3rem; min-height: 28px; font-size: .75rem; }
.sub-row th, .sub-row td { border-top: 0; }
.same-hour { width: 0; }
.driver-row .role-select, .driver-row .side-select { flex: 0 0 auto; width: auto; }
.reste.btn { display: block; }
input.mini { width: 4.5rem; }
.side .tablewrap th[scope="row"] { white-space: normal; }

/* ============================================================
   Habillage v2 : cartes lisibles, menu clair, mobile simple
   ============================================================ */

:root {
    --panel: rgba(246, 249, 250, .93);
    --good: #1f7a4d;
    --radius: 10px;
    --shadow: 0 8px 30px rgba(10, 25, 35, .12);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --panel: rgba(22, 31, 36, .92);
        --good: #6fd6a0;
        --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    }
}
:root[data-theme="dark"] {
    --panel: rgba(22, 31, 36, .92);
    --good: #6fd6a0;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
body::after { opacity: .8; }
:root[data-nobg] body::after { opacity: 1; }
.good { color: var(--good); font-weight: 600; }

.shell { padding: 0 1rem 3rem; }

/* Barre du haut : une carte arrondie, collée en haut quand on défile */
.top {
    position: sticky;
    top: .6rem;
    z-index: 5;
    margin-top: .8rem;
    padding: .5rem .9rem;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}
.tabs { gap: .2rem; }
.tabs a {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border: 0;
    border-radius: 99px;
    color: var(--ink-2);
}
.tabs a .ico { display: none; }
.tabs a:hover { background: var(--track); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

/* Contenu : un grand panneau lisible par-dessus la photo */
main {
    margin-top: 1rem;
    padding: .2rem 1.6rem 1.8rem;
    border: 1px solid var(--rule);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
main:focus { outline: none; }

.page-head { padding: 1.3rem 0 .2rem; }
.page-head h1 { margin: 0; font: 800 clamp(2rem, 5vw, 2.7rem)/1 var(--display); letter-spacing: .01em; }
.page-head p { max-width: 46rem; margin: .4rem 0 0; }

.weekbar { padding-top: .9rem; }
.step { border-radius: 99px; background: var(--bg); }
.weekbar-label { padding: 0 .4rem; }

.banner {
    margin: 1rem 0 0;
    padding: .7rem 1rem;
    border: 1px solid var(--rule);
    border-left-width: 1px;
    border-radius: var(--radius);
    background: var(--bg);
}

/* Cartes dans le panneau */
.compose, .block.card {
    border-radius: 14px;
    background: var(--bg);
    box-shadow: none;
}
.block { border-top: 0; padding: 1rem 0; }
.side .block { padding: 1rem 1.1rem; margin-bottom: 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg); }
.side .block h2 { font-size: 1.4rem; }

input[type="text"], select { background: var(--surface); border-radius: var(--radius); }
.btn { border-radius: 99px; padding: 0 1.5rem; }
.btn.small { padding: 0 .9rem; }
.seg:first-child span { border-radius: 99px 0 0 99px; }
.seg:last-child span { border-radius: 0 99px 99px 0; }
.chip { padding: .12rem .75rem; }

.hero { padding-top: 1.4rem; }
.stave::after { background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--n) - 2px), var(--panel) calc(100% / var(--n) - 2px), var(--panel) calc(100% / var(--n))); }

.day-block { border-top: 1px solid var(--rule); }
.grid24 tbody tr.now { background: var(--bg); }
table th, table td { border-color: var(--rule); }

/* ---------- Téléphone : menu en bas, comme une appli ---------- */
@media (max-width: 700px) {
    .shell { padding: 0 .6rem 6rem; }
    .top { position: static; margin-top: .5rem; padding: .5rem .8rem; }
    .me { margin-left: 0; width: 100%; justify-content: space-between; }
    main { padding: .1rem 1rem 1.4rem; border-radius: 16px; }

    .tabs {
        position: fixed;
        left: .5rem;
        right: .5rem;
        bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
        z-index: 20;
        justify-content: space-around;
        gap: 0;
        padding: .3rem;
        overflow: visible;
        border: 1px solid var(--rule);
        border-radius: 20px;
        background: var(--panel);
        box-shadow: var(--shadow);
        backdrop-filter: blur(10px);
    }
    .tabs a {
        flex: 1;
        flex-direction: column;
        gap: .05rem;
        min-width: 0;
        padding: .35rem .1rem;
        border-radius: 14px;
        font-size: .68rem;
        font-weight: 600;
        text-align: center;
    }
    .tabs a .ico { display: block; font-size: 1.25rem; line-height: 1.2; }
}

@media (max-width: 700px) {
    .deal { grid-template-columns: minmax(0, 1fr) auto; }
    .deal > .status-select { grid-column: 1; grid-row: 1; }
    .deal > .btn { grid-column: 2; grid-row: 1; }
    .deal > .del { grid-column: 1 / -1; justify-self: start; margin: 0; }
    .driver-row { flex-wrap: wrap; }
    .driver-row select:first-child { flex: 1 1 100%; }
    .fields { grid-template-columns: 1fr 1fr; }
    .side { margin-top: 1rem; }
}
.labo-cols { grid-template-columns: repeat(auto-fit, minmax(min(23rem, 100%), 1fr)); }
@media (max-width: 700px) { .labo-cols { gap: 1.5rem; } .grid24 th, .grid24 td { padding-left: .3rem; padding-right: .3rem; } }
.grid > * { min-width: 0; }
.tablewrap { overflow-x: auto; }
@media (max-width: 700px) { input.qty { width: 5.5rem; } .legend { flex-wrap: wrap; } }

/* Labos : les noms côte à côte sur la même ligne */
.crew-cell { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
.who { display: inline-flex; align-items: center; gap: .45rem; }
.who input.qty { width: 6.5rem; min-height: 36px; padding: .25rem .5rem; text-align: right; }
.qty-read { font-weight: 600; }
.who .del { min-height: 32px; margin: 0; padding: 0 .3rem; text-decoration: none; }
.who .del.confirm { text-decoration: underline; }
.grid24 td.crew-cell { white-space: normal; }
.grid24 tbody td { vertical-align: middle; }
.grid24 tbody tr { height: 3rem; }
.labo-cols { grid-template-columns: 1fr; gap: 2rem; }

/* Drogue : planning horizontal, un jour par colonne */
.shell { max-width: 1320px; }
.board {
    display: grid;
    grid-template-columns: repeat(7, minmax(9rem, 1fr));
    gap: .7rem;
    margin: 1rem 0 1.2rem;
    overflow-x: auto;
    padding-bottom: .4rem;
}
.col { min-width: 0; padding: .6rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg); }
.col.today { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.col-head { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .5rem; }
.col-head h2 { margin: 0; font-size: 1.2rem; text-transform: capitalize; }
.col-head .plus { align-self: flex-start; min-height: 32px; margin: 0; padding: 0; }
.col .empty { font-size: .9rem; }
.cards { display: flex; flex-direction: column; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.deal-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .6rem;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
}
.deal-card strong { overflow-wrap: anywhere; }
.deal-card .status-select { min-height: 36px; padding: .2rem .5rem; font-size: .9rem; }
.deal-card .crew .chip { padding: 0 .55rem; font-size: .85rem; }
.small-note { font-size: .85rem; }
.card-actions { display: flex; gap: .6rem; margin-top: .2rem; }
.card-actions .del { margin: 0; min-height: 32px; }

.fold { margin-top: .8rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg); }
.fold > summary { padding: .9rem 1.1rem; font: 800 1.25rem/1.1 var(--display); letter-spacing: .01em; cursor: pointer; }
.fold[open] > summary { border-bottom: 1px solid var(--rule); }
.fold > .compose, .fold > .block { margin: 0; border: 0; border-radius: 0; background: none; padding: 1rem 1.1rem 1.2rem; }
.fold > .compose > h2, .fold > .block > h2 { display: none; }
.fold .fields { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.fold .tablewrap { margin-top: 0; }
.deal-card .amount { display: block; }
.card-actions { flex-wrap: wrap; gap: .1rem .6rem; }
@media (max-width: 700px) { .board { grid-template-columns: repeat(7, 15rem); } }

/* Drogue : la carte ne montre que le groupe, un clic ouvre le détail */
.deal-item { list-style: none; }
.deal-card { padding: 0; gap: 0; border-left: 6px solid var(--c, var(--rule)); }
.deal-card > summary { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; cursor: pointer; list-style: none; }
.deal-card > summary::-webkit-details-marker { display: none; }
.deal-card > summary::after { content: "▾"; margin-left: auto; color: var(--ink-2); }
.deal-card[open] > summary::after { content: "▴"; }
.deal-card .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.deal-detail { display: flex; flex-direction: column; gap: .35rem; padding: 0 .7rem .7rem; border-top: 1px solid var(--rule); padding-top: .6rem; }

/* Salon des leads */
.polls { display: flex; flex-direction: column; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.poll { padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg); }
.poll.closed { opacity: .75; }
.poll h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
.poll-opts { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.poll-opt { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) 2rem; align-items: center; gap: .6rem; }
.poll-opt .voters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem; }
.poll-opt .voters .chip { font-size: .8rem; padding: 0 .5rem; }
.bar { height: 14px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.poll-opt.mine .bar-fill { background: var(--good); }
.count { text-align: right; }
.form-actions.tight { margin-top: .4rem; flex-wrap: wrap; gap: .5rem; }
.check { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; }
.apps { display: flex; flex-direction: column; gap: .6rem; }
.fold.app > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font: 600 1rem var(--body); }
.app-list { padding: .4rem 1rem 1rem; margin: 0; }
.app-entry { display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--rule); list-style: none; }
.app-text { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.stars { color: var(--ink); letter-spacing: .05em; }
@media (max-width: 700px) { .poll-opt { grid-template-columns: 1fr 2rem; } .poll-opt .bar { grid-column: 1 / -1; grid-row: 2; } .app-entry { grid-template-columns: 1fr auto; } .app-entry .stars { grid-column: 1 / -1; } }

/* Bot Discord */
textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    resize: vertical;
}
.bot-preview { min-height: 3rem; padding: .6rem .8rem; border: 1px dashed var(--rule); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.bot-list { display: flex; flex-direction: column; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.bot-item { padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.bot-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.bot-text { margin: .4rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9rem; overflow: auto; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .4rem; }
input[type="datetime-local"] { width: 100%; min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
@media (max-width: 700px) {
    .tabs { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
    .tabs a { flex: 1 0 auto; padding: .35rem .6rem; }
}

.tabbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 .4rem; }
.tabbtn { min-height: 40px; padding: 0 1.1rem; border: 1px solid var(--rule); border-radius: 99px; background: var(--bg); color: var(--ink); font: 600 .95rem var(--body); cursor: pointer; }
.tabbtn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.auto-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); gap: 1rem; margin-top: .8rem; align-items: start; }
.tpl-group h3 { margin: 1rem 0 .5rem; font-size: 1.05rem; }
pre.bot-preview { margin: .8rem 0 0; font: inherit; color: var(--ink); }
.compose .check { margin-top: .8rem; }

.preview-banner { margin: 0 0 .6rem; padding: .55rem .9rem; border-radius: 12px; background: #fff3cd; color: #5c4400; font-weight: 600; }
.viewas { min-height: 36px; border-radius: 99px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); padding: 0 .6rem; font: inherit; }

/* Bloc profil du haut de page : un seul pilule propre, nom jamais coupé en deux lignes */
.top { flex-wrap: wrap; row-gap: .5rem; }
.me { flex: 0 0 auto; flex-wrap: nowrap; gap: .5rem; padding: .2rem .3rem .2rem .3rem; border: 1px solid var(--rule); border-radius: 99px; background: transparent; }
.me .avatar { border-radius: 50%; flex: none; }
.me-name { font-weight: 600; white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.me-out { white-space: nowrap; padding: .3rem .7rem; border-radius: 99px; text-decoration: none; background: var(--bg); border: 1px solid var(--rule); font-size: .85rem; }
.viewas { max-width: 7rem; min-height: 32px; font-size: .85rem; margin-right: .1rem; }
@media (max-width: 760px) {
    .me { width: 100%; justify-content: flex-start; border-radius: 16px; }
    .me-name { flex: 1 1 auto; max-width: none; }
    .viewas { max-width: 10rem; }
}

/* Page Équipe */
.team-count { margin: .2rem 0 .8rem; color: var(--ink-2); }
.team-count strong { color: var(--ink); font-size: 1.4rem; margin-right: .25rem; }
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: .8rem; }
.team-card { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-left: 4px solid var(--c, var(--ink)); border-radius: 14px; background: var(--surface); }
.team-who { display: flex; align-items: center; gap: .7rem; }
.team-who .avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; background: var(--track); }
.team-name a { color: inherit; text-decoration: none; }
.team-name a:hover { text-decoration: underline; }
.team-who small { display: block; }
.team-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.team-edit { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.team-edit textarea { width: 100%; resize: vertical; }
.team-totals { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--rule); padding-top: .6rem; }
.team-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.team-stat { display: flex; flex-direction: column; }
.team-stat strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.team-stat span { font-size: .8rem; color: var(--ink-2); }
.team-grand { margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--accent); color: var(--on-accent); }
.team-grand h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.team-grand .team-stat span { color: inherit; opacity: .75; }
.team-grand .team-stat strong { font-size: 1.5rem; }
.field > .btn.small { justify-self: start; align-self: flex-start; margin-top: .4rem; width: auto; }
.field > .linkbtn { justify-self: start; text-align: left; margin-top: .3rem; }

/* Labos : deux colonnes (00h-12h, 13h-23h), noms en pastilles avec la croix dedans */
.labo-panel { padding: 1rem 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
.labo-panel > h2 { margin: 0 0 .1rem; }
.slot-halves { display: grid; grid-template-columns: 1fr; gap: 1.2rem 2rem; margin-top: .8rem; }
@media (min-width: 1000px) { .slot-halves { grid-template-columns: 1fr 1fr; } }
.slot-title { margin: 0 0 .4rem; font-size: .95rem; color: var(--ink-2); font-weight: 600; }
.slot-list { display: flex; flex-direction: column; gap: .3rem; }
.slot-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; min-height: 3rem; padding: .3rem .6rem; border-radius: 12px; background: var(--bg); border: 1px solid transparent; }
.slot-row.empty { background: transparent; border-color: var(--rule); border-style: dashed; opacity: .8; }
.slot-row.empty:hover { opacity: 1; }
.slot-row.now { border-color: var(--ink); border-style: solid; opacity: 1; box-shadow: 0 0 0 1px var(--ink) inset; }
.slot-hour { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-crew { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-width: 0; }
.slot-qty input.qty { width: 6.5rem; min-height: 34px; text-align: right; }
.slot-qty .qty-read { font-weight: 600; }
.slot-act .del { margin: 0; white-space: nowrap; font-size: .85rem; }
.who-chip { display: inline-flex; align-items: center; gap: .35rem; padding-right: .25rem; max-width: 100%; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem; margin: 0; border: 0; border-radius: 99px; background: rgba(0, 0, 0, .22); color: inherit; font: 700 .85rem/1 var(--body); cursor: pointer; }
.chip-x:hover { background: rgba(0, 0, 0, .42); }
.chip-x.confirm { background: #1a1a1a; color: #fff; font-size: .75rem; padding: 0 .55rem; }
@media (max-width: 700px) { .slot-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; } .slot-act { grid-column: 2 / -1; justify-self: start; } .slot-act:empty { display: none; } .slot-qty input.qty { width: 5.5rem; } }

/* Filtre des braquages */
.filter-bar { margin: .2rem 0 .9rem; }
.filter-bar .tabbtn { min-height: 36px; padding: 0 .9rem; font-size: .9rem; }
.team-open { align-self: flex-start; }

/* Réglages : sections bien séparées */
.set-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.set-nav .tabbtn { min-height: 38px; font-size: .9rem; }
.set-card { margin: 0 0 1.1rem; padding: 1.1rem 1.25rem 1.3rem; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); scroll-margin-top: 5rem; }
.set-card > h2:first-child, .set-card form > h2:first-child { margin-top: 0; }
.rc-row { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin: .6rem 0 .4rem; }
.rc-item { display: flex; align-items: center; gap: .55rem; }
.rc-item input[type="color"] { width: 44px; height: 44px; padding: 2px; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg); cursor: pointer; }

/* Lignes des membres */
.member-row { grid-template-columns: minmax(9rem, 1.2fr) minmax(8rem, auto) auto minmax(7rem, 1fr) auto; padding: .8rem 0; }
.member-id { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
.member-color { display: flex; align-items: center; gap: .6rem; }
.member-color input[type="color"] { width: 40px; height: 40px; padding: 2px; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg); cursor: pointer; }
.swatches { display: flex; gap: .3rem; }
.swatch { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--rule); }
.swatch.on { border-color: var(--ink); }
.swatch:hover { transform: scale(1.15); }
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--track); transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s; }
.switch input:checked + .switch-ui { background: #2e9e63; }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--ink); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .5; }
.switch-label { font-size: .92rem; }
@media (max-width: 900px) { .member-row { grid-template-columns: 1fr auto; } .member-row > :nth-child(4) { grid-column: 1 / -1; } .member-row > :nth-child(2):empty { display: none; } }
@media (prefers-reduced-motion: reduce) { .switch-ui, .switch-ui::after { transition: none; } }

/* Classement : podium or, argent, bronze */
.podium-wrap { margin: 1rem 0 1.4rem; }
.podium { list-style: none; margin: 0 auto; padding: 0; display: flex; align-items: flex-end; justify-content: center; gap: .6rem; max-width: 40rem; }
.podium > li { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 0; text-align: center; }
.podium .medal { font-size: 1.8rem; line-height: 1; }
.podium .avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--track); box-shadow: 0 0 0 3px var(--ring, var(--rule)); }
.podium-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-value { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.podium-block { width: 100%; display: grid; place-items: center; border-radius: 12px 12px 0 0; color: #1a1a1a; font: 800 2rem/1 var(--display); }
.place-1 .podium-block { height: 8rem; } .place-2 .podium-block { height: 6rem; } .place-3 .podium-block { height: 4.6rem; }
.step-gold { --ring: #d4af37; } .step-gold .podium-block { background: linear-gradient(180deg, #f6dc7a, #d4af37); }
.step-silver { --ring: #b8c0c8; } .step-silver .podium-block { background: linear-gradient(180deg, #eef1f4, #b8c0c8); }
.step-bronze { --ring: #cd7f32; } .step-bronze .podium-block { background: linear-gradient(180deg, #e9a868, #cd7f32); }
.rank-list { list-style: none; margin: 0 auto; padding: 0; max-width: 40rem; display: flex; flex-direction: column; gap: .3rem; }
.rank-list li { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .6rem; padding: .45rem .8rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--rule); }
.rank-list li.me { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.rank-n { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.podium + * , .rank-list + .hint { margin-top: 1rem; }

/* Absences */
.absence-grid { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .7rem; }
.absence-card { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: .8rem .95rem; border-radius: 14px; border: 1px solid var(--rule); border-left: 4px solid var(--c, var(--ink)); background: var(--surface); }
.absence-card.past { opacity: .65; }
.absence-card.now { box-shadow: 0 0 0 1px var(--ink) inset; }
.absence-who { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.absence-dates { margin: 0; font-weight: 700; }
.team-away { margin: 0; font-size: .85rem; color: var(--ink-2); }
.team-away.exempt { color: var(--ink); font-weight: 600; }

/* Historique */
.audit-search { display: flex; gap: .5rem; margin: .4rem 0 1rem; }
.audit-search input { flex: 1; min-height: 44px; }
.audit-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.audit-item { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .8rem; align-items: start; padding: .55rem .8rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--rule); }
.audit-detail { margin: .1rem 0 0; color: var(--ink-2); font-size: .92rem; overflow-wrap: anywhere; }
.audit-who { font-weight: 600; font-size: .9rem; text-align: right; }
@media (max-width: 700px) { .audit-item { grid-template-columns: 1fr auto; } .audit-when { grid-column: 1 / -1; } .podium .avatar { width: 40px; height: 40px; } .podium-block { font-size: 1.5rem; } }
.rank-list li .chip { justify-self: start; }

.audit-search input[type="search"], input[type="date"] { min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius, 8px); background: var(--bg); color: var(--ink); font: inherit; }

/* Aide intégrée */
.help { margin: .9rem 0 .2rem; border: 1px solid rgba(128,128,128,.35); border-radius: 12px; background: rgba(128,128,128,.07); }
.help > summary { cursor: pointer; padding: .7rem 1rem; font-weight: 700; list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help-body { padding: 0 1rem 1rem; display: grid; gap: .8rem; }
.help-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; max-width: 46rem; }
.help-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.help-imgs figure { margin: 0; display: grid; gap: .3rem; }
.help-imgs img { width: 100%; height: auto; border-radius: 10px; }
.help-imgs figcaption { font-size: .9rem; color: var(--ink-2); }
.help textarea { width: 100%; }

/* Ma personnalisation */
.perso-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 1rem; }
.color-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.color-row input[type="color"] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: none; cursor: pointer; }
.perso-bg { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--rule); background: var(--bg) center / cover no-repeat; }
.perso-preview .stave { margin-top: .5rem; }

/* Aperçu d'un bloc Discord */
.discord-embed { max-width: 460px; padding: .8rem 1rem; border-radius: 6px; border-left: 4px solid var(--bar, #5865f2); background: #2b2d31; color: #dbdee1; font-size: .92rem; display: grid; gap: .5rem; }
.discord-embed .de-title { font-weight: 700; font-size: 1.05rem; color: #fff; }
.de-fields { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; }
.de-field { flex: 1 1 100%; }
.de-field.inline { flex: 0 1 auto; min-width: 6rem; }
.de-field strong { display: block; color: #fff; font-size: .88rem; }
.de-foot { font-size: .75rem; color: #949ba4; }

/* Événements */
.event-list { display: grid; gap: 1.2rem; }
.event-card { padding: 1.1rem; border: 1px solid rgba(128,128,128,.3); border-radius: 14px; background: var(--surface); display: grid; gap: .7rem; }
.event-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; }
.event-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.event-head h2 { margin: 0; font: 800 1.5rem/1.1 var(--display); }
.event-meta { margin: 0; }
.event-desc { margin: 0; white-space: pre-wrap; max-width: 46rem; }
.event-card h3 { margin: .4rem 0 0; font-size: 1rem; }
.event-vote-row { display: grid; grid-template-columns: 9rem 1fr 6rem; gap: .6rem; align-items: center; }
.event-voters { margin: .1rem 0 0 9.6rem; font-size: .85rem; }
.event-tools { display: flex; gap: 1rem; }
.event-decide select { margin-left: .4rem; }
.event-thread { display: grid; gap: .5rem; border-top: 1px solid rgba(128,128,128,.3); padding-top: .6rem; }
.event-comment p { margin: .2rem 0 .4rem; white-space: pre-wrap; }
@media (max-width: 600px) { .event-vote-row { grid-template-columns: 1fr; } .event-voters { margin-left: 0; } }

/* ---------- Grand écran : le nom du site, l'icône et le menu passent dans une colonne à gauche ---------- */
@media (min-width: 900px) {
    .shell { max-width: 1560px; display: grid; grid-template-columns: 236px minmax(0, 1fr); column-gap: 1.2rem; align-items: start; }
    .preview-banner { grid-column: 1 / -1; grid-row: 1; }
    .top {
        grid-column: 1; grid-row: 2;
        position: sticky; top: .8rem; margin-top: .8rem;
        display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1rem;
        min-height: calc(100vh - 1.6rem); max-height: calc(100vh - 1.6rem); overflow-y: auto;
        padding: 1.1rem .8rem .8rem;
        border-bottom: 1px solid var(--rule);
    }
    main { grid-column: 2; grid-row: 2; }
    .brand { flex-direction: column; align-items: flex-start; gap: .6rem; padding: 0 .5rem .6rem; border-bottom: 1px solid var(--rule); font-size: 2rem; }
    .brand-mark { width: 56px; height: 56px; border-radius: 12px; }
    .tabs { flex-direction: column; gap: .15rem; }
    .tabs a { padding: .6rem .8rem; border-radius: 12px; }
    .tabs a .ico { display: inline-block; width: 1.5rem; text-align: center; }
    .me { margin: auto 0 0; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; border-radius: 14px; padding: .5rem; }
    .me .viewas { grid-column: 1 / -1; max-width: none; margin: 0; }
    .me-name { max-width: none; }
    .me-out { grid-column: 1 / -1; text-align: center; }
}

/* Téléphone : le flou du bandeau empêchait le menu de se coller en bas de l'écran */
@media (max-width: 700px) { .top { backdrop-filter: none; } }

/* Recrutement */
.rstats { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
.rstat { flex: 1 1 8rem; padding: .7rem 1rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); display: grid; }
.rstat strong { font: 800 1.7rem/1.1 var(--display); }
.rboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; align-items: start; }
.rcol { padding: .6rem; border: 1px solid var(--rule); border-top: 4px solid var(--c); border-radius: 12px; background: var(--surface); display: grid; gap: .5rem; }
.rcol-head { margin: 0; font-size: .95rem; display: flex; justify-content: space-between; gap: .4rem; }
.rcol-n { color: var(--ink-2); font-weight: 600; }
.rempty { margin: 0; font-size: .9rem; }
.rcard { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); color: inherit; text-decoration: none; }
.rcard:hover { border-color: var(--accent); }
.rcard-body { display: grid; gap: .15rem; min-width: 0; }
.rcard-body strong { overflow-wrap: anywhere; }
.rmeta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; }
.rtrial { font-size: .85rem; font-weight: 600; }
.rowner { font-size: .8rem; }
.avatar { border-radius: 50%; flex: none; }
.avatar.ph { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--track); font-weight: 700; }
.avatar.big { width: 64px; height: 64px; font-size: 1.6rem; }
.rhead { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem 0 .4rem; }
.rhead h2 { margin: 0; font: 800 1.8rem/1.1 var(--display); }
.rhead p { margin: .2rem 0 0; }
.rhead .chip { margin-left: auto; }
.stars-pick { display: flex; gap: .2rem; }
.star { border: 0; background: none; color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer; padding: .1rem; }

/* ---------- Plateforme (créer un groupe) ---------- */
.plat { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 4rem; display: grid; gap: 1rem; }
.plat-top { display: flex; align-items: center; gap: 1rem; }
.plat-top h1 { margin: 0; font: 800 clamp(2.4rem, 9vw, 3.6rem)/.95 var(--display); }
.plat-top p { margin: .2rem 0 0; }
.plat-section { border-top: 1px solid var(--rule); padding-top: 1rem; display: grid; gap: .7rem; justify-items: start; }
.plat-section h2 { margin: 0; font: 700 1.5rem/1.1 var(--display); }
.plat-section h3 { margin: .6rem 0 0; font-size: 1rem; }
.plat-section p { margin: 0; }
.plat-row { display: flex; gap: .5rem; flex-wrap: wrap; width: 100%; }
.plat-row input { flex: 1 1 14rem; }
.plat-card { width: 100%; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: .9rem 1rem; display: grid; gap: .5rem; }
.plat-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.plat-head h3 { margin: 0; font-size: 1.1rem; }
.plat-link { font-family: monospace; word-break: break-all; font-size: .9rem; }
.plat-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.plat-edit { display: grid; gap: .6rem; }
.plat-group { border: 1px solid var(--rule); border-radius: var(--radius); padding: .6rem .8rem; margin: 0; width: 100%; box-sizing: border-box; }
.plat-group legend { font-weight: 600; padding: 0 .3rem; }
.plat-roles { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 11rem; overflow: auto; }
.plat-role { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--rule); border-radius: 999px; padding: .2rem .6rem; cursor: pointer; min-height: 34px; }
.plat-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink-2); display: inline-block; }
.plat-ok { color: var(--good, inherit); font-weight: 600; }
.plat-warn { font-size: .9rem; border-left: 3px solid var(--danger, #cf1e21); padding-left: .6rem; }
.plat-edit { width: 100%; }
.plat-group legend { font-size: 1rem; }

/* ---------- Panel gestion + annonce globale ---------- */
.plat-row input[type="search"] { min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; }
.plat-row select { flex: 0 1 12rem; width: auto; }
.plat-section textarea { width: 100%; box-sizing: border-box; }
.plat-list { display: grid; gap: .7rem; width: 100%; }
.plat-stats { font-size: .9rem; }
.announce-banner { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; padding: .55rem .9rem; border-radius: 12px; background: var(--surface); color: var(--ink); border-left: 4px solid var(--ink); font-weight: 600; }
.announce-banner span { flex: 1; }
@media (min-width: 900px) { .shell-banners { grid-column: 1 / -1; grid-row: 1; } }

/* Fiches du panel gestion : bannière, logo, chiffres */
.plat.wide { max-width: 1180px; }
.gc-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.gc-card { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); overflow: hidden; display: grid; }
.gc-card.off .gc-banner, .gc-card.off .gc-logo { filter: grayscale(1); opacity: .7; }
.gc-banner { height: 110px; background: linear-gradient(135deg, var(--ink-2), var(--ink)); position: relative; }
.gc-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-body { padding: 0 1rem 1rem; display: grid; gap: .6rem; min-width: 0; }
.gc-head { display: flex; align-items: flex-end; gap: .75rem; margin-top: -32px; position: relative; }
.gc-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--bg); border: 3px solid var(--surface); flex: none; }
.gc-title { flex: 1; min-width: 0; padding-top: 36px; }
.gc-title h3 { margin: 0; font: 700 1.35rem/1.1 var(--display); overflow-wrap: anywhere; }
.gc-title p { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.gc-head .badge { align-self: flex-end; }
.gc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.gc-stat { background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: .4rem .5rem; display: grid; gap: .1rem; min-width: 0; }
.gc-stat strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-stat span { font-size: .72rem; color: var(--ink-2); }
.gc-meta { font-size: .88rem; margin: 0; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost.danger { background: none; color: var(--danger); border-color: var(--danger); }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.plat-danger { display: grid; gap: .5rem; border: 1px solid var(--danger); border-radius: 10px; padding: .7rem .8rem; }
.plat-danger p { margin: 0; }

/* « Pour bien démarrer » */
.onboarding:empty { display: none; }
.onboarding-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.onboarding-head h2 { margin: 0; flex: 1; }
.onboarding-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .45rem; }
.onboarding-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.onboarding-list li.ok span:nth-child(2) { text-decoration: line-through; color: var(--ink-2); }
.onboarding-list a, .onboarding-list .linkbtn { font-size: .9rem; color: inherit; }

/* Accueil Bastion (visiteurs), Confidentialité, pied de page */
.land-hero p { font-size: 1.05rem; max-width: 46rem; }
.land-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .7rem; width: 100%; }
.land-card { border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); padding: .8rem .9rem; display: grid; gap: .3rem; align-content: start; }
.land-card h3 { margin: 0; font-size: 1rem; }
.land-card p { margin: 0; font-size: .9rem; }
.land-ico { font-size: 1.5rem; line-height: 1; }
.land-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .45rem; }
.land-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.plat-foot { border-top: 1px solid var(--rule); padding-top: .8rem; font-size: .9rem; }
.plat-foot a, .login-foot a { color: inherit; }
.login-foot { font-size: .85rem; }
.plat-backups { width: 100%; }
.plat-backups summary { cursor: pointer; font-weight: 600; }
.plat-backups a { color: inherit; }
.plat-backups ul { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; font-size: .9rem; }
