:root {
  --zoom: .8;
  --bg: #f5f6f8; --card: #fff; --ink: #1b1f27; --muted: #667085; --line: #e3e6ec;
  --brand: #1f4fd8; --brand-ink: #fff;
  --ok: #157f4b; --ok-bg: #e4f6ec;
  --ko: #c0262d; --ko-bg: #fde7e8;
  --opt: #98a2b3;
  --chk: #93370d; --chk-bg: #fef0c7; --blr: #b54708; --blr-bg: #ffe4cc;
  --ccm: #3c3489; --ccm-bg: #eeedfe;
  --radius: 0.625rem;
  color-scheme: light;
}
/* Mode sombre : automatique (selon l'ordinateur) sauf si le compte a choisi « Clair » ; ou imposé par le choix « Sombre » */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --card: #1b2029; --ink: #e8ebf1; --muted: #98a2b3; --line: #2b323f;
    --brand: #6b93ff; --brand-ink: #0b1020;
    --ok: #52d08c; --ok-bg: #123a27;
    --ko: #ff7b83; --ko-bg: #4a1a1e;
    --chk: #fec84b; --chk-bg: #40300f; --blr: #fdb022; --blr-bg: #44230e;
    --ccm: #cecbf6; --ccm-bg: #3c3489;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --card: #1b2029; --ink: #e8ebf1; --muted: #98a2b3; --line: #2b323f;
  --brand: #6b93ff; --brand-ink: #0b1020;
  --ok: #52d08c; --ok-bg: #123a27;
  --ko: #ff7b83; --ko-bg: #4a1a1e;
  --chk: #fec84b; --chk-bg: #40300f; --blr: #fdb022; --blr-bg: #44230e;
  --ccm: #cecbf6; --ccm-bg: #3c3489;
  color-scheme: dark;
}
html { font-size: calc(16px * var(--zoom)); }
* { box-sizing: border-box; }
body { margin: 0; font: 0.9375rem/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--brand); }

.topbar { display: flex; align-items: center; gap: 0.25rem; padding: 0.625rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; margin-right: 1rem; }
.nav a { text-decoration: none; color: var(--muted); padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 0.8125rem; margin-right: 0.5rem; }
/* Recherche rapide (⌘K) */
.search-btn { color: var(--muted); margin-right: 0.5rem; }
.search-btn kbd, .qk-input kbd { font: 600 0.6875rem/1 system-ui, sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 0.25rem; padding: 0.125rem 0.3125rem; background: var(--bg); }
dialog#quick { width: min(36rem, 94vw); margin: 12vh auto auto; overflow: hidden; }
.qk-input { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.qk-input input { border: 0 !important; outline: none !important; padding: 0.25rem 0 !important; font-size: 1.0625rem; background: transparent !important; color: var(--ink); }
#qkList { list-style: none; margin: 0; padding: 0.375rem; max-height: 60vh; overflow-y: auto; }
#qkList li[data-i] { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; cursor: pointer; }
#qkList li.on { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.qk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qk-main .sub { font-size: 0.8125rem; }
.qk-proj { width: 2.375rem; height: 2.375rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--brand) 12%, var(--card)); color: var(--brand); flex: none; }
.qk-empty { padding: 1rem; color: var(--muted); text-align: center; }

/* Barre de chargement (requête de plus de 300 ms) */
#loadbar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .15s; overflow: hidden; }
#loadbar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--brand); animation: loadbar 1.1s ease-in-out infinite; }
#loadbar.on { opacity: 1; }
@keyframes loadbar { from { left: -35%; } to { left: 100%; } }

/* Ligne qui s'allume après un enregistrement ou un ajout */
@keyframes flash { from { background: color-mix(in srgb, var(--brand) 22%, var(--card)); } to { background: var(--card); } }
tr.flash > td { animation: flash 1.8s ease-out; }

/* Fiche : catégories vides et non requises repliées */
.idle-cats { border: 1px dashed var(--line); border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.idle-cats > summary { font-size: 0.875rem; }
.idle-cats[open] > summary { margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: reduce) { #loadbar::after { animation: none; left: 0; width: 100%; } tr.flash > td { animation: none; background: color-mix(in srgb, var(--brand) 14%, var(--card)); } }

/* Barre du haut, à droite : Corbeille isolée, séparateur, zoom, Utilisateurs (icône), compte */
.topbar a.btn { text-decoration: none; color: var(--ink); }
.topbar a.btn.active { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.trash-link { color: var(--muted) !important; }
.trash-link:hover { color: var(--ko) !important; border-color: var(--ko); }
.trash-link.active { color: var(--ko) !important; border-color: var(--ko) !important; background: var(--ko-bg) !important; }
.tb-sep { width: 1px; height: 1.375rem; background: var(--line); margin: 0 0.5rem; }
.icon-only { display: inline-flex; align-items: center; justify-content: center; padding: 0.25rem 0.5rem; margin-right: 0.25rem; }
#panel.page-panel > .head h1 { font-size: 1.375rem; }

main { padding: 1.25rem; max-width: 110rem; margin: 0 auto; }
.head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.875rem; flex-wrap: wrap; }
.head h1 { font-size: 1.375rem; }
.sub { color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--card); padding: 0.5rem 0.875rem; border-radius: 0.5rem; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--ko); }
.btn.small { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  border: 1px solid var(--line); background: var(--card); border-radius: 0.5rem; padding: 0.5rem 0.625rem; width: 100%;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.25rem; }
.field { margin-bottom: 0.75rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--ink); font-size: 0.875rem; margin: 0; cursor: pointer; }

