/* Panneaux, cards, onglets, badges, messages. */

.panel,
.auth-card {
  padding:       var(--pad-card);
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

.panel {
  margin-bottom: 1.5rem;
}

.auth-card {
  width:         100%;
  max-width:     420px;
  padding:       28px;
  border-radius: var(--r-panel);
}

/* --- Cards de bien -------------------------------------------------------- */

.card-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap:                   16px;
}

.card {
  padding:       var(--pad-card);
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

.card-title {
  font-family:    var(--font-title);
  font-size:      var(--t-h3);
  font-weight:    600;
  letter-spacing: -0.01em;
  color:          var(--ink);
}

.card-title:hover {
  color: var(--teal-dark);
}

/* La carte d'un bien : une barre de 8 px dit son état, de la couleur de son
   badge, et toute la carte mène au bien (25-ux-enhancements.md §4). Le lien du
   titre s'étire sur la carte entière ; le badge-lien passe au-dessus. */
.property-card {
  --property-tone: var(--line-strong);

  position:    relative;
  overflow:    hidden;
  padding-top: calc(20px + 8px);
  transition:  border-color 0.15s;
}

.property-card-pos    { --property-tone: var(--teal); }
.property-card-warn   { --property-tone: var(--warn-accent); }
.property-card-locked { --property-tone: var(--muted-2); }

.property-card::before {
  content:    "";
  position:   absolute;
  inset:      0 0 auto;
  height:     8px;
  background: var(--property-tone);
}

/* Au survol, la bordure prend la couleur de la barre plutôt que le marine de
   la maquette : la carte se lit d'une seule couleur. */
.property-card:hover,
.property-card:focus-within {
  border-color: var(--property-tone);
}

.property-card .card-title::after {
  content:  "";
  position: absolute;
  inset:    0;
}

.property-card .card-title:focus-visible {
  outline: none;
}

.property-card:has(.card-title:focus-visible) {
  outline:        2px solid var(--property-tone);
  outline-offset: 2px;
}

.property-card .badge-link {
  position: relative;
  z-index:  1;
}

/* --- Pour bien démarrer ------------------------------------------------------
 * La carte d'accueil du dashboard (25-ux-enhancements.md §1) : un compteur, la
 * barre d'avancement, puis les étapes — faites (coche verte), la prochaine
 * (mise en avant), et celles qui attendent un bien (estompées). */

.getting-started {
  display:        flex;
  flex-direction: column;
  gap:            14px;
}

.getting-started-head {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  gap:             16px;
}

.getting-started-head h2 {
  margin:      0;
  font-family: var(--font-title);
  font-size:   var(--t-h3);
  font-weight: 600;
}

.getting-started-count {
  margin:      2px 0 0;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

/* `button[type="submit"]` pèse plus lourd que `.button-link` : nommé ici pour
   que « Masquer » et « Pas de crédit » restent des liens, pas des boutons. */
.getting-started button[type="submit"].button-link {
  padding:     0;
  border:      0;
  background:  none;
  color:       var(--muted);
  font-size:   var(--t-sub);
  font-weight: 400;
  text-decoration: underline;
}

.getting-started button[type="submit"].button-link:hover {
  color: var(--ink);
}

/* « Masquer » : un vrai bouton, cadré et cliquable sans viser, mais d'un ton
   en dessous — la carte invite à faire les étapes, pas à la fermer. */
.getting-started button[type="submit"].getting-started-dismiss {
  padding:     6px 14px;
  border-color: var(--line);
  color:       var(--muted);
  font-size:   var(--t-sub);
  font-weight: 400;
}

.getting-started button[type="submit"].getting-started-dismiss:hover {
  border-color: var(--line-strong);
  color:        var(--ink);
}

.getting-started-steps {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:                   12px;
  margin:                0;
  padding:               0;
  list-style:            none;
}

.getting-started-step {
  display:       flex;
  gap:           10px;
  padding:       12px;
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

.getting-started-step.is-next {
  border-color: var(--teal);
  background:   var(--pos-bg);
}

.getting-started-step.is-waiting {
  opacity: 0.55;
}

.getting-started-mark {
  display:         inline-flex;
  flex:            none;
  align-items:     center;
  justify-content: center;
  width:           24px;
  height:          24px;
  border-radius:   50%;
  background:      var(--surface-alt);
  color:           var(--muted);
  font-family:     var(--font-mono);
  font-size:       var(--t-label);
}

.getting-started-step.is-next .getting-started-mark {
  background: var(--teal);
  color:      var(--teal-ink);
}

.getting-started-step.is-done .getting-started-mark {
  background: var(--pos-bg-2);
  color:      var(--pos-strong);
}

.getting-started-text {
  display:        flex;
  flex-direction: column;
  gap:            4px;
  min-width:      0;
}

.getting-started-text > a,
.getting-started-text > span {
  font-weight: 600;
  color:       var(--ink);
}

.getting-started-step.is-done .getting-started-text > span {
  color:           var(--muted);
  text-decoration: line-through;
}

.getting-started-hint {
  margin:    0;
  color:     var(--muted);
  font-size: var(--t-sub);
}

.card-sub {
  margin:    4px 0 0;
  color:     var(--muted);
  font-size: var(--t-sub);
}

/* Qui gère la location en cours, sous la ville : une icône et quelques mots. */
.card-management {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin:      6px 0 0;
  color:       var(--muted);
  font-size:   var(--t-small);
}

.card-figures,
.figures {
  display:   flex;
  flex-wrap: wrap;
  gap:       16px 32px;
  margin:    16px 0 0;
}

.card-figures dt,
.figures dt {
  margin:         0;
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--muted);
}

.card-figures dd,
.figures dd {
  margin:               4px 0 0;
  font-family:          var(--font-mono);
  font-size:            var(--t-lead);
  font-weight:          500;
  font-variant-numeric: tabular-nums;
}

.figures {
  margin-top: 0;
}

/* Une précision sous un chiffre — « 2 loués, 1 vacant » — qui ne doit pas se
   lire comme un second chiffre. */
.figures-note {
  display:     block;
  margin-top:  2px;
  color:       var(--muted);
  font-size:   var(--t-small);
  font-weight: 400;
}

/* --- Onglets -------------------------------------------------------------- */

/* La barre d'onglets porte l'action de l'onglet à son extrémité droite. Le
   filet et la marge basse sont posés sur elle, pas sur la liste d'onglets, pour
   que le bouton s'aligne sur le même trait. */
.tab-bar {
  display:       flex;
  align-items:   flex-end;
  gap:           1rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.tab-bar > .button {
  flex:          none;
  margin-bottom: 8px;
}

/* Le design abandonne les onglets « dossier » pour un simple soulignement. */
.tabs {
  display:       flex;
  flex:          1;
  gap:           4px;
  padding:       0 2px;
  overflow-x:    auto;
}

.tab {
  padding:       11px 14px;
  border-bottom: 2px solid transparent;
  color:         var(--muted);
  font-size:     var(--t-body);
  white-space:   nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab-active {
  border-bottom-color: var(--teal);
  color:               var(--ink);
  font-weight:         500;
}

/* --- Badges --------------------------------------------------------------- */

.badge {
  display:        inline-block;
  padding:        3px 8px;
  border-radius:  var(--r-badge);
  background:     var(--surface-alt);
  color:          var(--muted);
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  font-weight:    500;
  letter-spacing: 0.02em;
  white-space:    nowrap;
}

.badge-pos {
  background: var(--pos-bg-2);
  color:      var(--pos-strong);
}

.badge-neg {
  background: var(--neg-bg);
  color:      var(--neg-strong);
}

.badge-warn {
  background: var(--warn-bg);
  color:      var(--warn);
}

.badge-accent {
  background: var(--teal);
  color:      var(--teal-ink);
}

/* Une suggestion plutôt qu'un état : un simple contour, qui ne passe pas
   devant le badge d'état qu'il accompagne. Il se remplit au survol de son lien. */
.badge-outline {
  background: transparent;
  color:      var(--teal-dark);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.badge-link:hover .badge-outline {
  background: var(--pos-bg);
}

/* --- Barre de progression -------------------------------------------------- */

.progress {
  height:        6px;
  border-radius: 3px;
  background:    var(--line-soft);
  overflow:      hidden;
}

.progress-fill {
  height:        100%;
  border-radius: 3px;
  background:    var(--teal);
}

.progress-fill-neg {
  background: var(--neg);
}

/* --- Messages flash -------------------------------------------------------- */

.flash {
  margin:        0 0 1rem;
  padding:       11px 14px;
  border:        1px solid transparent;
  border-radius: var(--r-ctl);
  font-size:     var(--t-sub);
}

.flash-success {
  background:   var(--pos-bg);
  border-color: var(--pos-bg-2);
  color:        var(--pos-strong);
}

.flash-error {
  background:   var(--neg-bg);
  border-color: var(--neg-bg);
  color:        var(--neg-strong);
}

.flash-info {
  background:   var(--surface-alt);
  border-color: var(--line-strong);
  color:        var(--ink-2);
}

/* Ambre : rien n'est faux, mais l'ordre compte. */
.flash-warning {
  background:   var(--warn-bg);
  border-color: var(--warn-accent);
  color:        var(--warn);
}

.flash-warning a {
  color:       inherit;
  font-weight: 600;
}

/* --- Bandeau d'état --------------------------------------------------------- */

/* Ce que le plan interdit, dit en haut de l'écran où on s'apprêtait à le faire.
   Ambre et non rouge : rien n'est cassé, et rien n'est perdu — c'est une limite,
   pas une erreur.

   `.consent-banner` en a l'allure sans en porter la classe : la question du
   consentement (15-contacts-brevo.md §1) n'est pas un état de la page, et ce
   qui cherche « le » bandeau d'une page ne doit pas la trouver. */
.banner,
.consent-banner {
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin:        0 0 1rem;
  padding:       11px 14px;
  border:        1px solid var(--warn-accent);
  border-radius: var(--r-ctl);
  background:    var(--warn-bg);
  color:         var(--warn);
  font-size:     var(--t-sub);
}

.banner svg,
.consent-banner svg {
  flex-shrink: 0;
}

/* L'essai en cours : une information, pas une limite — le ton neutre de la
   marque, jusqu'aux trois derniers jours. */
.banner-info,
.consent-banner {
  border-color: var(--line);
  background:   var(--surface-soft);
  color:        var(--ink-2);
}

/* Les trois derniers jours de l'essai, et les biens qu'il a laissés en lecture
   seule : l'ambre du bandeau de limite, dit explicitement. */
.banner-warn {
  border-color: var(--warn-accent);
  background:   var(--warn-bg);
  color:        var(--warn);
}

/* --- Abonnement et crédits -------------------------------------------------- */

/* Le solde, en gros, à droite du titre du compteur — la même disposition que
   l'en-tête d'un prêt. */
.credit-total {
  margin:               0;
  color:                var(--ink);
  font-family:          var(--font-mono);
  font-size:            var(--t-h2);
  font-variant-numeric: tabular-nums;
}

.credit-lines {
  margin:     12px 0 0;
  padding:    0;
  list-style: none;
}

/* Trois colonnes : d'où vient le lot, jusqu'à quand il vaut, combien il reste.
   La date est au milieu parce que c'est elle qui justifie l'ordre des lignes. */
.credit-lines .figure-row {
  display:               grid;
  grid-template-columns: 1fr auto 70px;
  gap:                   12px;
}

.credit-line-meta {
  color:     var(--muted);
  font-size: var(--t-small);
}

.credit-line-amount {
  color:                var(--ink);
  font-family:          var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align:           right;
}

.plan-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:                   16px;
  margin-top:            14px;
}

.plan-card {
  padding:       var(--pad-card);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
  background:    var(--surface-soft);
}

/* Le palier en cours se distingue par son trait, pas par un fond : trois cards
   de couleurs différentes se liraient comme trois offres promotionnelles. */
.plan-card-current {
  border-color: var(--teal);
  background:   var(--surface);
}

.plan-price {
  margin:      12px 0 0;
  color:       var(--ink);
  font-family: var(--font-mono);
  font-size:   var(--t-h3);
}

.plan-price small {
  color:       var(--muted);
  font-family: var(--font-body);
  font-size:   var(--t-small);
}

.plan-price-year {
  margin:    2px 0 0;
  color:     var(--muted);
  font-size: var(--t-small);
}

.plan-features {
  margin:     14px 0 0;
  padding:    0;
  list-style: none;
  font-size:  var(--t-sub);
}

.plan-features li {
  padding-top: 7px;
  color:       var(--ink-2);
}

/* Les deux engagements côte à côte, de même poids : l'annuel est mis en avant
   par ce qu'il donne — les scans offerts, déjà listés au-dessus — et pas par un
   bouton deux fois plus gros. */
.plan-actions {
  display:     flex;
  gap:         8px;
  margin-top:  14px;
  flex-wrap:   wrap;
}

.plan-actions button {
  flex: 1 1 auto;
}

/* La bascule Mensuel / Annuel (14-homepage.md §4.7), **en CSS et rien d'autre**.
 *
 * Deux boutons radio cachés à l'œil et une paire d'étiquettes : le navigateur
 * fait le reste, y compris les flèches du clavier et la restauration de l'état
 * au retour arrière. Aucun JavaScript, donc elle marche sur le site public, qui
 * ne charge pas Stimulus (§8.5), et elle marche avant que le moindre script
 * n'ait tourné.
 *
 * Les radios sont des frères de la grille : c'est ce qui rend
 * `#interval-yearly:checked ~ .plan-grid` possible. Les déplacer casserait tout
 * sans rien afficher de faux, alors c'est écrit ici.
 */
.interval-radio {
  position: absolute;
  width:    1px;
  height:   1px;
  margin:   -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.interval-switch {
  display:       inline-flex;
  gap:           2px;
  padding:       3px;
  border:        1px solid var(--line);
  border-radius: var(--r-pill);
  background:    var(--surface-alt);
}

/* Des <label> : la marge basse que forms.css donne à toute étiquette de champ
   est retirée, sans quoi la pastille cochée descend dans la bascule. */
.interval-switch-option {
  margin:        0;
  padding:       6px 14px;
  border-radius: var(--r-pill);
  color:         var(--ink-2);
  font-size:     var(--t-sub);
  cursor:        pointer;
  user-select:   none;
}

/* L'étiquette de la radio cochée porte l'état : c'est le seul endroit où la
   bascule « se souvient » de quoi que ce soit. */
#interval-monthly:checked ~ .interval-switch [for="interval-monthly"],
#interval-yearly:checked ~ .interval-switch [for="interval-yearly"] {
  background: var(--surface);
  color:      var(--ink);
  box-shadow: 0 1px 2px rgb(27 58 87 / 12%);
}

/* La radio est invisible, donc son anneau de focus doit se voir sur
   l'étiquette — sans quoi la bascule devient intraversable au clavier. */
#interval-monthly:focus-visible ~ .interval-switch [for="interval-monthly"],
#interval-yearly:focus-visible ~ .interval-switch [for="interval-yearly"] {
  outline:        2px solid var(--teal-dark);
  outline-offset: 2px;
}

/* Ce que chaque intervalle montre. Les deux volets sont dans le document : sans
   feuille de style, la page affiche les deux prix côte à côte, ce qui reste
   juste. */
#interval-monthly:checked ~ .plan-grid .interval-pane[data-interval="yearly"],
#interval-yearly:checked ~ .plan-grid .interval-pane[data-interval="monthly"] {
  display: none;
}

.interval-switch-note {
  color:     var(--pos);
  font-size: var(--t-small);
}

/* Barré contre le prix mensuel : « 2 mois offerts » se démontre plutôt qu'il
   ne s'annonce. */
.plan-price-year s {
  color: var(--muted-2);
}

/* Ce que dit la carte gratuite quand elle n'est pas à prendre : une carte qui
   perd seulement son bouton ne dit pas pourquoi. */
.plan-note {
  margin:    14px 0 0;
  color:     var(--muted);
  font-size: var(--t-sub);
}

/* Le palier mis en avant (§4.7) : un trait, une ombre, et la pastille
   « Recommandé » — un conseil de l'éditeur. Pas « Le plus choisi » de la
   maquette : c'est une preuve sociale, et il n'y a pas encore un seul abonné
   pour la soutenir (§1.1). */
.plan-card-featured {
  border-color: var(--teal);
  border-width: 1.5px;
  background:   var(--surface);
  box-shadow:   0 18px 40px -28px color-mix(in srgb, var(--navy) 40%, transparent);
}

.pack-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:                   16px;
  margin-top:            14px;
}

.pack-card {
  display:        flex;
  flex-direction: column;
  gap:            8px;
  padding:        var(--pad-card);
  border:         1px solid var(--line);
  border-radius:  var(--r-card);
  background:     var(--surface-soft);
}

.pack-card .plan-price {
  margin: 0;
}

/* Le bouton du portail et sa ligne d'état, au-dessus de la grille : l'espace
   du bas le sépare de la bascule Mensuel / Annuel, qui n'en a pas en haut. */
.billing-portal {
  display:     flex;
  align-items: center;
  gap:         10px;
  margin:      14px 0 22px;
  flex-wrap:   wrap;
}

/* --- Divers ---------------------------------------------------------------- */

.loan-head {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             1rem;
}

.loan-head h2 {
  margin-bottom: 0;
}

.loan-head a {
  color:     var(--muted);
  font-size: var(--t-sub);
}

.loan-head a:hover {
  color: var(--teal-dark);
}

/* --- Onglet Prêt : l'encart bleu, les caractéristiques, la vie du prêt ---------
 * 25-ux-enhancements.md §7.2 : à gauche l'encart marine, à droite les
 * caractéristiques ; la vie du prêt puis le tableau dessous, pleine largeur.
 * Une colonne sous 900 px. */

.loan-layout {
  display:               grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap:                   22px;
  align-items:           stretch;
  margin-bottom:         28px;
}

.loan-main {
  display:        flex;
  flex-direction: column;
  gap:            16px;
  min-width:      0;
}

.loan-side {
  min-width: 0;
}


.loan-card {
  display:        flex;
  flex-direction: column;
  gap:            18px;
  padding:        20px 22px;
  border-radius:  var(--r-card);
  background:     var(--navy);
  color:          #FFFFFF;
}

.loan-card-head {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  gap:             14px;
}

.loan-card-head h2 {
  margin:      0;
  color:       #FFFFFF;
  font-size:   var(--t-lead);
  font-weight: 600;
}

.loan-card-meta {
  margin:      3px 0 0;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--side-meta);
}

