/* ==========================================================================
   ALTAIDE — MODALS / SHEETS
   Load AFTER tokens.css and base.css. Replaces assets/css/modals.css.

   Two shapes, both full-bleed:
     .modal-content            bottom sheet, height follows content (max 92vh)
     .modal-content.sheet-full full screen — use for forms and any required step
   Class names are unchanged, so existing markup keeps working.
   ========================================================================== */

/* --- Overlay ------------------------------------------------------------
   Darker than before (0.55 vs 0.6 blurred slate) and, crucially, no
   padding: the sheet reaches the screen edges instead of sitting in a
   16px frame at 96% width. */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;   /* sheets rise from the bottom */
  justify-content: center;
  padding: 0;
  background: rgba(16, 24, 40, 0.55);
  opacity: 1;
  transition: opacity var(--transition-slow);
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
}

/* --- Sheet --------------------------------------------------------------- */

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: sheetUp var(--transition-slow) forwards;
}

/* Required steps and long forms: no dismissible-dialog signals at all. */
.modal-content.sheet-full {
  height: 100%;
  max-height: none;
  border-radius: 0;
  animation: sheetFade var(--transition) forwards;
}

@keyframes sheetUp {
  from { transform: translateY(6%); opacity: 0; }
  to   { transform: translateY(0);  opacity: 1; }
}

@keyframes sheetFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Header -------------------------------------------------------------
   Left-aligned, same scale as a page title, with room for the close
   control on the right. Optional sub-line: .modal-header p. */

.modal-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--page-gutter) var(--space-4);
  padding-right: calc(var(--page-gutter) + var(--tap-min));
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-titles);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
  color: var(--text-strong);
}

.modal-header p {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-muted);
  text-wrap: pretty;
}

/* A grab handle instead of a header, for short confirmations. */
.modal-content .sheet-handle {
  flex-shrink: 0;
  width: 40px;
  height: 4px;
  margin: var(--space-3) auto 0;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
}

/* --- Body ---------------------------------------------------------------- */

.modal-body {
  flex-grow: 1;
  padding: var(--space-5) var(--page-gutter);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Footer -------------------------------------------------------------
   White, not grey — the grey read as a second surface. Vertical stack:
   the primary action is full width and the secondary sits under it,
   so a two-word label never has to wrap into two lines. */

.modal-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--page-gutter)
           calc(var(--space-4) + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Side-by-side only where both labels are one short word. */
.modal-footer.is-inline {
  flex-direction: row;
  align-items: center;
}

/* --- Close --------------------------------------------------------------- */

.modal-close-icon {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  width: var(--tap-min);
  height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-chip);
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition);
}

.modal-close-icon:hover { background: var(--surface-sunken); }

/* --- Explanation carousel (unchanged behaviour) -------------------------- */

#explication-slides-wrapper {
  position: relative;
  width: 100%;
  min-height: 250px;
  overflow: hidden;
}

#explication-slides-inner {
  display: flex;
  width: 100%;
  transition: transform var(--transition-slow);
  will-change: transform;
}

.expl-slide {
  flex: 0 0 100%;
  width: 100%;
  padding: 0 var(--page-gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* --- Caregiver detail sheet --------------------------------------------- */

.detail-card {
  max-width: 720px;
  padding: 0;
  overflow: hidden;
}

.cg-detail-header {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding: var(--space-6) var(--page-gutter) var(--space-5);
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cg-detail-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.cg-detail-identity h2 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-xl);
}

.cg-detail-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.cg-detail-body {
  flex-grow: 1;
  padding: var(--space-5) var(--page-gutter);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-section { margin-bottom: var(--space-6); }

.detail-section h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--space-2);
}

.cg-bio-text {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-main);
}

.detail-footer {
  flex-shrink: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--page-gutter)
           calc(var(--space-4) + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin: 0;
}

.price-big {
  font-family: var(--font-titles);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* --- PWA install prompt (same shape as every other sheet) --------------- */

#pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#pwa-install-modal.hidden { display: none; }

.pwa-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
}

