/* SALOMON Secrétaire — identité officielle de SALOMON V2 (images de référence validées) : Jean-Baptiste dans sa
   bibliothèque ancienne aux bougies, noir et or, panneaux noirs translucides à liseré doré, capitales Cinzel,
   titres Cormorant Garamond, onglets en pastilles dorées. Adapté à l'iPhone : onglets au pouce, en bas d'écran.
   Polices libres (SIL Open Font License 1.1) hébergées avec la page : polices/OFL-*.txt. */

@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400; font-display: swap; src: url("polices/cinzel-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 600; font-display: swap; src: url("polices/cinzel-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("polices/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("polices/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url("polices/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }

:root {
  --noir: #070605;
  --noir-2: #0e0b08;
  --panneau: rgba(12, 10, 8, 0.78);
  --panneau-fort: rgba(14, 11, 8, 0.92);
  --liseré: rgba(212, 170, 80, 0.32);
  --liseré-fort: rgba(232, 190, 100, 0.75);
  --or: #d8ad55;
  --or-clair: #f2cf7e;
  --or-pale: #f6dfa6;
  --texte: #f1ead9;
  --texte-doux: #b3a68c;
  --ok: #58c27d;
  --alerte: #e9b44c;
  --erreur: #e58a7b;
  --rayon: 10px;
  --capitales: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --titres: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --texte-police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  --gauche: env(safe-area-inset-left, 0px);
  --droite: env(safe-area-inset-right, 0px);
  --barre: 60px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--texte); overflow-x: hidden;
  background: radial-gradient(90% 60% at 15% 0%, rgba(120, 70, 25, 0.28) 0%, transparent 60%), var(--noir);
  font: 16px/1.5 var(--texte-police);
}
:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
p { margin: 0; }

/* ---- En-tête : Jean-Baptiste dans sa bibliothèque (image d'origine, non retouchée), titre SALOMON, date et heure */
.hero { position: relative; min-height: 300px; padding: calc(16px + var(--haut)) calc(16px + var(--droite)) 18px calc(16px + var(--gauche)); overflow: hidden; display: grid; align-content: end; }
.hero__portrait { position: absolute; inset: 0 auto 0 0; width: 58%; height: 100%; object-fit: cover; object-position: 30% 20%; }
.hero__voile { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(7, 6, 5, 0) 0%, rgba(7, 6, 5, 0.1) 36%, rgba(7, 6, 5, 0.8) 54%, var(--noir) 64%),
  linear-gradient(180deg, rgba(7, 6, 5, 0) 55%, var(--noir) 100%); }
.hero__contenu { position: relative; display: grid; gap: 14px; }
.marque { justify-self: end; width: 44%; min-width: 160px; display: grid; justify-items: center; text-align: center; gap: 2px; }
.marque__embleme { width: 34px; height: auto; filter: drop-shadow(0 0 6px rgba(216, 173, 85, 0.45)); }
.marque__nom { font-family: var(--capitales); font-weight: 400; font-size: 1.68rem; line-height: 1.1; letter-spacing: 0.08em; color: var(--or-clair);
  background: linear-gradient(180deg, var(--or-pale), var(--or) 70%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.marque__module { font-family: var(--capitales); font-size: 0.78rem; letter-spacing: 0.18em; color: var(--or); }
.horloge { justify-self: end; width: 46%; min-width: 172px; display: grid; justify-items: center; gap: 0; padding: 8px 10px; border: 1px solid var(--liseré); border-radius: var(--rayon); background: rgba(7, 6, 5, 0.72); }
.horloge__date { font-size: 0.7rem; color: var(--texte-doux); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.horloge__date svg { width: 14px; height: 14px; stroke: var(--or); fill: none; stroke-width: 1.6; }
.horloge__heure { font-family: var(--capitales); font-size: 1.55rem; line-height: 1.2; color: var(--texte); letter-spacing: 0.04em; }
.dossier-actif { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--liseré); border-radius: var(--rayon); background: rgba(7, 6, 5, 0.7); }
.dossier-actif__nom { font-family: var(--titres); font-weight: 600; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.retour-jarvis { justify-self: start; font-family: var(--capitales); font-size: 0.8rem; letter-spacing: 0.12em; color: var(--or); text-decoration: none; }

/* ---- Vues */
main { max-width: 46rem; margin: 0 auto; padding: 6px calc(16px + var(--droite)) calc(var(--barre) + 34px + var(--bas)) calc(16px + var(--gauche)); display: grid; gap: 14px; }
.vue { display: grid; gap: 14px; min-width: 0; }
.vue > h1 { margin: 2px 2px 0; font-family: var(--titres); font-weight: 600; font-size: 1.75rem; line-height: 1.15; color: var(--texte); }
.vue > .intro { margin: -8px 2px 0; color: var(--texte-doux); font-size: 0.92rem; }
.carte {
  background: linear-gradient(180deg, rgba(255, 220, 150, 0.035), rgba(255, 220, 150, 0) 40%), var(--panneau);
  border: 1px solid var(--liseré); border-radius: var(--rayon); padding: 16px; display: grid; gap: 12px; min-width: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.carte > h2, .titre-panneau { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--texte-police); font-size: 0.98rem; font-weight: 600; color: var(--texte); }
.titre-panneau svg, .carte > h2 svg { width: 18px; height: 18px; stroke: var(--or); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.carte--discrete { background: rgba(12, 10, 8, 0.55); }
.bandeau { border-left: 2px solid var(--or); }
.doux { color: var(--texte-doux); font-size: 0.9rem; }
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ligne--fin { justify-content: flex-end; }
.grille2 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }

/* ---- Tuiles d'actions (Vue d'ensemble) */
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tuile { min-height: 108px; display: grid; justify-items: center; align-content: center; gap: 8px; padding: 12px 6px; text-align: center;
  font-size: 0.82rem; font-weight: 600; line-height: 1.2; color: var(--texte); background: var(--panneau); border: 1px solid var(--liseré); border-radius: var(--rayon); box-shadow: none; }
.tuile svg { width: 30px; height: 30px; stroke: var(--or-clair); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(216, 173, 85, 0.35)); }
.tuile:active { border-color: var(--liseré-fort); }

/* ---- Listes à chevrons (Dernières tenues, Actions rapides) */
.liste-or { margin: 0; padding: 0; list-style: none; display: grid; }
.liste-or > li { border-top: 1px solid rgba(216, 173, 85, 0.14); }
.liste-or > li:first-child { border-top: 0; }
.tenue { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 12px 2px; text-align: left; color: var(--texte); background: none; border: 0; border-radius: 0; box-shadow: none; font-weight: 400; min-height: 56px; }
.tenue svg.doc { width: 26px; height: 26px; stroke: var(--or); fill: none; stroke-width: 1.4; }
.tenue__titre { display: block; font-weight: 600; font-size: 0.95rem; }
.tenue__detail { display: block; font-size: 0.8rem; color: var(--texte-doux); }
.tenue__etat { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.tenue__etat svg { width: 12px; height: 12px; stroke: #0a0805; stroke-width: 3; fill: none; }
.tenue__etat--valide { background: var(--ok); }
.tenue__etat--redaction { background: var(--or); }
.tenue__etat--vide { border: 1px solid var(--liseré); }
.chevron { width: 14px; height: 14px; stroke: var(--texte-doux); fill: none; stroke-width: 2; }
.tenue[aria-current="true"] .tenue__titre { color: var(--or-clair); }
details.action { padding: 0; }
details.action > summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; min-height: 52px; padding: 10px 2px; cursor: pointer; font-weight: 500; font-size: 0.95rem; }
details.action > summary::-webkit-details-marker { display: none; }
details.action > summary svg { width: 20px; height: 20px; stroke: var(--or); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
details.action > summary .chevron { transition: transform 0.15s; }
details.action[open] > summary .chevron { transform: rotate(90deg); }
details.action > .contenu { display: grid; gap: 10px; padding: 0 0 14px; }

/* ---- Contrôles */
button {
  font: inherit; font-weight: 600; min-height: 44px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  color: #1c1406; background: linear-gradient(180deg, var(--or-pale), var(--or) 85%); border: 1px solid rgba(246, 223, 166, 0.65);
  box-shadow: 0 0 14px rgba(216, 173, 85, 0.2);
}
button.second { color: var(--texte); background: rgba(216, 173, 85, 0.06); border: 1px solid var(--liseré); box-shadow: none; }
button.lien { min-height: 36px; padding: 6px 8px; color: var(--or-clair); background: none; border: 0; box-shadow: none; font-weight: 500; }
button.danger { color: var(--erreur); background: rgba(229, 138, 123, 0.08); border: 1px solid rgba(229, 138, 123, 0.4); box-shadow: none; }
button:disabled { opacity: 0.42; cursor: default; }
label { font-size: 0.86rem; color: var(--texte-doux); }
.champ { display: grid; gap: 4px; min-width: 0; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  font: inherit; font-size: 16px; color: var(--texte); background: rgba(5, 4, 3, 0.78);
  border: 1px solid var(--liseré); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--liseré-fort); outline: none; box-shadow: 0 0 0 3px rgba(216, 173, 85, 0.15); }
textarea { min-height: 96px; line-height: 1.45; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 15px; }
input[type=file] { font: inherit; font-size: 0.92rem; max-width: 100%; color: var(--texte-doux); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 9px 14px; border-radius: 8px; color: #1c1406; background: linear-gradient(180deg, var(--or-pale), var(--or)); border: 0; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--or); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--or) 50%), linear-gradient(135deg, var(--or) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
details { border-top: 1px solid rgba(216, 173, 85, 0.14); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; list-style-position: inside; }
details > .contenu { display: grid; gap: 10px; margin-top: 10px; }
details.carte { display: block; padding: 14px 16px; }
details.carte > summary { min-height: 28px; }
progress { width: 100%; height: 6px; accent-color: var(--or); }

/* ---- États et pastilles */
.etat { font-size: 0.9rem; padding: 9px 12px; border-radius: 8px; background: rgba(216, 173, 85, 0.06); color: var(--texte-doux); }
.etat.ok { background: rgba(88, 194, 125, 0.1); color: var(--ok); }
.etat.warn { background: rgba(233, 180, 76, 0.1); color: var(--alerte); }
.etat.bad { background: rgba(229, 138, 123, 0.1); color: var(--erreur); }
.pastille { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--liseré); color: var(--texte-doux); white-space: nowrap; }
.pastille--or { color: var(--or-pale); border-color: rgba(216, 173, 85, 0.55); background: rgba(216, 173, 85, 0.1); }
.pastille--alerte { color: var(--alerte); border-color: rgba(233, 180, 76, 0.55); background: rgba(233, 180, 76, 0.08); }
.pastille--ok { color: var(--ok); border-color: rgba(88, 194, 125, 0.5); }
.pastille--argent { color: #d8d2c4; }
.compteurs { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Enregistrements */
.liste-fichiers { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fichier { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; background: rgba(5, 4, 3, 0.6); border: 1px solid rgba(216, 173, 85, 0.16); overflow-wrap: anywhere; }
.fichier button { min-height: 38px; padding: 4px 12px; }

/* ---- Filtres (pastilles, comme les onglets de la référence) */
.segmente { display: flex; gap: 6px; flex-wrap: wrap; }
.segmente button { min-height: 38px; padding: 6px 14px; border-radius: 999px; font-size: 0.86rem; color: var(--texte); background: rgba(5, 4, 3, 0.6); border: 1px solid var(--liseré); box-shadow: none; }
.segmente button[aria-pressed="true"] { color: #1c1406; background: linear-gradient(180deg, var(--or-pale), var(--or)); border-color: transparent; }

/* ---- Passages transcrits, intervenants, notes, décisions */
.segments { display: grid; gap: 10px; }
.segment { display: grid; gap: 8px; padding: 12px; border-radius: var(--rayon); background: var(--panneau); border: 1px solid rgba(216, 173, 85, 0.18); min-width: 0; }
.segment--a-verifier { border-color: rgba(233, 180, 76, 0.55); }
.segment__tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segment__id { font-family: var(--mono); font-size: 0.8rem; color: var(--texte-doux); }
.segment__texte { overflow-wrap: anywhere; font-size: 0.98rem; }
.segment__texte--inaudible { color: var(--alerte); font-style: italic; }
.segment__attribution { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.segment__actions { display: flex; gap: 2px; flex-wrap: wrap; margin: -4px -6px -6px; }
.barre-selection {
  position: sticky; bottom: calc(var(--barre) + 26px + var(--bas)); z-index: 5;
  display: grid; gap: 8px; padding: 12px; border-radius: var(--rayon); background: var(--panneau-fort); border: 1px solid var(--liseré-fort);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ---- Ordre du jour */
.protocole { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.protocole li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(216, 173, 85, 0.12); font-family: var(--titres); font-size: 1.08rem; font-weight: 500; }
.protocole .numero { font-family: var(--capitales); font-size: 0.86rem; color: var(--or); min-width: 3rem; padding-top: 2px; }
.protocole li[data-niveau="2"] { padding-left: 22px; }
.protocole li[data-niveau="3"] { padding-left: 44px; }
.erreurs { margin: 0; padding-left: 1.2rem; color: var(--erreur); font-size: 0.9rem; }

/* ---- Prévisualisation du compte rendu : parchemin, comme la carte « Secrétariat » de la référence */
.document {
  background: linear-gradient(180deg, #f5ecd8, #efe2c6); color: #24190d; border-radius: 6px; padding: 24px 18px; display: grid; gap: 8px;
  font-family: var(--titres); font-weight: 500; font-size: 1.06rem; line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(216, 173, 85, 0.55); overflow-wrap: anywhere;
}
.document h3 { margin: 0 0 4px; text-align: center; font-family: var(--capitales); font-weight: 600; font-size: 1rem; letter-spacing: 0.12em; }
.document .statut { text-align: center; font-size: 0.92rem; color: #6b5330; font-style: italic; margin-bottom: 8px; }
.document dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 8px; }
.document dt { color: #6b5330; }
.document dd { margin: 0; }
.document h4 { margin: 12px 0 2px; font-weight: 700; font-size: 1.12rem; border-bottom: 1px solid rgba(36, 25, 13, 0.18); padding-bottom: 2px; }
.document .sous { margin: 4px 0 0; font-variant: small-caps; letter-spacing: 0.04em; color: #6b5330; }
.document ul { margin: 0; padding-left: 1.1rem; }
.document .a-completer { color: #8a5a00; background: rgba(216, 173, 85, 0.25); border-radius: 3px; padding: 0 3px; }
.document .inaudible { color: #8a3a2a; font-style: italic; }
.document aside { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: rgba(216, 173, 85, 0.16); font-size: 0.96rem; }
.analyse { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.9rem; }
.analyse li { padding: 8px 10px; border-radius: 8px; background: rgba(5, 4, 3, 0.55); border-left: 2px solid var(--liseré); }
.analyse li[data-type="erreur"] { color: var(--erreur); border-left-color: var(--erreur); }
.analyse li[data-type="manquant"] { color: var(--alerte); border-left-color: var(--alerte); }
.analyse li[data-type="avertissement"] { color: var(--texte-doux); }

/* ---- Onglets : pastilles dorées dans une barre en bas d'écran (au pouce), défilement horizontal */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 9px calc(12px + var(--droite)) calc(9px + var(--bas)) calc(12px + var(--gauche));
  background: linear-gradient(180deg, rgba(14, 11, 8, 0.9), rgba(7, 6, 5, 0.97)); border-top: 1px solid var(--liseré);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.onglets::-webkit-scrollbar { display: none; }
.onglets button {
  flex: none; scroll-snap-align: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 600; white-space: nowrap; color: var(--texte); background: rgba(5, 4, 3, 0.6); border: 1px solid var(--liseré); box-shadow: none;
}
.onglets button[aria-current="page"] { color: #1c1406; background: linear-gradient(180deg, var(--or-pale), var(--or) 85%); border-color: transparent; box-shadow: 0 0 14px rgba(216, 173, 85, 0.3); }

/* ---- Grand écran : disposition des références (Jean-Baptiste à gauche, contenu à droite), sans barre JARVIS */
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: minmax(300px, 34vw) 1fr; }
  .hero { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 0; height: 100dvh; min-height: 0; align-content: start; padding: 0; }
  .hero__portrait { width: 100%; object-position: 30% 25%; }
  .hero__voile { background: linear-gradient(90deg, rgba(7, 6, 5, 0) 60%, var(--noir) 100%), linear-gradient(180deg, rgba(7, 6, 5, 0) 70%, rgba(7, 6, 5, 0.6) 100%); }
  .hero__contenu { position: fixed; z-index: 15; top: 0; right: 0; left: 34vw; padding: 20px 24px 14px; grid-template-columns: 1fr auto; align-items: start;
    background: linear-gradient(180deg, var(--noir) 82%, rgba(7, 6, 5, 0)); }
  .marque { justify-self: center; width: auto; grid-column: 1; }
  .marque__nom { font-size: 2.2rem; letter-spacing: 0.1em; }
  .horloge { width: auto; min-width: 170px; grid-column: 2; grid-row: 1; }
  .horloge__date { font-size: 0.78rem; }
  .dossier-actif { grid-column: 1 / -1; }
  main { grid-column: 2; padding-top: 230px; max-width: 54rem; width: 100%; justify-self: center; }
  .onglets { left: calc(34vw + 24px); right: 24px; bottom: 16px; border: 1px solid var(--liseré); border-radius: 999px; padding: 6px; justify-content: center; }
  .barre-selection { bottom: calc(var(--barre) + 34px); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .carte, .onglets, .barre-selection { background: var(--panneau-fort); } }
