/* =========================================================================
   Composants
   ========================================================================= */

/* --- Cartes --- */
.card { padding: 18px; }
@media (min-width: 960px) { .card { padding: 24px; } }
.card-tight { padding: var(--space-4); }
.card-header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }

/* --- Boutons (pilules, ressort au survol et au clic) --- */
.btn {
  --btn-bg: var(--glass-bg-strong);
  --btn-fg: var(--text);
  --btn-border: var(--glass-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-1), var(--inner-light);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: transform var(--dur) var(--spring), box-shadow var(--dur) var(--ease), background-color var(--dur-fast) linear;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px) scale(1.02); box-shadow: var(--shadow-2), var(--inner-light); text-decoration: none; }
.btn:active { transform: scale(0.97); transition-duration: var(--dur-fast); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { --btn-fg: #fff; --btn-border: transparent; background: var(--fill-blue); box-shadow: var(--fill-blue-shadow); font-weight: 650; }
.btn-primary:hover { color: #fff; filter: brightness(1.06); box-shadow: var(--fill-blue-shadow); }
.btn-primary[disabled] { filter: grayscale(0.7); opacity: 0.5; box-shadow: none; }
.btn-danger { --btn-fg: #fff; --btn-border: transparent; background: var(--fill-red); box-shadow: var(--fill-red-shadow); }
.btn-danger:hover { color: #fff; filter: brightness(1.06); }
.btn-lg { min-height: 52px; padding: 0.8rem 1.5rem; font-size: var(--fs-md); }
.btn-done { --btn-bg: var(--success-soft); --btn-fg: var(--success); --btn-border: transparent; box-shadow: inset 0 0 0 1.5px var(--success); }
.btn-round { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text); }
.btn-round svg { width: 20px; height: 20px; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-ghost:hover { --btn-bg: var(--glass-bg-subtle); box-shadow: none; }
.btn-sm { min-height: 44px; padding: 0.35rem 0.9rem; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn .pill-in { font-size: var(--fs-xs); font-weight: 700; padding: 0.15rem 0.5rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.22); }
.link-button { background: none; border: 0; padding: 0; color: var(--tempo-blue-strong); text-decoration: underline; cursor: pointer; }

/* --- Formulaires --- */
.field { display: grid; gap: var(--space-2); }
.field + .field { margin-top: var(--space-4); }
.label { font-weight: 650; font-size: 0.8125rem; margin-left: 4px; }
.hint { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-muted); margin-left: 4px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  border: 0;
  background: var(--field);
  box-shadow: inset 0 1px 2px rgba(19, 32, 58, 0.08), inset 0 0 0 1px var(--line);
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) linear, box-shadow var(--dur) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { box-shadow: inset 0 1px 2px rgba(19, 32, 58, 0.08), inset 0 0 0 1px var(--tempo-blue); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; box-shadow: inset 0 1px 2px rgba(19, 32, 58, 0.08), 0 0 0 2px var(--tempo-blue), 0 0 0 6px var(--tempo-blue-soft); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.input::placeholder { color: var(--text-muted); opacity: 0.8; }
.row > .select, .row > .input { width: auto; flex: 1 1 180px; }
.error { color: var(--danger); font-size: var(--fs-xs); line-height: 1.4; font-weight: 600; margin-left: 4px; }
.checkbox { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.checkbox input[type="checkbox"], .cb {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 26px; height: 26px; margin: 0; border-radius: 9px;
  background: var(--field); box-shadow: inset 0 0 0 1.5px var(--tempo-white-edge), inset 0 1px 2px rgba(19, 32, 58, 0.1);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--dur-fast) linear;
}
.checkbox input[type="checkbox"]:checked, .cb:checked { background: var(--fill-blue); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 10px rgba(36, 83, 216, 0.35); }
.checkbox input[type="checkbox"]:checked::after, .cb:checked::after { content: ""; width: 6px; height: 11px; margin-top: -3px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.checkbox input[type="radio"] { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--tempo-blue); flex: none; }
.checkbox { line-height: 1.45; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 650; margin-bottom: var(--space-3); }

/* --- Pastilles de couleur Tempo --- */
.tempo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.7rem 0.2rem 0.3rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 650;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tempo-badge::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; flex: none; }
.tempo-badge.is-blue { background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); }
.tempo-badge.is-blue::before { background: var(--orb-blue); box-shadow: var(--orb-blue-shadow); }
.tempo-badge.is-white { background: var(--glass-bg-strong); color: var(--text); border-color: var(--tempo-white-edge); }
.tempo-badge.is-white::before { background: var(--orb-white); box-shadow: var(--orb-white-shadow); }
.tempo-badge.is-red { background: var(--tempo-red-soft); color: var(--tempo-red-strong); }
.tempo-badge.is-red::before { background: var(--orb-red); box-shadow: var(--orb-red-shadow); }
.tempo-badge.is-unknown { background: var(--glass-bg-subtle); color: var(--text-muted); border: 1px dashed var(--border-strong); }
.tempo-badge.is-unknown::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-subtle); }

.dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: middle; }
.dot.is-blue { background: var(--orb-blue); box-shadow: var(--orb-blue-shadow); }
.dot.is-white { background: var(--orb-white); box-shadow: var(--orb-white-shadow); }
.dot.is-red { background: var(--orb-red); box-shadow: var(--orb-red-shadow); }

