/* Titres-restaurant (#/titres) : prototype Titres.dc.html et TitresMobile.dc.html.
   Styles propres à cet écran (refonte du prototype v73) : un fichier par écran, chargé par index.html après
   shell.css. Téléphone : @media (max-width: 767px), comme la coque.
   Les briques communes avec Livraison (interrupteur, en-tête de bloc, choix des pièces, tableau en grille qui devient
   une liste, détail, boutons de pièces : classes `bl-`, static/js/blocs-lignes.js) sont dans css/screens/livraison.css ;
   ici, seulement ce qui n'est qu'à Titres (préfixe `trd-`, et quelques tailles du prototype Titres sous `.trd-page`). */

/* ---- Titre */
.trd-head { margin-bottom: 16px; }

/* ---- Cartes par émetteur : le logo à la place du nom ; un clic mène au bloc de l'émetteur */
.trd-cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.trd-card { min-width: 0; display: flex; }
.trd-card__btn { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: stretch; box-sizing: border-box;
  padding: 18px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px; color: var(--app-ink);
  font: inherit; line-height: 1.4; text-align: left; cursor: pointer; }
.trd-card__logo { flex: none; display: block; width: 96px; height: 28px; box-sizing: border-box; padding: 2px 6px; border-radius: 6px;
  background: #FFFFFF; object-fit: contain; object-position: left center; }
.trd-card__kicker { display: block; margin: 14px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--app-muted); }
.trd-card__net { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.trd-card__fees { display: block; margin-top: 4px; font-size: 14px; color: var(--app-muted); }
.trd-card__btn > .badge { align-self: flex-start; margin-top: 8px; }
.trd-card__warn { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--app-bad-ink); }
.trd-card__foot { display: block; margin-top: auto; padding-top: 10px; font-size: 14px; color: var(--app-muted); }
/* Émetteur sans remboursement sur la période : la raison sous la pastille, pas un bouton (27/10/2026) */
.trd-card__btn--absent { cursor: default; }
.trd-card__why { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--app-ink); }
.trd-card__link { align-self: flex-start; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--app-ink); }
/* Focus visible (app.css) qui garde l'arrondi de chaque élément */
.trd-card__btn:focus-visible { border-radius: 16px; }
.trd-grant:focus-visible { border-radius: 999px; }
.trd-empty__reset:focus-visible { border-radius: 12px; }

/* ---- Vide */
.trd-empty { margin-top: 24px; padding: 36px 24px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.trd-empty h2 { margin: 0; font-size: 20px; font-weight: 700; }
.trd-empty__reset { min-height: 44px; padding: 0 18px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface);
  color: var(--app-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }

/* ---- Blocs : un par émetteur ; logo du bloc 104 × 40 (Titres.dc.html) ; colonnes du tableau */
.trd-blocks { margin-top: 24px; display: flex; flex-direction: column; gap: 32px; }
.trd-blocks .bl-block { scroll-margin-top: 16px; }
.trd-page .bl-title__logo { width: 104px; height: 40px; padding: 4px 10px; }
.trd-page .bl-title:focus { outline: none; }
.trd-page .bl-title:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; border-radius: 8px; }
.trd-grid { min-width: 1000px; }
.trd-grid .bl-row { grid-template-columns: 260fr 140fr 120fr 140fr 180fr 190fr; }
.trd-grid .bl-row--total { cursor: default; }
.trd-row--flat { cursor: default; }
.trd-page .bl-check.is-off .bl-box { opacity: .35; }   /* case d'une ligne sans pièce ou d'un autre émetteur (Titres.dc.html) */
.trd-grant { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--app-line); border-radius: 999px;
  background: var(--app-surface); color: var(--app-ink); font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.trd-grant:hover { color: var(--app-ink); }
.trd-grant__icon { display: none; }

/* ---- Détail déplié : le net par produit (« Carte : … · Papier : … »), les virements, puis les pièces */
.trd-prods { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--app-muted); }
.trd-prods li { display: inline; }
.trd-prods li + li::before { content: " · "; }
.trd-prods__label::after { content: " : "; }
.trd-items { max-width: 720px; }
.trd-items__table { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 12px; font-size: 14px; }
.trd-items__row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; align-items: center; border-top: 1px solid var(--app-line); }
.trd-items__row > * { min-width: 0; padding: 10px 14px; }
.trd-items__row > :not(:first-child) { text-align: right; }
.trd-items__row--head { align-items: end; border-top: 0; border-bottom: 1px solid var(--app-line); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-muted); }
.trd-items__row--head > * { padding: 12px 14px 8px; }
.trd-items__row--head + .trd-items__row { border-top: 1px solid var(--app-line); }
.trd-items__what { font-weight: 600; }
.trd-items__date { display: block; }
.trd-items__sub { display: block; font-size: 13px; font-weight: 400; color: var(--app-muted); }
.trd-items__warn { display: block; font-size: 13px; font-weight: 600; color: var(--app-warn-ink); }