.loan-card-edit {
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--teal);
  white-space:    nowrap;
}

.loan-card-edit:hover {
  color: #FFFFFF;
}

.loan-card-progress {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.loan-card-progress-text {
  display:         flex;
  justify-content: space-between;
  gap:             12px;
  font-family:     var(--font-mono);
  font-size:       var(--t-label);
  color:           var(--side-meta);
}

.loan-card .progress {
  background: rgb(255 255 255 / 0.14);
}

.loan-card .progress-fill {
  background: var(--teal);
}

.loan-card-figures {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   16px;
  margin:                0;
}

.loan-card-figures dt {
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--side-meta);
}

.loan-card-figures dd {
  margin:               4px 0 0;
  font-family:          var(--font-title);
  font-size:            26px;
  font-weight:          600;
  line-height:          1.1;
  font-variant-numeric: tabular-nums;
}

.loan-card-figures dd.loan-card-note {
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  font-weight: 400;
  color:       var(--teal);
}

.loan-card-next {
  margin:      0;
  padding-top: 14px;
  border-top:  1px solid var(--navy-line);
  font-size:   var(--t-sub);
}

.loan-card-next span {
  color: var(--side-meta);
}

.loan-specs {
  display:        flex;
  flex-direction: column;
  padding:       18px 22px;
  border:        1px solid var(--line);
  border-radius: var(--r-card);
  background:    var(--surface);
}