/* Badges d'état génériques */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 700; line-height: 1.2; white-space: nowrap; background: var(--line); border: 0; color: var(--text-muted); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); border-color: transparent; }

/* --- Cartes « jour » du calendrier --- */
.days { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.day-card {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  min-height: 150px;
  overflow: hidden;
}
.day-card .day-name { font-weight: 700; text-transform: capitalize; }
.day-card .day-date { font-size: var(--fs-sm); color: var(--text-muted); }
.day-card .day-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.day-card.is-blue { box-shadow: inset 0 0 0 2px var(--tempo-blue), var(--shadow-1); }
.day-card.is-red { box-shadow: inset 0 0 0 2px var(--tempo-red), var(--shadow-1); }
.day-card.is-white { box-shadow: inset 0 0 0 2px var(--tempo-white-edge), var(--shadow-1); }
.day-card .day-swatch { position: absolute; inset: auto -30% -55% auto; width: 140px; height: 140px; border-radius: 50%; filter: blur(30px); opacity: 0.45; z-index: -1; }
.day-card.is-blue .day-swatch { background: var(--tempo-blue); }
.day-card.is-red .day-swatch { background: var(--tempo-red); }
.day-card.is-white .day-swatch { background: #fff; opacity: var(--white-swatch-opacity); }

/* --- Sélecteur de couleur (pronostic) : sphère + libellé + points --- */
.color-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.color-option { position: relative; min-width: 0; }
.color-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.color-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 80px;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 3px rgba(19, 32, 58, 0.06);
  text-align: center;
  cursor: pointer;
  transition: transform var(--dur) var(--spring), background-color var(--dur-fast) linear, box-shadow var(--dur) var(--ease);
}
.color-option .opt-dot { --orb-size: 18px; }
.color-option .opt-label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 700; }
.color-option .pts { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.color-option .check { display: none; width: 13px; height: 13px; }
.color-option input:hover + label { transform: translateY(-1px); }
.color-option input:active + label { transform: scale(0.95); }
.color-option input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.color-option input:checked + label .check { display: inline; }
.color-option input:checked + label .opt-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.color-option.is-blue input:checked + label { background: var(--fill-blue); color: #fff; border-color: rgba(255, 255, 255, 0.35); box-shadow: var(--fill-blue-shadow); }
.color-option.is-red input:checked + label { background: var(--fill-red); color: #fff; border-color: rgba(255, 255, 255, 0.35); box-shadow: var(--fill-red-shadow); }
.color-option.is-blue input:checked + label .pts, .color-option.is-red input:checked + label .pts { color: rgba(255, 255, 255, 0.9); }
.color-option.is-white input:checked + label { background: var(--tempo-white-pearl); color: #13203a; border-color: #8d9abb; box-shadow: inset 0 1px 0 #fff, 0 0 0 2px #2453d8, 0 10px 22px rgba(19, 32, 58, 0.18); }
.color-option.is-white input:checked + label .pts { color: #4c5875; }
.color-option input:disabled { cursor: not-allowed; }
.color-option input:disabled + label { background: transparent; border: 1.5px dashed var(--tempo-white-edge); box-shadow: none; cursor: not-allowed; transform: none; color: var(--text-muted); }
.color-option input:disabled + label .opt-dot { opacity: 0.35; }
fieldset:disabled .color-option input:not(:checked) + label { opacity: 0.7; }
.why-line { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Jauge (tunnel, compteurs) --- */
.gauge { display: grid; gap: var(--space-2); }
.gauge svg { width: 100%; height: 14px; overflow: visible; }
.gauge .track { fill: var(--glass-bg-subtle); stroke: var(--border-strong); }
.gauge .range { fill: var(--tempo-red-soft); }
.gauge .fill { fill: var(--tempo-red); }
.gauge .fill.is-blue { fill: var(--tempo-blue); }
.gauge .fill.is-white { fill: var(--tempo-white-edge); }
.gauge .target { stroke: var(--text); stroke-width: 2; }
.gauge-legend { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Compteurs --- */
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.counter { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); display: grid; gap: var(--space-1); }
.counter .value { font-size: 1.25rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.counter .label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 550; }

/* --- Compte à rebours --- */
.countdown { font-size: var(--fs-3xl); font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }

/* --- Messages / encadrés --- */
.callout { display: flex; gap: var(--space-3); align-items: flex-start; padding: 0.75rem 1rem; font-size: var(--fs-sm); line-height: 1.45; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--glass-bg-strong); }
.callout-info { border-color: transparent; background: var(--tempo-blue-soft); }
.callout-warning { border-color: transparent; background: var(--warning-soft); }
.callout-danger { border-color: transparent; background: var(--danger-soft); }
.callout-success { border-color: transparent; background: var(--success-soft); }

/* --- Toasts (messages flash) : pilule de verre centrée --- */
.toasts { position: fixed; z-index: 60; left: 50%; top: calc(var(--space-4) + env(safe-area-inset-top)); transform: translateX(-50%); display: grid; justify-items: center; gap: var(--space-2); width: min(92vw, 460px); pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 650;
  animation: toast-in var(--dur) var(--spring);
}
.toast-icon { flex: none; width: 18px; height: 18px; color: var(--tempo-blue-strong); }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast .toast-close { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: none; border: 0; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--text-muted); }
.toast .toast-close:hover { background: var(--line); color: var(--text); }
.toast.is-leaving { animation: toast-out var(--dur) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(0.98); } }

/* --- Modale (<dialog>) --- */
.modal {
  border: 0;
  padding: 0;
  max-width: min(92vw, 520px);
  width: 100%;
  background: transparent;
  color: var(--text);
}
.modal::backdrop { background: rgba(8, 13, 28, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* On anime la fenêtre entière, pas son contenu : le rebond du ressort ferait dépasser le panneau du <dialog>
   (overflow: auto par défaut) et afficherait un instant des barres de défilement. */
.modal[open] { animation: modal-in var(--dur) var(--spring); }
.modal-panel { padding: var(--space-5); }
/* Fenêtre « Ton boost va baisser » : récap avant / après */
.boost-loss-day { color: var(--text-muted); margin-top: calc(-1 * var(--space-2)); }
.boost-loss-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.boost-loss-table th, .boost-loss-table td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); }
.boost-loss-table tbody tr:last-child > * { border-bottom: 0; }
.boost-loss-table thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 650; }
.boost-loss-table tbody th { font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.boost-loss-table td { font-weight: 600; }
.boost-loss-table td:last-child { background: var(--danger-soft); }
.boost-loss-table td.is-down { color: var(--danger); }
.boost-loss-table .orb { --orb-size: 14px; margin-right: 0.4rem; vertical-align: -2px; }
.boost-loss-hint { font-size: var(--fs-sm); color: var(--text-muted); }
.modal-actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-5); flex-wrap: wrap; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

/* --- Tableaux --- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border-strong); vertical-align: middle; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 650; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--glass-bg-subtle); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-me { background: var(--tempo-blue-soft); }

/* --- Onglets segmentés --- */
.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 24px; }
.segmented a, .segmented button, .segmented label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 1rem;
  border-radius: 19px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 0;
  background: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented a:hover, .segmented button:hover, .segmented label:hover { color: var(--text); }
.segmented [aria-current="page"], .segmented [aria-selected="true"], .segmented [aria-checked="true"], .segmented input:checked + label {
  background: var(--glass-bg-strong); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 12px rgba(19, 32, 58, 0.14), 0 0 0 1px var(--glass-border);
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- Puces (filtres, ligues) --- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 1rem; border-radius: 22px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; color: var(--text); text-decoration: none; }
.chip:hover { color: var(--text); text-decoration: none; }
.chip[aria-current="page"], .chip.is-on { background: var(--tempo-blue); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(36, 83, 216, 0.32); }
.chip-round { width: 44px; padding: 0; }
.chip svg { width: 16px; height: 16px; }

/* --- Pilules d'état --- */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; line-height: 1.2; padding: 0.3rem 0.65rem; border-radius: var(--radius-pill); white-space: nowrap; background: var(--line); color: var(--text-muted); }
.pill-ok { background: var(--success-soft); color: var(--success); }
.pill-warn { background: var(--warning-soft); color: var(--warning); }
.pill-info { background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* --- Avatars --- */
/* Avatars : toujours carrés (aspect-ratio) et ronds ; object-fit pour les photos importées */
.avatar { width: 36px; height: auto; aspect-ratio: 1; border-radius: 50%; flex: none; object-fit: cover; box-shadow: 0 0 0 1px var(--border-strong); }
.avatar-lg { width: 64px; }
.avatar-xl { width: 96px; }
/* Sélecteur d'avatar : 12 sphères sur 2 lignes de 6 */
.avatar-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 4px; }
.avatar-picker > span { position: relative; display: grid; min-width: 0; }
.avatar-picker label { position: relative; display: block; width: 100%; aspect-ratio: 1; min-width: 44px; border-radius: 50%; cursor: pointer; transition: transform var(--dur) var(--spring); }
.avatar-picker label img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: inset 0 -6px 14px rgba(5, 15, 60, 0.3), var(--shadow-1); }
.avatar-picker label::after { content: ""; position: absolute; left: 18%; top: 8%; width: 46%; height: 28%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none; }
.avatar-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-picker input:checked + label { outline: 3px solid var(--tempo-blue); outline-offset: 3px; }
.avatar-picker input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 8px var(--tempo-blue-soft); }
.avatar-picker label:hover { transform: scale(1.06); }
.avatar-picker label:active { transform: scale(0.9); }
@media (max-width: 360px) { .avatar-picker { gap: 8px; } }