/* =====================================================================================================  Téléphone */
@media (max-width: 767px) {
  .trd-head { margin: 4px 0 16px; }

  /* Cartes en pile, une ligne chacune : logo à gauche, net à droite (Bimpli : « Accès à accorder ») */
  .trd-cards { display: flex; flex-direction: column; gap: 8px; }
  .trd-card__btn { flex-direction: row; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; }
  .trd-card__logo { width: 88px; height: 36px; padding: 3px 6px; border: 1px solid var(--app-line); border-radius: 8px; object-position: center; }
  .trd-card__kicker, .trd-card__fees, .trd-card__foot, .trd-card__warn { display: none; }
  .trd-card__net { margin-left: auto; font-size: 17px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
  .trd-card__btn--closed .trd-card__net { display: none; }
  .trd-card__btn > .badge { align-self: center; margin: 0 0 0 auto; }
  /* sans remboursement : la raison passe sous le logo et la pastille, sur toute la largeur */
  .trd-card__btn--absent { flex-wrap: wrap; }
  .trd-card__why { flex: 1 0 100%; margin: 0; font-size: 13px; }
  .trd-card__link { margin: 0; font-size: 13px; }
  .trd-page .badge { gap: 5px; padding: 3px 8px; font-size: 12px; }
  .trd-page .badge::before { width: 7px; height: 7px; }

  .trd-blocks { margin-top: 16px; gap: 16px; }
  .trd-grid { min-width: 0; }
  .trd-page .bl-title__logo { width: 88px; height: 36px; padding: 3px 6px; }
  .trd-page span.bl-tot { padding-right: 8px; }
  /* En-tête de bloc (TitresMobile) : sans interrupteur, « Tout choisir » sur la ligne du logo et « Total net » dessous ;
     bloc bloqué par le choix d'un autre émetteur : le logo seul, puis « Tout choisir · Un émetteur à la fois », puis le total. */
  .trd-page .bl-head:has(.bl-pick):not(:has(.bl-switch)) > .bl-tot,
  .trd-page .bl-head:has(.bl-lock:not([hidden])) > .bl-tot { flex-basis: 100%; justify-content: flex-end; }
  .trd-page .bl-head:has(.bl-lock:not([hidden])) > .bl-head__lead { flex-basis: 100%; }
  .trd-page .bl-lock { margin-left: 0; text-align: left; }

  /* Lignes : case, nom, net, flèche (pas de pastille « Récupéré ») ; Bimpli : la pastille à la place du net, et la
     ligne mène à sa connexion (flèche vers la droite) */
  .trd-page .trd-row--one { grid-template-areas: "check name name value chev"; row-gap: 0; }
  .trd-page .trd-row > .bl-c--state { display: none; }
  .trd-page .trd-row--todo > .bl-key { display: none; }
  .trd-page .trd-row--todo > .bl-c--state { display: block; grid-area: value; }
  .trd-grant { grid-area: chev; justify-self: end; position: relative; width: 20px; min-height: 44px; padding: 0; border: 0;
    border-radius: 0; background: none; justify-content: center; color: var(--app-muted); }
  .trd-grant::before { content: ""; position: absolute; inset: 0 -12px 0 -8px; }   /* doigt : 40 × 44 (audit EC-13) */
  .trd-grant__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .trd-grant__icon { display: block; width: 8px; height: 8px; box-sizing: border-box; border-top: 2px solid currentColor;
    border-right: 2px solid currentColor; transform: rotate(45deg); }
  .trd-row--flat { cursor: pointer; }

  /* Détail : Brut, Frais, Net versé sur trois colonnes ; net par produit ; virements ; boutons pleine largeur */
  .trd-page .trd-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .trd-page .trd-fields dd { white-space: nowrap; }
  .trd-page .trd-fields .bl-field:last-child dd { font-weight: 700; }
  .trd-page .trd-detail__body { gap: 14px; }
  .trd-prods { padding: 10px 0 0; border-top: 1px solid var(--bl-divider); display: flex; flex-direction: column; gap: 6px; color: var(--app-ink); }
  .trd-prods li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .trd-prods li + li::before, .trd-prods__label::after { content: none; }
  .trd-prods__amount { font-weight: 600; white-space: nowrap; }
  .trd-items { max-width: none; }
  .trd-items__title { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-muted); }
  .trd-items__table { border: 0; border-radius: 0; background: none; }
  .trd-items__more { display: none; }
  .trd-items__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bl-divider); }
  .trd-items__row--head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .trd-items__row--head + .trd-items__row { border-top-color: var(--bl-divider); }
  .trd-items__row > * { padding: 0; }
  .trd-items__what { min-width: 0; }
  .trd-items__sub, .trd-items__warn { font-size: 12px; }
  .trd-items__net { flex: none; font-weight: 600; white-space: nowrap; }
  .trd-page .bl-origs { margin-top: 2px; }
  .trd-page .bl-orig { width: 100%; }
}

/* Tablette (768 à 1 199 px, le doigt ; audit EC-13) : « Accorder l'accès » à 40 px. */
@media (min-width: 768px) and (max-width: 1199px) {
  .trd-grant { min-height: 40px; }
}
