/* ---------- Base ---------- */
:root {
  /* ===== Charte des couleurs (voir docs/charte-couleurs.md) : n'utilisez que ces variables ===== */
  /* Neutres : fonds, textes, bordures */
  --bg: #f4f6f8;            /* fond des pages */
  --panel: #ffffff;         /* cartes, fenêtres, barres */
  --subtle: #f1f3f5;        /* fonds secondaires, survols, boutons discrets */
  --border: #e3e6ea;        /* bordures et séparateurs */
  --border-strong: #c9cdd2; /* bordures au survol, interrupteurs éteints, icônes inactives */
  --text: #1f2933;          /* texte principal */
  --muted: #5f6672;         /* texte secondaire, aides */
  /* Couleur d'action unique : boutons principaux, liens, onglet actif, sélection */
  --primary: #1a73e8;
  --primary-dark: #1558b8;  /* survol, texte sur fond clair */
  --primary-soft: #e8f0fe;  /* fonds légers (badges, sélection) */
  /* États : uniquement pour dire « ça va / attention / problème » */
  --success: #2e7d32;  --success-soft: #e3f2e6;   /* présent, publié, validé */
  --warning: #b34d00;  --warning-soft: #fff3e0;   /* peut-être, en attente, proposé */
  --danger: #c62828;   --danger-dark: #a91f1f;  --danger-soft: #fdecea;   /* absent, erreurs, supprimer, pastilles */
  /* Texte posé sur une teinte pâle (--x-soft) : même couleur en clair, plus lumineuse en sombre */
  --primary-ink: #1558b8; --success-ink: #2e7d32; --warning-ink: #b34d00; --danger-ink: #c62828; --match-ink: #6a1b9a; --tag-ink: #00796b; --neutral-ink: #455a64;
  /* Fonds pleins sous un texte blanc (boutons, réponse choisie) : identiques en clair, plus sombres en mode sombre */
  --primary-fill: var(--primary); --success-fill: var(--success); --warning-fill: var(--warning); --danger-fill: var(--danger);
  --brand-ink: #3b8540;  /* nom « Rugbeo » en texte (le vert du terrain est trop pâle pour du texte) */
  --on-color: #ffffff;  /* texte et icônes posés sur une couleur pleine (bouton bleu, pastille…) : blanc dans les deux modes */
  /* Catégories (étiquettes d'information, jamais des boutons) */
  --match: #6a1b9a;    --match-soft: #f3e5f5;     /* matchs */
  --tag: #00796b;      --tag-soft: #e0f2f1;       /* catégories de stratégies */
  --neutral: #455a64;  --neutral-soft: #eceff1;   /* rôles, privé, autres */
  /* Terrain (dessins uniquement) */
  --field: #4a9e4f;
  --field-highlight: #ffd54f; /* cadre en cours de modification sur le terrain */
  /* Graphiques du back-office : ordre fixe des séries (validé daltonisme), « autres » en gris */
  --chart-1: #1a73e8; --chart-2: #1baf7a; --chart-3: #6250d6; --chart-4: #eda100; --chart-5: #e87ba4; --chart-other: #9aa3ad;
  --chart-grid: #e9ecef;
  /* Présentation plein écran (fond noir) et marques extérieures */
  --stage: #000000; --stage-btn: #222222; --stage-border: #444444;
  --whatsapp: #25d366;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); display: flex; flex-direction: column; overflow: hidden; font-size: 14px; padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.topbar {
  height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.btn-back {
  width: 36px; height: 36px; border-radius: 8px; border: none; background: var(--subtle); color: var(--text);
  display: grid; place-items: center;
}
.title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 380px; }
.title-input {
  font-size: 20px; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px;
  min-width: 120px; width: 100%; background: transparent; color: var(--text); text-overflow: ellipsis;
  font-family: inherit; resize: none; overflow: hidden; line-height: 1.2; display: block;
}
.title-input.long { font-size: 15px; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { outline: none; border-color: var(--primary); background: var(--panel); }

.zoom { margin-left: auto; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.zoom button { width: 40px; height: 40px; border: none; background: var(--panel); font-size: 18px; }
.zoom button:hover { background: var(--subtle); }
.zoom span { width: 64px; text-align: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); line-height: 40px; }

.actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  border-radius: 8px; padding: 10px 16px; border: 1px solid transparent; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn.primary { background: var(--primary-fill); color: var(--on-color); }
.btn.primary:hover { background: var(--primary-fill); box-shadow: inset 0 0 0 999px rgba(0,0,0,.14); }   /* assombri au survol, lisible dans les deux modes */
.btn.secondary { background: var(--primary-soft); color: var(--primary-ink); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.outline { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn.outline:hover { background: var(--subtle); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--subtle); }
.btn.ghost:disabled { opacity: .35; cursor: default; background: transparent; }
.btn.icon-only { padding: 8px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }
.btn.danger { background: var(--danger-soft); color: var(--danger-ink); }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 300px; padding: 6px; z-index: 40; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: none; background: transparent; padding: 10px 12px; border-radius: 8px; }
.menu button:hover { background: var(--subtle); }
.menu button span { font-size: 12px; color: var(--muted); }
.progress { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 70; }
.progress .box { background: var(--panel); border-radius: 12px; padding: 20px 26px; min-width: 300px; text-align: center; box-shadow: var(--shadow); }
.progress .bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--primary-fill); transition: width .15s; }

/* ---------- Layout ---------- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }

/* ---------- Palette ---------- */
.sidebar {
  width: 300px; flex: 0 0 auto; background: var(--panel); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 8px 16px 24px;
}
.group { padding: 10px 0 14px; border-bottom: 1px solid var(--border); }
.group:last-child { border-bottom: none; }
.group-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.group-head .mini-wrap { flex: 1 1 100%; }
.group-head h3 { margin: 0; font-size: 15px; }
.select-tool {
  width: 36px; height: 24px; border-radius: 6px; border: none; background: var(--border-strong); color: var(--on-color); display: grid; place-items: center;
}
.select-tool.active { background: var(--primary-fill); }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tool {
  position: relative; aspect-ratio: 1; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--panel);
  display: grid; place-items: center; color: var(--text); padding: 0;
}
.tool:hover { border-color: var(--border-strong); }
.tool.active { border-color: var(--primary-ink); box-shadow: 0 0 0 2px rgba(26,115,232,.25); background: var(--primary-soft); }
.tool svg { width: 32px; height: 32px; }
.tool .key { position: absolute; right: 4px; bottom: 2px; font-size: 10px; color: var(--muted); }
.tool.labeled { aspect-ratio: auto; padding: 6px 2px 4px; gap: 2px; align-content: center; }
.tool .cap { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.1; }
@media (pointer: coarse) { .tool .key, .shortcuts-group { display: none; } }
.advanced summary { cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '▸ '; color: var(--muted); }
.advanced[open] summary::before { content: '▾ '; }
.advanced[open] summary { margin-bottom: 6px; }

/* ---------- Canvas ---------- */
.canvas-area { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; position: relative; }
.canvas-wrap { flex: 1 1 auto; overflow: auto; display: flex; padding: 24px; }
#canvas { display: block; margin: auto; flex: 0 0 auto; border-radius: 18px; box-shadow: var(--shadow); background: var(--field); touch-action: none; user-select: none; }
#canvas.tool-active { cursor: crosshair; }
#canvas .objects > g { cursor: move; }
#canvas .handle { fill: var(--on-color); stroke: var(--primary); stroke-width: 1.5; cursor: nwse-resize; }
#canvas .handle.vertex, #canvas .handle.endpoint { cursor: pointer; }
#canvas .selection-box { fill: none; stroke: var(--primary); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
#canvas .marquee { fill: rgba(26,115,232,.12); stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.fab-left { position: absolute; left: 16px; bottom: 44px; z-index: 6; display: flex; gap: 8px; }
.fab-history { display: flex; position: absolute; left: 16px; top: 12px; z-index: 6; gap: 8px; }
.fab-history button { width: 46px; height: 46px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--panel); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.fab-history button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.fab-history button:disabled { opacity: .35; }
.fab-select, .fab-mode {
  width: 52px; height: 52px; padding: 0;
  display: grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--primary);
  background: var(--panel); color: var(--primary); cursor: pointer;
}
.fab-mode { display: none; border-color: var(--border); color: var(--text); }
.fab-mode.on { border-color: var(--primary); background: var(--primary-fill); color: var(--on-color); }
.fab-select svg { width: 26px; height: 26px; }
.fab-select.tool-on { background: var(--primary-fill); color: var(--on-color); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zoom-fab { display: none; position: absolute; right: 12px; bottom: 68px; flex-direction: column; gap: 6px; z-index: 6; }
.zoom-fab button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); box-shadow: var(--shadow); font-size: 20px; display: grid; place-items: center; color: var(--text); }
.hint { padding: 6px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); background: var(--panel); }

/* Barre de propriétés de l'objet sélectionné */
.props {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 32px);
}
.props .pcount { font-weight: 700; font-size: 13px; padding: 0 4px; color: var(--primary); }
.props .sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.props .pbtn {
  border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 8px; font-size: 13px; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
}
.props .pbtn:hover { background: var(--subtle); }
.props .pbtn.on { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-soft); }
.props .pbtn.danger { color: var(--danger); }
.props .swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.props .swatch.on { box-shadow: 0 0 0 2px var(--primary); }
.props input[type=text] { width: 60px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font: inherit; }
.props input[type=range] { width: 80px; }

/* ---------- Panneau droit ---------- */
.panel { width: 300px; flex: 0 0 auto; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 12px; }
.tab { background: none; border: none; padding: 14px 8px; margin-right: 12px; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tab-content { padding: 16px; overflow-y: auto; flex: 1 1 auto; }
.steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.step-card {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; background: var(--panel);
  display: grid; grid-template-columns: 18px 1fr 28px; gap: 6px; align-items: start;
}
.step-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
.step-card .num { font-size: 12px; color: var(--primary); font-weight: 700; padding-top: 2px; }
.step-card .thumb { width: 100%; aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; background: var(--field); display: grid; place-items: center; }
.step-card .thumb svg { width: 100%; height: 100%; }
.step-card .meta { grid-column: 2; font-size: 12px; color: var(--muted); margin-top: 6px; }
.step-card .meta:empty { display: none; }
.step-card .card-actions { display: flex; flex-direction: column; gap: 4px; }
.step-card .card-actions button { width: 26px; height: 26px; border: none; background: transparent; border-radius: 6px; color: var(--text); display: grid; place-items: center; }
.step-card .card-actions button:hover { background: var(--subtle); }
.step-card .card-actions button.del:hover { color: var(--danger-ink); background: var(--danger-soft); }
.help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.step-opts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.step-opts input[type=text] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
.step-opts-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text); }
.step-opts-row select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
#canvas .handle.curve { fill: var(--on-color); stroke: var(--danger); }
.filter-bar { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.filter-bar input[type=search] { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; width: 100%; background: var(--panel); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--primary-fill); color: var(--on-color); border-color: var(--primary); }
.vis-badge.cat { background: var(--tag-soft); color: var(--tag-ink); }

.field-group { margin-bottom: 18px; }
.label { display: block; font-weight: 600; margin-bottom: 8px; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.choice-row label { display: inline-flex; align-items: center; gap: 6px; }
.shortcuts { margin: 0; padding-left: 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }
kbd { background: var(--subtle); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; font-family: inherit; color: var(--text); }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; overscroll-behavior: contain; background: rgba(15,23,42,.55); display: grid; grid-template-columns: minmax(0, 100%); place-items: center; z-index: 50; padding: 24px; }
.modal-box { overscroll-behavior: contain; background: var(--panel); max-width: 100%; min-width: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: 100%; width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head strong { font-size: 16px; }
/* Fenêtre qui défile en entier : le titre et la croix restent en haut */
.modal-box > .modal-head { position: sticky; top: 0; z-index: 2; background: var(--panel); border-radius: inherit; }
.btn-close { margin-left: auto; border: none; background: transparent; font-size: 18px; width: 32px; height: 32px; border-radius: 8px; }
.btn-close:hover { background: var(--subtle); }
.preview-canvas { padding: 20px; display: grid; place-items: center; background: var(--subtle); min-height: 0; overflow: auto; }
.preview-canvas svg { max-width: 100%; max-height: 65vh; border-radius: 14px; box-shadow: var(--shadow); }
.preview-controls { display: flex; justify-content: center; gap: 10px; padding: 14px; }
.library-box { width: min(760px, 100%); }
.library-list { padding: 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 14px; min-height: 0; }
.lib-card { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); cursor: pointer; }
.lib-card:hover { border-color: var(--primary); }
.lib-card .thumb { aspect-ratio: 16/10; background: var(--field); }
.lib-card .thumb svg { width: 100%; height: 100%; display: block; }
.lib-card .body { padding: 8px 10px; display: flex; align-items: center; gap: 6px; }
.lib-card .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card .date { font-size: 12px; color: var(--muted); padding: 0 10px 8px; }
.lib-card .del { border: none; background: transparent; color: var(--muted); border-radius: 6px; width: 26px; height: 26px; }
.lib-card .del:hover { color: var(--danger-ink); background: var(--danger-soft); }
.library-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--panel); padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); }
/* Au-dessus de la barre d'onglets du téléphone, sans la recouvrir */
@media (max-width: 760px) { .toast { bottom: calc(68px + var(--bar-safe)); } }