/* --- Interrupteur (case à cocher native, role="switch") --- */
.switch {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; width: 52px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 16px;
  background: var(--track); box-shadow: inset 0 1px 2px rgba(19, 32, 58, 0.12);
  cursor: pointer; transition: background-color var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #eef1f8); box-shadow: 0 2px 6px rgba(19, 32, 58, 0.25), inset 0 1px 0 #fff;
  transition: left 300ms var(--spring), width 200ms var(--ease);
}
.switch:active::after { width: 34px; }
.switch:checked, .switch[aria-checked="true"] { background: var(--switch-on); }
.switch:checked::after, .switch[aria-checked="true"]::after { left: 22px; }
.switch:checked:active::after { left: 16px; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- Listes groupées (réglages, classements, jeux) --- */
.list { list-style: none; margin: 0; padding: 4px 0; border-radius: 26px; }
.list > li { margin: 0; }
.list-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; color: var(--text); text-decoration: none; }
.list > li + li > .list-item, .list > li + li > details > summary, .list-item + .list-item { border-top: 1px solid var(--line); }
a.list-item:hover { color: var(--text); text-decoration: none; background: var(--line); }
.list > li:first-child > a.list-item:hover { border-radius: 22px 22px 0 0; }
.list > li:last-child > a.list-item:hover { border-radius: 0 0 22px 22px; }
.list-main { flex: 1; min-width: 0; }
.list-title { display: block; font-size: 0.9rem; font-weight: 600; }
.list-sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); overflow-wrap: anywhere; }
.list-chevron { flex: none; width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--dur) var(--spring); }
.list-icon { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); }
.list-icon svg { width: 18px; height: 18px; }
.list details > summary { list-style: none; cursor: pointer; }
.list details > summary::-webkit-details-marker { display: none; }
.list details[open] > summary .list-chevron { transform: rotate(90deg); }
.list details > .list-body { padding: 4px 16px 16px; }