.pwa-modal-content {
  position: relative;
  width: 100%;
  max-width: 720px;
  padding: var(--space-6) var(--page-gutter)
           calc(var(--space-5) + var(--safe-bottom));
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: var(--shadow-md);
  text-align: left;
  animation: sheetUp var(--transition-slow) forwards;
}

.pwa-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.pwa-modal-content h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  color: var(--text-strong);
}

.pwa-modal-content p {
  margin: 0 0 var(--space-5);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

.pwa-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* --- FICHE AIDANT ------------------------------------------------------ */
.cg-sheet-head {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--surface-sunken);
}
.cg-sheet-photo {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 20px; object-fit: cover;
  background: var(--surface-sunken);
  cursor: pointer;
}
.cg-sheet-ident { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.cg-sheet-name {
  margin: 0;
  font-family: var(--font-titles);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.cg-sheet-place {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.cg-sheet-place .icon { flex-shrink: 0; }
.cg-sheet-close {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.cg-sheet-close:hover { border-color: var(--border-strong); color: var(--text-strong); }

.cg-sheet-body { display: flex; flex-direction: column; gap: 22px; }
.cg-block { display: flex; flex-direction: column; gap: 9px; }
.cg-block-label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cg-bio { margin: 0; font-size: var(--text-base); line-height: 1.6; color: var(--text-main); text-wrap: pretty; }

/* Correspondance avec la demande */
.cg-match {
  display: flex; flex-direction: column; gap: 11px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--color-success-soft);
  border: 1px solid color-mix(in oklch, var(--color-success) 28%, #fff);
}
.cg-match.is-partial {
  background: var(--color-warning-soft);
  border-color: var(--color-warning-border);
}
.cg-match-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-titles);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-success);
}
.cg-match.is-partial .cg-match-head { color: var(--color-warning); }

.cg-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-main);
}
.cg-chip .icon { font-size: 1rem; flex-shrink: 0; }
.cg-chip.is-ok {
  background: var(--surface);
  border-color: color-mix(in oklch, var(--color-success) 28%, #fff);
  color: var(--color-success);
  font-weight: var(--weight-semibold);
}
.cg-chip.is-missing {
  background: transparent;
  border-style: dashed;
  color: var(--text-muted);
  text-decoration: line-through;
}
.cg-chip.is-like { background: var(--color-accent-soft); border-color: var(--color-accent-border); color: var(--color-accent-ink); }

/* Pied : un montant, une action */
.cg-sheet-foot { display: flex; align-items: center; gap: var(--space-3); padding: 14px 20px 22px; }
.cg-price { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.cg-price-line { display: flex; align-items: baseline; gap: 5px; }
.cg-price-total {
  font-family: var(--font-titles);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.cg-price-cycle { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-muted); }
.cg-price-detail { font-size: var(--text-sm); color: var(--text-muted); }
.cg-action { flex: 1; }
.cg-action .contact-btn { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cg-action .cg-action-note { margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: var(--text-muted); text-align: center; }
.cg-action .status-badge {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 16px;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}.modal-footer.cg-sheet-foot {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 14px 20px 22px;
}
.cg-sheet-foot .cg-price { flex: 0 0 auto; }
.cg-sheet-foot .cg-action { flex: 1 1 auto; min-width: 0; }
/* ---------- EN-TÊTE : le duo, le statut, le prix ---------------------- */
.sub-head-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Aidant à gauche, protégé décalé par-dessus : l'ordre de lecture du titre. */
.sub-head-avatars {
    display: flex;
    flex-shrink: 0;
}

.sub-head-avatars img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--surface-sunken);
    border: 2px solid var(--surface);
}

/* Le second <img> (le protégé) chevauche le premier. */
.sub-head-avatars img + img { margin-left: -14px; }

.sub-head-id {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* En-tête de la fiche aidant avec adresse : le bloc photo / nom / pastilles à gauche, le bouton « Adresse » à droite,
   étroit et de la MÊME HAUTEUR que ce bloc (align-items: stretch). Sans adresse, ces deux enveloppes n'existent pas. */
.sub-head-split {
    display: flex;
    align-items: stretch;
    gap: var(--space-3);
}

/* Même empilement que .modal-header (rangée, puis pastilles). */
.sub-head-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Bouton « Adresse » : icône au-dessus du libellé, rose (framboise) comme les alertes. */
.sub-addr-btn {
    flex-shrink: 0;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--color-warning-border);
    border-radius: 18px;
    background: var(--color-warning-soft);
    color: var(--color-warning);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sub-addr-btn .icon { width: 26px; height: 26px; }
.sub-addr-btn:active { background: var(--color-warning-border); }

.sub-head-eyebrow {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}

.sub-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-chip);
    background: var(--surface-sunken);
    color: var(--text-main);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.sub-chip i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.sub-chip.is-active   { background: var(--color-success-soft); color: var(--color-success); font-weight: var(--weight-bold); }
.sub-chip.is-info     { background: var(--color-info-soft);    color: var(--color-info);    font-weight: var(--weight-bold); }
.sub-chip.is-warning  { background: var(--color-warning-soft); color: var(--color-warning); font-weight: var(--weight-bold); }
.sub-chip.is-danger   { background: var(--color-danger-soft);  color: var(--color-danger);  font-weight: var(--weight-bold); }
.sub-chip.is-neutral i { display: none; }

/* ---------- CORPS : heures, dates ------------------------------------- */
.sub-detail-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sub-hours-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--surface-sunken);
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius-sm);
}