.loan-specs h3 {
  margin: 0 0 10px;
}

.loan-specs dl {
  margin: 0;
}

/* Les deux colonnes finissent à la même hauteur : à droite, le cadre
   s'étire le long de l'encart et de la courbe, et ses lignes se répartissent
   sur toute la hauteur plutôt que de laisser un vide en bas. */
.loan-side {
  display:        flex;
  flex-direction: column;
}

.loan-side .loan-specs {
  flex: 1;
}

.loan-side .loan-specs dl {
  display:         flex;
  flex:            1;
  flex-direction:  column;
  justify-content: space-between;
}

.loan-specs dl > div {
  display:         flex;
  justify-content: space-between;
  gap:             16px;
  padding:         7px 0;
  border-bottom:   1px solid var(--line-soft);
  font-size:       var(--t-sub);
}

.loan-specs dl > div:last-child {
  border-bottom: 0;
}

.loan-specs dt {
  color: var(--muted);
}

.loan-specs dd {
  margin:               0;
  text-align:           right;
  font-variant-numeric: tabular-nums;
}

.loan-specs-total dt,
.loan-specs-total dd {
  color:       var(--ink);
  font-weight: 600;
}

@media (max-width: 900px) {
  .loan-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Tuile d'indicateur ----------------------------------------------------- */

.stat-card {
  padding:       var(--pad-card);
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

.stat-card .eyebrow {
  margin: 0 0 10px;
}

.stat-card-value {
  display:     flex;
  align-items: baseline;
  gap:         5px;
  margin:      0;
}

.stat-card-number {
  font-family:          var(--font-title);
  font-size:            var(--t-figure);
  font-weight:          600;
  line-height:          1;
  letter-spacing:       -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card-unit {
  color:       var(--muted);
  font-family: var(--font-mono);
  font-size:   var(--t-lead);
}

.stat-card-hint {
  display:     flex;
  align-items: center;
  gap:         5px;
  margin:      10px 0 0;
  color:       var(--muted);
  font-size:   var(--t-small);
}

.stat-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:                   16px;
  margin-bottom:         20px;
}

/* --- Ligne libellé / valeur --------------------------------------------------- */

.figure-row {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             16px;
  padding:         11px 0;
  border-bottom:   1px solid var(--line-soft);
}

.figure-row:last-child {
  border-bottom: 0;
}

.figure-row-label {
  color:     var(--muted);
  font-size: var(--t-sub);
}

.figure-row-value {
  font-family:          var(--font-mono);
  font-size:            var(--t-body);
  font-weight:          500;
  font-variant-numeric: tabular-nums;
  text-align:           right;
}

/* --- Blocs du tableau de bord ----------------------------------------------- */

/* Douze colonnes, et une largeur par bloc. C'est ce que « emplacement et
   dimension » veut dire tant que personne ne déplace rien à la souris. */
.dashboard-grid {
  display:               grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap:                   1.5rem;
  margin:                0 0 1.5rem;
}

/* Une ligne de blocs qui se partagent la largeur, quel qu'en soit le nombre :
   ceux qui n'ont rien à dire ne s'affichent pas, et les autres s'élargissent.
   C'est la règle du voisin qui prend la ligne (`09-enhance-dashboards.md` §3)
   généralisée à trois blocs — la page n'a pas à les compter, et elle ne le
   pourrait pas sans les rendre deux fois. */
.dashboard-row {
  display:               grid;
  grid-column:           span 12;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:                   1.5rem;
}

/* Dans une telle ligne, la largeur vient du partage, pas de la prop. */
.dashboard-row > .dashboard-block {
  grid-column: auto;
}

/* Le cadre appartient au bloc, pas à son contenu : écrit ici une fois, aucun
   gabarit de bloc ne dessine le sien. Un bloc ajouté l'a d'office, un bloc
   déplacé l'emporte avec lui (`09-enhance-dashboards.md` §3). */
.dashboard-block {
  position:      relative;
  min-width:     0; /* sans quoi un canvas refuse de rétrécir dans sa colonne */
  overflow:      hidden; /* le tableau masqué d'un graphique, qui ignore sa
                            largeur d'un pixel, élargissait la page au téléphone */
  grid-column:   span 12;
  padding:       var(--pad-card);
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

/* Les tuiles de la synthèse portent leur intitulé en titre de bloc : le cadre
   est celui du bloc, et la tuile perd le sien — sans quoi ce serait un cadre
   dans un cadre. */
.dashboard-block.block-figure {
  container-type: inline-size;
}

.block-figure .stat-card {
  padding:       0;
  background:    none;
  border:        0;
  border-radius: 0;
}

/* Une tuile au tiers de la grille est étroite entre 900 et 1 200 px : le grand
   chiffre suit alors la largeur de son bloc plutôt que d'être coupé, sans
   jamais dépasser sa taille d'origine. */
.block-figure .stat-card-number {
  font-size: min(var(--t-figure), 13cqi);
}

/* Le triangle de variation, dans le pied d'une tuile : sa couleur vient des
   montants (`amount-positive` / `amount-negative`), jamais d'un vert ou d'un
   rouge écrit ici. */
.trend {
  font-size:   0.8em;
  line-height: 1;
}

/* La tendance, sur sa propre ligne sous le résultat cumulé. */
.cash-flow-pace {
  display:    block;
  margin-top: 4px;
}

/* Le filtre de période est enveloppé comme un bloc : le cadre est celui du
   bloc, et le formulaire perd le sien — sans quoi ce serait un cadre dans un
   cadre. Le filtre du grand livre, hors grille, garde le sien. Le bloc garde
   en revanche le fond adouci des barres de filtres : il commande les autres
   blocs, et se distingue d'eux au premier coup d'œil. */
.dashboard-block.dashboard-filters-block {
  background: var(--surface-soft);
}

.dashboard-filters-block .dashboard-filters {
  margin:        0;
  padding:       0;
  background:    none;
  border:        0;
  border-radius: 0;
}

.block-small  { grid-column: span 4; }
.block-medium { grid-column: span 6; }
.block-wide   { grid-column: span 8; }
.block-large  { grid-column: span 12; }

/* Sous 900 px, plus de colonnes : deux graphiques côte à côte n'y tiennent pas.
   Le filtre de période remonte alors au-dessus de Le bien : empilé dessous, il
   tomberait sous un bloc haut d'un écran, loin de tout ce qu'il commande. */
@media (max-width: 900px) {
  .block-small,
  .block-medium,
  .block-wide {
    grid-column: span 12;
  }

  .dashboard-filters-block {
    order: -1;
  }
}

.block-title {
  margin:      0 0 0.9rem;
  font-family: var(--font-title);
  font-size:   var(--t-lead);
  font-weight: 600;
}

/* La portée d'un bloc que la période ne commande pas, dite sous son titre. */
.block-scope {
  margin:      -0.6rem 0 0.9rem;
  color:       var(--muted);
  font-family: var(--font-mono);
  font-size:   var(--t-label);
}

.block-note {
  margin:    0.9rem 0 0;
  color:     var(--muted);
  font-size: var(--t-small);
}

/* --- Graphiques -------------------------------------------------------------- */

.chart {
  margin: 0;
}

/* Chart.js dessine dans le parent : sans hauteur ici, le canvas s'effondre. */
.chart-canvas {
  position: relative;
  height:   320px;
}

/* Un camembert partage sa boîte avec sa légende, qui passe à la ligne dans une
   colonne étroite : sans un peu de hauteur en plus, il ne reste qu'un jeton. */
.chart-pie .chart-canvas {
  height: 380px;
}

.chart figcaption {
  margin:         0.75rem 0 0;
  color:          var(--muted);
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  letter-spacing: 0.04em;
}

/* --- Période du tableau de bord --------------------------------------------- */

/* Le résumé de la période, sur sa propre ligne en pied de l'encadré du filtre :
   le filtre se suffit à lui-même, et dit ce qu'il a retenu. */
.dashboard-period,
.ledger-period {
  flex-basis:  100%;
  margin:      0;
  color:       var(--muted);
  font-family: var(--font-mono);
  font-size:   var(--t-label);
}

/* --- État vide ------------------------------------------------------------------ */

.empty-message {
  margin: 0;
}

.empty-action {
  margin: 10px 0 0;
}

/* --- Baux ------------------------------------------------------------------ */

/* Même en-tête que celui d'un prêt : le titre dit l'état, le lien ouvre la
   saisie, et les deux tiennent la même ligne. */
.lease-head {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             1rem;
}

.lease-head h2 {
  margin-bottom: 0;
}

.lease-head a {
  color:     var(--muted);
  font-size: var(--t-sub);
}

.lease-head a:hover {
  color: var(--teal-dark);
}

/* Un bail se lit d'un bloc : qui, combien, jusqu'à quand. Le trait à gauche le
   détache de ses voisins dans l'historique sans en faire une carte de plus. */
.lease-card {
  margin:      1rem 0 0;
  padding:     0.9rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--line-strong);
}

.lease-card header {
  display:     flex;
  align-items: baseline;
  gap:         0.6rem;
}

.lease-card header h4 {
  margin:    0;
  font-size: var(--t-sub);
}

.lease-card .figures {
  margin: 0.7rem 0 0.5rem;
}

.lease-card .lease-dates {
  margin:    0 0 0.6rem;
  font-size: var(--t-small);
}

/* La révision du loyer selon l'IRL : une proposition, à valider ou écarter. */
.revision-panel {
  margin:        1rem 0 1.25rem;
  padding:       var(--pad-card);
  background:    var(--pos-bg);
  border:        1px solid var(--pos-bg-2);
  border-radius: var(--r-card);
}

/* Une baisse se montre telle quelle, sans alarme : ambre, pas rouge. */
.revision-panel-down {
  background:   var(--warn-bg);
  border-color: var(--warn-accent);
}

.revision-panel h3 {
  margin: 0 0 0.6rem;
}

.revision-panel .figures {
  margin: 0 0 0.4rem;
}

.revision-panel p {
  margin: 0 0 0.5rem;
}

.revision-panel .form-actions {
  justify-content: flex-end;
  flex-wrap:       wrap;
  margin:          0.8rem 0 0;
}

.revision-dismissed {
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         0.6rem;
}

.revision-dismissed button[type="submit"].button-link {
  padding:    0;
  border:     0;
  background: none;
  color:      inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Le passé pèse moins que le présent : l'historique s'efface d'un ton. */
.lease-history,
.lease-upcoming {
  margin-top: 1.8rem;
}

.lease-history .lease-card {
  border-left-color: var(--line);
  color:             var(--muted);
}

/* Le titre d'une card et son état locatif tiennent la même ligne : l'état se lit
   avant les chiffres, parce qu'un bien vacant explique son résultat à lui seul. */
.card-head {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             0.8rem;
}

/* L'action qui ferme un bail, ou le rouvre : elle vit dans l'en-tête de sa
   carte, à côté du crayon, et se lit comme une phrase plutôt qu'une icône. */
.lease-action {
  margin-left: auto;
  color:       var(--muted);
  font-size:   var(--t-small);
}

.lease-action:hover {
  color: var(--teal-dark);
}

/* Ce que le bail propose à ses deux bouts : le dépôt à l'entrée, sa restitution
   à la sortie. Une offre, pas une action déjà faite. */
.lease-offers {
  margin:    0.4rem 0 0.6rem;
  font-size: var(--t-small);
}

/* --- Les blocs d'action du tableau de bord global -------------------------- */

/* Le chiffre qui coiffe « À enregistrer » : c'est lui qu'on vient lire, pas la
   liste qui le détaille. */
.pending-total {
  margin: 0 0 12px;
  color:  var(--muted);
}

.pending-count {
  font-family:          var(--font-title);
  font-size:            var(--t-lead);
  font-weight:          600;
  font-variant-numeric: tabular-nums;
  color:                var(--ink);
}

.pending-clear {
  margin: 0;
  color:  var(--muted);
}

.pending-list,
.watchlist {
  margin:     0;
  padding:    0;
  list-style: none;
}

.pending-list > li,
.watchlist > li {
  padding-top: 10px;
  border-top:  1px solid var(--line-soft);
}

.pending-list > li:first-child,
.watchlist > li:first-child {
  padding-top: 0;
  border-top:  0;
}

.pending-list > li + li,
.watchlist > li + li {
  margin-top: 10px;
}

.pending-property,
.watchlist-property {
  display:     block;
  font-weight: 600;
}

/* Les lignes d'un bien : ce qu'il y a à enregistrer, et où. */
.pending-line {
  display:     block;
  margin-top:  2px;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
}

/* Une règle déclenchée, sous le nom du bien. */
.watchlist-reason {
  display:    block;
  margin-top: 2px;
  color:      var(--muted);
  font-size:  var(--t-small);
}

/* Les prochaines échéances : deux montants et leur net, alignés en pile. */
.due-rows {
  width:                100%;
  font-variant-numeric: tabular-nums;
}

.due-rows th {
  font-weight: 400;
  text-align:  left;
  color:       var(--muted);
}

.due-rows td {
  font-family: var(--font-mono);
  text-align:  right;
}

.due-rows .due-count {
  padding-left: 12px;
  color:        var(--muted);
  font-size:    var(--t-label);
}

.due-rows tfoot th,
.due-rows tfoot td {
  padding-top: 8px;
  border-top:  1px solid var(--line);
  font-weight: 600;
  color:       var(--ink);
}

/* --- Mes portefeuilles, dans le profil ----------------------------------- */

.portfolio-list {
  margin:         0 0 1rem;
  padding:        0;
  list-style:     none;
  display:        flex;
  flex-direction: column;
  gap:            0.6rem;
}

.portfolio-rename {
  display:     flex;
  align-items: center;
  gap:         0.6rem;
}

/* Le champ porte un `margin-bottom` global, posé pour un formulaire empilé :
   sur une ligne il décale le bouton d'un cran. */
.portfolio-rename input[type="text"] {
  flex:          1;
  margin-bottom: 0;
}

/* La TMI : une liste de cinq valeurs, qui n'a pas à prendre la largeur d'un
   nom. Les noms de portefeuille tiennent dans une colonne fixe, pour que les
   listes s'alignent d'une ligne à l'autre ; au téléphone, tout passe à la
   ligne. */
.portfolio-tax-rate {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         0.6rem;
}

.portfolio-tax-rate label:not(.visually-hidden) {
  flex:          0 0 14rem;
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
}

.portfolio-tax-rate select {
  width:         auto;
  margin-bottom: 0;
}

/* Le nom et les plans dans un seul formulaire : la grille respire au-dessus
   des actions du formulaire plutôt que de leur être collée. */
.plan-required {
  margin-top: 18px;
}

/* --- L'essai, l'accueil et le récapitulatif de paiement --------------------- */

/* Plus sobre que les cartes de plans : la rubrique « Vous hésitez ? » rattrape
   ceux qui n'osent pas encore, elle ne concurrence pas ce qui est en vente. */
.panel-quiet {
  border-style: dashed;
  background:   var(--surface-soft);
}

.trial-offer p {
  max-width: 62ch;
  color:     var(--ink-2);
}

.trial-offer form {
  margin-top: 14px;
}

/* Le choix mis en avant de l'écran d'accueil (§7.2.3) : un seul bloc porte la
   couleur de la marque, sinon aucun des trois ne se détache. */
.onboarding-highlight {
  border-color: var(--teal);
}

.onboarding-highlight p {
  max-width: 62ch;
  color:     var(--ink-2);
}

.onboarding-highlight form {
  margin-top: 14px;
}

/* L'issue gratuite, obligatoire et discrète : un lien, pas un bouton. */
.onboarding-skip {
  margin:     18px 0 0;
  text-align: center;
  font-size:  var(--t-sub);
}

.checkout-recap {
  max-width: 460px;
}

.checkout-recap form {
  margin-top: 18px;
}

.checkout-hesitate {
  margin-top: 10px;
}

/* Un bouton qui se lit comme un lien : l'action est un POST — elle change
   quelque chose — mais son poids visuel est celui d'une échappatoire. */
.button-link {
  padding:         0;
  border:          0;
  background:      none;
  color:           var(--ink-2);
  font-size:       var(--t-sub);
  text-decoration: underline;
  cursor:          pointer;
}

.button-link:hover {
  color: var(--ink);
}

/* --- Sections repliables ------------------------------------------------------
 *
 * Les biens vacants et les baux terminés, sous l'écran « Locataires » : on vient
 * y lire qui est là, pas qui y était. Un `<details>` natif plutôt qu'un
 * contrôleur, comme le sélecteur de portefeuille et la FAQ — il s'ouvre au
 * clavier et fonctionne avant que le moindre JS n'ait tourné.
 */

.fold {
  margin-bottom: 1.5rem;
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-card);
}

.fold > summary {
  display:         flex;
  align-items:     center;
  gap:             10px;
  padding:         14px 22px;
  cursor:          pointer;
  font-family:     var(--font-title);
  font-size:       var(--t-h3);
  font-weight:     600;
  letter-spacing:  -0.01em;
  color:           var(--ink);
  list-style:      none;
}

.fold > summary::-webkit-details-marker {
  display: none;
}

/* Le chevron est dessiné plutôt que listé : le marqueur natif ne se met pas
   où il faut, et une flèche en CSS tourne toute seule à l'ouverture. */
.fold > summary::before {
  content:    '';
  width:      7px;
  height:     7px;
  border:     solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform:  rotate(-45deg);
  transition: transform 0.15s ease;
}

.fold[open] > summary::before {
  transform: rotate(45deg);
}

.fold > summary:hover {
  color: var(--teal-dark);
}

.fold-count {
  padding:       1px 8px;
  background:    var(--surface-alt);
  border-radius: var(--r-pill);
  font-family:   var(--font-mono);
  font-size:     var(--t-small);
  font-weight:   500;
  color:         var(--muted);
}

.fold-body {
  padding: 0 22px 18px;
}

@media (prefers-reduced-motion: reduce) {
  .fold > summary::before {
    transition: none;
  }
}

/* Le titre d'une section à l'intérieur d'un panneau : plus discret qu'un h2
   isolé, qui se lirait comme le titre de la page. */
.section-heading {
  margin:         1.6rem 0 0.6rem;
  font-size:      var(--t-h3);
  color:          var(--ink-2);
}

/* Le cadenas d'un bien gelé dans une ligne du grand livre : muet et discret.
   La phrase complète, répétée sur trois cents lignes, serait du bruit — elle
   est dans l'infobulle et, pour les lecteurs d'écran, dans un texte caché. */
.row-lock {
  display:        inline-flex;
  vertical-align: middle;
  margin-left:    6px;
  color:          var(--muted-2);
}

/* « Me prévenir » (19-beta-plan.md §11) : un encart discret en tête du tableau
   de bord, pas une bannière — il ne doit pas faire concurrence aux chiffres. */
.waitlist-panel {
  display:       flex;
  align-items:   center;
  gap:           14px;
  flex-wrap:     wrap;
  margin-bottom: 18px;
  padding:       14px 18px;
  border:        1px dashed var(--line-strong);
  border-radius: var(--r-card);
  background:    var(--surface);
}

.waitlist-icon {
  flex:  none;
  color: var(--teal-dark);
}

.waitlist-text {
  flex:      1 1 260px;
  margin:    0;
  color:     var(--ink-2);
  font-size: var(--t-sub);
}

.waitlist-panel form {
  margin: 0;
}

/* --- La suite, après une création ---------------------------------------------
 * L'encadré de 25-ux-enhancements.md §2 : la même forme que le bandeau du
 * tableau de bord, en vert plein plutôt qu'en pointillés — il propose d'agir
 * tout de suite. */

.next-step {
  display:       flex;
  align-items:   center;
  gap:           14px;
  flex-wrap:     wrap;
  margin-bottom: 18px;
  padding:       14px 18px;
  border:        1px solid var(--teal);
  border-radius: var(--r-card);
  background:    var(--pos-bg);
}

.next-step-icon {
  flex:  none;
  color: var(--teal-dark);
}

.next-step-text {
  flex:        1 1 260px;
  margin:      0;
  color:       var(--ink);
  font-weight: 500;
}

.next-step-actions {
  display:     flex;
  align-items: center;
  gap:         10px;
  flex-wrap:   wrap;
}

.next-step-actions form {
  margin: 0;
}

/* --- Rendement : la grille brut · net · net-net ------------------------------ */

/* Deux lignes, trois colonnes : la même typographie que `.figures`, rangée en
   tableau pour que l'œil compare en colonne (la vacance) et en ligne
   (les charges, puis l'impôt). */
.yield-grid {
  border-collapse: collapse;
}

.yield-grid th {
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  font-weight:    400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--muted);
  text-align:     left;
  vertical-align: top;
  padding:        0 48px 6px 0;
}

.yield-grid td {
  padding:              6px 48px 10px 0;
  vertical-align:       top;
  font-family:          var(--font-mono);
  font-size:            var(--t-lead);
  font-weight:          500;
  font-variant-numeric: tabular-nums;
}

.yield-grid tbody th {
  padding-top: 10px;
}

/* --- Effort d'épargne -------------------------------------------------------- */

.saving-effort-figure {
  display:     flex;
  align-items: baseline;
  gap:         0.6rem;
  margin:      0 0 12px;
  font-family: var(--font-mono);
  font-size:   var(--t-h1);
  font-weight: 500;
}

.saving-effort-word {
  color:          var(--muted);
  font-size:      var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saving-effort-lines {
  border-collapse: collapse;
}

.saving-effort-lines th {
  padding:     3px 32px 3px 0;
  font-weight: 400;
  text-align:  left;
  color:       var(--muted);
}

.saving-effort-lines td {
  padding:              3px 0;
  text-align:           right;
  font-family:          var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --- Hypothèses des projections ---------------------------------------------- */

/* Dans le formulaire de période, sur sa propre ligne : on lit d'abord sur quoi
   portent les chiffres, puis ce que les projections supposent. */
.assumptions {
  display:   flex;
  flex-wrap: wrap;
  gap:       8px 16px;
  flex-basis: 100%;
  margin:    0;
  padding:   0;
  border:    0;
}

.assumptions legend {
  float:          left;
  margin-right:   8px;
  font-family:    var(--font-mono);
  font-size:      var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--muted);
}

.assumption-input {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
}

.assumption-input input {
  width:         5.5em;
  margin-bottom: 0;
}

/* Deux taux côte à côte, en grand : le réalisé et le projeté. */
.irr-rate {
  font-size: var(--t-h1);
}

/* La relecture d'un relevé (18-scans-releves-gestion.md §5), au plus près de la maquette
   « Scan IA » : à gauche ce qui sera écrit au grand livre, à droite les lignes
   lues ; le document dans une modale, à la demande. */
.review-open {
  display:     inline-flex;
  align-items: center;
  gap:         8px;
}

.review-layout {
  display:               grid;
  grid-template-columns: minmax(0, 1fr);
  gap:                   20px;
  align-items:           start;
}

@media (min-width: 1100px) {
  .review-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}

.review-main {
  display:        flex;
  flex-direction: column;
  gap:            16px;
  min-width:      0;
}

/* Le grand livre à venir : il suit les lignes à mesure qu'on les relit. Sur
   un petit écran, il passe sous la relecture, juste avant de valider. */
.review-ledger {
  display:        flex;
  flex-direction: column;
  gap:            14px;
  padding:        22px 24px;
  background:     var(--surface);
  border:         1px solid var(--line);
  border-radius:  var(--r-panel);
}

@media (min-width: 1100px) {
  .review-ledger {
    position:   sticky;
    top:        16px;
    max-height: calc(100vh - 32px);
    overflow:   auto;
  }
}

@media (max-width: 1099px) {
  .review-ledger {
    order: 1;
  }
}

.review-ledger-head h2 {
  margin:      4px 0 0;
  font-family: var(--font-title);
  font-size:   var(--t-h2);
  font-weight: 600;
}

.review-ledger-sub {
  margin:      2px 0 0;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

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

.review-ledger-entry {
  display:               grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  gap:                   12px;
  align-items:           baseline;
  padding:               11px 0;
  border-top:            1px solid var(--line-soft);
}

.review-ledger-date,
.review-ledger-amount {
  font-family:          var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space:          nowrap;
}

.review-ledger-date {
  font-size: var(--t-small);
  color:     var(--muted);
}

.review-ledger-amount {
  font-size: var(--t-body);
}

.review-ledger-text {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  min-width:      0;
}

.review-ledger-label {
  font-size:   var(--t-body);
  font-weight: 500;
}

.review-ledger-meta,
.review-ledger-detail {
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

.review-ledger-detail {
  color: var(--muted-2);
}

.review-ledger-empty {
  padding:    14px 0;
  border-top: 1px solid var(--line-soft);
  color:      var(--muted);
  font-size:  var(--t-body);
}

.review-ledger-total {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  margin:          0;
  padding-top:     12px;
  border-top:      1px solid var(--line);
  font-weight:     600;
}

.review-ledger-total strong {
  font-family:          var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Le document, par-dessus la relecture. */
.review-modal {
  width:         min(960px, calc(100vw - 32px));
  height:        calc(100vh - 48px);
  padding:       0;
  border:        1px solid var(--line);
  border-radius: var(--r-panel);
  overflow:      hidden;
}

.review-modal[open] {
  display:        flex;
  flex-direction: column;
}

.review-modal::backdrop {
  background: rgba(27, 58, 87, 0.45);
}

.review-modal-head {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         10px 14px;
  border-bottom:   1px solid var(--line);
  font-size:       var(--t-body);
  font-weight:     600;
}

.review-modal iframe {
  flex:   1;
  width:  100%;
  border: 0;
}

/* Le bandeau : ce que l'IA a lu, et sa confiance en grand. */
.review-summary {
  display:       flex;
  align-items:   center;
  gap:           16px;
  padding:       20px 22px;
  background:    var(--navy);
  border-radius: var(--r-panel);
  color:         var(--surface);
}

.review-summary-icon {
  flex:  0 0 auto;
  color: var(--teal);
}

.review-summary-text {
  flex:      1;
  min-width: 0;
}

.review-summary-title {
  margin:      0 0 3px;
  font-size:   14.5px;
  font-weight: 600;
}

.review-summary-sub {
  margin:      0;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--side-meta);
}

.review-summary-figure {
  margin:               0;
  font-family:          var(--font-title);
  font-size:            32px;
  font-weight:          600;
  line-height:          1;
  color:                var(--teal);
  font-variant-numeric: tabular-nums;
}

.review-panel {
  display:        flex;
  flex-direction: column;
  gap:            18px;
  padding:        22px 24px;
  background:     var(--surface);
  border:         1px solid var(--line);
  border-radius:  var(--r-panel);
}

.review-panel-head {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  gap:             12px;
}

.review-panel-head h2 {
  margin:      0;
  font-family: var(--font-body);
  font-size:   var(--t-lead);
  font-weight: 600;
}

/* Les libellés en petites capitales mono de la maquette. */
.review-label,
.review-facts dt {
  margin:         0;
  font-family:    var(--font-mono);
  font-size:      10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.review-facts {
  display:               grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:                   14px;
  margin:                0;
}

.review-facts dd {
  margin:        6px 0 0;
  padding:       10px 12px;
  border:        1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  font-size:     var(--t-body);
}

.review-checks {
  padding:       10px 12px;
  background:    var(--surface-soft);
  border:        1px solid var(--line-soft);
  border-radius: var(--r-ctl);
  font-family:   var(--font-mono);
  font-size:     var(--t-label);
  color:         var(--muted);
}

.review-checks p {
  margin: 0;
}

.review-checks p:first-child {
  margin-bottom: 4px;
  font-family:   var(--font-body);
  font-size:     var(--t-sub);
  color:         var(--ink-2);
}

.review-checks p:empty {
  display: none;
}

.review-cards {
  display:        flex;
  flex-direction: column;
  gap:            10px;
  margin:         -8px 0 0;
  padding:        0;
  list-style:     none;
}

.review-card {
  display:        flex;
  flex-direction: column;
  gap:            12px;
  padding:        13px 14px;
  border:         1px solid var(--line);
  border-radius:  8px;
}

.review-card[hidden] {
  display: none;
}

.review-card.row-doubt {
  padding:      14px;
  background:   #FEFBF4;
  border:       1.5px solid #E3B54A;
}

.review-card.row-duplicate .review-card-main {
  opacity: 0.6;
}

.review-card-main {
  display:     flex;
  align-items: center;
  gap:         14px;
}

/* La case de la maquette : pleine, teal, quand la ligne est gardée. */
.review-check {
  flex:          0 0 18px;
  width:         18px;
  height:        18px;
  margin:        0;
  accent-color:  var(--teal);
  cursor:        pointer;
}

.review-card-read {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  flex:           1;
  min-width:      0;
  padding:        0;
  background:     none;
  border:         0;
  color:          inherit;
  font:           inherit;
  text-align:     left;
  cursor:         pointer;
}

.review-card-label {
  font-size:   var(--t-body);
  font-weight: 500;
}

.review-card-read:hover .review-card-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.review-card-meta {
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

.review-card-meta .is-uncertain,
.review-card-meta.is-uncertain {
  color: var(--warn);
}

.review-card-amount {
  font-family:          var(--font-mono);
  font-size:            var(--t-body);
  font-variant-numeric: tabular-nums;
  white-space:          nowrap;
}

.review-card-choices {
  display:        flex;
  flex-direction: column;
  gap:            7px;
}

.review-card-choices .review-label {
  color: var(--warn);
}

.review-card-choices div {
  display:   flex;
  flex-wrap: wrap;
  gap:       8px;
}

.chip {
  padding:       6px 13px;
  background:    var(--surface);
  border:        1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color:         var(--ink);
  font:          inherit;
  font-size:     var(--t-sub);
  cursor:        pointer;
}

.chip:hover {
  border-color: var(--navy);
}

.chip.is-active {
  background:   var(--navy);
  border-color: var(--navy);
  color:        var(--surface);
}

/* Corriger : replié jusqu'au clic sur la ligne. */
.review-card-edit {
  display:               none;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap:                   10px 12px;
  padding-top:           12px;
  border-top:            1px solid var(--line-soft);
}

.review-card.is-editing .review-card-edit {
  display: grid;
}

.review-card-edit label {
  display:        flex;
  flex-direction: column;
  gap:            4px;
  font-family:    var(--font-mono);
  font-size:      10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.review-card-edit input,
.review-card-edit select {
  margin-bottom:  0;
  font-family:    var(--font-body);
  font-size:      var(--t-body);
  letter-spacing: normal;
  text-transform: none;
}

.review-card-edit input[type="number"] {
  text-align: right;
}

.review-group label {
  display:     flex;
  align-items: flex-start;
  gap:         14px;
  margin:      0;
  /* Dans l'axe des cases des lignes : leur marge intérieure plus leur bord. */
  padding:     0 15px;
  color:       var(--ink);
  font-size:   var(--t-body);
  cursor:      pointer;
}

.review-group .row-note {
  display:    block;
  margin-top: 2px;
}

.review-foot {
  display:         flex;
  flex-wrap:       wrap;
  justify-content: space-between;
  align-items:     center;
  gap:             16px;
  padding-top:     16px;
  border-top:      1px solid var(--line-soft);
}

.review-foot .form-actions {
  margin-top: 0;
  gap:        10px;
}

.review-impact {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.review-impact strong {
  font-family:          var(--font-title);
  font-size:            26px;
  font-weight:          600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .review-facts,
  .review-card-edit {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Un bloc du bail : une échéance, ce que le relevé en dit, ce qui en sera
   écrit (18-scans-releves-gestion.md §6). Détaché, il s'efface et ses lignes reviennent. */
.review-block {
  display:        flex;
  flex-direction: column;
  gap:            12px;
  margin-top:     -8px;
  padding:        14px 16px;
  background:     var(--surface-soft);
  border:         1px solid var(--line-strong);
  border-left:    3px solid var(--teal);
  border-radius:  8px;
}

.review-block.is-detached {
  border-left-color: var(--line-strong);
}

.review-block.is-detached > :not(.review-block-head):not(.review-block-controls) {
  display: none;
}

.review-block-head {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  gap:             12px;
}

.review-block-head h3 {
  margin:      0;
  font-family: var(--font-body);
  font-size:   var(--t-body);
  font-weight: 600;
}

.review-block-lease {
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

.review-block-figures {
  display:               grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:                   10px;
  margin:                0;
}

.review-block-figures dt {
  font-family:    var(--font-mono);
  font-size:      10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.review-block-figures dd {
  margin:               3px 0 0;
  font-family:          var(--font-mono);
  font-size:            var(--t-sub);
  font-variant-numeric: tabular-nums;
}

.review-block-figures .badge {
  margin-left: 4px;
}

.review-block-lines,
.review-block-notes {
  margin:     0;
  padding:    0;
  list-style: none;
}

.review-block-lines li {
  display:         flex;
  justify-content: space-between;
  gap:             12px;
  padding:         6px 0;
  border-top:      1px solid var(--line-soft);
  font-size:       var(--t-sub);
}

.review-block-notes li {
  font-size: var(--t-sub);
  color:     var(--ink-2);
}

.review-block-notes li + li {
  margin-top: 2px;
}

.review-block-controls {
  display:         flex;
  flex-wrap:       wrap;
  justify-content: flex-end;
  gap:             18px;
}

.review-inline {
  display:     inline-flex;
  align-items: center;
  gap:         8px;
  margin:      0;
  color:       var(--ink);
  font-size:   var(--t-sub);
  cursor:      pointer;
}

.is-uncertain {
  color: var(--warn);
}

@media (max-width: 640px) {
  .review-block-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* L'onglet Documents (maquette « Documents ») : filtres et dépôt sur une
   ligne, le bandeau des documents à relire, le tableau. */
.documents-tab {
  display:        flex;
  flex-direction: column;
  gap:            18px;
}

.documents-toolbar {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         10px;
}

.documents-filters {
  display:   flex;
  flex-wrap: wrap;
  gap:       10px;
}

.documents-filter {
  padding:         9px 13px;
  background:      var(--surface);
  border:          1px solid var(--line-strong);
  border-radius:   var(--r-ctl);
  color:           var(--muted);
  font-family:     var(--font-mono);
  font-size:       var(--t-small);
  text-decoration: none;
}

.documents-filter:hover {
  border-color: var(--navy);
  color:        var(--ink);
}

.documents-filter.is-active {
  background:   var(--navy);
  border-color: var(--navy);
  color:        var(--surface);
}

.documents-scan {
  margin-left: auto;
}

.documents-scan-open {
  display:     inline-flex;
  align-items: center;
  gap:         8px;
}

.documents-awaiting {
  display:         flex;
  align-items:     center;
  gap:             16px;
  padding:         16px 20px;
  background:      #F2FBF7;
  border:          1.5px dashed var(--teal);
  border-radius:   var(--r-card);
  color:           var(--pos);
  text-decoration: none;
}

.documents-awaiting:hover {
  background: #E9F7F1;
}

.documents-awaiting-text {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  flex:           1;
  min-width:      0;
}

.documents-awaiting-text strong {
  font-size:   14.5px;
  font-weight: 600;
  color:       var(--pos-strong);
}

.documents-awaiting-text span,
.documents-awaiting-go {
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       #3D7A64;
}

.documents-awaiting-go {
  font-size: var(--t-small);
  color:     var(--pos);
}

.documents-file {
  font-weight: 500;
}

.documents-meta {
  display:     block;
  margin-top:  2px;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted-2);
}

.documents-mono {
  font-family:          var(--font-mono);
  font-size:            12.5px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .documents-scan {
    margin-left: 0;
  }
}

/* Le détail d'un relevé relu : la même page, en lecture seule. La case devient
   une coche, une ligne écartée s'efface, une correction garde la valeur lue
   barrée à côté. */
.review-tick {
  display:         inline-flex;
  flex:            0 0 18px;
  align-items:     center;
  justify-content: center;
  width:           18px;
  height:          18px;
  border:          1.5px solid var(--line-strong);
  border-radius:   4px;
  color:           var(--teal-ink);
}

.review-tick.is-on {
  background:   var(--teal);
  border-color: var(--teal);
}

.review-card.is-dropped .review-card-main {
  opacity: 0.55;
}

.review-was {
  margin-right: 4px;
  color:        var(--muted-2);
  font-weight:  400;
}

.is-readonly .review-card-read {
  cursor: default;
}

.is-readonly .review-card-read:hover .review-card-label {
  text-decoration: none;
}

/* Ce que le relevé dit du bail (18-scans-releves-gestion.md §6.5) : une
   proposition, décochée, avec son effet sur l'échéancier. */
.review-event {
  display:        flex;
  flex-direction: column;
  gap:            6px;
  padding:        12px 14px;
  background:     var(--surface);
  border:         1px dashed var(--line-strong);
  border-radius:  var(--r-ctl);
}

.review-event.is-applied {
  border-style: solid;
  border-color: var(--teal);
}

.review-event-title {
  display:     flex;
  align-items: center;
  gap:         10px;
  margin:      0;
  font-size:   var(--t-body);
}

.review-event-reason {
  margin:    0;
  font-size: var(--t-sub);
  color:     var(--ink-2);
}

.review-event-effect {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px 16px;
}

.review-event-date {
  display:        inline-flex;
  align-items:    center;
  gap:            8px;
  font-family:    var(--font-mono);
  font-size:      10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.review-event-date input {
  width:          auto;
  margin:         0;
  padding:        4px 8px;
  font-family:    var(--font-body);
  font-size:      var(--t-sub);
  letter-spacing: normal;
  text-transform: none;
}

.review-block-event {
  margin-top: -8px;
}


/* Les encadrés de l'onglet Documents, à côté du vert « à valider » : gris pour
   ce qui se lit encore — il se recharge seul —, terracotta pour ce qui a
   échoué. Même forme, pour qu'ils se lisent comme une seule famille. */
.documents-banner {
  display:       flex;
  align-items:   center;
  gap:           16px;
  padding:       14px 20px;
  border-radius: var(--r-card);
}

.documents-banner form {
  margin: 0;
}

.documents-banner-reading {
  background: var(--surface-alt);
  border:     1px solid var(--line-strong);
  color:      var(--ink-2);
}

.documents-banner-reading .documents-awaiting-text strong {
  color: var(--ink);
}

.documents-banner-reading .documents-awaiting-text span {
  color: var(--muted);
}

.documents-banner-failed {
  background: var(--neg-bg);
  border:     1px solid var(--neg);
  color:      var(--neg-strong);
}

.documents-banner-failed .documents-awaiting-text strong,
.documents-banner-failed .documents-awaiting-text span {
  color: var(--neg-strong);
}

.documents-spinner {
  flex:          0 0 18px;
  width:         18px;
  height:        18px;
  border:        2px solid var(--line-strong);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation:     documents-spin 0.9s linear infinite;
}

@keyframes documents-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .documents-spinner {
    animation: none;
  }
}

/* La modale du scan : ses étapes se remplacent dans le même cadre. */
.scan-modal {
  width:         min(560px, calc(100vw - 32px));
  padding:       0;
  border:        1px solid var(--line);
  border-radius: var(--r-panel);
}

.scan-modal::backdrop {
  background: rgba(27, 58, 87, 0.45);
}

/* La croix en haut à droite ; le titre est celui de l'étape, dans le cadre. */
.scan-modal {
  position: relative;
}

.scan-modal-head {
  position: absolute;
  top:      12px;
  right:    12px;
}

.scan-step-title {
  margin:        -20px -20px 18px;
  padding:       16px 56px 16px 20px;
  border-bottom: 1px solid var(--line);
  font-family:   var(--font-body);
  font-size:     var(--t-lead);
  font-weight:   600;
}

/* En page de secours, l'en-tête blanc porte déjà le titre. */
.scan-page .scan-step-title {
  display: none;
}

.scan-modal turbo-frame {
  display: block;
  padding: 20px;
}

.scan-modal turbo-frame[busy]::before {
  content:   'Un instant…';
  color:     var(--muted);
  font-size: var(--t-sub);
}

.scan-step-lead {
  margin:    0 0 14px;
  color:     var(--ink-2);
  font-size: var(--t-sub);
}

.scan-quote {
  display:               grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:                   12px;
  margin:                0 0 16px;
}

.scan-quote dt {
  font-family:    var(--font-mono);
  font-size:      10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.scan-quote dd {
  margin:      4px 0 0;
  font-family: var(--font-title);
  font-size:   var(--t-h2);
  font-weight: 600;
}

.scan-sent {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            6px;
  text-align:     center;
}

.scan-sent p {
  margin: 0;
}

.scan-sent-icon {
  padding:       6px;
  border-radius: 50%;
  background:    var(--pos-bg);
  color:         var(--pos);
}

.scan-sent-title {
  font-size:   var(--t-lead);
  font-weight: 600;
}

.scan-sent .form-actions {
  align-self: stretch;
  margin-top: 10px;
}

/* Le bouton qui avance tout à droite, ce qui annule juste à sa gauche. */
.scan-actions {
  justify-content: flex-end;
}

/* Les documents à envoyer ou à relancer, une ligne chacun : ses pages, ses
   scans. Un document de plus de cinq pages en coûte plus d'un — sa case le
   montre. */
.scan-files-table {
  width:           100%;
  margin:          0 0 6px;
  border-collapse: collapse;
  font-size:       var(--t-sub);
}

.scan-files-table th {
  padding:        0 0 8px;
  font-family:    var(--font-mono);
  font-size:      10.5px;
  font-weight:    400;
  letter-spacing: 0.1em;
  text-align:     left;
  text-transform: uppercase;
  color:          var(--muted-2);
}

.scan-files-table td {
  padding:    9px 0;
  border-top: 1px solid var(--line-soft);
}

.scan-files-table td:first-child {
  overflow-wrap: anywhere;
}

.scan-files-table .num {
  width:                4.5rem;
  font-family:          var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align:           right;
}

.scan-files-table tfoot th,
.scan-files-table tfoot td {
  padding-top:    10px;
  border-top:     1px solid var(--line);
  font-weight:    600;
  color:          var(--ink);
}

.scan-files-table tfoot th {
  font-family:    var(--font-body);
  font-size:      var(--t-sub);
  letter-spacing: normal;
  text-transform: none;
}

.scan-files-more {
  color:       var(--warn);
  font-weight: 600;
}

.scan-files-rule {
  margin: 0 0 16px;
}

.scan-quote-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Les en-têtes du tableau des documents se trient : le libellé devient le
   lien, la flèche ne paraît que sur la colonne triée (tables.css,
   `.column-sort`). */
.documents-table a.column-sort {
  display:         inline-flex;
  align-items:     center;
  gap:             0.4em;
  color:           inherit;
  text-decoration: none;
}

.documents-table a.column-sort:hover {
  color: var(--teal-dark);
}

.documents-table a.column-sort:not(.is-active)::after {
  content: none;
}

.documents-table a.column-sort[data-order="asc"]::after {
  content: '\2191';
}

.documents-table a.column-sort[data-order="desc"]::after {
  content: '\2193';
}

/* Une lecture en retard : ambre, rien n'est perdu, mais il faut le dire. */
.documents-banner-reading.is-late {
  background:   var(--warn-bg);
  border-color: var(--warn-accent);
}

.documents-banner-reading.is-late .documents-awaiting-text strong,
.documents-banner-reading.is-late .documents-awaiting-text span {
  color: var(--warn);
}

/* Un fichier qui ne partira pas — déjà envoyé, illisible — reste dans la
   liste, en retrait, avec sa raison. */
.scan-files-aside td {
  color: var(--muted);
}

.scan-files-note {
  display:   block;
  font-size: var(--t-small);
}

/* --- Infobulles ---------------------------------------------------------------
 * Une seule bulle pour toute la page (25-ux-enhancements.md §7.3), placée par le
 * contrôleur `tooltip` au-dessus de l'élément, ou dessous faute de place. Fixe :
 * un tableau qui défile ne la coupe pas. La flèche suit le centre de l'élément,
 * même quand la bulle est décalée pour rester dans la fenêtre. */

.tooltip {
  --tooltip-arrow: 50%;

  position:       fixed;
  z-index:        1000;
  max-width:      18rem;
  padding:        6px 10px;
  border-radius:  6px;
  background:     var(--navy);
  color:          #FFFFFF;
  font-size:      var(--t-small);
  line-height:    1.35;
  pointer-events: none;
  box-shadow:     0 6px 18px rgb(27 58 87 / 0.18);
  animation:      tooltip-in 0.12s ease-out;
}

.tooltip[hidden] {
  display: none;
}

.tooltip::after {
  content:      "";
  position:     absolute;
  top:          100%;
  left:         var(--tooltip-arrow);
  margin-left:  -5px;
  border:       5px solid transparent;
  border-top-color: var(--navy);
}

.tooltip.tooltip-below::after {
  top:                 auto;
  bottom:              100%;
  border-top-color:    transparent;
  border-bottom-color: var(--navy);
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tooltip {
    animation: none;
  }
}

/* --- Onglet Prêt : la courbe du capital restant dû ----------------------------
 * Sous l'encart bleu (25-ux-enhancements.md §7.2) : le réalisé en marine plein,
 * le projeté en pointillés gris, comme la maquette. */

.loan-curve {
  padding:       18px 22px;
  border:        1px solid var(--line);
  border-radius: var(--r-card);
  background:    var(--surface);
}

.loan-curve-head {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  gap:             14px;
  margin-bottom:   10px;
}

.loan-curve-head h3 {
  margin: 0;
}

.loan-curve-meta {
  margin:      3px 0 0;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

.loan-curve-legend {
  display:     flex;
  gap:         14px;
  margin:      0;
  padding:     0;
  list-style:  none;
  font-family: var(--font-mono);
  font-size:   var(--t-label);
  color:       var(--muted);
}

.loan-curve-legend li {
  display:     flex;
  align-items: center;
  gap:         6px;
}

.loan-curve-swatch {
  width:      16px;
  height:     3px;
  background: var(--navy);
}

.loan-curve-swatch-projected {
  height:     0;
  border-top: 2px dashed #B4B9BC;
  background: none;
}

.loan-curve-canvas {
  height: 200px;
}

/* Quittances et reçus (28-gestion-locative.md §4) : l'aperçu est le document
   lui-même, dans un cadre isolé — ses styles sont ceux du PDF. */
.receipt-frame {
  display: block;
  width: 100%;
  /* Ajustée au document une fois chargé (receipt-preview) ; sans JS, une
     page entière reste lisible en défilant. */
  height: 60rem;
  margin: 1rem 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.receipt-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.receipt-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.receipt-list li.is-cancelled strong {
  color: var(--muted);
  text-decoration: line-through;
}

.receipt-list li.is-new {
  background: var(--pos-bg);
  margin: 0 -.75rem;
  padding: .75rem;
  border-radius: 6px;
}

.receipt-list .row-actions form {
  display: inline;
}

.landlord-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
}

/* L'en-tête de l'aperçu d'une quittance : le titre à gauche, « Émettre » à
   droite ; sur un téléphone, le bouton passe dessous. */
.receipt-head {
  align-items: center;
  flex-wrap:   wrap;
}

.receipt-head h2 {
  margin: 0;
}

/* La case de l'avis d'échéance, à gauche du bouton qu'elle modifie. */
.receipt-head form {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         .5rem 1rem;
}

.receipt-head .checkbox-inline {
  display:     inline-flex;
  align-items: center;
  gap:         .4rem;
  margin:      0;
  font-weight: 500;
  cursor:      pointer;
}

.receipt-notice-mark {
  display:     inline-flex;
  align-items: center;
  gap:         .3rem;
  margin-left: .35rem;
}

/* Sous le titre d'un document émis : ses envois, puis pourquoi il ne peut
   pas partir (28-gestion-locative.md §5). Chaque ligne a son air, la raison
   son encart : collée au titre, on ne la voyait pas. */
.receipt-body {
  flex:      1 1 22rem;
  min-width: 0;
}

.receipt-title .muted {
  margin-left: .35rem;
}

.receipt-delivery {
  display:     flex;
  align-items: center;
  gap:         .4rem;
  margin-top:  .5rem;
  font-size:   var(--t-small);
}

.receipt-note {
  /* Sous le titre et les boutons, de toute la largeur : à côté des boutons,
     l'encart les décalait. */
  flex:          1 0 100%;
  display:       flex;
  align-items:   flex-start;
  gap:           .5rem;
  margin-top:    -.25rem;
  padding:       .55rem .75rem;
  border-left:   3px solid var(--warn-accent);
  border-radius: 4px;
  background:    var(--warn-bg);
  color:         var(--warn);
  font-size:     var(--t-small);
  line-height:   1.45;
}

.receipt-note svg {
  flex:       none;
  margin-top: .15rem;
}

/* --- Le dépôt de garantie (28-gestion-locative.md §7) ---------------------- */

.deposit-status {
  margin:    .4rem 0 .6rem;
  font-size: var(--t-small);
}

.deposit-status p {
  margin: 0 0 .3rem;
}

/* Le délai passé : la majoration de la loi, à titre d'information. */
.deposit-late {
  display:       flex;
  align-items:   flex-start;
  gap:           .5rem;
  padding:       .55rem .75rem;
  border-left:   3px solid var(--warn-accent);
  border-radius: 4px;
  background:    var(--warn-bg);
  color:         var(--warn);
  line-height:   1.45;
}

.deposit-late svg {
  flex:       none;
  margin-top: .15rem;
}

/* Les montants de la restitution : le détenu, puis ce qui revient. */
.deposit-figures {
  margin: 0 0 1rem;
}

.deposit-figures div {
  display:         flex;
  justify-content: space-between;
  max-width:       28rem;
}

.deposit-figures dt {
  color: var(--muted);
}

.deposit-figures dd {
  margin:      0;
  font-weight: 600;
}

.deposit-total dd.is-negative {
  color: var(--danger);
}

/* La copie du décompte au bailleur : dite avant l'envoi, en encart. */
.deposit-copy-note {
  margin: 0 0 1rem;
}

/* L'onglet Documents (28-gestion-locative.md §8) et l'espace du portefeuille (§11). */
.kept-documents {
  display:        flex;
  flex-direction: column;
  gap:            14px;
}

.storage-room {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px 14px;
  font-size:   var(--t-small);
  color:       var(--muted);
  margin-bottom: 4px;
}

.storage-room strong {
  color: var(--ink);
}

.storage-room-gauge {
  width:  140px;
  height: 8px;
}

.storage-room-warning {
  flex-basis:    100%;
  padding:       .55rem .75rem;
  border-left:   3px solid var(--warn-accent);
  border-radius: 4px;
  background:    var(--warn-bg);
  color:         var(--warn);
}

.kept-file-name {
  display:   block;
  font-size: var(--t-small);
}

.inline-form {
  display: inline;
  margin:  0;
}

.share-toggle {
  display:       inline-flex;
  align-items:   center;
  gap:           5px;
  padding:       4px 9px;
  background:    var(--surface);
  border:        1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  color:         var(--muted);
  font-size:     var(--t-small);
  cursor:        pointer;
}

.share-toggle.is-shared {
  border-color: var(--navy);
  color:        var(--navy);
}

.kept-documents-note {
  font-size: var(--t-small);
}

/* L'espace locataire sur la carte du bail (28-gestion-locative.md §9.1). */
.tenant-access {
  list-style: none;
  margin:     0 0 12px;
  padding:    0;
  display:    flex;
  flex-direction: column;
  gap:        6px;
  font-size:  var(--t-small);
}

.tenant-access li {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         6px 12px;
}

.tenant-access-name {
  color:       var(--ink);
  font-weight: 600;
}

/* « Mon logement » (28-gestion-locative.md §9.2). */
.tenant-section h2 {
  margin-top: 0;
}

.tenant-list {
  list-style:     none;
  margin:         0;
  padding:        0;
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.tenant-download {
  display:     inline-flex;
  align-items: center;
  gap:         6px;
}

.tenant-note {
  font-size:  var(--t-small);
  margin-top: 10px;
}

/* « Contacter mon bailleur » (28-gestion-locative.md §9.4). */
.tenant-message-categories {
  border:  0;
  margin:  0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tenant-message-warning {
  margin:        4px 0 4px 24px;
  padding:       .45rem .7rem;
  border-left:   3px solid var(--warn-accent);
  border-radius: 4px;
  background:    var(--warn-bg);
  color:         var(--warn);
  font-size:     var(--t-small);
}

.tenant-message-body {
  white-space: pre-line;
}

.message-about {
  margin:     0 0 6px;
  padding:    0;
  list-style: none;
  font-size:  var(--t-small);
}

.form-shortcut {
  margin-left: 10px;
  font-size:   var(--t-small);
}

.lease-messages {
  margin: 0 0 12px;
}

.lease-messages h5 {
  margin: 0 0 6px;
}

.tenant-last-quittance {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px 16px;
  margin:      14px 0 0;
}

/* L'onglet « Échanges » (28-gestion-locative.md §5.1). */
.exchanges {
  display:        flex;
  flex-direction: column;
  gap:            12px;
}

.exchanges-note {
  font-size: var(--t-small);
  margin:    0;
}

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

.exchange {
  display:               grid;
  grid-template-columns: 9.5em 20px 1fr;
  gap:                   10px;
  padding:               10px 0;
  border-top:            1px solid var(--line);
  align-items:           start;
}

.exchange-lease {
  display:   block;
  font-size: var(--t-small);
}

@media (max-width: 600px) {
  .exchange {
    grid-template-columns: 20px 1fr;
  }

  .exchange time {
    grid-column: 1 / -1;
  }
}

/* Les quittances demandées (28-gestion-locative.md §9.5). */
.receipt-requests h2 {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-top:  0;
}

.icon-action-requested {
  color: var(--warn-accent);
}

/* La relecture d'un document du syndic (30-scans-syndic.md §6) : chaque
   proposition dans son encadré, un écart de contrôle en rouge. */
.condo-proposal {
  padding:       0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.condo-proposal:last-child {
  border-bottom: 0;
}

.condo-checks {
  margin-top: 1rem;
}

.condo-checks tr.is-gap td {
  color:       var(--neg-strong);
  font-weight: 600;
}