/* --- Stepper −/+ (jeux annexes) --- */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 6px; border-radius: 30px; background: var(--glass-bg-strong); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-border); }
.stepper-btn { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0; background: var(--glass-bg-strong); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 12px rgba(19, 32, 58, 0.12); color: var(--text); cursor: pointer; transition: transform var(--dur) var(--spring); }
.stepper-btn:active { transform: scale(0.9); }
.stepper-btn:disabled { opacity: 0.4; cursor: default; }
.stepper-btn svg { width: 20px; height: 20px; }
.stepper-value { flex: 1; min-width: 0; text-align: center; }
.stepper-value input { width: 100%; max-width: 160px; border: 0; background: transparent; text-align: center; font-size: 2.75rem; line-height: 1; font-weight: 800; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper.is-red .stepper-value input { color: var(--tempo-red-strong); }
.stepper-value input::-webkit-outer-spin-button, .stepper-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-value input:focus-visible { outline: 3px solid var(--focus); border-radius: 12px; }
.stepper-unit { display: block; margin-top: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }

/* Pilules de choix (radio) : mois, oui/non… */
.choice-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.choice-pills > span { position: relative; display: grid; }
.choice-pills input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-pills label { display: grid; place-items: center; min-height: 44px; padding: 0 0.5rem; border-radius: 22px; border: 1px solid var(--glass-border); background: var(--glass-bg-strong); box-shadow: inset 0 1px 0 var(--glass-hi); font-size: 0.85rem; font-weight: 650; text-align: center; cursor: pointer; transition: transform var(--dur) var(--spring); }
.choice-pills input:active + label { transform: scale(0.94); }
.choice-pills input:checked + label { background: var(--fill-red); color: #fff; border-color: rgba(255, 255, 255, 0.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px rgba(217, 38, 56, 0.34); }
.choice-pills input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Barème (cases) */
.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; text-align: center; }
.scale > div { padding: 8px 0; border-radius: 14px; background: var(--line); }
.scale > div:first-child { background: var(--tempo-blue-soft); }
.scale.is-red > div:first-child { background: var(--tempo-red-soft); }
.scale strong { display: block; font-size: 0.95rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.scale > div:first-child strong { color: var(--tempo-blue-strong); }
.scale.is-red > div:first-child strong { color: var(--tempo-red-strong); }
.scale span { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }

/* --- Divers --- */
details.disclosure { border-radius: var(--radius-md); }
details.disclosure > summary { cursor: pointer; padding: var(--space-4); font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--text-muted); transition: transform var(--dur) var(--spring); }
details.disclosure[open] > summary::after { transform: rotate(45deg); }
details.disclosure > .disclosure-body { padding: 0 var(--space-4) var(--space-4); }
.source-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.source-list a { display: inline-flex; gap: 0.35rem; }
.kpi { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-md); }
.kpi .value { font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -0.03em; }
.kpi .label { font-size: var(--fs-sm); color: var(--text-muted); }
.pagination { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-4); }
.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--text-muted); }
.prose > p, .prose > ul, .prose > h2, .prose > h3, .prose > .table-wrap { max-width: 72ch; }
.prose h2 { margin-top: var(--space-6); }
.prose h3 { margin-top: var(--space-5); }
.prose ul { margin: 0 0 var(--space-4); }
.prose table { margin: var(--space-4) 0; }