.hour-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Deux filets au lieu de trois cellules flottantes : les colonnes se lisent. */
.hour-item + .hour-item { border-left: 1px solid var(--border); }

.hour-item label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.hour-item span {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

.hour-item.accent span { color: var(--color-accent-ink); }

/* .sub-dates-inline / .date-item servent aussi au modal aidant
   (core.js, renderSubscriptionModalContentCG) : ne pas supprimer. */
.sub-dates-inline {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.date-item {
    display: flex;
    align-items: center;
    gap: 9px;
}

.date-item .icon {
    width: 20px;
    height: 20px;
    color: var(--text-subtle);
    flex-shrink: 0;
}

.date-item label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.date-item p {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

/* ---------- ACTIONS --------------------------------------------------- */
.sub-actions-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Utilisée aussi par le modal aidant. */
.danger-text {
    color: var(--color-danger);
    background: var(--surface);
    border: 1px solid var(--color-danger-soft);
}

.danger-text:active { background: var(--color-danger-soft); }
/* ---------- En-tête : les deux modals d'abonnement -------------------- */
/* .modal-header réserve 44 px à droite pour un bouton de fermeture qui
   n'existe pas ici (la fermeture est dans le footer) : on les rend au titre. */
#sub-modal-head,
#sub-cg-head { padding-right: var(--page-gutter); }

#sub-modal-head h2,
#sub-cg-head h2 {
    font-size: var(--text-lg);
    line-height: var(--leading-tight);
    overflow-wrap: anywhere;
}

/* ---------- Modal aidant : adresse, bio, abonnement planifié ---------- */
/* Même gabarit que .date-item (icône + bloc texte), mais l'adresse passe à
   la ligne : on aligne sur le haut. */
.sub-place {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.sub-place .icon {
    width: 20px;
    height: 20px;
    color: var(--text-subtle);
    flex-shrink: 0;
    margin-top: 2px;
}

.sub-place-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sub-place-body address {
    font-style: normal;
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
    color: var(--text-strong);
    text-wrap: pretty;
}

.sub-place-body a {
    align-self: flex-start;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-accent-ink);
    text-decoration: none;
    border-bottom: 1px dashed;
}

.sub-note {
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-note-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}

.sub-note p {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    line-height: var(--leading-normal);
    color: var(--text-main);
    white-space: pre-line;
    text-wrap: pretty;
}

/* Bloc « Mes notes » de la fiche aidant : même carte que « À propos », bouton d'édition à droite du titre. */
.sub-notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 36px;
}

.sub-notes-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sub-notes-btn .icon { width: 20px; height: 20px; }
.sub-notes-btn:active { background: var(--bg); }

/* Les notes gardent leurs espaces et retours à la ligne (un code, une liste) ; sans note, la phrase d'aide est discrète. */
.sub-note p.sub-notes-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sub-note p.sub-notes-text.is-empty { color: var(--text-muted); }

/* Abonnement pas encore commencé : le pointillé dit « en attente » sans
   couleur d'alerte — rien ne va mal. */
.sub-planned {
    background: var(--surface-sunken);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.sub-planned .icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

.sub-planned-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sub-planned-body strong {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

.sub-planned-body span {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    line-height: var(--leading-normal);
    color: var(--text-main);
    text-wrap: pretty;
}
/* ---------- Actions en tuiles (modal abonnement famille) -------------- */
.sub-action-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sub-action-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sub-action-label {
    font-size: 11px;
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}

.sub-action-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.sub-tile {
    min-height: 128px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    /* Texte calé sous l'icône, pas en bas : les titres des deux tuiles d'une
       ligne s'alignent même si l'un tient sur une ligne et l'autre sur deux. */
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--space-3);
    text-align: left;
    font-family: var(--font-body);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sub-tile:active { background: var(--bg); }

.sub-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-sunken);
    color: var(--text-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-tile-icon .icon { width: 22px; height: 22px; }

.sub-tile-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sub-tile-title {
    font-size: 15px;
    font-weight: var(--weight-bold);
    line-height: 1.25;
    color: var(--text-strong);
    text-wrap: pretty;
}

.sub-tile-hint {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    line-height: 1.35;
    color: var(--text-muted);
    text-wrap: pretty;
}

/* Groupe « Arrêter » : framboise (comme les alertes carte), fond toujours blanc. */
.sub-tile.is-danger { border-color: var(--color-warning-border); }
.sub-tile.is-danger:active { background: var(--color-warning-soft); }
.sub-tile.is-danger .sub-tile-icon { background: var(--color-warning-soft); color: var(--color-warning); }

/* Section à un seul bouton (« Mettre en pause ») : pleine largeur, icône à gauche du
   texte plutôt qu'au-dessus — un bouton large et haut de 128 px serait disproportionné. */
.sub-action-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.sub-tile.is-wide {
    min-height: 0;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
}
.sub-tile.is-danger .sub-tile-title { color: var(--color-warning); }
.sub-tile.is-danger .sub-tile-hint { color: color-mix(in oklch, var(--color-warning) 55%, var(--text-main)); }

/* Action principale d'un groupe (fiche aidant : « Démarrer une visite ») : bordure et icône corail,
   le reste de la tuile ne change pas. */
.sub-tile.is-primary { border-color: var(--color-accent-border); }
.sub-tile.is-primary:active { background: var(--color-accent-soft); }
.sub-tile.is-primary .sub-tile-icon { background: var(--color-accent-soft); color: var(--color-accent-ink); }

/* ---------- Modaux d'aide (« Comment ça marche », explainers) ----------
   Feuille montante comme les autres : coins arrondis en haut seulement (le
   style inline imposait 28px partout). Le titre est centré : .modal-header
   réserve 44px à droite pour un bouton de fermeture absent ici, ce qui
   décalait le titre vers la gauche. */
.help-sheet .modal-content { border-radius: 28px 28px 0 0 !important; }
.help-sheet .modal-header {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
.help-sheet .modal-header h3,
.help-sheet .modal-header p { text-align: center; width: 100%; }

/* Fiche aidant : relation avec la famille */
.cg-family-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.9rem; color: var(--text-muted); }
.cg-family-row .icon { font-size: 1.05rem; flex-shrink: 0; }
.cg-family-row.is-active { color: var(--color-success); font-weight: 600; }