.toolbar { display: flex; gap: 0.625rem; align-items: center; margin-bottom: 0.875rem; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 17.5rem; }
.toolbar select { width: auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap { overflow: auto; max-height: calc(100vh - 14.375rem); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 0.5625rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--card); position: sticky; top: 0; z-index: 1; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
td.c, th.c { text-align: center; }
td.wrap { white-space: normal; }

.cell { display: inline-flex; align-items: center; justify-content: center; min-width: 2.125rem; height: 1.625rem; border-radius: 0.375rem; font-weight: 700; font-size: 0.8125rem; }
.cell.ok { background: var(--ok-bg); color: var(--ok); }
.cell.ko { background: var(--ko-bg); color: var(--ko); }
.cell.opt { color: var(--opt); }
.badge { display: inline-block; padding: 2px 0.5rem; border-radius: 6.1875rem; font-size: 0.75rem; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.ko { background: var(--ko-bg); color: var(--ko); }
.badge.grey { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: 0.875rem; padding: 0; width: min(47.5rem, 94vw); max-height: 92vh; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(10, 14, 22, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h2 { font-size: 1.125rem; }
.modal-body { padding: 1.125rem 1.25rem 1.375rem; }
.modal-body h3 { font-size: 0.9375rem; margin: 1.375rem 0 0.625rem; }
.x { border: 0; background: none; font-size: 1.375rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0.25rem 0.5rem; }
.actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

.doc { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.625rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; margin-bottom: 0.5rem; }
.doc.ko { border-color: var(--ko); background: var(--ko-bg); }
.doc.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.doc .t { flex: 1; min-width: 0; }
.doc .t strong { display: block; }
.files { margin-top: 0.25rem; font-size: 0.8125rem; }
.files li { display: flex; gap: 0.5rem; align-items: center; }
.files ul { list-style: none; margin: 0; padding: 0; }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20rem; }
.files button { border: 0; background: none; color: var(--ko); cursor: pointer; padding: 0 0.25rem; }
.filebtn input { display: none; }
/* un bouton en <label> (« + Fichier ») garde la couleur du texte : sinon il paraît désactivé sur une carte neutre */
label.btn { color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 0.875rem; }
.pcard { padding: 1rem; cursor: pointer; }
.pcard:hover { border-color: var(--brand); }
.pcard h3 { margin-bottom: 0.375rem; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.err { color: var(--ko); font-size: 0.875rem; min-height: 1.25rem; margin: 0.375rem 0; }
.hint { font-size: 0.8125rem; color: var(--muted); }

#toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 0.625rem 1rem; border-radius: 0.5rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--ko); color: #fff; }

th.cat { white-space: normal; min-width: 7.5rem; max-width: 9.375rem; line-height: 1.25; }
td:first-child, th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
th:first-child { z-index: 3; }
tbody tr.click:hover td:first-child { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.modal-body td:first-child, .modal-body th:first-child { position: static; }

/* Photos */
.avatar { border-radius: 50%; object-fit: cover; object-position: top; background: var(--bg); border: 1px solid var(--line); flex: none; display: inline-block; }
.avatar.sm { width: 2.375rem; height: 2.375rem; }
.avatar.md { width: 2.75rem; height: 2.75rem; }
.avatar.lg { width: 6rem; height: 6rem; }
.avatar.noimg { background: color-mix(in srgb, var(--muted) 12%, var(--card)); }
.who-cell { display: flex; align-items: center; gap: 0.625rem; }
.modal-head .row { gap: 0.75rem; }

/* Regroupement par poste */
tr.group td { background: var(--bg); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0.4375rem 0.75rem; position: static; }

/* Documents dans la fiche */
.doc-toolbar { display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; padding: 0.625rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; margin-bottom: 0.625rem; background: var(--bg); position: sticky; top: 3.5rem; z-index: 1; }
.doc-toolbar select { width: auto; max-width: 16.25rem; }
.doc-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Stagiaire CCM : case dans la carte CCM de la fiche, mention à côté du nom dans l'équipe d'un projet */
.ccm-chips { display: inline-flex; gap: 0.375rem; margin-left: auto; flex-wrap: wrap; }
.check.ccm-chip { font-size: 0.75rem; padding: 0.125rem 0.5rem; border: 1px solid var(--line); border-radius: 0.4375rem; background: var(--card); }
.check.ccm-chip.on { border-color: var(--ccm); color: var(--ccm); background: var(--ccm-bg); }
.check.ccm-chip.pro.on { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.ccm-tag.pro { background: var(--ok-bg); color: var(--ok); }
.ccm-tag.none { background: var(--chk-bg); color: var(--chk); }
.ccm-tag.check { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
/* liste globale : nom et mention CCM ensemble ; la mention passe sous le nom si la place manque */
.who-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.375rem; min-width: 0; }
.who-name .ccm-tag { margin-left: 0; }
.check.ccm-chip.none.on { border-color: var(--chk); color: var(--chk); background: var(--chk-bg); }
.ccm-tag { display: inline-block; margin-left: 0.375rem; padding: 0.0625rem 0.5rem; border-radius: 99px; background: var(--ccm-bg); color: var(--ccm); font-size: 0.6875rem; font-weight: 600; white-space: nowrap; vertical-align: 0.0625rem; }
.check.small { font-size: 0.75rem; color: var(--muted); margin-left: auto; }
.files li { padding: 0.1875rem 0; }
.fthumb { width: 2.125rem; height: 2.75rem; object-fit: cover; border-radius: 0.25rem; border: 1px solid var(--line); background: #fff; flex: none; }
.fthumb.file { display: inline-flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; color: var(--muted); }
.files .name { max-width: 16.25rem; }

/* Cases à cocher en grille (documents attendus, export) */
.expect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); gap: 0.5rem 1rem; }
fieldset.expect { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem 0.875rem; margin: 0.25rem 0 0.5rem; }
fieldset.expect legend { font-size: 0.8125rem; font-weight: 600; padding: 0 0.375rem; }

/* Catalogue de postes */
.role-dept { padding: 0.625rem 0.875rem; font-weight: 700; background: color-mix(in srgb, var(--brand) 8%, var(--card)); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.role-sub { padding: 0.5rem 0.875rem 2px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.role-row { display: flex; gap: 0.5rem; padding: 0.25rem 0.875rem; align-items: center; }
.role-row input { max-width: 23.75rem; }
dialog#modal2 { width: min(40rem, 94vw); }
.files button.rot { color: var(--ink); font-size: 1.0625rem; line-height: 1; padding: 2px 0.375rem; border: 1px solid var(--line); border-radius: 0.375rem; background: var(--card); }
.files button.rot:hover { border-color: var(--brand); color: var(--brand); }

/* Aperçu avant ajout */
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.875rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.up-card { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem; background: var(--card); }
.up-view { height: 12.5rem; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 0.375rem; overflow: hidden; color: var(--muted); font-weight: 700; }
.up-view canvas { max-width: 100%; max-height: 12.5rem; }
.up-name { font-size: 0.75rem; color: var(--muted); margin: 0.375rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Qualité des scans : badge discret (À vérifier = ambre, Flou = orange, Trop petit ou illisible = rouge) */
.qbadge { display: inline-block; padding: 1px 0.4375rem; border-radius: 6.1875rem; font-size: 0.6875rem; font-weight: 600; white-space: nowrap; cursor: help; flex: none; }
.qbadge.check { background: var(--chk-bg); color: var(--chk); }
.qbadge.blurry { background: var(--blr-bg); color: var(--blr); }
.qbadge.unreadable { background: var(--ko-bg); color: var(--ko); }
.up-q { min-height: 1.125rem; font-size: 0.75rem; margin-bottom: 0.375rem; }
.up-q .qwhy { color: var(--muted); }
.up-warn { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border: 1px solid var(--blr); border-radius: 0.5rem; background: var(--blr-bg); color: var(--ink); font-size: 0.8125rem; }
.qline { padding: 0.25rem 0; }
.qline + .qline { border-top: 1px solid var(--line); }
details > summary { cursor: pointer; }

/* Messages dans la couche supérieure (visibles au-dessus des fenêtres ouvertes) */
#toast { top: auto; right: auto; margin: 0; width: max-content; height: auto; border: 0; overflow: visible; }
#toast:not(:popover-open), #syncbar:not(:popover-open) { display: none; }
#syncbar { top: 0.75rem; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); margin: 0; width: max-content; max-width: 92vw; height: auto; padding: 0.625rem 0.875rem; border: 1px solid var(--brand); border-radius: 0.625rem; background: var(--card); color: var(--ink); box-shadow: 0 0.375rem 1.5rem rgba(0, 0, 0, .18); overflow: visible; }

/* Numérotation des lignes */
.rownum { min-width: 1.5rem; text-align: right; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; flex: none; }

/* Réglages */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: 0.5625rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
#panel > .head h1 { font-size: 1.125rem; }

/* Recadrage */
.crop-presets { margin-bottom: 0.625rem; }
.crop-clip { overflow: hidden; padding: 0.75rem; background: #15181e; border-radius: 0.5rem; display: flex; justify-content: center; }
.crop-stage { position: relative; touch-action: none; user-select: none; line-height: 0; }
.crop-stage canvas { display: block; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58); cursor: move; outline: 1px solid rgba(0, 0, 0, .45); }
.crop-box i { position: absolute; width: 1rem; height: 1rem; margin: -8px 0 0 -8px; background: #fff; border: 2px solid var(--brand); border-radius: 50%; }
.crop-box i[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; }
.crop-box i[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.crop-box i[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-box i[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.crop-box i[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-box i[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.crop-box i[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-box i[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.crop-box.locked i.edge { display: none; }

/* Flèches d'ordre et catalogue des postes */
.mvs { display: inline-flex; gap: 2px; flex: none; }
.mv { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 0.375rem; width: 1.625rem; height: 1.625rem; line-height: 1; cursor: pointer; font-size: 0.875rem; padding: 0; }
.mv:hover:not([disabled]) { border-color: var(--brand); color: var(--brand); }
.mv[disabled] { opacity: .3; cursor: default; }
.role-dept, .role-sub { display: flex; align-items: center; gap: 0.5rem; }
.role-sub { padding-right: 0.875rem; margin-top: 0.375rem; }
.role-dept { padding-right: 0.875rem; }
.role-row { gap: 0.375rem; }
details.addbox { padding: 0.25rem 0.875rem 0.5rem; }
details.addbox summary { cursor: pointer; color: var(--brand); font-size: 0.8125rem; font-weight: 600; padding: 0.1875rem 0; }
details.addbox form { margin-top: 0.375rem; }
details.addbox input { max-width: 16.25rem; }

/* Réglage de la taille d'affichage */
.zoomctl { display: inline-flex; align-items: center; gap: 0.25rem; margin-right: 0.5rem; }
.zoomctl .btn { padding: 0.125rem 0.5rem; font-weight: 700; }
#zval { min-width: 2.4rem; text-align: center; font-size: 0.75rem; color: var(--muted); }

/* Page projet : en-tête, ajout d'une personne sur la ligne « Équipe », panneau de réglages */
.icon-btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.icon-btn svg { flex: none; }
.proj-desc { margin: -0.375rem 0 1rem; color: var(--muted); max-width: 60rem; white-space: pre-line; }
.team-head { margin-top: 1.125rem; margin-bottom: 0.5rem; }
.add-inline { flex-wrap: nowrap; gap: 0.5rem; }
.add-inline input { width: 16rem; max-width: 100%; }
.add-inline .btn { white-space: nowrap; }
.info { color: var(--muted); cursor: help; font-size: 1rem; line-height: 1; padding: 0 0.125rem; border-radius: 50%; }
.info:hover, .info:focus-visible { color: var(--brand); }
.danger-zone { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger-zone h3 { margin: 0 0 0.375rem; }
.danger-zone .hint { margin: 0 0 0.625rem; }
@media (max-width: 640px) { .add-inline { flex-wrap: wrap; width: 100%; } .add-inline input { width: 100%; } }

/* Panneau latéral qui glisse depuis la droite */
dialog#drawer[open] { display: flex; flex-direction: column; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(26rem, 94vw); border-radius: 0.875rem 0 0 0.875rem; border-right: 0; animation: drawer-in .22s ease-out; }
dialog#drawer .modal-body { flex: 1; overflow-y: auto; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog#drawer[open] { animation: none; } }

/* Formulaires compacts */
.compact .field { margin-bottom: 0.5rem; }
.compact label { margin-bottom: 0.125rem; font-size: 0.75rem; }
.compact input[type=text], .compact input[type=email], .compact input[type=tel], .compact input[type=date], .compact select, .compact textarea { padding: 0.3125rem 0.5rem; }
.compact textarea { min-height: 2.5rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 0.75rem; }
.grid5 { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr; gap: 0 0.75rem; }
.span2 { grid-column: span 1; }
.grid3 .span2 { grid-column: span 2; }
.grid2 .span2 { grid-column: 1 / -1; }
.form-foot { display: flex; gap: 0.75rem; align-items: flex-end; }
.form-foot .grow { flex: 1; margin-bottom: 0; }
.form-foot .btn { margin-bottom: 0.0625rem; }
@media (max-width: 640px) { .grid3, .grid5 { grid-template-columns: 1fr; } .grid3 .span2 { grid-column: auto; } .form-foot { flex-direction: column; align-items: stretch; } }
input.mini { padding: 0.1875rem 0.375rem; font-size: 0.8125rem; min-width: 6.5rem; width: 100%; }
td input.mini[type=text] { min-width: 5rem; max-width: 8rem; }
tr.contract td { padding-top: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
.contract-row { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); }
.contract-row label { display: inline-flex; align-items: center; gap: 0.375rem; margin: 0; }
.contract-row input.mini { width: auto; }
.card.compact-card { padding: 0.875rem; }
td.wrap { min-width: 13rem; }
td input.mini[type=text] { min-width: 6rem; max-width: 9rem; }

/* Mot de passe généré */
.pwbox { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.pwbox input { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; letter-spacing: 0.06em; }

/* Montants masqués et contrat dans la fiche */
.eye-btn { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 0.375rem; padding: 0.125rem 0.375rem; cursor: pointer; display: inline-flex; align-items: center; vertical-align: middle; }
.eye-btn:hover, .eye-btn[aria-pressed=true] { color: var(--brand); border-color: var(--brand); }
th .eye-btn { margin-left: 0.25rem; }
.amount { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.contract-card { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.625rem 0.75rem; margin: 0.75rem 0; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.contract-card .grid3 { margin-top: 0.375rem; }

/* Montants masqués sans champ « mot de passe » (sinon Chrome propose d'enregistrer un mot de passe) */
input.masked { -webkit-text-security: disc; text-security: disc; }

/* ===== Page de connexion : plateau de tournage la nuit (le formulaire suit le mode clair ou sombre) ===== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(22rem, 1fr); }
.login-set { position: relative; overflow: hidden; background: #0e1420; }
.login-set svg, .login-dust { position: absolute; inset: 0; width: 100%; height: 100%; }
.ls-cone { transform-origin: 1120px 250px; animation: ls-pan 12s ease-in-out infinite; }
.ls-flick { animation: ls-flick 7s infinite; }
.ls-tally { animation: ls-blink 1.2s steps(2, start) infinite; }
@keyframes ls-pan { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(7deg); } }
@keyframes ls-flick { 0%, 48%, 50%, 52%, 100% { opacity: 1; } 49% { opacity: .82; } 51% { opacity: .9; } }
@keyframes ls-blink { to { visibility: hidden; } }
.login-caption { position: absolute; left: 2rem; bottom: 1.75rem; right: 2rem; color: rgba(255, 255, 255, .75); font-size: 0.8125rem; letter-spacing: .04em; }
.login-caption strong { display: block; color: #fff; font-size: 1.25rem; letter-spacing: 0; margin-bottom: 0.25rem; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.login { width: min(22rem, 100%); }
.login-logo { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 0.625rem; background: var(--ink); color: var(--bg); margin-bottom: 1.125rem; }
.login h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login .sub { margin: 0 0 1.5rem; }
.login input { padding: 0.6875rem 0.75rem; }
.login-go { width: 100%; padding: 0.75rem; font-weight: 600; }
.login-foot { margin: 1.375rem 0 0; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 760px) { .login-page { grid-template-columns: 1fr; grid-template-rows: 38vh auto; } }
@media (prefers-reduced-motion: reduce) { .ls-cone, .ls-flick, .ls-tally { animation: none; } }

/* ===== Barre du haut sombre, façon moniteur (identique en mode clair et en mode sombre) ===== */
.topbar { --tb-ink: #e8ebf1; --tb-muted: #9aa4b2; --tb-line: rgba(255, 255, 255, .16); background: #0e1116; border-bottom: 1px solid rgba(255, 255, 255, .06); color: var(--tb-ink); }
.brand { display: inline-flex; align-items: center; color: #fff; }
.brand-clap { display: inline-block; width: 1.375rem; height: 1rem; margin-right: 0.5rem; border-radius: 3px; background: linear-gradient(#e8ebf1, #e8ebf1) bottom / 100% 55% no-repeat, repeating-linear-gradient(115deg, #e8ebf1 0 0.3rem, transparent 0.3rem 0.6rem) top / 100% 36% no-repeat; }
.topbar .nav a { color: var(--tb-muted); }
.topbar .nav a:hover { background: rgba(255, 255, 255, .08); color: var(--tb-ink); }
.topbar .nav a.active { color: #fff; background: rgba(255, 255, 255, .13); }
.topbar .btn { background: transparent; color: var(--tb-ink); border-color: var(--tb-line); }
.topbar .btn:hover { border-color: rgba(255, 255, 255, .4); }
.topbar a.btn { color: var(--tb-ink); }
.topbar a.btn.active { color: #fff; border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .13); }
.topbar .trash-link { color: var(--tb-muted) !important; }
.topbar .trash-link:hover { color: #ff8a90 !important; border-color: #ff8a90; }
.topbar .trash-link.active { color: #ff8a90 !important; border-color: #ff8a90 !important; background: rgba(255, 123, 131, .14) !important; }
.topbar .tb-sep { background: var(--tb-line); }
/* Compteur « À valider (N) » : documents envoyés par lien de dépôt (barre toujours sombre, donc une seule couleur) */
.topbar .pend-btn { color: #fec84b; border-color: rgba(254, 200, 75, .45); background: rgba(254, 200, 75, .12); font-weight: 600; white-space: nowrap; }
.topbar .pend-btn:hover { border-color: #fec84b; background: rgba(254, 200, 75, .2); }
.topbar #zval { color: var(--tb-muted); }
.topbar .search-btn { color: var(--tb-muted); }
.topbar .search-btn kbd { color: var(--tb-muted); border-color: var(--tb-line); background: transparent; }

/* ===== Couleur d'un projet (bandeau) : teintes moyennes, lisibles sur fond clair comme sombre ===== */
[data-color="blue"] { --pc: #3b74e0; } [data-color="teal"] { --pc: #14a394; } [data-color="green"] { --pc: #2f9e44; }
[data-color="amber"] { --pc: #e0a21b; } [data-color="orange"] { --pc: #f2711c; } [data-color="red"] { --pc: #e03b3b; }
[data-color="pink"] { --pc: #d6427a; } [data-color="violet"] { --pc: #7a52e6; }
.proj-band { height: 0.3125rem; border-radius: 99px; background: var(--pc); margin: -0.25rem 0 0.875rem; }
.proj-band[data-color=""] { display: none; }
.swatches { border: 0; padding: 0; margin: 0 0 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.swatches legend { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.375rem; padding: 0; }
.sw { position: relative; margin: 0; cursor: pointer; }
.sw input { position: absolute; opacity: 0; }
.sw span { display: block; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--pc, color-mix(in srgb, var(--muted) 35%, var(--card))); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.sw input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.sw input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== Cartes des projets : bandeau, avancement des dossiers, visages ===== */
.pcard { display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden; padding-top: 1.25rem; }
.pcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0.3125rem; background: var(--pc, var(--line)); }
.pc-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin: 0.875rem 0 0.3125rem; }
.pc-track { height: 0.375rem; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.pc-track i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.pc-foot { margin-top: 0.75rem; gap: 0.375rem; flex-wrap: wrap; }
.pc-foot .badge { white-space: nowrap; }
.cards { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
.faces { display: inline-flex; }
.faces > * { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 2px solid var(--card); margin-left: -0.5rem; object-fit: cover; object-position: top; background: color-mix(in srgb, var(--muted) 22%, var(--card)); display: inline-flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; color: var(--ink); flex: none; }
.faces > :first-child { margin-left: 0; }
.faces .more { color: var(--muted); }

/* ===== Postes à pourvoir ===== */
.badge.warn { background: var(--chk-bg); color: var(--chk); }
tr.vacant td { background-image: repeating-linear-gradient(135deg, transparent 0 0.5rem, color-mix(in srgb, var(--muted) 7%, transparent) 0.5rem 1rem); }
.vac-ava { border: 1.5px dashed var(--muted); background: transparent; }
.vac-label { font-style: italic; color: var(--muted); font-weight: 600; }
select.vac-role { width: 100%; min-width: 10.5rem; max-width: 15rem; text-overflow: ellipsis; padding: 0.25rem 0.5rem; font-size: 0.8125rem; }
.row-acts { white-space: nowrap; text-align: right; }
.row-acts .btn + .btn { margin-left: 0.375rem; }

/* Équipe d'un projet : tient dans la largeur (défilement vertical seulement) ; les noms longs passent à la ligne */
.team-table td { white-space: normal; }
.team-table .badge, .team-table .nw, .team-table .amount { white-space: nowrap; }
.team-table th:last-child, .team-table .row-acts { width: 1%; }
.nw { white-space: nowrap; }
.team-table td.row-acts { white-space: nowrap; }
/* Barre du haut : quand la place manque (grand zoom ou petit écran), Rechercher et Corbeille passent en icônes seules */
.topbar { container-type: inline-size; }
@container (max-width: 86rem) {
  .search-btn > span, .search-btn kbd, .trash-link > span { display: none; }
}
.team-table td:first-child { min-width: 12rem; }
.team-table th, .team-table td { padding-left: 0.5625rem; padding-right: 0.5625rem; }

/* Tableau de bord du projet : 4 cases cliquables qui filtrent l'équipe */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 22rem)); gap: 0.625rem; margin: 0 0 1rem; }
.tile { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 0.75rem; padding: 0.75rem 0.875rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.25rem; font: inherit; }
.tile:hover { border-color: var(--muted); }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.tile-k { font-size: 0.75rem; color: var(--muted); }
.tile-v { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.tile-v small { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.tile-s { font-size: 0.75rem; color: var(--muted); }
.tile .pc-track { margin: 0.125rem 0; }
.team-filter { margin: 0 0 0.5rem; padding: 0.375rem 0.625rem; border-radius: 0.5rem; background: color-mix(in srgb, var(--brand) 9%, var(--card)); display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.team-filter[hidden] { display: none; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Fiche : date de validité et dépôt à valider sous le fichier */
.files li { flex-wrap: wrap; }
.vrow { flex-basis: 100%; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.125rem 0 0.25rem 1.5rem; }
.vrow input.mini { width: auto; min-width: 0; }

/* Page Projets : arrivées des 7 prochains jours (un bloc par jour, cases de taille fixe, deux rangées puis « Voir les N autres ») */
.arrivals { padding: 0.75rem 1rem; margin-bottom: 1rem; }
.arr-day-block { margin-top: 0.625rem; }
.arr-day-block + .arr-day-block { border-top: 1px solid var(--line); padding-top: 0.625rem; }
.arr-day-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; }
.arr-date { font-size: 0.8125rem; font-weight: 700; }
.arr-date::first-letter { text-transform: uppercase; }
.arr-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); grid-auto-rows: 3.25rem; gap: 0.375rem; }
.arr-day-block:not(.open) .arr-grid { max-height: calc(2 * 3.25rem + 0.375rem); overflow: hidden; }
.arr-grid li { min-width: 0; }
.arr-item { display: flex; align-items: center; gap: 0.5rem; height: 100%; padding: 0.25rem 0.625rem 0.25rem 0.375rem; border: 1px solid var(--line); border-radius: 0.625rem; background: var(--bg); color: inherit; text-decoration: none; min-width: 0; }
.arr-item:hover { border-color: var(--brand); }
.arr-item .avatar { width: 2.25rem; height: 2.25rem; }
.arr-ini { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--card); border: 1px solid var(--line); }
.arr-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.arr-who strong, .arr-who .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-who strong { font-size: 0.8125rem; }
.arr-who .sub { font-size: 0.75rem; }
.arr-more { margin-top: 0.5rem; }

/* Fiche : indicatif devant le téléphone, pays devant la ville (menu natif transparent posé sur l'étiquette) */
.combo { display: flex; align-items: stretch; min-width: 0; }
.combo > input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cc { position: relative; flex: none; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.375rem 0 0.5rem; border: 1px solid var(--line); border-right: 0; border-radius: 0.5rem 0 0 0.5rem; background: var(--bg); font-size: 0.8125rem; white-space: nowrap; color: var(--ink); }
.cc-country { max-width: 8.5rem; }
.cc-country .cc-show { overflow: hidden; text-overflow: ellipsis; }
.cc-caret { width: 0.5rem; height: 0.375rem; color: var(--muted); flex: none; }
.cc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0; }
.cc:focus-within { outline: 2px solid var(--brand); outline-offset: -1px; }
.cc:hover { border-color: color-mix(in srgb, var(--muted) 50%, var(--line)); }

/* Liste de noms à choisir (sans suggestion) */
.picker { position: relative; display: inline-block; }
.add-inline .picker { width: 16rem; max-width: 100%; }
.picker input { width: 100%; }
.picker-list { position: absolute; z-index: 30; top: calc(100% + 0.25rem); left: 0; right: 0; min-width: 14rem; max-height: 18rem; overflow-y: auto; margin: 0; padding: 0.25rem; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, .14); }
.picker-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.375rem 0.5rem; border-radius: 0.375rem; cursor: pointer; font-size: 0.875rem; }
.picker-list li .sub { font-size: 0.75rem; white-space: nowrap; }
.picker-list li.on, .picker-list li:hover { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.picker-list .picker-empty { color: var(--muted); cursor: default; }
dialog .picker { display: block; }

/* Équipe : outils, sélection, relance */
.team-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.5rem; }
.btn.on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
.team-table tr.sel td { background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
.team-table input.selbox, .team-table input.selgroup, #teamSelAll { width: 1rem; height: 1rem; margin: 0 0.375rem 0 0; vertical-align: middle; accent-color: var(--brand); cursor: pointer; }
.selbar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 2rem); padding: 0.625rem 0.75rem; border-radius: 0.875rem; background: #0e1116; color: #e8ebf1; box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, .3); }
.selbar .selcount { font-weight: 650; margin-right: 0.25rem; white-space: nowrap; }
.selbar .btn { background: transparent; color: #e8ebf1; border-color: rgba(255, 255, 255, .22); }
.selbar .btn:hover { border-color: rgba(255, 255, 255, .5); }
.selbar .btn.primary { background: #fff; color: #0e1116; border-color: #fff; }
.selbar .btn.danger { color: #ff8a90; }
main:has(.selbar) { padding-bottom: 5rem; }
.badge-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.badge-btn:hover .badge { outline: 2px solid currentColor; outline-offset: 1px; }
.reminded { font-size: 0.6875rem; color: var(--muted); margin-top: 0.125rem; white-space: nowrap; }
.remind-list { display: flex; flex-direction: column; gap: 0.75rem; }
.remind { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.remind.done { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.remind textarea { min-height: 0; font-size: 0.875rem; }
.btn.wa { background: #128c4a; border-color: #128c4a; color: #fff; }
.reminded.pend { color: var(--chk); font-weight: 600; }

/* Équipe : bascule Liste / Portraits, menu Télécharger */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 0.5rem; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; color: var(--muted); padding: 0.25rem 0.75rem; font: inherit; font-size: 0.8125rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--bg); font-weight: 600; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 25; min-width: 12rem; display: flex; flex-direction: column; padding: 0.25rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, .14); }
.menu-list a { padding: 0.4375rem 0.625rem; border-radius: 0.375rem; color: var(--ink); text-decoration: none; font-size: 0.875rem; white-space: nowrap; }
/* Menu « Afficher » de l'équipe : cases à cocher ; colonnes masquées par classe sur le tableau */
.menu-checks { min-width: 15rem; padding: 0.5rem 0.75rem; gap: 0.125rem; }
.menu-checks .check { padding: 0.1875rem 0; font-size: 0.875rem; white-space: nowrap; }
.mc-all { display: flex; gap: 0.375rem; margin: 0.125rem 0 0.25rem; }
.mc-h { font-size: 0.6875rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0.375rem 0 0.125rem; }
.mc-note { margin: 0.375rem 0 0; font-size: 0.75rem; color: var(--muted); white-space: normal; }
.team-table.h-poste [data-c=poste], .team-table.h-ville [data-c=ville], .team-table.h-cip [data-c=cip], .team-table.h-ccm [data-c=ccm],
.team-table.h-start [data-c=start], .team-table.h-amounts [data-c=amounts], .team-table.h-dossier [data-c=dossier] { display: none; }
.team-table td[data-c=poste] { min-width: 6.5rem; }
/* Nom : jamais écrasé par les colonnes ajoutées ; la mention « Stagiaire CCM » passe sous le nom si la place manque */
.team-table td:first-child { min-width: 13rem; }
.team-table.dense th, .team-table.dense td { padding-left: 0.4375rem; padding-right: 0.4375rem; }
.team-table.dense td:first-child { min-width: 10.5rem; }
.team-table.dense td[data-c=poste] { min-width: 5.5rem; }
.team-table.dense td.row-acts { white-space: normal; }
.team-table.dense .row-acts .btn { display: block; width: 100%; margin: 0 0 0.25rem; }
.team-table.dense .row-acts .btn + .btn { margin-left: 0; }
.team-table.dense select.vac-role { min-width: 7rem; }
.team-table .who-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.375rem; min-width: 0; }
.team-table .who-name .ccm-tag { margin-left: 0; }
.team-table td[data-c=ccm] { white-space: nowrap; }
.menu-list a:hover { background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
.menu-list .menu-opt { padding: 0.4375rem 0.625rem 0.5rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--line); font-size: 0.8125rem; white-space: nowrap; cursor: pointer; }
/* Vue Portraits */
.trombi-wrap { margin-bottom: 1rem; }
.trombi-h { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem 0 0.5rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
.trombi { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.pc { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.625rem 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--card); color: var(--ink); font: inherit; text-align: center; }
button.pc { cursor: pointer; }
button.pc:hover { border-color: var(--brand); }
.pc img, .pc .pc-ini { width: 6.5rem; height: 8.125rem; border-radius: 0.5rem; object-fit: cover; object-position: top; background: color-mix(in srgb, var(--muted) 15%, var(--card)); }
.pc .pc-ini { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: var(--muted); }
.pc b { font-size: 0.875rem; line-height: 1.2; }
.pc span:last-child { font-size: 0.75rem; color: var(--muted); }
.pc.vacant { border-style: dashed; }
.pc.vacant .pc-ini { background: transparent; border: 1.5px dashed var(--muted); }
.pc.vacant b { color: var(--muted); font-style: italic; }

/* Fiche : glisser-déposer, historique, doublons */
.doc.drop { outline: 2px dashed var(--brand); outline-offset: 2px; background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
.doc-tip { font-size: 0.75rem; font-weight: 400; margin-left: 0.375rem; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; max-height: 12rem; overflow-y: auto; }
.hist li { padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.dups { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.dups li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.375rem 0; border-bottom: 1px solid var(--line); }
.dups li .btn { margin-left: auto; }

/* ===== Version téléphone (écrans étroits) ===== */
@media (max-width: 760px) {
  html { font-size: 15px; } /* le zoom A- / A+ ne s'applique pas sur téléphone */
  .zoomctl, .tb-sep { display: none; }
  .topbar { padding: 0.5rem 0.75rem; gap: 0.375rem; }
  .topbar .brand { margin-right: auto; }
  .topbar .nav { order: 10; flex-basis: 100%; display: flex; overflow-x: auto; white-space: nowrap; gap: 0.25rem; scrollbar-width: none; }
  .topbar .nav a { padding: 0.375rem 0.625rem; }
  .topbar > .spacer { display: none; }
  main { padding: 0.75rem; }
  .head h1 { font-size: 1.25rem; }
  .cards { grid-template-columns: 1fr; }
  .toolbar input[type=search], .toolbar select { max-width: none; width: 100%; }
  .team-head .spacer, .team-tools .spacer { display: none; }
  .add-inline { width: 100%; flex-wrap: wrap; }
  .add-inline .picker, .add-inline input { width: 100%; }
  .add-inline .btn { flex: 1; }
  .team-tools > .sub { flex-basis: 100%; order: 5; font-size: 0.75rem; }
  /* tableaux en cartes : une personne par carte, libellé devant chaque information */
  .table-wrap { max-height: none; overflow: visible; background: transparent; border: 0; }
  .team-table thead, #tbody ~ thead, .table-wrap thead { display: none; }
  .team-table, .team-table tbody, .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .team-table tr, .table-wrap tbody tr { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; margin-bottom: 0.5rem; padding: 0.5rem 0.75rem; }
  .team-table tr.group, .table-wrap tbody tr.group { background: none; border: 0; padding: 0.75rem 0.25rem 0.25rem; margin: 0; }
  .team-table tr.group td, .table-wrap tbody tr.group td { background: none; padding: 0; }
  .team-table td, .table-wrap tbody td { display: flex; align-items: baseline; gap: 0.5rem; border: 0; padding: 0.125rem 0; position: static !important; background: transparent !important; white-space: normal; }
  .team-table td[data-l]::before, .table-wrap tbody td[data-l]::before { content: attr(data-l); flex: none; width: 6.5rem; font-size: 0.75rem; color: var(--muted); }
  .team-table td:first-child, .table-wrap tbody td:first-child { padding-bottom: 0.375rem; }
  .team-table td.m-hide, .team-table td.eye-cell:empty, .table-wrap tbody td:empty { display: none; }
  .team-table td.eye-cell { justify-content: flex-start; padding-left: 7rem; margin-top: -0.25rem; }
  .team-table td.row-acts { width: auto; justify-content: flex-end; flex-wrap: wrap; padding-top: 0.375rem; }
  .team-table tr.vacant { border-style: dashed; }
  .team-table td:first-child { min-width: 0; }
  select.vac-role { max-width: none; }
  /* fenêtres en plein écran */
  dialog#modal, dialog#modal2 { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  dialog#drawer[open] { width: 100vw; border-radius: 0; }
  dialog#quick { width: 94vw; margin-top: 4vh; }
  .modal-body { padding: 0.875rem 0.875rem 1.25rem; }
  .doc { flex-wrap: wrap; }
  .files .name { max-width: 10rem; }
  .doc-toolbar { position: static; }
  .selbar { left: 0.5rem; right: 0.5rem; transform: none; bottom: 0.5rem; max-width: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .drag-tip { display: none; }
}
a.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
a.btn.primary { color: var(--brand-ink); }

.vrow.cat-validity { padding: 0.375rem 0 0; }
.hist-box { margin-top: 1.375rem; }
.hist-box > summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; list-style: none; }
.hist-box > summary::-webkit-details-marker { display: none; }
.hist-box > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.hist-box[open] > summary::before { transform: rotate(90deg); }
.hist-box > summary h3 { margin: 0; }
.hist-box .hist { margin-top: 0.5rem; }

/* Réglages > Postes : glisser-déposer */
.grip { cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-size: 1.125rem; line-height: 1; padding: 0.25rem 0.375rem; border-radius: 0.375rem; flex: none; }
.grip:hover, .grip:focus-visible { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); outline: none; }
.role-dept, .role-sub { display: flex; align-items: center; gap: 0.375rem; }
.sort-item.dragging { position: fixed; z-index: 60; pointer-events: none; box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, .25); background: var(--card); border-radius: 0.5rem; opacity: .96; }
.sort-ph { border: 2px dashed color-mix(in srgb, var(--brand) 55%, var(--line)); border-radius: 0.5rem; margin: 0.125rem 0.875rem; background: color-mix(in srgb, var(--brand) 6%, transparent); }
.role-list { min-height: 0.5rem; }
body:has(.sort-item.dragging) { cursor: grabbing; user-select: none; }
.dept-card { margin-bottom: 14px; }

/* Recadrage : redresser une photo prise de travers */
.straighten { margin: 0 0 0.625rem; gap: 0.625rem; }
.straighten label { margin: 0; font-size: 0.8125rem; color: var(--ink); font-weight: 600; }
.straighten input[type=range] { flex: 1; min-width: 10rem; accent-color: var(--brand); }
.straighten output { min-width: 3.25rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: var(--muted); }

/* Réglages > Postes : départements repliables */
.roles-tools { margin: 0 0 0.5rem; }
.dept-add { margin-bottom: 0.75rem; }
.dept-toggle { display: inline-flex; align-items: center; gap: 0.5rem; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; padding: 0.125rem 0.25rem; border-radius: 0.375rem; text-align: left; }
.dept-toggle:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.dept-toggle svg { transition: transform .15s; flex: none; color: var(--muted); }
.dept-card.open .dept-toggle svg { transform: rotate(90deg); }
.dept-count { font-weight: 400; font-size: 0.75rem; }
.dept-card:not(.open) .role-dept { border-bottom: 0; border-radius: var(--radius); }
.dept-body { padding-bottom: 0.5rem; }

/* Réglages > Documents */
.howto { margin: 0 0 0.875rem; font-size: 0.8125rem; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.howto ul { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.25rem; }
.cat-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cat-row { display: grid; grid-template-columns: minmax(12rem, 1fr) 8.5rem 20rem 3.5rem; align-items: center; gap: 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.cat-row:hover { border-color: color-mix(in srgb, var(--muted) 50%, var(--line)); }
.cat-name { font-weight: 600; border-color: transparent !important; background: transparent !important; }
.cat-name:hover, .cat-name:focus { border-color: var(--line) !important; background: var(--card) !important; }
.cat-validity { display: flex; align-items: center; gap: 0.375rem; }
.cat-validity select { width: auto; }
.cat-validity input[type=number] { width: 4.25rem; }
.cat-row > .badge { justify-self: center; }
.icon-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0.375rem; border-radius: 0.5rem; display: inline-flex; justify-self: center; }
.icon-del:hover { color: var(--ko); background: var(--ko-bg); }
.cat-add { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.875rem; padding: 0.625rem 0.75rem; border: 1px dashed var(--line); border-radius: 0.75rem; }
.cat-add input[type=text] { flex: 1; min-width: 14rem; }
/* interrupteur (case à cocher en forme de bouton glissant) */
.switch { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; cursor: pointer; font-size: 0.8125rem; color: var(--ink); white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 2.125rem; height: 1.25rem; border-radius: 99px; background: color-mix(in srgb, var(--muted) 35%, var(--card)); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 0.125rem; left: 0.125rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--ok); }
.switch input:checked + .switch-ui::after { transform: translateX(0.875rem); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 760px) { .cat-row { grid-template-columns: 1fr auto; grid-template-areas: 'name name' 'sw del' 'val val'; row-gap: 0.375rem; } .cat-row > .cat-name { grid-area: name; } .cat-row > .switch { grid-area: sw; } .cat-row > .cat-validity { grid-area: val; } .cat-row > .icon-del, .cat-row > .badge { grid-area: del; } }

/* Bouton à mon nom : personnes connectées */
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.online-dot { min-width: 1.125rem; height: 1.125rem; padding: 0 0.25rem; border-radius: 99px; background: #2fbf71; color: #062312; font: 700 0.6875rem/1.125rem system-ui, sans-serif; text-align: center; }
.online-dot[hidden] { display: none; }
.online-pop { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 40; min-width: 15rem; padding: 0.625rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, .2); }
.online-pop .op-h { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 0.375rem; }
.online-pop ul { list-style: none; margin: 0; padding: 0; }
.online-pop li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.25rem; font-size: 0.875rem; }
.op-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 3px color-mix(in srgb, #2fbf71 25%, transparent); flex: none; }
.op-empty { margin: 0.25rem 0.25rem 0; font-size: 0.8125rem; }
.op-link { display: block; width: 100%; margin-top: 0.5rem; padding: 0.4375rem 0.5rem; border: 0; border-top: 1px solid var(--line); background: none; color: var(--brand); font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; }
.op-link:hover { text-decoration: underline; }

/* Appeler ou écrire sur WhatsApp d'un tap : boutons seulement en version téléphone (équipe d'un projet, liste globale) */
.call-acts { display: none; }
@media (max-width: 760px) {
  td[data-l="Téléphone"] { flex-wrap: wrap; }
  .call-acts { display: flex; flex-wrap: wrap; gap: 0.375rem; flex-basis: 100%; margin: 0.25rem 0 0.125rem 7rem; }
  .call-acts .btn { min-height: 2.25rem; padding: 0.3125rem 0.75rem; gap: 0.375rem; }
}

/* Refuser un document déposé par lien : motifs en pastilles, ligne « Refusé » dans la fiche */
.rj-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.check.rj-chip { padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-size: 0.875rem; }
.check.rj-chip:has(input:checked) { border-color: var(--ko); color: var(--ko); background: var(--ko-bg); }
.rej-row { margin: 0.375rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.rej-row b { color: var(--ko); }

/* iPhone et iPad : un champ écrit en moins de 16 px fait zoomer la page dès qu'on le touche (connexion, recherche…),
   et le zoom reste ensuite. Sur un écran tactile, les champs de saisie sont donc toujours à 16 px. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: 16px !important; }
}

/* ---------- Lot du 16/10/2026 : cloche, onglets du téléphone, colonnes de la liste globale, notes, visionneuse, appareils ---------- */
/* Cloche de notifications (barre du haut) */
.notif { position: relative; }
.notif-btn { position: relative; color: var(--tb-muted) !important; }
.notif-btn:hover { color: var(--tb-ink) !important; }
.notif-dot { position: absolute; top: -0.3rem; right: -0.3rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 99px; background: #ff7b83; color: #2b0b0e; font: 700 0.625rem/1.05rem system-ui, sans-serif; text-align: center; }
.notif-dot[hidden] { display: none; }
.notif-pop { min-width: 20rem; max-width: min(24rem, 92vw); max-height: 70vh; overflow-y: auto; }
.nf-list { list-style: none; margin: 0; padding: 0; }
.nf-list li { display: block; padding: 0.5rem 0.5rem 0.5rem 0.875rem; border-top: 1px solid var(--line); font-size: 0.8125rem; position: relative; border-radius: 0.375rem; }
.nf-list li:first-child { border-top: 0; }
.nf-list li.click { cursor: pointer; }
.nf-list li.click:hover, .nf-list li.click:focus-visible { background: color-mix(in srgb, var(--brand) 8%, var(--card)); outline: none; }
.nf-list li.unread::before { content: ""; position: absolute; left: 0.125rem; top: 0.875rem; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--brand); }
.nf-t { line-height: 1.35; }
.nf-d { font-size: 0.75rem; margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-when { font-size: 0.6875rem; margin-top: 0.125rem; }

/* Liste globale : colonnes au choix (menu « Afficher ») */
.people-table.h-phone [data-c=phone], .people-table.h-email [data-c=email], .people-table.h-ville [data-c=ville], .people-table.h-cip [data-c=cip],
.people-table.h-adresse [data-c=adresse], .people-table.h-projets [data-c=projets], .people-table.h-dossier [data-c=dossier], .people-table.h-relance [data-c=relance] { display: none; }
.people-table td { white-space: normal; }
.people-table td:first-child { min-width: 13rem; }
.people-table a.pl { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.people-table a.pl:hover { color: var(--brand); border-bottom-color: var(--brand); }
.head details.menu { margin-right: 0.125rem; }

/* Fiche : fil de notes partagé */
.notes-box { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.625rem 0.75rem; background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.note-add { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.note-add input { flex: 1; }
.notes { list-style: none; margin: 0; padding: 0; max-height: 14rem; overflow-y: auto; }
.notes li { padding: 0.375rem 0; border-top: 1px solid var(--line); font-size: 0.8125rem; }
.notes li:first-child { border-top: 0; }
.notes li.note-empty { padding: 0.125rem 0; }
.note-h { display: flex; align-items: center; gap: 0.25rem; }
.note-h b { font-weight: 600; }
.note-b { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.0625rem; }
.x-note { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.0625rem; line-height: 1; padding: 0 0.375rem; border-radius: 0.375rem; }
.x-note:hover { color: var(--ko); background: var(--ko-bg); }

/* Mon compte : appareils connectés */
.devices { list-style: none; margin: 0; padding: 0; }
.devices li { display: flex; align-items: center; gap: 0.625rem; padding: 0.4375rem 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.devices li:first-child { border-top: 0; }
.devices li.dev-all { justify-content: flex-end; }
.dev-ico { display: inline-flex; color: var(--muted); flex: none; }
.dev-main { flex: 1; min-width: 0; }
.dev-main .sub { font-size: 0.75rem; }

/* Visionneuse plein écran */
dialog.viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: #0b0d12; color: #e8ebf1; display: none; flex-direction: column; color-scheme: dark; }
dialog.viewer[open] { display: flex; }
dialog.viewer::backdrop { background: rgba(0, 0, 0, .7); }
.vw-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.vw-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-sub, .vw-count { color: #98a2b3; font-size: 0.8125rem; }
.vw-x { border: 0; background: none; color: #e8ebf1; font-size: 1.75rem; line-height: 1; cursor: pointer; padding: 0 0.375rem; }
.vw-main { flex: 1; min-height: 0; display: flex; align-items: stretch; }
.vw-arrow { border: 0; background: none; color: #e8ebf1; font-size: 2.5rem; cursor: pointer; padding: 0 0.75rem; opacity: .75; flex: none; }
.vw-arrow:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.vw-arrow[disabled] { opacity: .2; cursor: default; }
.vw-stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 0.5rem; }
.vw-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, .5); background: #fff; }
.vw-stage.zoomed { display: block; }
.vw-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.vw-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 0.25rem; }
.vw-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.625rem 1rem 0.25rem; }
.vw-bar .btn { background: #1b2029; color: #e8ebf1; border-color: #2b323f; }
.vw-bar .btn:hover { border-color: #6b93ff; }
.vw-bar .btn.primary { background: #157f4b; border-color: #157f4b; color: #fff; }
.vw-bar .btn.danger { background: #c0262d; border-color: #c0262d; color: #fff; }
.vw-bar .badge.warn { background: #40300f; color: #fec84b; }
.vw-info { padding: 0.25rem 1rem 0.75rem; font-size: 0.75rem; color: #98a2b3; }
.vw-q { color: #fec84b; }
.fthumb.view { cursor: zoom-in; }
.fthumb.view:hover, .fthumb.view:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Téléphone : barre d'onglets en bas (Projets, Techniciens, À valider, Compte) ; la barre du haut garde le nom, la recherche et la cloche */
.tabbar { display: none; }
.mob-acct { display: flex; flex-direction: column; gap: 0.5rem; }
.mob-acct .btn { text-align: left; justify-content: flex-start; padding: 0.75rem 0.875rem; }
.who-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.who-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
@media (max-width: 760px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-top: 1px solid var(--line); padding: 0.25rem 0 calc(0.25rem + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; min-height: 3.25rem; border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; font-size: 0.6875rem; font-weight: 600; cursor: pointer; position: relative; }
  .tabbar svg { width: 1.375rem; height: 1.375rem; }
  .tabbar .active { color: var(--brand); }
  .tab-badge { position: absolute; top: 0.25rem; left: calc(50% + 0.25rem); min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 99px; background: #fec84b; color: #40300f; font: 700 0.625rem/1.05rem system-ui, sans-serif; text-align: center; font-style: normal; }
  .tab-badge[hidden] { display: none; }
  body { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)); }
  .topbar .nav, .topbar #logout, .topbar .acct, .topbar [data-nav=utilisateurs], .topbar [data-nav=historique], .topbar .trash-link, .topbar #pendBtn { display: none; }
  .topbar .search-btn span, .topbar .search-btn kbd { display: none; }
  #toast { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
  .selbar { bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
  .notif-pop { position: fixed; left: 0.5rem; right: 0.5rem; top: 3.25rem; min-width: 0; max-width: none; }
  .note-add { flex-wrap: wrap; }
  .note-add input { flex-basis: 100%; }
  .vw-arrow { padding: 0 0.25rem; font-size: 2rem; }
}