/* --- Chronologie d'un pronostic (ouverture → clôture → annonce → validation) --- */
.timeline-figure { margin: 0; display: grid; gap: var(--space-4); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); counter-reset: step; }
.timeline-step {
  --phase: var(--tempo-blue);
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0 0 0 calc(36px + var(--space-3));
  margin: 0;
}
.timeline-step.is-closed { --phase: var(--text-muted); }
.timeline-step.is-official { --phase: var(--tempo-red); }
.timeline-step.is-day { --phase: var(--tempo-white-edge); }
/* Trait vertical reliant les étapes (mobile) */
.timeline-step::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: calc(-1 * var(--space-4));
  width: 3px;
  border-radius: 3px;
  background: var(--phase);
  opacity: 0.35;
}
.timeline-step:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: var(--fs-sm);
  color: #fff;
  background: var(--phase);
  box-shadow: 0 0 0 4px var(--glass-bg-strong), var(--shadow-1);
}
.timeline-step.is-day .timeline-dot { background: var(--tempo-white-pearl); color: var(--on-white); box-shadow: 0 0 0 4px var(--glass-bg-strong), inset 0 0 0 1.5px var(--tempo-white-edge); }
.timeline-when { font-size: var(--fs-xs); font-weight: 700; color: var(--phase); }
.timeline-step.is-day .timeline-when, .timeline-step.is-closed .timeline-when { color: var(--text-muted); }
.timeline-title { font-size: var(--fs-md); }
.timeline-text { font-size: var(--fs-sm); color: var(--text-muted); }
.timeline-example { justify-self: start; margin-top: var(--space-1); font-size: var(--fs-xs); font-weight: 600; padding: 0.1rem 0.55rem; border-radius: var(--radius-pill); background: var(--glass-bg-subtle); border: 1px solid var(--border-strong); }

