/* Suivi Dossier réparation — couche spécifique de la charte ILC Pro (après ilc-pro.css).
   Pages publiques consultées surtout sur téléphone : une colonne, champs de 44 px,
   texte lisible sans zoom. */

:root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.ilc-dossier {
  & .card { width: 460px !important; max-width: 100% !important; }

  /* Recherche du dossier : deux champs côte à côte, empilés sur mobile */
  & .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  & .miniHelp { color: var(--ux-muted) !important; font-size: 12px !important; line-height: 1.4; }
  & .miniHelp b { color: var(--ux-text-2) !important; }

  /* Pied de carte : aide / note / téléphone */
  & .right .callout {
    display: flex !important;
    align-items: center;
    gap: 12px;
  }
  & .callout .ico {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: var(--ux-brand-soft) !important;
    font-size: 16px;
    box-shadow: none !important;
  }
  & .callout .t { color: var(--ux-text) !important; font: 700 16px/1.2 var(--ux-font) !important; font-variant-numeric: tabular-nums; }
  & .callout .s { color: var(--ux-muted) !important; font-size: 12.5px !important; }
  & .callout .t a { color: inherit !important; font: inherit !important; text-decoration: none; }
}

/* ---------- Fiche du dossier ---------- */
:root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.dossier-view {
  & .card { width: 560px !important; }
  & .title { font-size: 20px !important; }
  & .title .accent { display: block; margin-top: 4px; color: var(--ux-brand-text) !important; -webkit-text-fill-color: currentColor !important; font-family: var(--ux-mono) !important; font-size: 17px; }
  & .bigId {
    margin: 0 0 4px !important;
    color: var(--ux-muted) !important;
    font: 600 12.5px/1.3 var(--ux-font) !important;
    text-align: center;
    letter-spacing: .02em;
  }
  & .kv {
    display: grid !important;
    grid-template-columns: minmax(130px, auto) 1fr;
    margin-top: 12px !important;
    border: 1px solid var(--ux-border) !important;
    border-radius: var(--ux-r-lg) !important;
    background: var(--ux-surface) !important;
    overflow: hidden;
  }
  & .kv .k, & .kv .v { padding: 10px 14px !important; border-bottom: 1px solid var(--ux-border) !important; background: none !important; }
  & .kv .k { color: var(--ux-muted) !important; font: 500 13px/1.4 var(--ux-font) !important; text-transform: none !important; letter-spacing: 0 !important; background: var(--ux-surface-2) !important; }
  & .kv .v { color: var(--ux-text) !important; font: 600 14px/1.4 var(--ux-font) !important; overflow-wrap: anywhere; }
  & .kv .k:nth-last-child(2), & .kv .v:last-child { border-bottom: 0 !important; }
  & .followBox {
    margin-top: 12px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--ux-border) !important;
    border-left: 3px solid var(--ux-brand) !important;
    border-radius: var(--ux-r) !important;
    background: var(--ux-surface-2) !important;
    color: var(--ux-text) !important;
    font: 400 13.5px/1.55 var(--ux-font) !important;
    white-space: pre-wrap;
    box-shadow: none !important;
  }
  & .footer { margin-top: 14px !important; }
}

@media (max-width: 560px) {
  :root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.ilc-dossier {
    & .row2 { grid-template-columns: 1fr; }
    & .footer { flex-direction: column; align-items: center; text-align: center; }
  }
  :root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.dossier-view {
    /* Fiche : libellé au-dessus de la valeur, plus lisible sur téléphone */
    & .kv { grid-template-columns: 1fr; }
    & .kv .k { padding: 8px 14px 2px !important; border-bottom: 0 !important; background: none !important; font-size: 12px !important; }
    & .kv .v { padding: 0 14px 10px !important; }
    & .kv .v:not(:last-child) { border-bottom: 1px solid var(--ux-border) !important; }
  }
}

/* Bouton mode sombre / mode clair, en haut à droite de la carte */
:root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.ilc-dossier {
  & .card { position: relative; }
  & .themeToggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--ux-border-strong);
    border-radius: 999px;
    background: var(--ux-surface-2);
    color: var(--ux-text-2);
    font: 500 12.5px/1 var(--ux-font);
    box-shadow: var(--ux-shadow-sm);
    cursor: pointer;
    transition: background-color .15s var(--ux-ease), color .15s var(--ux-ease), border-color .15s var(--ux-ease);
  }
  & .themeToggle:hover { border-color: var(--ux-brand); background: var(--ux-brand-soft); color: var(--ux-brand-text); }
  & .themeToggle:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ux-brand-ring); }
  & .themeToggle svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ux-brand-text); }
  & .themeToggle .icoMoon { display: none; }
}
:root[data-theme="light"]:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.ilc-dossier {
  & .themeToggle .icoSun { display: none; }
  & .themeToggle .icoMoon { display: inline; }
}
/* Téléphone : icône seule (le libellé reste lu par les lecteurs d'écran) */
@media (max-width: 520px) {
  :root:not(#ilc-a):not(#ilc-b) body.ilc-pro-auth.ilc-dossier {
    & .themeToggle { top: 10px; right: 10px; width: 40px; min-height: 40px; padding: 0; justify-content: center; }
    & .themeToggle .themeLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }
}