/* ---------- Formations ---------- */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.swatches .swatch.on { box-shadow: 0 0 0 3px var(--primary); }
#formation-form .field-group { margin-bottom: 4px; }
.group-head .mini { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; padding: 5px 9px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.group-head .mini:hover { background: var(--subtle); }
.group-head .mini-wrap { display: flex; gap: 6px; }
.group-head .mini { white-space: nowrap; }
.saved-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; }
.saved-row .who { flex: 1 1 auto; min-width: 0; }
.saved-row .who small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Vues & page d'accueil ---------- */
.view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.home-bar .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.home-body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 24px 32px; gap: 12px; max-width: 1100px; width: 100%; margin: 0 auto; }
.home-body > * { flex: 0 0 auto; }
.home-body .library-list, .home-body .member-list { padding: 0; overflow: visible; }
.home-body #home-tabs { padding: 0; border-bottom: 1px solid var(--border); }
.home-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel); }
.home-login { grid-column: 1 / -1; background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.home-login p { margin: 0; color: var(--muted); }
.home-h4 { grid-column: 1 / -1; margin: 8px 0 0; }

/* ---------- Page équipe ---------- */
.select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); max-width: 220px; }
.team-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.team-card h2 { margin: 0; font-size: 20px; flex: 1 1 auto; }
.team-card .code { display: inline-flex; align-items: center; gap: 8px; }
.team-card code { background: var(--subtle); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: 16px; letter-spacing: 3px; }
.team-tabs { border-bottom: 1px solid var(--border); }
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-list .member-row { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.member-row .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.member-row .who { flex: 1 1 auto; min-width: 0; }
.member-row .who small { display: block; color: var(--muted); font-size: 12px; }
.team-forms-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.team-forms-card h4 { margin: 0; }
.team-row-select { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Mode présentation ---------- */
.modal.presenting { padding: 0; background: var(--stage); }
.modal.presenting .modal-box { width: 100%; height: 100%; max-height: none; border-radius: 0; background: var(--stage); }
.modal.presenting .modal-head { display: none; }
.modal.presenting .preview-canvas { background: var(--stage); flex: 1 1 auto; padding: 0; cursor: pointer; }
.modal.presenting .preview-canvas svg { max-height: calc(100vh - 70px); border-radius: 0; box-shadow: none; }
.modal.presenting .preview-controls { background: var(--stage); }
.modal.presenting .preview-controls .btn { background: var(--stage-btn); color: var(--on-color); border-color: var(--stage-border); }
.modal.presenting .preview-controls .btn.primary { background: var(--primary-fill); }

/* ---------- Partage public ---------- */
.share-body { gap: 10px; }
.share-canvas { padding: 0; background: transparent; border-radius: 14px; }
.share-canvas svg { max-height: 70vh; }
.center { text-align: center; }

/* ---------- Commentaires ---------- */
.comments-list { max-height: 50vh; overflow-y: auto; gap: 8px; }
.comment { background: var(--subtle); border-radius: 10px; padding: 8px 12px; }
.comment .who { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.comment .who strong { color: var(--text); }
.comment .body { margin-top: 2px; white-space: pre-wrap; }
.comment .del { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; }
.comments-form { padding: 10px 18px 16px; }
.comments-form input { font-size: 16px; }

/* ---------- Qui a vu ---------- */
.views-list { max-height: 60vh; overflow-y: auto; }
.views-head { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.views-bar { display: block; height: 10px; background: var(--subtle); border-radius: 5px; overflow: hidden; }
.views-bar i { display: block; height: 100%; background: var(--field); border-radius: 5px; }
.view-row { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 12px; flex-wrap: nowrap !important; }
.view-row .who { min-width: 0; }
.view-state { font-size: 13px; font-weight: 700; color: var(--success); white-space: nowrap; }
.view-state.no { color: var(--danger); }
.views-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 16px; }
.views-actions:empty { display: none; }
.views-actions .btn { justify-content: center; }

/* ---------- Notifications push ---------- */
.push-block { display: flex; flex-direction: column; gap: 6px; }
.push-block .small { font-size: 12px; margin: 0; }
#btn-push.on { border-color: var(--primary); color: var(--primary); }

/* ---------- Comptes & équipes ---------- */
.btn.account.logged { color: var(--primary); }
.has-badge { position: relative; }
.has-badge::after { content: attr(data-badge); position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger-fill); color: var(--on-color); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.tabs.small { padding: 0; border: none; flex: 0 0 auto; }
.tabs.small .tab { padding: 10px 6px; font-size: 14px; }
#library-tabs { padding: 0 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.auth-box { width: min(420px, 100%); }
.team-box { width: min(640px, 100%); }
.form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.form input, .inline-form input { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; min-height: 1em; }
.team-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.team-body h4 { margin: 0; }
.team-list { display: flex; flex-direction: column; gap: 6px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; }
.team-row.active { border-color: var(--primary-ink); background: var(--primary-soft); }
.role-badge { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--neutral-soft); color: var(--neutral-ink); }
.role-badge.coach { background: var(--primary-soft); color: var(--primary-dark); }
.role-badge.admin { background: var(--neutral-soft); color: var(--neutral-ink); }
.member-row.pending { border-color: var(--warning-ink); background: var(--warning-soft); }
.select.small { padding: 5px 8px; font-size: 13px; }
.team-members { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--subtle); border-radius: 8px; }
.team-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-head code { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 15px; letter-spacing: 2px; }
.member-row { display: flex; align-items: center; gap: 8px; }
.member-row span:first-child { flex: 1; }
.team-forms { display: flex; flex-direction: column; gap: 8px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
.lib-card .card-btns { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.vis-badge { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--neutral-soft); color: var(--neutral-ink); }
.vis-badge.team { background: var(--success-soft); color: var(--success-ink); }
.vis-badge.proposed { background: var(--warning-soft); color: var(--warning-ink); }

/* ---------- Coquille : en-tête, onglets, barre du bas ---------- */
.hub-bar .brand { flex: 0 1 auto; min-width: 0; }
.hub-bar #hub-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-team { font: inherit; font-size: 15px; font-weight: 700; padding: 6px 28px 6px 10px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); max-width: 220px; }
.hub-tabs { display: flex; gap: 4px; margin: 0 auto; height: 100%; }
.hub-tabs .nav-item { border: none; background: none; padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; position: relative; display: flex; align-items: center; gap: 6px; }
.hub-tabs .nav-item:hover { color: var(--text); }
.hub-tabs .nav-item[aria-current="page"] { color: var(--text); border-bottom-color: var(--primary); }
.hub-bar .actions { margin-left: 0; }
.hub-account { border: none; background: none; padding: 0; display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 999px; font-weight: 600; color: var(--primary); }
.hub-account:not(.logged) { padding: 0 12px; border: 1.5px solid var(--border); }
.hub-account .avatar-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; font-size: 16px; display: grid; place-items: center; border: 2px solid transparent; }
.hub-account.on .avatar-dot { border-color: var(--primary); }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger-fill); color: var(--on-color); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.app-nav { display: none; }

/* ---------- Accueil connecté ---------- */
.hub-hello h1 { margin: 4px 0 0; font-size: 24px; }
.hub-hello p { margin: 2px 0 0; font-size: 15px; }
.hub-slots { display: flex; flex-direction: column; gap: 12px; }
.todo-card { background: var(--panel); border: 2px solid var(--primary); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.todo-card.onboarding { border-color: var(--field); }
.todo-card.loading { border-color: var(--border); }
.todo-head { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.todo-card > p { margin: 0; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 15px; min-height: 52px; }
.todo-head + .todo-row, .progress-line + .todo-row { border-top: none; }
.todo-row .grow { flex: 1 1 auto; min-width: 0; }
.todo-row .btn { flex: 0 0 auto; }
.todo-row.done { color: var(--muted); }
.todo-row.done .grow { text-decoration: line-through; }
.todo-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: 0 0 auto; font-weight: 800; font-size: 13px; color: var(--on-color); }
.todo-row.done .todo-check { background: var(--field); border-color: var(--field); }
.todo-empty { color: var(--muted); font-size: 15px; padding: 4px 0; }
.progress-line { height: 8px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; margin: 2px 0 4px; }
.progress-line i { display: block; height: 100%; background: var(--field); border-radius: 4px; }
.hub-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hub-tiles:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* joueur : 4 tuiles sur une ligne */
.hub-tile { position: relative; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 16px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; min-height: 120px; color: var(--text); }
.hub-tile:hover { border-color: var(--primary); }
.hub-tile svg { width: 30px; height: 30px; color: var(--primary); }
.hub-tile strong { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.hub-tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.hub-tile.soon svg { color: var(--border-strong); }
.hub-tile .soon-tag { position: absolute; top: 10px; right: 10px; }
.soon-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--warning-ink); background: var(--warning-soft); border-radius: 6px; padding: 2px 6px; }