@media (min-width: 760px) {
  .timeline { grid-template-columns: repeat(6, 1fr); gap: var(--space-3); }
  .timeline-step { padding: calc(36px + var(--space-3)) 0 0; align-content: start; }
  /* Trait horizontal entre les pastilles */
  .timeline-step::before { left: 36px; right: calc(-1 * var(--space-3)); top: 17px; bottom: auto; width: auto; height: 3px; }
}

/* Import de fichier */
.upload-form { flex: 1 1 260px; }
.input-file { padding: 0.55rem 0.75rem; cursor: pointer; }
.input-file::file-selector-button { margin-right: var(--space-3); padding: 0.4rem 0.9rem; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--glass-bg-subtle); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }

/* --- Ligues --- */
.league-card { color: var(--text); text-decoration: none; transition: transform var(--dur) var(--spring); }
.league-card:hover { transform: translateY(-2px) scale(1.01); text-decoration: none; }
.code-pill { display: inline-block; padding: 0.15rem 0.7rem; border-radius: var(--radius-pill); background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; }
.input-code { text-transform: uppercase; letter-spacing: 0.15em; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
/* Code à 6 chiffres reçu par email (validation d'adresse, nouveau mot de passe, changement d'email) */
.code-form { display: grid; gap: 6px; width: 100%; text-align: left; }
.code-row { display: flex; gap: var(--space-2); }
.code-row .code-input { flex: 1; min-width: 0; }
.code-input { letter-spacing: 0.3em; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.125rem; font-variant-numeric: tabular-nums; }

/* --- Lots --- */
.prize-code { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--tempo-blue-soft); color: var(--tempo-blue-strong); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--fs-xl); font-weight: 700; letter-spacing: 0.08em; text-align: center; user-select: all; word-break: break-all; }

/* Champ piège anti-robot (formulaire partenaires) */
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Héros (partenaires) --- */
.hero { padding: 28px 22px; border-radius: var(--radius-xl); }
.hero h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.035em; max-width: 18ch; }
.hero p { font-size: var(--fs-lg); color: var(--text-muted); max-width: 52ch; }
.btn-dashed { --btn-bg: transparent; --btn-fg: var(--tempo-blue-strong); --btn-border: transparent; box-shadow: inset 0 0 0 1px var(--tempo-white-edge); border-style: dashed; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-dashed svg { width: 18px; height: 18px; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
