/* Carnet — compléments propres à l'application, en plus de carnet.css (repris tel quel des maquettes) */

/* Polices servies en local (sous-ensembles latin et latin-ext de Google Fonts, licence OFL),
   jamais depuis Google Fonts : comme HTMX, rien ne part vers un CDN. */
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/InstrumentSerif-italic-latin-ext.c3fbcb38845f.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/InstrumentSerif-italic-latin.26082c73a711.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/InstrumentSerif-normal-latin-ext.18e8ea957b6c.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/InstrumentSerif-normal-latin.c008db4e8a97.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/JetBrainsMono-normal-latin-ext.e6155c5cfacf.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/JetBrainsMono-normal-latin.570751c5f8b4.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

body { margin: 0; background: #f7f8f5; }
body:has(.cn[data-theme="dark"]) { background: #0e1a1f; }
.cn [hidden] { display: none !important; }

/* Intertitres de jour : filet entre deux groupes (remplace les style="" des maquettes) */
.list + .day, .tl + .day { border-top: 1px solid var(--line); }

/* Résumé Kanban : autant de colonnes que d'étapes actives */
@media (min-width: 761px) { .kpis { grid-template-columns: repeat(var(--kpis, 5), minmax(0, 1fr)); } }

/* Recherche globale : liste déroulante sous le champ (maquette Recherche) */
.search-res { position: absolute; left: -1px; right: -1px; top: calc(100% + 8px); z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .14); max-height: 72vh; overflow-y: auto; color: var(--ink); }
.search-res:empty { display: none; }
.search-res a.rel { color: var(--ink); }
.search-res a.rel + a.rel { border-top: 1px solid var(--line); }
.search-res a.rel:hover, .search-res a.rel:focus { background: var(--tint); outline: 0; }
.search-res a.rel:focus .kbd-entree { visibility: visible; }
.kbd-entree { visibility: hidden; }
.search-res .vide { padding: 14px 16px; }

/* Messages flash */
.msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.msgs li { padding: 8px 14px; border-radius: 10px; background: var(--tint); color: var(--teal); font-size: 13px; }
.msgs li.error { background: transparent; border: 1px solid var(--alert); color: var(--alert); }

.vide { margin: 0; padding: 14px 16px; color: var(--ink3); font-size: 13px; }
.side-foot form { margin: 0; }
.side-foot .lnk { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.date-cachee { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.htmx-request .acts, .htmx-request.quick { opacity: .55; }

/* Mobile : la barre latérale devenue en-tête ne doit pas s'élargir à la taille de sa nav défilante */
@media (max-width: 760px) {
  .side { min-width: 0; }
}

/* Petits boutons texte discrets (supprimer un échange, retirer un lien) */
.lien-discret { min-height: 0 !important; padding: 0 4px; margin-left: auto; font-weight: 400; color: var(--ink3); }
.lien-discret:hover { color: var(--alert); }

/* Modale native <dialog> habillée par .modal (carnet.css dessine la carte, pas la fenêtre) */
dialog.modal { padding: 0; border: 1px solid var(--line); color: var(--ink); }
dialog.modal::backdrop { background: rgba(14, 26, 31, .45); }
form[data-etape="acceptee"] .cloture-motif { display: none !important; }

/* Kanban : la zone close survolée pendant un glisser */
.dz:has(.kc-ghost) { border-color: var(--teal); background: var(--tint); }
.dz .kc-ghost { display: none; }

/* Connexion (maquette Login) : accroche à gauche, formulaire sur panneau à droite */
.connexion-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); min-height: 100vh; }
.connexion-accroche { padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.connexion-titre { font-size: 72px; line-height: 1.02; letter-spacing: -.015em; margin: 16px 0 0; font-weight: 400; }
.connexion-panneau { background: var(--panel); border-left: 1px solid var(--line); padding: 40px 56px; display: flex; align-items: center; }
@media (max-width: 760px) {
  .connexion-accroche, .connexion-panneau { padding: 28px 20px; }
  .connexion-titre { font-size: 48px; }
  .connexion-panneau { border-left: 0; border-top: 1px solid var(--line); }
}

/* Un bouton qui poste (archiver, supprimer) reste aligné avec ses voisins dans une rangée d'actions */
.acts form { display: contents; }
.acts { flex-wrap: nowrap; }
.rel .acts, .quick .acts { flex-wrap: wrap; }