/* ---------- Agenda et convocations ---------- */
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.agenda-list { display: flex; flex-direction: column; gap: 10px; }
.agenda-week { margin: 6px 0 0; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.agenda-empty { margin-top: 0; }
.ev-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; }
.ev-card:hover { border-color: var(--primary); }
.ev-card.cancelled, .ev-detail.cancelled { opacity: .7; }
.ev-card.cancelled .ev-title, .ev-detail.cancelled h2 { text-decoration: line-through; }
.ev-date { border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 0; text-transform: uppercase; font-size: 12px; font-weight: 700; line-height: 1.15; align-self: start; }
.ev-date strong { font-size: 24px; line-height: 1.1; }
.ev-date.match { background: var(--match-soft); color: var(--match-ink); }
.ev-date.other { background: var(--match-soft); color: var(--match-ink); }
.ev-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.ev-kind { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-ink); }
.ev-kind.match { background: var(--match-soft); color: var(--match-ink); }
.ev-kind.other { background: var(--neutral-soft); color: var(--neutral-ink); }
.ev-cancel { font-size: 12px; font-weight: 800; color: var(--danger); text-transform: uppercase; }
.ev-title { font-size: 17px; font-weight: 700; }
.ev-place { font-size: 14px; color: var(--muted); }
.rsvp { display: flex; gap: 6px; margin-top: 6px; }
.rsvp .rsvp-btn { flex: 1 1 0; justify-content: center; padding: 8px 6px; font-size: 14px; background: var(--panel); border: 1.5px solid var(--border); color: var(--text); min-height: 40px; }
.rsvp.big .rsvp-btn { min-height: 48px; font-size: 15px; }
.rsvp .rsvp-btn.yes { border-color: var(--success); color: var(--success); }
.rsvp .rsvp-btn.maybe { border-color: var(--warning); color: var(--warning); }
.rsvp .rsvp-btn.no { border-color: var(--danger); color: var(--danger); }
.rsvp .rsvp-btn.yes[aria-pressed="true"] { background: var(--success-fill); border-color: var(--success); color: var(--on-color); }
.rsvp .rsvp-btn.maybe[aria-pressed="true"] { background: var(--warning-fill); border-color: var(--warning); color: var(--on-color); }
.rsvp .rsvp-btn.no[aria-pressed="true"] { background: var(--danger-fill); border-color: var(--danger); color: var(--on-color); }
.rsvp .rsvp-btn:disabled { opacity: .5; cursor: default; }
.ev-counts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pres-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--neutral-soft); }
.pres-bar i { display: block; height: 100%; }
.pres-bar .y { background: var(--success-fill); } .pres-bar .m { background: var(--warning-fill); } .pres-bar .n { background: var(--danger-fill); }
.pres-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; font-weight: 700; }
.pres-legend .y { color: var(--success); } .pres-legend .m { color: var(--warning); } .pres-legend .n { color: var(--danger); } .pres-legend .w { color: var(--muted); }
.back-link { align-self: flex-start; padding: 6px 4px; color: var(--primary); }
.ev-detail { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ev-detail h2 { margin: 0; font-size: 22px; }
.ev-lines { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.ev-notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--subtle); border-radius: 8px; padding: 8px 10px; font-size: 14px; -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.ev-notes a { color: var(--primary); font-weight: 600; }
.ev-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ev-answer { background: var(--panel); border: 2px solid var(--primary); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ev-comment input { font-size: 15px; }
.ev-who { display: flex; flex-direction: column; gap: 8px; }
.ev-who .home-h4 { margin: 8px 0 0; }
.ev-remind { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-person { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.ev-person .who small { display: block; color: var(--muted); font-size: 13px; }
.form > * { flex-shrink: 0; }   /* une fenêtre plus haute que l’écran défile au lieu d’écraser ses lignes */
.event-form .seg-row { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.event-form .seg-row label { flex: 1 1 0; display: block; font-weight: 600; }
.event-form .seg-row input { position: absolute; opacity: 0; pointer-events: none; }
.event-form .seg-row span { display: block; text-align: center; padding: 10px 6px; font-size: 14px; cursor: pointer; }
.event-form .seg-row input:checked + span { background: var(--primary-fill); color: var(--on-color); }
.event-form .seg-row input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.event-form #ev-match-fields { display: flex; flex-direction: column; gap: 10px; }
.event-form #ev-match-fields.hidden { display: none; }
.form-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.form-row label { min-width: 0; }
.form-row input { width: 100%; min-width: 0; }
/* Safari sur iPhone : les champs date et heure ont une largeur minimale qui fait déborder les fenêtres sur le côté */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 42px; background: var(--panel); color: var(--text); }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.modal-box form { min-width: 0; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.form textarea { font: inherit; font-size: 15px; }
#modal-event .modal-box { max-height: 94%; overflow-y: auto; }
.agenda-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.import-body p { margin: 0; }
.import-body .small { font-size: 13px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn { cursor: pointer; }
.import-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.import-field .select { max-width: none; width: 100%; font-size: 15px; }
.import-sum { font-size: 15px; }
.import-list { display: flex; flex-direction: column; max-height: 40vh; overflow-y: auto; border: 1.5px solid var(--border); border-radius: 10px; }
.import-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 14px; }
.import-row:first-child { border-top: none; }
.import-row .grow { flex: 1 1 auto; min-width: 0; }
.import-date { color: var(--muted); white-space: nowrap; font-size: 13px; min-width: 120px; }
.import-state { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--muted); }
.import-row.new .import-state { color: var(--success); }
.import-row.changed .import-state { color: var(--warning); }
.recur { display: flex; flex-direction: column; gap: 8px; }
.recur-box { display: flex; flex-direction: column; gap: 8px; background: var(--subtle); border-radius: 10px; padding: 10px; }
.recur-box.hidden { display: none; }
.recur-box .help { margin: 0; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips label { display: block; font-weight: 600; }
.day-chips input { position: absolute; opacity: 0; pointer-events: none; }
.day-chips span { display: grid; place-items: center; min-width: 46px; height: 40px; padding: 0 8px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--panel); font-size: 14px; cursor: pointer; }
.day-chips input:checked + span { background: var(--primary-fill); border-color: var(--primary); color: var(--on-color); }
.day-chips input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.ev-foot { display: flex; justify-content: flex-end; margin-top: 2px; }
.ev-quick { padding: 2px 8px; font-size: 13px; color: var(--muted); }
.ev-quick:hover { color: var(--danger); }
.choice-panel { display: flex; flex-direction: column; gap: 8px; background: var(--warning-soft); border: 1.5px solid var(--warning); border-radius: 10px; padding: 10px 12px; }
.choice-panel p { margin: 0; font-weight: 600; }
.choice-panel .row { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row label:first-child { grid-column: 1 / -1; } }

/* ---------- Feuilles de match ---------- */
.page-title { margin: 0; font-size: 22px; }
.sheet-st { font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.sheet-st.none { background: var(--danger-soft); color: var(--danger-ink); }
.sheet-st.draft { background: var(--warning-soft); color: var(--warning-ink); }
.sheet-st.pub { background: var(--success-soft); color: var(--success-ink); }
.sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sheet-status { font-size: 13px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-actions .select { max-width: 200px; }
.sheet-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.sheet-card .muted.small { margin: 0; font-size: 13px; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sheet-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-field input { font: inherit; font-size: 16px; font-weight: 500; color: var(--text); padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.sheet-sq-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sheet-rows { display: flex; flex-direction: column; gap: 4px; }
.sheet-row { display: flex; align-items: center; gap: 8px; }
.sheet-row.bench-start { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sheet-row input.dup { border-color: var(--danger-ink); background: var(--danger-soft); }
.sheet-num { width: 30px; text-align: right; font-weight: 800; color: var(--muted); flex: 0 0 auto; }
.sheet-row input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; }
.sheet-marks { display: flex; gap: 4px; flex: 0 0 auto; }
.sheet-mark { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--panel); font-weight: 800; font-size: 13px; color: var(--muted); padding: 0; }
.sheet-mark.on { background: var(--primary-fill); border-color: var(--primary); color: var(--on-color); }
.sheet-mark.auto { border-style: dashed; cursor: help; }
.sheet-mark.auto.on { border-style: solid; background: var(--warning-fill); border-color: var(--warning); }
.sheet-publish { display: flex; flex-direction: column; gap: 8px; }
.sheet-publish .btn { min-height: 48px; }
.sheet-frame { width: 100%; overflow: hidden; background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; }
.ms-offscreen { position: fixed; left: -10000px; top: 0; width: 760px; }
#modal-sheet-preview .modal-box { width: min(820px, 100%); }
.sheet-settings { gap: 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tpl-card { text-align: left; border: 1.5px solid var(--border); background: var(--panel); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.tpl-card small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.tpl-card.on { border-color: var(--primary-ink); box-shadow: 0 0 0 2px rgba(26,115,232,.2); background: var(--primary-soft); }
.brand-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-callout { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--warning-soft); border: 1.5px solid var(--warning); border-radius: 14px; padding: 12px 16px; font-size: 15px; }
.hub-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; flex: 0 0 auto; }
.logo-box { width: 96px; height: 96px; border-radius: 10px; display: grid; place-items: center; padding: 8px; color: var(--on-color); font-size: 12px; text-align: center; flex: 0 0 auto; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-right { display: flex; flex-direction: column; gap: 8px; }
.row-wrap { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.color-row { display: grid; grid-template-columns: auto 48px; gap: 6px 10px; align-items: center; font-size: 13px; }
.color-row input[type=color] { width: 48px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; background: var(--panel); }
.list-editor { display: flex; flex-direction: column; gap: 6px; }
.list-editor > .btn { align-self: flex-start; }
.list-rows { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: flex; gap: 6px; align-items: center; }
.list-row input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 15px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.list-row input.mark-code { flex: 0 0 52px; text-align: center; font-weight: 800; }
.sheet-settings label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* ---------- Pages « Bientôt » et Compte ---------- */
.soon-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 24px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 560px; width: 100%; margin: 12px auto 0; }
.soon-card h2 { margin: 0; font-size: 22px; }
.soon-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.soon-card p.muted { color: var(--muted); font-size: 13px; }
.soon-icon svg { width: 40px; height: 40px; color: var(--primary); }
.account-page { max-width: 560px; }
.account-card h2 { margin: 0; font-size: 22px; }
.account-card p { margin: 0; }
.account-teams { display: flex; flex-direction: column; gap: 6px; }
.account-team { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.account-actions { display: flex; flex-direction: column; gap: 10px; }
.admin-refresh { align-self: flex-end; }

/* ---------- Accueil visiteur ---------- */
.hero { grid-column: 1 / -1; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.hero ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: var(--text); }
.hero li::before { content: '✓'; color: var(--field); font-weight: 800; margin-right: 8px; }
.hero .hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .hero-btns .btn { padding: 0 22px; font-size: 16px; min-height: 48px; }
.hero small { color: var(--muted); font-size: 14px; }
.link { color: var(--primary); font-weight: 600; }
@media (max-width: 900px) { .hero { padding: 18px; } .hero h1 { font-size: 22px; } .hero .hero-btns .btn { flex: 1 1 100%; justify-content: center; } }

/* ---------- Cadrage par étape ---------- */
.frame-layer { pointer-events: none; }
.frame-mask { fill: rgba(15, 23, 42, .45); }
.frame-box { fill: transparent; stroke: var(--on-color); stroke-width: 3; stroke-dasharray: 12 8; }
.frame-label { fill: var(--on-color); font: 700 16px Arial, Helvetica, sans-serif; paint-order: stroke; stroke: rgba(15,23,42,.6); stroke-width: 3px; }
.frame-layer.editing .frame-mask { fill: rgba(15, 23, 42, .6); }
.frame-layer.editing .frame-box { pointer-events: all; cursor: move; stroke: var(--field-highlight); stroke-dasharray: none; }
.frame-layer.editing .frame-handle { pointer-events: all; fill: var(--field-highlight); stroke: var(--text); stroke-width: 2; cursor: nwse-resize; }
.frame-layer.editing .frame-handle[data-frame=ne], .frame-layer.editing .frame-handle[data-frame=sw] { cursor: nesw-resize; }
.frame-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; width: min(640px, calc(100% - 24px)); }
.frame-help { color: var(--muted); font-size: 13px; }
.frame-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.frame-btns #frame-ok { margin-left: auto; }

/* ---------- Annonces ---------- */
.announce-bar { flex: 0 0 auto; display: flex; flex-direction: column; }
.announce { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; border-bottom: 1px solid var(--primary-soft); }
.announce.warning { background: var(--warning-soft); color: var(--warning-ink); border-bottom-color: var(--warning-ink); }
.announce span { flex: 1 1 auto; }
.announce .btn { color: inherit; }

/* ---------- Avis ---------- */
.admin-textarea { font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; width: 100%; }
#feedback-mine:empty { display: none; }
.fb-status { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--neutral-soft); color: var(--neutral-ink); }
.fb-status.new { background: var(--primary-soft); color: var(--primary-dark); }
.fb-status.planned { background: var(--warning-soft); color: var(--warning-ink); }
.fb-status.done { background: var(--success-soft); color: var(--success-ink); }
.fb-reply { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* ---------- Back-office ---------- */
.admin-page { max-width: 1300px; }
.admin-tabs { border-bottom: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }
.admin-body { display: flex; flex-direction: column; gap: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 24px; }
.kpi small { color: var(--muted); font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.admin-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-card h4 { margin: 0 0 4px; }
.admin-card.wide { grid-column: 1 / -1; }
.admin-card .small, .admin-body .small { font-size: 12px; margin: 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 38%) 1fr minmax(36px, auto); align-items: center; gap: 8px; font-size: 13px; }
.bar-name { overflow-wrap: anywhere; line-height: 1.3; }
.bar-track { height: 10px; background: var(--subtle); border-radius: 5px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--primary-fill); border-radius: 5px; }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.col-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.col-chart .col { flex: 1 1 0; max-width: 32px; height: 100%; display: flex; align-items: flex-end; }
.col-chart .col i { display: block; width: 100%; background: var(--primary-fill); border-radius: 3px 3px 0 0; }
.col-axis { display: flex; justify-content: space-between; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-search { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; width: 100%; max-width: 480px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-form input { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; flex: 1 1 160px; min-width: 0; }
.admin-table-wrap { overflow-x: auto; background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px; }
.admin-card .admin-table-wrap { border: none; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--subtle); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table code { background: var(--subtle); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; letter-spacing: 1px; }
.fb-card.new { border-color: var(--primary); }
.fb-card.done, .fb-card.rejected { opacity: .75; }
.fb-head { font-size: 13px; }
.fb-msg { margin: 0; white-space: pre-wrap; font-size: 15px; }
.fb-form { display: flex; flex-direction: column; gap: 6px; }
.err-card summary { cursor: pointer; font-size: 13px; }
.err-card pre { font-size: 11px; background: var(--subtle); padding: 8px; border-radius: 6px; overflow-x: auto; margin: 0; }

/* ---------- Mobile ---------- */
.mobile-bar { display: none; }

@media (max-width: 900px) {
  .topbar { height: 52px; gap: 6px; padding: 0 8px; }
  .zoom { display: none; }
  .hint { display: none; position: absolute; top: 120px; left: 50%; transform: translateX(-50%); z-index: 7; border: none; border-radius: 999px; background: var(--text); color: var(--panel); font-size: 13px; padding: 6px 14px; max-width: calc(100% - 24px); text-align: center; box-shadow: var(--shadow); }
  .hint.tool-on { display: block; }
  body:has(#props:not(.hidden)) .hint.tool-on { display: none; }   /* ne cache pas « Supprimer » quand un objet est sélectionné */
  .btn-back { width: 40px; height: 40px; flex: 0 0 auto; }
  .title-wrap { flex: 1 1 auto; min-width: 0; }
  .title-input { width: 100%; min-width: 0; font-size: 16px; padding: 2px 6px; line-height: 1.15; }
  .title-input.long { font-size: 14px; }
  /* Téléphone : le nom du dessin a sa propre ligne, à droite d'Annuler / Rétablir (plus coupé par les boutons) */
  #view-editor { position: relative; }
  #view-editor .title-wrap { position: absolute; top: 64px; left: 140px; right: 10px; height: 50px; z-index: 6; }
  /* Le nom se lit comme un titre (souligné en pointillés, crayon) ; en le touchant, il devient un champ */
  #view-editor .title-input { background: transparent; border: 1.5px solid transparent; border-bottom: 1.5px dashed var(--border-strong); border-radius: 8px 8px 0 0; min-height: 0; font-weight: 700; padding: 4px 28px 4px 6px; }
  #view-editor .title-input:focus { background: var(--panel); border-color: var(--primary); border-radius: 8px; }
  #view-editor .title-wrap::after { content: '✎'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
  #view-editor .title-wrap:focus-within::after { display: none; }
  .actions { margin-left: auto; gap: 4px; flex: 0 0 auto; }
  .actions .btn { padding: 4px 8px; flex-direction: column; gap: 1px; font-size: 11px; font-weight: 600; }
  .actions .btn > span { display: block; line-height: 1.1; }
  .actions .btn .long { display: none; }
  #btn-account { display: none; }
  .home-bar { gap: 8px; }
  .home-bar .brand { gap: 6px; flex: 1 1 auto; min-width: 0; }
  .home-bar .brand strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-bar .actions .btn { flex-direction: row; padding: 0 12px; font-size: 14px; gap: 6px; }
  .home-bar .actions .btn span { display: inline; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-bar #home-new .long, .home-bar #home-team .long, .home-bar #home-feedback .long { display: none; }
  .home-bar #home-new .only-short { display: inline; }
  .hub-tabs { display: none; }
  .app-nav { display: flex; flex: 0 0 auto; background: var(--panel); border-top: 1px solid var(--border); padding-bottom: var(--bar-safe); }
  .app-nav .nav-item { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); padding: 6px 0 8px; position: relative; min-height: 56px; }
  .app-nav .nav-item svg { width: 24px; height: 24px; }
  .app-nav .nav-item[aria-current="page"] { color: var(--primary); font-weight: 700; }
  .app-nav .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .hub-team { max-width: 170px; font-size: 14px; }
  .hub-bar .actions { margin-left: auto; }
  .hub-tiles, .hub-tiles:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hub-tile { min-height: 112px; padding: 14px 12px; }
  .todo-row { font-size: 14px; }
  .home-bar #home-feedback { padding: 8px 6px; }
  .home-bar .select { max-width: 150px; font-size: 13px; }
  .team-card h2 { font-size: 18px; }
  .home-body { padding: 12px 12px 32px; }
  .fab-history { left: 12px; }
  .props { top: 66px; }
  .mobile-bar .has-badge::after { top: 4px; right: 12px; }
  .mobile-bar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Modales en feuilles plein écran */
  .modal { padding: 0; align-items: end; }
  /* Fenêtre collée en bas : marge pour la barre d'accueil de l'iPhone (retirée quand le clavier est ouvert) */
  .modal-box { width: 100%; max-height: 94%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  /* Clavier ouvert : la fenêtre blanche continue derrière le clavier (pas de page visible dessous) ;
     son contenu défile dans la partie visible, au-dessus du clavier */
  html.kb-open .modal-box { padding-bottom: var(--vv-bottom, 0px); max-height: 100%; }
  /* Clavier ouvert : le fond grisé couvre tout l'écran, la fenêtre se place dans la partie visible au-dessus du clavier */
  html.kb-open .modal { padding-top: var(--vv-top, 0px); }
  .modal-head { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .modal-head .btn-close { order: 99; }
  .team-box, .auth-box, .library-box, .preview-box { width: 100%; }
  .team-body { padding: 12px 14px; }
  .team-row, .member-row, .team-head { flex-wrap: wrap; }
  .team-row > div { flex: 1 1 100%; }
  .member-row span:first-child { flex: 1 1 100%; }
  .inline-form { flex-direction: column; }
  .inline-form .btn { width: 100%; justify-content: center; }
  #team-user { width: 100%; font-size: 12px; }
  .tabs.small { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
  .tabs.small .tab { white-space: nowrap; margin-right: 4px; }
  .library-list { grid-template-columns: 1fr; padding: 12px; gap: 16px; min-width: 0; }
  .lib-card { min-width: 0; }
  .lib-card .thumb svg { width: 100%; height: 100%; }
  /* Téléphone : carte en ligne, petite miniature à gauche, pour voir plusieurs stratégies d'un coup */
  .lib-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "thumb body" "thumb date" "thumb btns"; align-items: start; grid-template-rows: auto auto 1fr; }
  .lib-card .thumb { grid-area: thumb; aspect-ratio: auto; height: 100%; min-height: 84px; border-radius: 9px 0 0 9px !important; }
  .lib-card .thumb svg { object-fit: cover; }
  /* Cartes aérées : plus de marge intérieure, nom et infos espacés, boutons séparés des infos */
  .lib-card .body { grid-area: body; padding: 14px 14px 4px; }
  .lib-card .date { grid-area: date; padding: 2px 14px 10px; line-height: 1.5; }
  .lib-card .card-btns { grid-area: btns; padding: 4px 14px 14px; gap: 8px; flex-wrap: nowrap; align-items: center; }
  /* Boutons des cartes : plus petits, tous sur une ligne (« Vue par… », commentaires, ⋯), le ⋯ toujours à droite */
  .lib-card .card-btns .btn { min-height: 34px; padding: 4px 10px; font-size: 13px; white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .lib-card .card-btns .btn:last-child { margin-left: auto; flex: 0 0 auto; }
  .menu { min-width: 250px; }
  .menu button span { display: block; }

  .layout { position: relative; }
  .canvas-area { padding-bottom: calc(56px + var(--bar-safe)); }
  /* Place réservée en haut (Annuler, Rétablir, nom) et en bas (sélection, zoom) : le terrain n'est jamais dessous */
  .canvas-wrap { padding: 66px 8px 64px; }
  #canvas { border-radius: 10px; }
  .props { top: 6px; left: 6px; right: 6px; transform: none; max-width: none; padding: 4px 6px; gap: 4px; }
  .props input[type=text] { font-size: 16px; width: 52px; }
  .props .pbtn { padding: 5px 7px; }

  .sidebar, .panel {
    position: fixed; left: 0; right: 0; bottom: calc(56px + var(--bar-safe)); width: auto; height: 46vh;
    border: none; border-top: 1px solid var(--border); border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,.14); transform: translateY(120%); transition: transform .25s ease; z-index: 30;
  }
  .sidebar.open, .panel.open { transform: none; }
  .sidebar { padding: 4px 12px 16px; }
  .group { padding: 8px 0 10px; }
  .tools { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
  .tool svg { width: 28px; height: 28px; }
  .tab-content { padding: 12px; }

  .zoom-fab { display: flex; }
  .fab-left { left: 12px; bottom: calc(68px + var(--bar-safe)); }
  .zoom-fab { bottom: calc(68px + var(--bar-safe)); }
  .fab-select, .fab-mode { width: 50px; height: 50px; }
  .fab-left.with-modes .fab-mode { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 56px; }
  .props .pbtn { padding: 6px 8px; }
  .mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(56px + var(--bar-safe)); z-index: 35;
    background: var(--panel); border-top: 1px solid var(--border); padding-bottom: var(--bar-safe);
  }
  .mobile-bar button { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); }
  .step-card .thumb { max-height: 120px; }
  .choice-row #drawing-tags { max-width: none; flex: 1 1 100%; }
  .mobile-bar button.active { color: var(--primary); }

  .preview-canvas { padding: 8px; }
  .preview-controls { flex-wrap: wrap; gap: 6px; padding: 10px; }
  .preview-controls .btn { padding: 0 12px; font-size: 14px; }
}

@media (max-width: 700px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .admin-table td { border: none; padding: 3px 12px; display: flex; gap: 10px; }
  .admin-table td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: 12px; }
  .admin-table td:last-child::before { content: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi strong { font-size: 20px; }
}

/* =====================================================================
   Système commun : tailles des boutons, champs et espacements
   (une seule règle pour toute l'appli, mobile et ordinateur)
   ===================================================================== */
/* ===== Mode sombre (Compte → Réglages : Clair / Sombre / Automatique ; voir docs/charte-couleurs.md) =====
   Même rôle pour chaque variable que dans le mode clair. « Automatique » (par défaut) suit le réglage du téléphone.
   Les impressions et les exports (feuille de match, PDF, images du terrain) restent toujours en clair. */
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b22; --subtle: #1d252e; --border: #2a333d; --border-strong: #46515d;
  --text: #e6edf3; --muted: #9da7b3;
  --primary: #4d94f0; --primary-dark: #7cb0ff; --primary-soft: #19304e;
  --success: #45a84b; --success-soft: #1c3427;
  --warning: #e0701a; --warning-soft: #3e291b;
  --danger: #e65c5c; --danger-dark: #ff7b7b; --danger-soft: #40252b;
  --primary-fill: #1a6fd0; --success-fill: #2f8034; --warning-fill: #b34d00; --danger-fill: #c43c3c; --brand-ink: #5bb361;
  --match: #ac54e1; --match-soft: #36284c;
  --tag: #008c7c; --tag-soft: #103436;
  --neutral: #63818f; --neutral-soft: #26313a;
  --primary-ink: #80b1f2; --success-ink: #5bc361; --warning-ink: #ff8f3b; --danger-ink: #e99595; --match-ink: #ce99ed; --tag-ink: #00c4ae; --neutral-ink: #9db2bb;
  --chart-grid: #2a333d; --chart-other: #6b7580;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
  --bg: #0d1117; --panel: #151b22; --subtle: #1d252e; --border: #2a333d; --border-strong: #46515d;
  --text: #e6edf3; --muted: #9da7b3;
  --primary: #4d94f0; --primary-dark: #7cb0ff; --primary-soft: #19304e;
  --success: #45a84b; --success-soft: #1c3427;
  --warning: #e0701a; --warning-soft: #3e291b;
  --danger: #e65c5c; --danger-dark: #ff7b7b; --danger-soft: #40252b;
  --primary-fill: #1a6fd0; --success-fill: #2f8034; --warning-fill: #b34d00; --danger-fill: #c43c3c; --brand-ink: #5bb361;
  --match: #ac54e1; --match-soft: #36284c;
  --tag: #008c7c; --tag-soft: #103436;
  --neutral: #63818f; --neutral-soft: #26313a;
  --primary-ink: #80b1f2; --success-ink: #5bc361; --warning-ink: #ff8f3b; --danger-ink: #e99595; --match-ink: #ce99ed; --tag-ink: #00c4ae; --neutral-ink: #9db2bb;
  --chart-grid: #2a333d; --chart-other: #6b7580;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
  }
}
@media print {
  :root, :root[data-theme] {
  --bg: #f4f6f8; --panel: #ffffff; --subtle: #f1f3f5; --border: #e3e6ea; --border-strong: #c9cdd2;
  --text: #1f2933; --muted: #5f6672;
  --primary: #1a73e8; --primary-dark: #1558b8; --primary-soft: #e8f0fe;
  --primary-fill: #1a73e8; --success-fill: #2e7d32; --warning-fill: #b34d00; --danger-fill: #c62828; --brand-ink: #3b8540;
  --success: #2e7d32; --success-soft: #e3f2e6;
  --warning: #b34d00; --warning-soft: #fff3e0;
  --danger: #c62828; --danger-dark: #a91f1f; --danger-soft: #fdecea;
  --match: #6a1b9a; --match-soft: #f3e5f5;
  --tag: #00796b; --tag-soft: #e0f2f1;
  --neutral: #455a64; --neutral-soft: #eceff1;
  --primary-ink: #1558b8; --success-ink: #2e7d32; --warning-ink: #b34d00; --danger-ink: #c62828; --match-ink: #6a1b9a; --tag-ink: #00796b; --neutral-ink: #455a64;
  --chart-grid: #e9ecef; --chart-other: #9aa3ad;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  color-scheme: light;
  }
}
:root { --tap: 44px; --tap-sm: 44px; --gap: 8px; --radius-btn: 10px; }   /* 44 px au doigt (recommandation d'accessibilité) */
@media (pointer: fine) { :root { --tap: 40px; --tap-sm: 36px; } }

/* Boutons : texte centré, marges intérieures identiques des deux côtés */
.btn { min-height: var(--tap); padding: 0 18px; font-size: 15px; line-height: 1.2; border-radius: var(--radius-btn); justify-content: center; text-align: center; gap: 8px; }
.btn.small { min-height: var(--tap-sm); padding: 0 14px; font-size: 14px; }
.btn.icon-only { width: var(--tap); padding: 0; }
.btn.ghost.back-link { min-height: var(--tap-sm); padding: 0 12px 0 4px; justify-content: flex-start; }
.btn-close { width: var(--tap-sm); height: var(--tap-sm); }
.ev-quick { min-height: var(--tap-sm); padding: 0 12px; }
.announce .btn { min-height: 32px; padding: 0 10px; }
button:focus-visible, .btn:focus-visible, a:focus-visible, label.btn:focus-within { outline: 3px solid rgba(26,115,232,.45); outline-offset: 2px; }

/* Champs de saisie : même hauteur partout, 16 px (pas de zoom automatique sur iPhone) */
.form input, .inline-form input, .admin-search, .admin-form input, .sheet-field input, .sheet-row input, .list-row input,
.ev-comment input, .filter-bar input[type=search], #comments-input, .step-opts input[type=text] { min-height: var(--tap); font-size: 16px; }
.select { min-height: var(--tap); font-size: 15px; }
.select.small { min-height: var(--tap-sm); font-size: 14px; }
.hub-team { min-height: var(--tap-sm); }

/* Groupes de boutons : même écart partout */
.sheet-actions, .ev-tools, .card-btns, .admin-actions, .row-wrap, .agenda-acts, .ev-remind, .hero-btns, .choice-panel .row,
.preview-controls, .admin-filters, .actions, .rsvp, .day-chips, .frame-btns { gap: var(--gap); }

/* « À faire » : boutons de même largeur, alignés à droite */
.todo-row .btn { min-width: 112px; }
.todo-row .btn.pair { min-width: 64px; }

/* Feuille de match : lignes et repères plus aérés */
.sheet-rows { gap: 8px; }
.sheet-marks { gap: 6px; }
.sheet-mark { width: var(--tap-sm); height: var(--tap-sm); }

/* Éditeur : boutons des étapes et options */
.step-card .card-actions { gap: 6px; }
.step-card .card-actions button { width: 36px; height: 36px; }
.step-card { grid-template-columns: 18px 1fr 36px; }
.step-opts-row select { min-height: 36px; }
.group-head .mini { min-height: var(--tap-sm); padding: 0 12px; }
.title-input { min-height: 40px; }

/* Liens d'action dans le détail d'un événement */
.ev-lines a.link { display: inline-flex; align-items: center; min-height: var(--tap-sm); }

.lib-card { overflow: visible; }
.lib-card .thumb { border-radius: 9px 9px 0 0; overflow: hidden; }

/* Logo / nom en haut à gauche : retour à l'accueil */
.hub-bar .brand.home-link { cursor: pointer; border-radius: 10px; padding: 4px 6px; margin-left: -6px; }
.hub-bar .brand.home-link:hover { background: var(--subtle); }
.todo-more { align-self: flex-start; margin-top: 4px; color: var(--primary); padding: 0 8px; }
.tab .tab-badge { margin-left: 6px; vertical-align: 1px; }

/* =====================================================================
   Listes déroulantes : flèche de l'appli (même marge partout) et menu aux couleurs du site
   ===================================================================== */
select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 14px center !important; background-size: 12px 8px !important;
  padding-left: 12px !important; padding-right: 38px !important;
}
select.small, .select.small, .step-opts-row select { background-position: right 12px center !important; padding-left: 10px !important; padding-right: 32px !important; }
select:hover { border-color: var(--border-strong); }
select[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
select:disabled { opacity: .5; cursor: default; }

.rs-pop { position: fixed; z-index: 120; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); padding: 6px; overflow-y: auto; display: flex; flex-direction: column; }
.rs-list { display: flex; flex-direction: column; gap: 2px; }
.rs-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: var(--tap-sm); padding: 0 12px; border: none; background: none; border-radius: 8px; font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer; }
.rs-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-opt svg { flex: 0 0 auto; }
.rs-opt:hover, .rs-opt:focus-visible { background: var(--primary-soft); outline: none; }
.rs-opt.on { color: var(--primary); font-weight: 600; }
.rs-opt:disabled { opacity: .4; cursor: default; }
.rs-group { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px 4px; }
.rs-back { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 119; }
.rs-pop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; border: none; padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px)); animation: rs-up .18s ease-out; }
.rs-pop.sheet .rs-opt { min-height: 50px; font-size: 16px; }
.rs-title { font-weight: 700; font-size: 16px; padding: 8px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
@keyframes rs-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rs-pop.sheet { animation: none; } }

/* En-tête des pages : 3 colonnes fixes, les onglets restent centrés quelle que soit l'action à droite */
.hub-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "brand tabs actions"; }
.hub-bar .brand { grid-area: brand; justify-self: start; max-width: 100%; }
.hub-bar .hub-tabs { grid-area: tabs; margin: 0; }
.hub-bar .actions { grid-area: actions; justify-self: end; }
@media (max-width: 900px) { .hub-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions"; } }

/* Boutons sous un trait de séparation ou au-dessus : jamais collés au trait */
.agenda-head { padding-bottom: 12px; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--gap); justify-content: flex-end; }
.page-tabs { border-bottom: 1px solid var(--border); }
@media (max-width: 600px) { .page-actions .btn { flex: 1 1 auto; } }
.sheet-head { padding-bottom: 4px; }
.step-opts { padding-top: 10px; }
.card-more { margin-left: auto; min-width: var(--tap-sm); font-size: 18px; letter-spacing: 1px; }
.rs-opt.danger { color: var(--danger); }
.vis-badge.share-app { background: var(--warning-soft); color: var(--warning-ink); }
.vis-badge.share-download { background: var(--primary-soft); color: var(--primary-dark); }
.share-card .select { max-width: 320px; }
.share-card p { margin: 0; }

/* Profil */
.avatar.photo { padding: 0; overflow: hidden; background: var(--neutral-soft); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-account .avatar-dot.photo { padding: 0; overflow: hidden; }
.hub-account .avatar-dot.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.account-id { display: flex; align-items: center; gap: 14px; }
.account-id .avatar { width: 64px; height: 64px; font-size: 26px; }
.account-who { min-width: 0; }
.account-who p { margin: 2px 0 0; }
.member-row.clickable { cursor: pointer; }
.member-row.clickable:hover { border-color: var(--primary); }
.profile-photo { display: flex; align-items: center; gap: 14px; padding: 4px 18px 0; }
.profile-photo .avatar { width: 72px; height: 72px; font-size: 28px; flex: 0 0 auto; }
.profile-form { gap: 14px; }
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-label { font-weight: 600; font-size: 13px; }
.poste-chips span { min-width: 0; padding: 0 12px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.profile-private-head { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 14px; font-size: 14px; }
.member-head { display: flex; align-items: center; gap: 14px; }
.member-head .avatar { width: 72px; height: 72px; font-size: 28px; flex: 0 0 auto; }
.member-head h2 { margin: 0; font-size: 20px; }
.member-head p { margin: 2px 0 0; }
.member-bio { margin: 0; white-space: pre-wrap; }
.member-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.member-facts div { background: var(--subtle); border-radius: 10px; padding: 8px 10px; }
.member-facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.member-facts dd { margin: 2px 0 0; font-weight: 600; }
.member-facts.private { border-top: 1px solid var(--border); padding-top: 10px; }
.member-facts .facts-title { grid-column: 1 / -1; background: none; padding: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 520px) { .form-row.two { grid-template-columns: 1fr; } }
/* Avatar (photo ou initiale) partout dans l'appli */
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.profile-form .select { max-width: none; width: 100%; }
.profile-form textarea { width: 100%; }

/* Fenêtres de dialogue de l'appli (remplacent celles du navigateur) */
.dialog-modal { z-index: 130; }
.dialog-box { width: min(440px, 100%); }
.dialog-form { gap: 14px; }
.dialog-msg { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.dialog-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.dialog-field.hidden, .dialog-text.hidden, .dialog-msg.hidden, .dialog-choices.hidden, .dialog-ok.hidden { display: none; }
.dialog-choices { display: grid; gap: 10px; }
/* « Vue par 3/4 » dans la ligne d'infos d'une carte de stratégie : lien, pas bouton */
.card-views.btn { display: inline; min-height: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--primary-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.home-ffr { display: block; text-align: center; margin: 14px auto 0; font-weight: 600; }
.dialog-choices .btn { width: 100%; min-width: 0; justify-content: center; min-height: 56px; white-space: normal; text-align: center; }
.dialog-text { font: inherit; font-size: 14px; width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--gap); flex-wrap: wrap; }
.btn.primary.danger-solid { background: var(--danger-fill); }
.btn.primary.danger-solid:hover { background: var(--danger-fill); box-shadow: inset 0 0 0 999px rgba(0,0,0,.14); }
@media (max-width: 600px) { .dialog-actions .btn { flex: 1 1 0; } }

/* Fenêtres : le contenu défile toujours si la fenêtre est plus petite que lui */
.modal-box > .team-body, .modal-box > .form, .modal-box > .preview-canvas { min-height: 0; overflow-y: auto; }
.modal-box > .team-body, .modal-box > .form { flex: 1 1 auto; }
#modal-profile .modal-box, #modal-member .modal-box { width: min(680px, 100%); }

/* Onglets de page posés sur un trait de séparation (Agenda, comme Stratégies) */
.tabs.small.page-tabs { border-bottom: 1px solid var(--border); }

/* Éditeur : boutons du groupe Formations sur deux colonnes égales, texte jamais coupé */
.group-head .mini-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); width: 100%; }
.group-head .mini { white-space: normal; text-align: center; justify-content: center; line-height: 1.15; min-width: 0; }

/* Invitation */
.invite-body { gap: 12px; }
.invite-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--subtle); border-radius: 12px; padding: 12px 14px; }
.invite-code span { flex: 1 0 100%; font-size: 13px; }
.invite-code strong { font-size: 28px; letter-spacing: 6px; font-variant-numeric: tabular-nums; flex: 1 1 auto; }
.invite-label { font-weight: 600; font-size: 13px; }
.invite-msg { width: 100%; font-size: 15px; }
.invite-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.invite-links .btn { width: 100%; text-decoration: none; }
/* Une fenêtre ne dépasse jamais la hauteur de l'écran ; son contenu défile */
.modal-box { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; }
@media (max-width: 900px) { .modal-box { max-height: 94%; } }

/* Réglages du dessin : sections aérées, contrôles modernes */
.settings-pane { display: flex; flex-direction: column; gap: 0; padding: 4px 16px 24px; }
.set-section { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.set-section:last-child { border-bottom: none; }
.set-title { margin: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.set-help { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.settings-pane .select, .set-input { width: 100%; max-width: none; }
.set-input { font: inherit; font-size: 16px; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.segmented { display: flex; background: var(--subtle); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented label { flex: 1 1 0; display: block; position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: calc(var(--tap-sm) - 4px); border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.set-range { display: flex; align-items: center; gap: 12px; }
.set-range input[type=range] { flex: 1 1 auto; accent-color: var(--primary); height: 28px; }
.set-range output { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--subtle); border-radius: 8px; padding: 4px 8px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch-row strong { display: block; font-size: 15px; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch { -webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--border-strong); position: relative; flex: 0 0 auto; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--on-color); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--primary-fill); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 3px solid rgba(26,115,232,.45); outline-offset: 2px; }
.set-details summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.set-details summary::-webkit-details-marker { display: none; }
.set-details summary::after { content: ''; width: 12px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; transition: transform .15s; }
.set-details[open] summary::after { transform: rotate(180deg); }
.set-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (prefers-reduced-motion: reduce) { .segmented span, .switch, .switch::after, .set-details summary::after { transition: none; } }

/* Barre d'onglets + actions (Agenda) : un seul trait, boutons décollés du trait */
.page-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.page-bar .tabs.small { border: none; }
.page-bar .page-actions { padding-bottom: 10px; }
@media (max-width: 600px) { .page-bar .page-actions { order: -1; width: 100%; padding: 0 0 6px; } .page-bar .page-actions .btn { flex: 1 1 0; } }

/* Invitation : plus large sur ordinateur, partage en icônes */
#modal-invite .modal-box { width: min(560px, 100%); }
.invite-icons { display: flex; justify-content: center; gap: 16px; padding: 4px 0; }
.invite-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; padding: 0; }
.invite-icon svg { width: 26px; height: 26px; }
.invite-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.invite-icon:hover { border-color: var(--primary); }
.invite-icon.whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: var(--on-color); }
.invite-icon.sms { color: var(--primary); }
.invite-icon.email { color: var(--muted); }
.saved-help { margin: 0; }

/* Éditeur : « Mes formations » sous le titre, en petit groupe */
.group-head .mini.mini-block { flex: 1 1 100%; width: 100%; }

/* Page Équipe */
.team-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-title h2 { margin: 0; font-size: 22px; }
.members-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Réglages : cartes de même largeur et, sur grand écran, de même hauteur ; les actions s'alignent en bas */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: stretch; }
@media (min-width: 700px) { .settings-grid { grid-auto-rows: 1fr; } }
.set-card { gap: 10px; }
.set-card .set-title { margin: 0; }
.set-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.set-foot .set-input { flex: 1 1 150px; width: auto; min-width: 0; }
.set-foot .select { flex: 1 1 100%; max-width: none; }
.set-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.code-big { font-size: 26px; font-weight: 800; letter-spacing: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.forms-head { display: flex; align-items: center; gap: 8px; }
.set-card.danger-zone { border-color: var(--danger-soft); }
.set-card.danger-zone .set-title { color: var(--danger); }
.account-join { display: flex; flex-direction: column; gap: 10px; }

/* Éditeur : formations en 2 colonnes, icône et nom côte à côte, toutes de la même taille */
.tools.tools-formations { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tools-formations .tool.labeled { display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 6px; min-height: var(--tap); min-width: 0; }
.tools-formations .tool.labeled svg { width: 26px; height: 26px; flex: none; }
.tools-formations .tool .cap { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Confidentialité */
.legal-box { width: min(680px, 100%); }
.legal-tabs { padding: 0 14px; overflow-x: auto; flex: 0 0 auto; white-space: nowrap; }
.legal-tabs .tab { flex: 0 0 auto; }
.legal-body { overflow-y: auto; padding: 8px 18px 22px; font-size: 14px; line-height: 1.55; color: var(--text); min-height: 0; }
.legal-body h4 { margin: 18px 0 6px; font-size: 15px; }
.legal-body p { margin: 6px 0; }
.legal-body ul { margin: 4px 0; padding-left: 18px; }
.legal-body li { margin: 4px 0; }
.legal-kid { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.legal-kid ul { margin-top: 6px; }
.legal-table-wrap { overflow-x: auto; margin: 6px 0; border: 1px solid var(--border); border-radius: 10px; }
.legal-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.legal-table th { background: var(--bg); font-weight: 700; }
.legal-table tr:last-child td { border-bottom: 0; }

/* Inscription : e-mail à confirmer */
.form-error.info { color: var(--success); }
.auth-pending { text-align: center; display: flex; flex-direction: column; gap: 10px; padding: 8px 18px 18px; }
.auth-pending h3 { margin: 0; font-size: 19px; }
.auth-pending p { margin: 0; line-height: 1.45; }
.auth-pending-icon { font-size: 40px; line-height: 1; }

/* Profil : date de naissance avec bouton « Effacer » */
.birth-box { display: flex; gap: 6px; align-items: center; }
.birth-box input { flex: 1; min-width: 0; }

/* Connexion : liens « Mot de passe oublié ? » et « Retour » */
.auth-link { font-size: 13px; color: var(--primary); text-decoration: none; align-self: flex-start; margin-top: -4px; }
.auth-link.center { align-self: center; margin-top: 0; }
.auth-link:hover { text-decoration: underline; }

/* Accueil : réponses aux convocations (mêmes boutons que l'Agenda), sous le texte sur mobile */
.todo-row.stack { flex-wrap: wrap; }
.todo-row.stack .grow { flex: 1 1 220px; }
.todo-btns { display: flex; gap: 6px; flex: 1 1 auto; justify-content: flex-end; }
.todo-btns .rsvp-btn { flex: 1 1 0; min-width: 0 !important; justify-content: center; background: var(--panel); border: 1.5px solid var(--border); color: var(--text); }
.todo-btns .rsvp-btn.yes { border-color: var(--success); color: var(--success); }
.todo-btns .rsvp-btn.no { border-color: var(--danger); color: var(--danger); }
.todo-btns .rsvp-btn.maybe { border-color: var(--warning); color: var(--warning); }
@media (min-width: 700px) { .todo-btns { flex: 0 0 auto; } .todo-btns .rsvp-btn { min-width: 92px !important; } }

/* Agenda : commentaire enregistré automatiquement */
.ev-comment { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ev-comment input { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; min-height: var(--tap); background: var(--panel); }
.ev-comment-state { min-height: 1em; }

/* Membres : actions (rôle, Retirer, Accepter, Refuser) groupées et alignées de la même façon sur chaque ligne */
.member-row .who { overflow: hidden; text-overflow: ellipsis; }
.member-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.member-actions .btn, .member-actions .select { min-width: 96px; justify-content: center; }
@media (max-width: 560px) {
  .member-row:has(.member-actions) { flex-wrap: wrap; }
  .member-row .member-actions { flex: 1 1 100%; padding-left: 42px; }
  .member-row .member-actions { flex-wrap: wrap; }
  .member-row .member-actions > * { flex: 1 1 auto; min-width: 88px; }
}

/* Fenêtres de dialogue : les retours à la ligne du message sont respectés */
.dialog-msg { white-space: pre-line; }

/* Jauge de solidité du mot de passe */
.pw-meter { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
.pw-bar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pw-bar i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }
.pw-label { font-size: 13px; color: var(--muted); }
.pw-meter[data-level="1"] .pw-bar i { width: 15%; background: var(--danger-fill); }
.pw-meter[data-level="2"] .pw-bar i { width: 35%; background: var(--danger-fill); }
.pw-meter[data-level="3"] .pw-bar i { width: 65%; background: var(--warning-fill); }
.pw-meter[data-level="4"] .pw-bar i { width: 100%; background: var(--success-fill); }
.pw-meter[data-level="1"] .pw-label, .pw-meter[data-level="2"] .pw-label { color: var(--danger); }
.pw-meter[data-level="4"] .pw-label { color: var(--success); font-weight: 600; }

/* Équipe (joueur) : « Quitter l'équipe » discret sous la liste */
.team-leave { margin: 18px auto 0; display: flex; }

/* Tutoriel de première connexion : le bloc expliqué est découpé dans un voile sombre, la bulle l'accompagne */
.tour { position: fixed; inset: 0; z-index: 3000; }
.tour.centered { background: rgba(15, 23, 32, .55); display: grid; place-items: center; padding: 16px; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 23, 32, .55); outline: 3px solid var(--primary); transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: top .25s ease, left .25s ease; }
.tour.centered .tour-card { position: static; width: min(420px, 100%); }
.tour-title { font-size: 17px; }
.tour-text { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tour-grow { flex: 1; }

/* Équipe : case « Joue aussi » (coach ou admin convoqué comme un joueur) */
.plays-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap-sm); padding: 0 10px; border: 1.5px solid var(--border); border-radius: var(--radius-btn); background: var(--panel); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.plays-toggle.on { border-color: var(--primary-ink); background: var(--primary-soft); color: var(--primary-dark); }
.plays-toggle input { margin: 0; accent-color: var(--primary); }
.role-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.member-row .member-actions > .role-badges { flex: 0 0 auto; }

/* Club : choix des équipes, liste des équipes et membres du club */
.club-teams-body { padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.club-teams-body > p { margin: 0; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel); flex-wrap: wrap; }
.pick-name { display: flex; align-items: center; gap: 8px; font-weight: 600; flex: 1 1 140px; min-width: 0; }
.pick-name input { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; }
.inline-form.is-disabled { opacity: .55; }
.club-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.club-card h3 { margin: 0; font-size: 18px; }
.club-card .row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.club-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 700; letter-spacing: .08em; }
.club-team-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel); flex-wrap: wrap; }
.club-team-row .grow { flex: 1 1 140px; min-width: 0; }
.club-team-row small { display: block; color: var(--muted); font-size: 12px; }
.club-section { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.team-club { margin-bottom: -6px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Rejoindre ou créer : blocs séparés (code, équipe du club, nouveau club) */
.forms-part { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.forms-head + .forms-part { border-top: 0; padding-top: 0; }
.forms-part-title { font-size: 14px; }
.forms-part .help { margin: 0; }
.club-card .club-rename { align-self: flex-start; }

#strat-share-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Fenêtre « Partager » d'une stratégie : équipes du club (défilent sur le côté), interrupteurs */
.strat-share { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; max-height: 75vh; overflow-y: auto; }
.share-what { margin: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-part { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.share-part + .share-part { padding-top: 14px; border-top: 1px solid var(--border); }
.share-part-title { font-size: 14px; }
.share-part .help, .strat-share > .help { margin: 0; }
.team-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; margin-right: -18px; padding-right: 18px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.team-strip .chip { flex: 0 0 auto; scroll-snap-align: start; font-weight: 600; padding: 8px 14px; border: 1.5px solid var(--border-strong); background: var(--panel); color: var(--text); white-space: nowrap; }
.team-strip .chip.sent { background: var(--primary-soft); border-color: var(--primary-ink); color: var(--primary-dark); }
.share-switch { display: flex; align-items: center; gap: 12px; }
.share-switch strong { display: block; font-size: 14.5px; }
.share-switch small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.35; }
button.switch { border: 0; padding: 0; }
.switch[aria-checked="true"] { background: var(--primary-fill); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.share-copy { align-self: flex-start; }

/* Barre du bas : marge sous les icônes. Navigateur : la zone de sécurité de l'appareil ;
   appli installée (écran d'accueil) : au moins 14 px, pour ne pas toucher la barre d'accueil de l'iPhone */
:root { --bar-safe: env(safe-area-inset-bottom, 0px); }
@media (display-mode: standalone) { :root { --bar-safe: max(14px, env(safe-area-inset-bottom, 0px)); } }

/* Bandeaux (mesure d'usage, conditions) : un seul à la fois, compact, non bloquant, au-dessus de la barre du bas.
   Masqués tant qu'une fenêtre (connexion, inscription…) est ouverte. */
.consent-bar { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(12px + var(--bar-safe)); max-width: 560px; margin: 0 auto; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.consent-bar p { margin: 0; color: var(--muted); line-height: 1.4; font-size: 13.5px; }
.consent-bar p strong { color: var(--text); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-actions .btn { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
@media (min-width: 761px) { .consent-bar { flex-direction: row; align-items: center; gap: 14px; } .consent-bar p { flex: 1; } .consent-actions { flex: 0 0 auto; } }
body:has(.modal:not(.hidden)) .consent-bar, body:has(.tour) .consent-bar { display: none; }
@media (max-width: 760px) { .consent-bar { bottom: calc(68px + var(--bar-safe)); } }

/* Inscription : âge, accord parental, conditions */
.auth-extra { display: flex; flex-direction: column; gap: 10px; }
.auth-parent { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); }
.auth-parent .help { margin: 0; }
label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; font-weight: 400; }
label.check input { margin-top: 2px; flex: 0 0 auto; }
#modal-legal { z-index: 90; }
.consent-actions.single { grid-template-columns: 1fr; }
.form .auth-extra label.check { align-items: flex-start; font-weight: 400; font-size: 13.5px; }
.form .auth-extra input[type="checkbox"], .form .auth-extra input[type="radio"] { width: auto; margin: 2px 0 0; flex: 0 0 auto; }
.auth-terms { margin: 0; }
@media (max-width: 760px) { .hub-tiles:has(> :nth-child(3):last-child) > :last-child { grid-column: span 2; } }
.club-hint { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; margin-top: 12px; border: 1.5px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.invite-scope { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-scope .chip { font-weight: 600; padding: 7px 14px; }
.invite-explain { margin: 0; }

/* Page Compte : quatre groupes (Moi, Réglages, Aide, Compte), lignes de réglages façon téléphone */
.account-page { gap: 18px; }
.acc-group { display: flex; flex-direction: column; gap: 8px; }
.acc-label { margin: 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.acc-list { background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 12px 16px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; }
.acc-list > .acc-row:first-child, .acc-list > .acc-item:first-child .acc-row, .acc-list > .hidden:first-child + .acc-row { border-top: 0; }
.acc-row:hover { background: var(--bg); }
.acc-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.acc-row.danger { color: var(--danger); }
.acc-chev { color: var(--muted); font-size: 20px; line-height: 1; }
.acc-item { display: flex; flex-direction: column; }
.acc-item .muted { padding: 0 16px 12px; margin: -4px 0 0; }
.acc-item + .acc-row { border-top: 1px solid var(--border); }
.push-block .acc-row.hidden { display: none; }
/* Aide des notifications : même marge que les lignes de la carte, aussi quand le bouton est masqué (iPhone sans appli installée) */
.push-block #push-help { padding: 0 16px 12px; }
.push-block #push-help:empty { display: none; }
.push-block .acc-row.hidden + #push-help { padding-top: 14px; }
/* Safari (iPhone) colore en bleu le texte des boutons et des listes sans couleur : on reprend celle du texte */
.btn-close, select { color: var(--text); }

/* Tableau de bord du back-office */
.dash-period { margin-bottom: 4px; }
.dash-section { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0 10px; }
.dash-section h3 { margin: 0; font-size: 18px; }
.dash-section p { margin: 2px 0 0; }
.dash-step { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 14px; }
.dash-note { margin: -4px 0 8px; }
.dash-chart { width: 100%; }
.dash-svg { width: 100%; height: auto; display: block; }
.dash-grid { stroke: var(--chart-grid); stroke-width: 1; }
.dash-tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-hit { cursor: pointer; }
.dash-hit:hover { fill: rgba(0, 0, 0, .04); }
.dash-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--text); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i, .dash-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dash-legend b { font-variant-numeric: tabular-nums; }
.dash-tip { position: fixed; z-index: 140; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; font-variant-numeric: tabular-nums; }
.dash-tip span { display: flex; align-items: center; gap: 6px; }
.dash-big { font-size: 34px; font-weight: 700; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.bar-n small { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* Nom et slogan : accueil (sans compte) et fenêtre de connexion */
.hero-brand { margin: 0 0 6px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.hero-brand strong { color: var(--brand-ink); font-size: 15px; letter-spacing: .01em; }
.hero-slogan { margin: 4px 0 0; font-weight: 600; color: var(--text); }
.auth-brand { margin: 0; padding: 10px 18px 0; font-size: 13px; color: var(--muted); }
.auth-brand strong { color: var(--brand-ink); }
/* Bandeau terrain de la fenêtre de connexion (décoratif) */
.auth-hero { height: 104px; overflow: hidden; border-bottom: 1px solid var(--border); }
.auth-hero svg { display: block; width: 100%; height: 100%; }
.auth-hero .ah-grass { fill: var(--field); }
.auth-hero .ah-stripe { fill: var(--panel); opacity: .06; }
.auth-hero .ah-lines { stroke: var(--panel); stroke-width: 1.6; opacity: .75; fill: none; }
.auth-hero .ah-lines .dash { stroke-dasharray: 5 5; }
.auth-hero .ah-run { fill: none; stroke: var(--panel); stroke-width: 2.4; stroke-dasharray: 7 6; animation: ah-run 1.6s linear infinite; }
.auth-hero .ah-pass { fill: none; stroke: var(--panel); stroke-width: 2; stroke-dasharray: 3 4; }
.auth-hero .ah-blue circle { fill: var(--primary); stroke: var(--panel); stroke-width: 1.5; }
.auth-hero .ah-red circle { fill: var(--danger); stroke: var(--panel); stroke-width: 1.5; }
.auth-hero .ah-num text { fill: var(--panel); font-size: 8px; font-weight: 800; text-anchor: middle; }
.auth-hero .ah-ball { fill: var(--panel); stroke: var(--text); stroke-width: 1; }
@keyframes ah-run { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) { .auth-hero .ah-run { animation: none; } }
/* Accueil visiteur : présentation de l'appli */
.pres-page { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; }
.pres-title { margin: 10px 0 0; font-size: 20px; }
.pres-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 1fr 230px; align-items: stretch; }
.pres-text { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.pres-text h3 { margin: 0; font-size: 18px; }
.pres-text p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.pres-n { width: 28px; height: 28px; border-radius: 50%; background: var(--field); color: var(--panel); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.pres-shot { background: var(--bg); padding: 16px 16px 0; display: flex; justify-content: center; align-items: flex-start; max-height: 300px; overflow: hidden; border-left: 1px solid var(--border); }
.pres-shot img { width: 100%; max-width: 200px; height: auto; border-radius: 10px 10px 0 0; border: 1px solid var(--border-strong); border-bottom: none; display: block; }
.pres-club { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.pres-club h3 { margin: 0 0 8px; font-size: 18px; }
.pres-club ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pres-club li::before { content: '✓'; color: var(--field); font-weight: 800; margin-right: 8px; }
.pres-why { display: flex; gap: 10px; flex-wrap: wrap; }
.pres-why span { flex: 1 1 140px; text-align: center; font-weight: 700; border-top: 4px solid var(--field); padding-top: 8px; }
.pres-cta { background: var(--primary-soft); border-radius: 14px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pres-cta p { margin: 0; }
.pres-cta .btn { min-height: 48px; padding: 0 22px; font-size: 16px; }
@media (max-width: 700px) {
  .pres-card { grid-template-columns: 1fr; }
  .pres-shot { border-left: none; border-top: 1px solid var(--border); max-height: 240px; }
  .pres-text { padding: 16px 18px; }
  .pres-cta .btn { flex: 1 1 100%; justify-content: center; }
  .pres-why span { flex-basis: 90px; font-size: 13px; }
}
.auth-who { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.auth-step-title { margin: 0; font-weight: 700; font-size: 16px; }
.who-card { text-align: left; background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; color: var(--text); }
.who-card:hover, .who-card:focus-visible { border-color: var(--primary-ink); background: var(--primary-soft); }
.who-card strong { font-size: 15px; }
.who-card span { font-size: 13px; color: var(--muted); }
.auth-kids { display: flex; flex-direction: column; gap: 6px; }
.auth-kids-label { font-weight: 600; font-size: 13px; }
#auth-kid-list input { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; }
#auth-kid-list { display: flex; flex-direction: column; gap: 6px; }
.auth-kids .btn { align-self: flex-start; }
.kid-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.kid-row .who { flex: 1 1 140px; display: flex; flex-direction: column; font-weight: 600; }
.kid-row .who small { font-weight: 400; color: var(--muted); }
.kids-card .inline-form { margin-top: 8px; }

/* Base de test : petit bandeau toujours visible (js/config.js) */
.env-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 5000; pointer-events: none; background: var(--warning-fill); color: var(--on-color); font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 10px 3px; border-radius: 0 0 8px 8px; white-space: nowrap; }
@media print { .env-banner { display: none; } }
.club-ffr { display: inline-block; margin: 2px 0 8px; font-weight: 600; }
.kid-handover { margin: -4px 0 8px; }
.kid-nudge { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--warning-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; }

/* Compos : déplacer / échanger un joueur, vider un poste, absents connus, reprendre la compo */
.sheet-clear { flex: 0 0 auto; width: 28px; height: 28px; border: none; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; font-size: 14px; }
.sheet-clear:hover, .sheet-clear:focus-visible { background: var(--danger-soft); color: var(--danger-ink); }
.sheet-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 6px 38px; padding: 8px 10px; border-radius: 10px; background: var(--primary-soft); font-size: 14px; }
.sheet-choice span { flex: 1 1 100%; }
.sheet-row.is-absent input { border-color: var(--danger-ink); background: var(--danger-soft); }
.sheet-in { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.sheet-in input { flex: 1 1 auto; min-width: 0; }
.sheet-row.is-absent .sheet-in input { padding-right: 58px; }
.sheet-absent { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--danger); background: var(--panel); border-radius: 6px; padding: 1px 5px; pointer-events: none; }
.sheet-reuse { display: flex; justify-content: flex-start; }
/* Feuille de match sur téléphone : boutons de repère plus petits pour laisser la place au nom */
@media (max-width: 560px) {
  .sheet-row { gap: 5px; }
  .sheet-num { width: 20px; font-size: 13px; }
  .sheet-marks { gap: 4px; }
  .sheet-mark { width: 38px; height: 38px; font-size: 13px; }
  .sheet-clear { width: 36px; height: 38px; margin-left: 6px; }
  .sheet-choice { margin-left: 25px; }
}

/* Invitation : lien et QR code */
.invite-link { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); }
.invite-url { font-size: 13px; color: var(--primary-dark); word-break: break-all; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 0; }
.qr-img { width: min(280px, 80vw); aspect-ratio: 1; background: var(--panel); padding: 8px; border-radius: 12px; border: 1px solid var(--border); }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-acts { justify-content: center; }
.auth-note { margin: 8px 18px 0; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--text); font-size: 14px; }

/* Mode démo : bandeau flottant, au-dessus de la barre de navigation du téléphone */
.demo-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 4000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 12px; border-radius: 14px; background: var(--text); color: var(--panel); box-shadow: var(--shadow); font-size: 14px; }
.demo-banner .btn.ghost { color: var(--panel); }
@media (max-width: 900px) { .demo-banner { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
.password-form { border-top: 1px solid var(--border); padding: 12px 16px 16px; gap: 10px; }
.kids-card.kids-closed { padding: 4px 8px; }
.kids-card.kids-closed .kids-help, .kids-card.kids-closed .inline-form { display: none; }
.kids-open { width: 100%; justify-content: flex-start; color: var(--muted); white-space: normal; text-align: left; font-weight: 500; font-size: 14px; min-height: 44px; }

/* Réponse directe depuis la notification : trois grands boutons */
.quick-rsvp { max-width: 520px; margin: 8px auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.quick-rsvp h2 { margin: 0; font-size: 22px; }
.quick-when { margin: 0; line-height: 1.5; }
.quick-person { display: flex; flex-direction: column; gap: 8px; }
.quick-buttons { display: flex; flex-direction: column; gap: 10px; }
.quick-buttons .rsvp-btn.quick { min-height: 60px; font-size: 18px; font-weight: 600; background: var(--panel); border: 2px solid var(--border); color: var(--text); }
.quick-buttons .rsvp-btn.yes { border-color: var(--success); color: var(--success); }
.quick-buttons .rsvp-btn.maybe { border-color: var(--warning); color: var(--warning); }
.quick-buttons .rsvp-btn.no { border-color: var(--danger); color: var(--danger); }
.quick-buttons .rsvp-btn.yes[aria-pressed="true"] { background: var(--success-fill); color: var(--panel); }
.quick-buttons .rsvp-btn.maybe[aria-pressed="true"] { background: var(--warning-fill); color: var(--panel); }
.quick-buttons .rsvp-btn.no[aria-pressed="true"] { background: var(--danger-fill); color: var(--panel); }
.quick-done { margin: 0; color: var(--success); }

/* Réglages : interrupteur dans une ligne ; abonnement à l'agenda */
.acc-toggle span small { display: block; font-weight: 400; font-size: 13px; margin-top: 2px; }
.cal-links { display: flex; flex-direction: column; gap: var(--gap); margin: 12px 0; }
.calendar-body .help { margin: 6px 0; }

/* Présences (page Équipe → Présences, fiche d'un membre) */
.st-head { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.st-period { display: inline-flex; background: var(--subtle); border-radius: var(--radius-btn); padding: 3px; gap: 2px; }
.st-period .seg { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 0 14px; min-height: var(--tap-sm); border-radius: 8px; cursor: pointer; }
.st-period .seg.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.st-table { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.st-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 1fr 0.8fr; gap: 8px; align-items: center; padding: 10px 12px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.st-row:first-child { border-top: 0; }
.st-row:not(.st-th):hover { background: var(--bg); }
.st-th { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; cursor: default; }
.st-row > span { display: flex; flex-direction: column; min-width: 0; }
.st-row small { color: var(--muted); font-size: 12px; }
.st-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.st-rate.good { color: var(--success); }
.st-rate.mid { color: var(--warning); }
.st-rate.low { color: var(--danger); }
.st-none { color: var(--warning); font-weight: 600; }
.st-help { margin-top: 10px; }
.st-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.st-box { display: flex; flex-direction: column; gap: 2px; }
.st-box strong { font-size: 20px; }
.st-box small { color: var(--muted); }
.st-box .pres-bar { margin-top: 4px; }
@media (max-width: 560px) {
  .st-row { grid-template-columns: minmax(0, 1.3fr) 1fr 1fr 0.6fr; padding: 10px; font-size: 14px; }
  .st-th { font-size: 11px; }
}

/* Partenaires du club */
.sponsor-strip { margin: 18px 0 6px; text-align: center; }
.sponsor-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sponsor-logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.sponsor-item { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; color: var(--muted); text-decoration: none; }
.sponsor-item img { max-height: 40px; max-width: 120px; object-fit: contain; }
a.sponsor-item:hover img { opacity: .8; }
.sponsor-name { font-weight: 600; font-size: 14px; }
.home-sponsors { opacity: .9; }
.share-sponsors .sponsor-strip { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); }
.sponsor-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.sponsor-row .grow { min-width: 0; display: flex; flex-direction: column; }
.sponsor-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sponsor-thumb { width: 64px; height: 40px; object-fit: contain; flex: 0 0 auto; background: var(--subtle); border-radius: 6px; }
.sponsor-thumb.empty { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.sponsor-form { display: flex; flex-direction: column; gap: 10px; }
.sponsor-preview { display: flex; align-items: center; gap: 12px; }
.sponsor-preview img { max-height: 50px; max-width: 150px; object-fit: contain; background: var(--subtle); border-radius: 6px; padding: 4px; }
.sponsor-row { flex-wrap: wrap; }
.sponsor-acts { margin-left: auto; flex-wrap: nowrap; }
@media (max-width: 560px) { .sponsor-acts { width: 100%; justify-content: flex-end; } }
/* Partenaires dans l'onglet Club : une carte par partenaire */
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.sponsor-box { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; min-width: 0; }
.sponsor-box-logo { height: 90px; display: grid; place-items: center; background: var(--subtle); border-radius: 10px; overflow: hidden; }
.sponsor-box-logo img { max-height: 76px; max-width: 80%; object-fit: contain; }
.sponsor-box-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sponsor-box-text strong { font-size: 16px; }
.sponsor-box-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sponsor-box .sponsor-acts { width: 100%; margin: 0; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; }
.sponsor-adult { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--warning-ink); background: var(--warning-soft); border-radius: 999px; padding: 2px 10px; }
.sponsor-card-initial { font-size: 28px; font-weight: 800; color: var(--muted); }
/* Annonce d'un partenaire (accueil, agenda) : toute la carte mène au site */
.sponsor-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "tag tag tag" "logo text go"; align-items: center; gap: 4px 12px;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 14px; color: var(--text); text-decoration: none; margin: 12px 0; }
a.sponsor-card:hover { border-color: var(--primary); }
.sponsor-card-tag { grid-area: tag; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sponsor-card-logo { grid-area: logo; height: 52px; display: grid; place-items: center; background: var(--subtle); border-radius: 10px; overflow: hidden; }
.sponsor-card-logo img { max-height: 46px; max-width: 64px; object-fit: contain; }
.sponsor-card-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.sponsor-card-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sponsor-card-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sponsor-card-go { grid-area: go; font-weight: 700; color: var(--primary); font-size: 14px; white-space: nowrap; }
.agenda-sponsor { margin: 6px 0 14px; }

/* Hors ligne */
.offline-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; background: var(--neutral); color: var(--panel); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
@media (min-width: 900px) { .offline-banner { bottom: 16px; } }

/* Réglages : apparence */
.acc-theme { cursor: default; flex-wrap: wrap; }
.acc-theme:hover { background: none; }
.theme-choice { display: inline-flex; background: var(--subtle); border-radius: var(--radius-btn); padding: 3px; gap: 2px; }
.theme-choice button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 0 12px; min-height: var(--tap-sm); border-radius: 8px; cursor: pointer; }
.theme-choice button[aria-checked="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.st-short { display: none; }
@media (max-width: 560px) { .st-th .st-long { display: none; } .st-th .st-short { display: inline; } }

/* Compteurs de réponses cliquables (fiche événement) */
.only-short { display: none; }
.pres-legend .linkish { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.kid-sent { margin: 8px 0 4px; color: var(--text); line-height: 1.4; }
/* Liens de texte : une seule couleur, celle des actions */
a:not([class]) { color: var(--primary); }
.admin-title { font-size: 22px; margin: 0 0 8px; }
.btn.two-lines { flex-direction: column; gap: 0; padding-top: 6px; padding-bottom: 6px; }
.btn.two-lines small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.sheet-status.sheet-st { align-self: flex-start; }
#home-list.refreshing { opacity: .6; transition: opacity .2s; }
.sheet-absent.unsure { color: var(--warning-ink); }
.sheet-row.is-unsure input { border-color: var(--warning); }
.sheet-row.is-unsure .sheet-in input { padding-right: 96px; }
.sheet-legend { font-size: 12.5px; margin: 0 0 6px; }
/* Chargement : formes grises (pas d'écran faux pendant que le compte se charge) */
.skel { display: flex; flex-direction: column; gap: 14px; }
.skel-line { height: 14px; border-radius: 7px; background: var(--subtle); margin: 6px 0; animation: skel 1.2s ease-in-out infinite alternate; }
.skel-line.title { height: 26px; width: 55%; }
.skel-line.short { width: 60%; }
.skel-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skel-tiles div { height: 96px; border-radius: 14px; background: var(--subtle); animation: skel 1.2s ease-in-out infinite alternate; }
@keyframes skel { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skel-line, .skel-tiles div { animation: none; } }
/* Filtres et puces : au moins 36 px de haut au doigt */
@media (pointer: coarse) { .chip { min-height: 36px; } }
/* Politique de confidentialité sur téléphone : une fiche par ligne du tableau, onglets sur deux lignes */
@media (max-width: 600px) {
  .legal-tabs { white-space: normal; display: flex; flex-wrap: wrap; overflow-x: visible; }
  .legal-tabs .tab { padding: 10px 6px; margin-right: 8px; }
  .legal-table-wrap { border: 0; overflow: visible; }
  .legal-table { min-width: 0; }
  .legal-table thead { display: none; }
  .legal-table tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
  .legal-table td { display: block; border-bottom: 0; padding: 6px 10px; }
  .legal-table td:nth-child(2)::before { content: 'À quoi elles servent : '; font-weight: 700; }
  .legal-table td:nth-child(3)::before { content: 'Base légale : '; font-weight: 700; }
}
/* Visite guidée dans la démo : la bulle passe devant, le bandeau de la démo se retire le temps de la visite */
body:has(.tour) .demo-banner, body:has(.modal:not(.hidden)) .demo-banner { display: none; }
/* Boutons à icône de l'éditeur : un mot sous l'icône (on n'a plus à deviner) */
.fab-history button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.fab-history button { width: 54px; height: 50px; }
.fab-cap { font-size: 10.5px; font-weight: 600; line-height: 1; }
.fab-history button svg { width: 20px; height: 20px; }
.pick-adults { margin-top: 8px; }
.pick-adults summary { cursor: pointer; color: var(--muted); padding: 8px 0; min-height: 36px; }
/* Page jamais ouverte et pas de réseau */
.offline-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 20px; margin: 12px auto; max-width: 420px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px; }
.offline-card h2 { margin: 4px 0 0; font-size: 20px; }
.offline-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.offline-card .boot-tile { fill: var(--field); }
.offline-card .boot-oval { fill: var(--on-color); }
.offline-card ul { margin: 0; padding-left: 18px; text-align: left; color: var(--muted); line-height: 1.5; font-size: 14px; }
/* Comportement d'appli, pas de page web : pas de zoom au double appui, pas de sélection ni de menu « Copier »
   à l'appui long, pas de zoom à deux doigts (aussi bloqué dans index.html pour iPhone). Les champs de saisie restent sélectionnables. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* défilement seulement : ni double appui ni zoom à deux doigts */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg { -webkit-user-drag: none; }
.auth-switch { margin: 2px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.auth-note a { font-weight: 600; }
/* Aide de l'éditeur : à côté d'Annuler / Rétablir sur ordinateur, au-dessus du zoom sur téléphone (la ligne du haut porte le nom du dessin) */
.zoom-fab .help-m { font-weight: 800; color: var(--primary); margin-bottom: 6px; }
@media (max-width: 900px) { .fab-history #fab-help { display: none; } }

/* ---------- Charte « Terrain » (aperçu) ----------
   Activée par le lien « ?charte=terrain » (retour : « ?charte=classique »), mémorisée sur l'appareil (classe
   html.charte-terrain posée dans index.html). Reprend la charte graphique Rugbeo : vert Pelouse pour les actions,
   texte vert Vestiaire, orange Ballon en accent (focus, ballon), Archivo pour les titres, DM Sans pour le texte,
   boutons en pilule, cartes très arrondies à ombre plate. Seules les variables changent : le reste de l'appli suit.
   Polices hébergées avec l'appli (vendor/fonts), jamais chargées depuis Google. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700 900; font-display: swap; src: url(../vendor/fonts/archivo-latin.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../vendor/fonts/dmsans-latin.woff2) format('woff2'); }
/* Couleurs claires de la charte : à l'écran et à l'impression (toujours claire) */
:root.charte-terrain {
    --bg: #f4f6f1; --panel: #ffffff; --subtle: #eaefe7; --border: #dce3d8; --border-strong: #8fa294;
    --text: #0b3d2a; --muted: #4a6357;
    --primary: #0e7a4b; --primary-dark: #0b6a41; --primary-soft: #e3f2ea;
    --success: #108653; --success-soft: #e3f2ea;
    --warning: #8f5600; --warning-soft: #fff0d1;
    --danger: #c2362b; --danger-dark: #a12c23; --danger-soft: #fbe6e3;
    --primary-ink: #0b6a41; --success-ink: #0b6a41; --warning-ink: #8f5600; --danger-ink: #a12c23;
    --primary-fill: #0e7a4b; --success-fill: #108653; --warning-fill: #8f5600; --danger-fill: #c2362b;
    --brand-ink: #0e7a4b; --field: #0e7a4b;
    --accent: #ffb020; --on-accent: #0b3d2a; --accent-soft: #fff0d1;
    --chart-1: #0e7a4b; --chart-2: #2563c9; --chart-3: #ffb020; --chart-4: #8f5600; --chart-5: #5fb98a;
    --radius: 8px;
    --shadow: 0 2px 0 #dce3d8;
    --shadow-pop: 0 12px 32px rgba(11, 61, 42, .16);
    --font-display: 'Archivo', 'Arial Black', system-ui, sans-serif;
    --font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media screen {
  :root.charte-terrain[data-theme="dark"] {
    --bg: #0c1712; --panel: #13221a; --subtle: #1a2d23; --border: #2a3f33; --border-strong: #557263;
    --text: #eaf2ec; --muted: #a3b8ab;
    --primary: #3fbf7f; --primary-dark: #5acd93; --primary-soft: #173b2a;
    --success: #3fbf7f; --success-soft: #173b2a;
    --warning: #ffc95c; --warning-soft: #3a2c0e;
    --danger: #f07a6e; --danger-dark: #f59a90; --danger-soft: #3a1916;
    --primary-ink: #6fd6a0; --success-ink: #6fd6a0; --warning-ink: #ffc95c; --danger-ink: #f59a90;
    --primary-fill: #0e7a4b; --success-fill: #108653; --warning-fill: #8f5600; --danger-fill: #c2362b;
    --brand-ink: #6fd6a0; --field: #0f5c3a; --accent-soft: #3a2c0e;
    --shadow: 0 2px 0 #08120d; --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root.charte-terrain:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0c1712; --panel: #13221a; --subtle: #1a2d23; --border: #2a3f33; --border-strong: #557263;
    --text: #eaf2ec; --muted: #a3b8ab;
    --primary: #3fbf7f; --primary-dark: #5acd93; --primary-soft: #173b2a;
    --success: #3fbf7f; --success-soft: #173b2a;
    --warning: #ffc95c; --warning-soft: #3a2c0e;
    --danger: #f07a6e; --danger-dark: #f59a90; --danger-soft: #3a1916;
    --primary-ink: #6fd6a0; --success-ink: #6fd6a0; --warning-ink: #ffc95c; --danger-ink: #f59a90;
    --primary-fill: #0e7a4b; --success-fill: #108653; --warning-fill: #8f5600; --danger-fill: #c2362b;
    --brand-ink: #6fd6a0; --field: #0f5c3a; --accent-soft: #3a2c0e;
    --shadow: 0 2px 0 #08120d; --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
  }
}
@media screen {
  /* Typographie : DM Sans pour le texte, Archivo pour les titres et les chiffres */
  .charte-terrain body, .charte-terrain button, .charte-terrain input, .charte-terrain select, .charte-terrain textarea { font-family: var(--font-sans); }
  .charte-terrain :is(h1, h2, h3, .modal-head strong, .hub-tile strong, .kpi strong, .ev-date strong, .boot-name, .page-title) { font-family: var(--font-display); letter-spacing: -.3px; }
  .charte-terrain :is(h1, .hub-hello h1) { font-weight: 900; letter-spacing: -1px; }
  /* Logo : poteaux en H et ballon ; « rugbeo » en minuscules, Archivo 900 */
  .logo-terrain { display: none; }
  .charte-terrain .logo-terrain { display: block; }
  .charte-terrain #hub-logo-default, .charte-terrain .logo-classique { display: none; }
  .lt-disc { fill: var(--primary-fill); } .lt-h { stroke: var(--on-color); } .lt-ball { fill: var(--accent); }
  .charte-terrain .logo-terrain { flex: 0 0 auto; }
  .charte-terrain .brand strong { font-family: var(--font-display); font-weight: 900; letter-spacing: -.5px; color: var(--text); }
  .charte-terrain .brand strong.is-brand { text-transform: lowercase; letter-spacing: -1px; }   /* « rugbeo », jamais le nom d'une équipe */
  /* Boutons en pilule, texte gras */
  .charte-terrain .btn { border-radius: 8px; font-weight: 700; }
  .charte-terrain :is(.chip, .hub-team, .day-chips span) { border-radius: 8px; }
  /* Choix dans la compo (« Déplacer ici », « Échanger », « Annuler ») : boutons compacts */
  .sheet-choice .btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }
  .charte-terrain .btn.primary:hover:not(:disabled) { background: var(--primary-dark); }
  /* Gros boutons de la barre du haut (Aperçu, Exporter, Enregistrer…) : coins arrondis, pas de pilule */
  .charte-terrain :is(.topbar .actions .btn, .topbar .btn-back, .fab-history button) { border-radius: 8px; }
  /* Tutoriel : la zone expliquée entourée d'orange Ballon (le vert se confondait avec les cartes) */
  .charte-terrain .tour-spot { outline: 4px solid var(--accent); outline-offset: 2px; border-radius: 14px; }
  /* Cartes très arrondies, ombre plate (marche de 2 px) ; ce qui flotte garde une ombre douce */
  .charte-terrain :is(.todo-card, .hub-tile, .ev-card, .lib-card, .admin-card, .sponsor-card, .sponsor-box, .pres-card, .soon-card, .kpi, .club-card, .member-card) { border-radius: 12px; box-shadow: var(--shadow); }
  .charte-terrain :is(.modal-box, .menu, .rs-pop, .tour-card, .toast) { box-shadow: var(--shadow-pop); }
  .charte-terrain .modal-box { border-radius: 14px; }
  @media (max-width: 900px) { .charte-terrain .modal-box { border-radius: 14px 14px 0 0; } }
  .charte-terrain :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not(.title-input) { border-radius: 8px; }
  /* Focus clavier : anneau orange Ballon */
  .charte-terrain :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent); }
  /* Terrain des stratégies : vert Pelouse de la charte (à l'écran ; les exports gardent leurs couleurs) */
  .charte-terrain .field > rect:first-child { fill: var(--field); }
  /* Pastille de date des événements : vert pâle, chiffre en Archivo */
  .charte-terrain .ev-date { border-radius: 10px; }
}

/* En-tête des pages (accueil, agenda, équipe…) sur téléphone : plus haut et aligné sur la marge des pages (l'éditeur garde sa barre compacte) */
@media (max-width: 900px) {
  .home-bar { height: 62px; padding: 0 16px; gap: 12px; }
  .home-bar .brand { gap: 10px; }
  .home-bar .logo-terrain { width: 34px; height: 34px; }
  .home-bar .brand strong { font-size: 17px; }
  .hub-team { font-size: 15px; padding: 8px 32px 8px 12px; max-width: 200px; }
  /* Le sélecteur rétrécit avec la place laissée par « + Dessin » et le compte (sinon il passe dessous) */
  .hub-bar .brand { overflow: hidden; }
  .hub-bar .hub-team { min-width: 0; flex: 0 1 auto; width: auto; max-width: 100%; text-overflow: ellipsis; }
  .hub-account { min-width: 42px; height: 42px; }
  .hub-account .avatar-dot { width: 40px; height: 40px; }
}

/* ---------- Vie du club : programme du club et événements du club (js/club.js) ---------- */
.club-h3 { margin: 14px 0 2px; font-size: 18px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.club-h3 .muted { font-size: 14px; font-weight: 600; }
.club-program > .club-h3:first-child { margin-top: 4px; }
.club-empty { margin: 4px 0 6px; }
.ev-card.club-ev:not(.is-mine):not(.is-club) { cursor: default; }
.ev-card.club-ev.clickable { cursor: pointer; }
.ev-card.is-club { border-left: 4px solid var(--accent); }
.ev-date.club { background: var(--neutral-soft); color: var(--neutral-ink); }
.ev-kind.club { background: var(--neutral-soft); color: var(--neutral-ink); }
.club-team { font-weight: 700; color: var(--text); }
.club-ev-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.club-audience { font-size: 13px; font-weight: 700; color: var(--muted); }
.club-rsvp { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.club-rsvp-q { font-size: 14px; font-weight: 700; }
.club-rsvp .rsvp { margin-top: 0; }
.club-rsvp-who summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 4px 0; }
.club-rsvp-who .y { color: var(--success); } .club-rsvp-who .m { color: var(--warning); } .club-rsvp-who .n { color: var(--danger); }
.club-rsvp-who p { margin: 2px 0; }
.ce-audience { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ce-audience legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.ce-audience .help { margin: 0; }
.club-home { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.club-home-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.club-home-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 15px; }
.club-home-when { font-weight: 700; min-width: 74px; text-transform: capitalize; color: var(--muted); font-size: 14px; }
.club-home-what { min-width: 0; overflow-wrap: anywhere; }
.club-home .club-more { align-self: flex-start; border: none; background: none; padding: 4px 0; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- Stats de match (js/matchstats.js) ---------- */
.mstats-box { max-width: 1100px; width: 100%; }
.mstats-box .modal-head { gap: 10px; }
.mstats-box .modal-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* État de l'enregistrement : une pastille de taille fixe (rond qui tourne, coche, alerte) : l'en-tête ne bouge plus */
.mstats-state { margin-left: auto; flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; }
.mstats-state.saving::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--primary); animation: mstats-spin .8s linear infinite; }
.mstats-state.saved::before { content: '✓'; color: var(--on-color); background: var(--primary-fill); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.mstats-state.error::before { content: '!'; color: var(--on-color); background: var(--danger); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
@keyframes mstats-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mstats-state.saving::before { animation-duration: 2.4s; } }
.mstats-body { display: flex; flex-direction: column; gap: 12px; }
.mstats-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mstats-summary div { background: var(--subtle); border-radius: 10px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; }
.mstats-summary strong { font-size: 20px; }
.mstats-summary span { font-size: 12px; color: var(--muted); }
.mstats-help { margin: 0; }
.mstats-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mstats-actions .chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-color); }
.mstats-last { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); font-size: 14px; min-height: 48px; }
.mstats-last span { flex: 1; min-width: 0; }
.mstats-last.empty { background: var(--subtle); color: var(--muted); }
.mstats-step { margin: 4px 0 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.mstats-step > span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-fill); color: var(--on-color); font-size: 13px; }
.mstats-step small { font-weight: 600; }
.mstats-groups { display: flex; flex-direction: column; gap: 6px; }
.mstats-group { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 6px; }
.mstats-group-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mstats-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.mstats-player { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 4px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.mstats-player:active, .mstats-player.flash { background: var(--primary-soft); border-color: var(--primary); }
.mstats-big { font-size: 20px; font-weight: 800; line-height: 1; }
.mstats-pname { font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mstats-count { position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--primary-fill); color: var(--on-color); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.mstats-minus { opacity: .8; }
.mstats-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--subtle); font-weight: 800; font-size: 13px; margin-right: 6px; }
.mstats-undo { align-self: flex-start; }
.mstats-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 10px; }
.mstats-table { border-collapse: collapse; font-size: 14px; min-width: 100%; background: var(--panel); }
.mstats-table th, .mstats-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.mstats-table thead th { font-size: 12px; color: var(--muted); background: var(--panel); position: sticky; top: 0; }
.mstats-table tbody th, .mstats-table tfoot th { text-align: left; font-weight: 700; }
.mstats-sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mstats-table tfoot td, .mstats-table tfoot th { font-weight: 800; background: var(--subtle); }
.mstats-table tfoot .mstats-sticky { background: var(--subtle); }
.mstats-table input { width: 46px; padding: 4px; text-align: center; font: inherit; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.mstats-rate, .mstats-pts { font-weight: 700; }
.mstats-me th, .mstats-me td { background: var(--primary-soft); }
.mstats-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mstats-phase { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mstats-phase h4 { margin: 0; font-size: 16px; }
.mstats-phase-row { display: flex; align-items: center; gap: 8px; }
.mstats-phase-row span { flex: 1; }
.mstats-phase-row strong { min-width: 28px; text-align: center; font-size: 18px; }
.mstats-phase p { margin: 0; }
.mstats-season { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
  .mstats-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mstats-summary div:nth-child(n+4) { display: none; }
  .mstats-players { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mstats-actions { gap: 5px; }
  .mstats-actions .chip { padding: 6px 10px; font-size: 14px; }
  .mstats-group { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- Messages du bureau et des coachs (js/messages.js) ---------- */
.msg-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.msg-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.msg-row:hover { border-color: var(--primary); }
.msg-row.unread { border-color: var(--primary); }
.msg-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: transparent; }
.msg-row.unread .msg-dot { background: var(--primary-fill); }
.msg-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.msg-from { font-size: 13px; color: var(--muted); }
.msg-title { font-size: 16px; }
.msg-row:not(.unread) .msg-title { font-weight: 600; }
.msg-excerpt { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-stat { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.msg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg-tag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--neutral-soft); color: var(--neutral-ink); }
.msg-tag.kid { background: var(--primary-soft); color: var(--primary-ink); }
.msg-empty { margin-top: 10px; }
.back-link { align-self: flex-start; margin-bottom: 8px; border: none; background: none; padding: 4px 0; font: inherit; font-weight: 700; color: var(--primary); cursor: pointer; }
.msg-card { background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.msg-kid { margin: 0; font-size: 14px; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); border-radius: 8px; padding: 6px 10px; align-self: flex-start; }
.msg-h { margin: 0; font-size: 22px; line-height: 1.2; }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; -webkit-user-select: text; user-select: text; }
.msg-body a { color: var(--primary); font-weight: 600; }
.msg-file { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.msg-img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border); object-fit: contain; }
.msg-ack { margin-top: 12px; }
.msg-acked { margin: 0; font-weight: 700; color: var(--success); }
.msg-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.msg-thread-h { margin: 14px 0 0; font-size: 15px; }
.msg-reply { background: var(--subtle); border-radius: 12px; padding: 8px 12px; max-width: 92%; }
.msg-reply.mine { align-self: flex-end; background: var(--primary-soft); }
.msg-reply p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.msg-reply-form { display: flex; flex-direction: column; gap: 6px; }
.msg-reply-form .btn { align-self: flex-end; }
.msg-stats { margin-top: 12px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg-counts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 16px; }
.msg-who summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.msg-who p { margin: 2px 0 6px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.msg-form .day-chips { flex-wrap: wrap; }
.msg-who-box { display: flex; flex-direction: column; gap: 6px; }
.msg-pick { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.msg-pick.hidden, .msg-pick-holder.hidden, .msg-groups.hidden, .day-chips.hidden { display: none; }
.msg-search { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); width: 100%; }
.msg-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.msg-pick-list label { padding: 6px 2px; flex-shrink: 0; min-height: 0; }
.msg-pick-list label[hidden] { display: none; }
.msg-pick-list input[type=checkbox] { width: auto; height: auto; padding: 0; margin: 0; }
.msg-groups { display: flex; flex-direction: column; gap: 6px; }
/* Fenêtres longues (message, événement du club) : elles défilent */
#modal-message .modal-box, #modal-club-event .modal-box { max-height: 94%; overflow-y: auto; }
.msg-opts { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.msg-opts legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.msg-exp { display: flex; flex-direction: column; gap: 4px; }
.msg-pinned { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.msg-pin-row { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--text); background: none; border: none; padding: 4px 0; cursor: pointer; }
.msg-pin-row small { color: var(--muted); }
.msg-form #msg-as { width: 100%; max-width: 100%; }
