/* « Ajouter un Drive » dans une fiche */
.note-add-drive { margin-top: var(--sp-3); }
.note-add-drive > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ardoise); font-size: 13px; }
.note-add-drive > summary:hover { color: var(--graphite); }
.note-add-drive form { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.note-add-drive .field { flex: 1; min-width: 220px; }

/* Cerveau : fiches d'infos à garder */
.notes-page { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.notes-bar .mail-search { flex: 1; min-width: 240px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--sp-4); align-items: start; }
.note-card { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.note-head { display: flex; align-items: center; gap: var(--sp-2); }
.note-edit { margin-left: auto; }
.note-title { font: 600 16px/1.3 var(--f-titre); overflow-wrap: anywhere; }
.note-url { font-size: 13px; overflow-wrap: anywhere; }
.note-secret { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-ctrl); background: var(--surface-2); font-size: 13px; }
.note-secret p { display: flex; gap: var(--sp-2); align-items: baseline; min-width: 0; }
.note-secret code { font-family: var(--f-donnees); overflow-wrap: anywhere; }
.note-secret-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.note-secret-actions .btn { padding: 4px 8px; font-size: 12px; gap: 4px; }
.note-secret-actions svg.icon { width: 14px; height: 14px; }
.note-body { font-size: 13.5px; color: var(--graphite); overflow-wrap: anywhere; }
.note-body p + p { margin-top: 6px; }
.note-foot { display: flex; flex-wrap: wrap; gap: 4px var(--sp-3); font-size: 12px; margin-top: auto; }
.note-pin { display: flex; align-items: flex-end; }
.note-delete { margin-top: var(--sp-4); }
.notes-export summary { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-weight: 500; }
.notes-export summary svg.icon { width: 16px; height: 16px; }
.notes-export > p { margin: var(--sp-2) 0 var(--sp-3); font-size: 13px; }
.export-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.export-form .field { width: auto; flex: 1; min-width: 220px; }

/* Recherche partout */
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--sp-4); align-items: start; }
.search-section { display: block; min-width: 0; }
.search-section .eyebrow { margin-bottom: var(--sp-2); }
.search-list { list-style: none; padding: 0; margin: 0; }
.search-list li + li { border-top: 1px solid var(--trait); }
.search-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; border-radius: var(--r-ctrl); min-width: 0; }
.search-list a:hover { background: var(--surface-2); }
.search-list b { font-weight: 500; overflow-wrap: anywhere; }
.search-list .muted { font-size: 12px; }
.veille-sources { margin-top: var(--sp-5); }
.veille-sources h2 { font: 600 17px/1.2 var(--f-titre); margin-bottom: var(--sp-1); }
.veille-sources .label { margin-top: var(--sp-3); }

/* Formulaire de fiche : deux colonnes larges */
.note-form .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin-top: var(--sp-4); }
.note-form .form-row + .form-grid, .note-form .form-grid + .form-row { margin-top: var(--sp-4); }

/* Onglets du cerveau */
.brain-tabs { margin-right: var(--sp-2); }
.project-pill { background: color-mix(in oklab, var(--c) 18%, transparent); color: var(--graphite); }

/* Projets : tableau par étape */
.project-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: var(--sp-3); align-items: start; overflow-x: auto; padding-bottom: var(--sp-2); }
.project-col { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 120px; padding: var(--sp-2); border-radius: var(--r-card, 12px); background: var(--surface-2); transition: box-shadow .15s; }
.project-col.drop { box-shadow: inset 0 0 0 2px var(--prusse); }
.project-col-title { display: flex; align-items: center; gap: 8px; font: 600 13px/1.2 var(--f-texte); padding: 4px 6px; }
.project-col-title .mono { margin-left: auto; color: var(--ardoise); font-weight: 400; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ardoise); }
.stage-a_chiffrer { --stage: var(--ambre); } .stage-attente_validation { --stage: var(--cal-equipe); } .stage-prevu { --stage: var(--cal-pro); }
.stage-en_cours { --stage: var(--cal-perso); } .stage-en_pause { --stage: var(--cal-brique); } .stage-termine { --stage: var(--ardoise); }
.stage-dot[class*="stage-"] { background: var(--stage); }
.stage-pill { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: color-mix(in oklab, var(--stage, var(--ardoise)) 20%, transparent); color: var(--graphite); }
.project-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--sp-3); cursor: grab; box-shadow: inset 3px 0 0 var(--c); }
.project-card.dragging { opacity: .5; }
.project-card.proposed { outline: 1px dashed var(--ambre); }
.project-card-link { display: block; padding-right: 26px; }
.project-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.project-client { font-size: 12.5px; color: var(--ardoise); }
.project-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11.5px; color: var(--ardoise); }
.project-proposal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--trait); font-size: 12px; }
.project-proposal form { display: inline; }
.project-move { position: absolute; top: 8px; right: 8px; }
.project-move > summary, .track-list > summary { list-style: none; cursor: pointer; }
.project-move > summary::-webkit-details-marker, .track-list > summary::-webkit-details-marker { display: none; }
.project-move .vi-menu, .track-list .vi-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--sp-2) var(--sp-3); min-width: 200px; font-size: 13px; }
.track-list { position: relative; }
.track-list .vi-menu { left: 0; right: auto; }
.project-empty { padding: 6px; font-size: 13px; }
.project-page { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--sp-4); align-items: start; }
.project-grid .eyebrow { margin-bottom: var(--sp-2); }
.project-summary { font-size: 14px; }
.project-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.project-actions form { display: inline; }
@media (max-width: 900px) {
  .project-board { grid-template-columns: minmax(0, 1fr); overflow: visible; }
}

/* Cerveau en réseau : voir « Réseau du cerveau » plus bas */

/* Carte « Projets en cours » du cerveau */
.brain-projects { display: flex; flex-direction: column; gap: var(--sp-3); }
.brain-projects-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.brain-projects-head .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.brain-projects-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--sp-3); }
.bp-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.bp-stage-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ardoise); }
.bp-project { display: block; max-width: 100%; padding: 4px 10px; border-radius: var(--r-ctrl); background: color-mix(in oklab, var(--c) 14%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-project:hover { background: color-mix(in oklab, var(--c) 24%, var(--surface)); }
.bp-project.proposed { outline: 1px dashed var(--ambre); }

/* Fiche projet dans le cerveau */
.project-fiche { box-shadow: inset 4px 0 0 var(--c); }
.project-fiche.proposed { outline: 1px dashed var(--ambre); }
.project-fiche .note-title a:hover { text-decoration: underline; }
.project-fiche .project-proposal form { display: inline; }

/* Cerveau en arbre : navigation à gauche, contenu à droite */
.brain-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.brain-tree { position: sticky; top: var(--sp-4); display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 2 * var(--sp-4)); overflow-y: auto; padding: var(--sp-3); scrollbar-width: thin; }
.brain-main { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-list .tree-list { padding-left: 14px; border-left: 1px solid var(--trait); margin-left: 9px; }
.tree-node > summary { list-style: none; cursor: pointer; }
.tree-node > summary::-webkit-details-marker { display: none; }
.tree-node > summary::before { content: "▸"; width: 10px; color: var(--ardoise); font-size: 11px; transition: rotate .15s; }
.tree-node[open] > summary::before { rotate: 90deg; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: var(--r-ctrl); font-size: 13.5px; min-width: 0; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.current { background: color-mix(in oklab, var(--c, var(--prusse)) 14%, var(--surface)); font-weight: 600; }
.tree-row.drop { box-shadow: inset 0 0 0 2px var(--prusse); background: var(--surface-2); }
.tree-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.tree-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: 11px; color: var(--ardoise); }
.tree-root { font-weight: 600; }
.tree-empty { font-size: 12.5px; padding: 6px; }
.tree-add { margin-top: var(--sp-2); justify-content: center; }
.brain-layout.dragging .tree-row { outline: 1px dashed var(--trait); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ardoise); }
.breadcrumb b { color: var(--graphite); }
.branch-intro { font-size: 13.5px; }
.new-menu { position: relative; }
.new-menu > summary { list-style: none; cursor: pointer; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu .vi-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; gap: 8px; padding: var(--sp-3); min-width: 240px; }
.new-menu .vi-menu a { display: inline-flex; align-items: center; gap: 8px; }
/* Branches et cartes Drive */
.note-branch { box-shadow: inset 0 4px 0 var(--c); background: color-mix(in oklab, var(--c) 6%, var(--surface)); }
.branch-pill, .drive-pill { display: inline-flex; align-items: center; gap: 4px; }
.branch-summary { font-size: 13px; }
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.note-drive { box-shadow: inset 4px 0 0 var(--cal-sarcelle); }
.drive-meta { font-size: 12px; }
.drive-refresh { align-self: flex-start; padding: 3px 10px; font-size: 12.5px; gap: 6px; }
.drive-refresh svg.icon, .note-open svg.icon { width: 14px; height: 14px; }
.note-open { padding: 3px 10px; font-size: 12.5px; gap: 6px; }
.drive-text { max-height: 9em; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
.note-path { font-size: 11.5px; }
.note-card.from-ai { outline: 1px dashed var(--ambre); }
.note-card[draggable="true"] { cursor: grab; }
/* Formulaire : type, recherche d'un fichier Drive */
.kind-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--sp-2); }
.kind-option { display: flex; gap: 8px; align-items: flex-start; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--trait); border-radius: var(--r-ctrl); cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--prusse); background: color-mix(in oklab, var(--prusse) 8%, var(--surface)); }
.kind-option span { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.kind-option small { color: var(--ardoise); font-size: 12px; }
.drive-picker { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.drive-chosen { font-weight: 500; }
.drive-search { display: flex; gap: var(--sp-2); }
.drive-search .field { flex: 1; }
.drive-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.drive-result { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--trait); border-radius: var(--r-ctrl); background: var(--surface); cursor: pointer; text-align: left; }
.drive-result:hover { border-color: var(--prusse); }
.note-form [hidden] { display: none !important; }
@media (max-width: 900px) {
  .brain-layout { grid-template-columns: minmax(0, 1fr); }
  .brain-tree { position: static; max-height: 320px; }
}

/* IA à traiter */
.ai-review-page { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-5); }
.review-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.review-section .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.review-head form { display: inline; }
.review-list.card { padding: 0 var(--sp-3); }
.review-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--trait); }
.review-item:first-child { border-top: 0; }
.review-mail { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.review-title { font-size: 14px; overflow-wrap: anywhere; }
.review-title:hover { text-decoration: underline; }
.review-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; }
.review-summary { font-size: 13.5px; color: var(--graphite); }
.rdv-pill { background: color-mix(in oklab, var(--cal-pro) 18%, transparent); }
.review-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; position: relative; }
.review-actions form { display: inline; }
.review-adjust > summary { list-style: none; cursor: pointer; }
.review-adjust > summary::-webkit-details-marker { display: none; }
.review-adjust-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: flex !important; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); min-width: 260px; }
.review-adjust-form label { display: flex; flex-direction: column; gap: 4px; }
.review-adjust-form .label { margin: 0; }
.review-learned .label { margin-top: var(--sp-2); }
/* Lignes du brief : « pas pertinent » au survol */
.brief-line { position: relative; padding-right: 22px; }
.brief-x-form { position: absolute; right: 0; top: 0; }
.brief-x { border: 0; background: none; color: var(--ardoise); cursor: pointer; opacity: 0; font-size: 14px; line-height: 1.4; }
.brief-line:hover .brief-x, .brief-x:focus-visible { opacity: 1; }
.brief-x:hover { color: var(--erreur); }
@media (hover: none) { .brief-x { opacity: .45; } }

/* ===== Cerveau en trois colonnes : branches · contenu · fiche ouverte ===== */
.brain-quick { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
.brain-quick > svg.icon { width: 18px; height: 18px; margin-top: 11px; color: var(--prusse); flex: none; }
.brain-quick textarea.field { flex: 1; min-height: 40px; resize: none; border: 0; background: transparent; font-size: 15px; line-height: 1.45; padding: 9px 4px; }
.brain-quick textarea.field:focus { outline: none; box-shadow: none; }
.brain-quick .btn { margin-top: 3px; }
.brain-proposed { font-size: 13px; }
.brain-proposed a { display: inline-flex; align-items: center; gap: 6px; }
.brain-cols { display: grid; grid-template-columns: minmax(200px, 250px) minmax(280px, 1fr) minmax(320px, 1.2fr); gap: var(--sp-3); align-items: start; }
.brain-cols .brain-tree { position: sticky; top: var(--sp-4); max-height: calc(100vh - 2 * var(--sp-4)); overflow-y: auto; padding: var(--sp-3); }
.tree-wrap > summary { list-style: none; }
.tree-wrap > summary::-webkit-details-marker { display: none; }
.tree-title { font: 600 11.5px/1 var(--f-donnees); text-transform: uppercase; letter-spacing: .06em; color: var(--ardoise); padding: 4px 6px 8px; cursor: default; }
.brain-list { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); min-width: 0; }
.brain-list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.brain-list .breadcrumb { font-size: 13.5px; gap: 4px; }
.brain-search .field { height: 36px; font-size: 14px; }
.brain-search > svg.icon { top: 9px; }
.brain-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.brain-row { position: relative; display: flex; align-items: center; gap: 2px; border-radius: 10px; transition: background .12s, box-shadow .12s; }
.brain-row:hover { background: var(--surface-2); }
.brain-row.selected { background: color-mix(in oklab, var(--c) 14%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
.brain-row-main { flex: 1; display: flex; align-items: center; gap: var(--sp-3); padding: 10px 6px; min-width: 0; border-radius: 10px; }
.brain-row-grip { flex: none; display: grid; place-items: center; width: 18px; align-self: stretch; color: var(--ardoise); opacity: 0; cursor: grab; transition: opacity .12s; }
.brain-row:hover .brain-row-grip, .brain-row:focus-within .brain-row-grip { opacity: .7; }
.brain-row-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; background: color-mix(in oklab, var(--c) 18%, var(--surface)); color: color-mix(in oklab, var(--c) 70%, var(--graphite)); }
.brain-row-icon svg.icon { width: 17px; height: 17px; }
.brain-row.kind-branch .brain-row-icon, .brain-row.kind-project .brain-row-icon { background: color-mix(in oklab, var(--c) 30%, var(--surface)); }
.brain-row.kind-access .brain-row-icon { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--erreur) 45%, transparent); }
.brain-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.brain-row-text b { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-row-text .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-row-date { flex: none; font-size: 11px; color: var(--ardoise); }
.brain-row-go { color: var(--ardoise); }
.brain-row-pin { color: var(--ambre); }
.brain-row[draggable="true"] { cursor: grab; }
.brain-row.is-dragged { opacity: .45; }
/* Glisser-déposer : pendant le glisser, toutes les cibles (arbre, branches de la liste, chemin) se signalent. */
.brain-cols.dragging [data-brain-tree-target="drop"] { outline: 1.5px dashed color-mix(in oklab, var(--prusse) 45%, transparent); outline-offset: -2px; }
.brain-cols.dragging .brain-row.kind-branch, .brain-cols.dragging .brain-row.kind-project { background: color-mix(in oklab, var(--prusse) 6%, transparent); }
[data-brain-tree-target="drop"].drop { outline: 2px solid var(--prusse) !important; background: color-mix(in oklab, var(--prusse) 12%, var(--surface)) !important; }
.breadcrumb .crumb { padding: 2px 6px; border-radius: 6px; }
.crumb-back { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); margin-right: 4px; }
/* Menu « ⋯ » d'une ligne */
.row-menu { position: relative; flex: none; }
.row-menu > summary { list-style: none; cursor: pointer; opacity: .55; }
.row-menu > summary::-webkit-details-marker { display: none; }
.brain-row:hover .row-menu > summary, .row-menu[open] > summary { opacity: 1; }
.row-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgb(0 0 0 / .14); }
.row-menu-pop a, .row-menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--graphite); text-align: left; cursor: pointer; }
.row-menu-pop a:hover, .row-menu-pop button:hover { background: var(--surface-2); }
.row-menu-pop .danger { color: var(--erreur); }
.row-menu-pop form { display: block; }
/* Déplacer vers… et chemin de la fiche */
.relocate-form { display: flex; flex-direction: column; gap: var(--sp-2); }
.relocate-form select.field { height: auto; padding: 6px; font-size: 14px; }
.brain-card-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.brain-card-path a:hover { text-decoration: underline; color: var(--graphite); }
.brain-card-move { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--graphite); }
/* Carte Drive : aperçu Google sur demande, jamais le texte brut */
.drive-preview > summary { list-style: none; width: max-content; }
.drive-preview > summary::-webkit-details-marker { display: none; }
.drive-preview iframe { display: block; width: 100%; height: 62vh; margin-top: var(--sp-2); border: 1px solid var(--trait); border-radius: 10px; background: #fff; }
.drive-sensitive { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: color-mix(in oklab, var(--erreur) 9%, var(--surface)); }
.brain-empty { padding: var(--sp-3) 6px; font-size: 13.5px; }
.brain-detail { display: block; position: sticky; top: var(--sp-4); max-height: calc(100vh - 2 * var(--sp-4)); overflow-y: auto; padding: var(--sp-4); min-width: 0; }
.brain-detail-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: var(--sp-6) var(--sp-3); color: var(--graphite); }
.brain-detail-empty svg.icon { width: 34px; height: 34px; color: var(--ardoise); }
.brain-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.brain-card-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.brain-card-head .pill { display: inline-flex; align-items: center; gap: 4px; }
.brain-card-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.brain-card-actions form { display: inline; }
.brain-card-path { font-size: 12.5px; color: var(--ardoise); }
.brain-card-title { font: 600 21px/1.25 var(--f-titre); overflow-wrap: anywhere; }
.brain-card-body { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.brain-card-body p + p { margin-top: 8px; }
.brain-card-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.brain-card-buttons form { display: inline; }
.stage-buttons .btn { padding: 4px 10px; font-size: 12.5px; }
.brain-mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.brain-mini-list a:hover { text-decoration: underline; }
.brain-card-foot { display: flex; flex-wrap: wrap; gap: 4px var(--sp-3); font-size: 12px; border-top: 1px solid var(--trait); padding-top: var(--sp-2); }
/* Formulaire compact */
.note-form .kind-choice { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
.note-form .kind-option { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; }
.note-form .kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.note-form .kind-option svg.icon { width: 14px; height: 14px; }
.more-options { margin-top: var(--sp-3); font-size: 13.5px; }
.more-options > summary { cursor: pointer; color: var(--prusse); width: max-content; }
.swatches-row { margin-top: var(--sp-3); }
@media (max-width: 1100px) {
  .brain-cols { grid-template-columns: minmax(0, 1fr); }
  .brain-cols .brain-tree, .brain-detail { position: static; max-height: none; }
  .brain-detail:not([src]) { display: none; } /* aucune fiche choisie : rien à montrer sous la liste */
  .tree-wrap:not([open]) .tree-list { display: none; }
}

/* Propositions de l'IA et « Dans le cerveau » */
.proposal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-3); }
.proposal-card { display: flex; flex-direction: column; gap: 6px; box-shadow: inset 0 3px 0 var(--c); }
.proposal-where { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.proposal-title { font: 600 16px/1.3 var(--f-titre); overflow-wrap: anywhere; }
.proposal-body { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--sp-2); }
.proposal-actions form { display: inline; }
.brain-related { display: flex; flex-direction: column; gap: 6px; margin: var(--sp-3) 0; font-size: 13.5px; }
.brain-related-head { display: flex; align-items: center; gap: 6px; }
.brain-related-head .link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.brain-related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.brain-related-list a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: color-mix(in oklab, var(--c) 14%, var(--surface)); }
.brain-related-list a:hover { background: color-mix(in oklab, var(--c) 24%, var(--surface)); }

/* Échéances (IA à traiter) : choix de l'agenda et bouton sur une ligne */
.deadline-accept { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.deadline-accept select.field { width: auto; max-width: 240px; }
@media (max-width: 640px) { .deadline-accept select.field { max-width: none; flex: 1 1 100%; } }
.brain-row-sense { flex: none; font-size: 11px; padding: 1px 7px; color: var(--prusse); background: color-mix(in oklab, var(--prusse) 10%, transparent); }

/* Fichier « Notes » d'un dossier : entrées datées, la plus récente en haut */
.notes-file-add { display: flex; gap: var(--sp-2); align-items: flex-start; margin: var(--sp-2) 0 var(--sp-3); }
.notes-file-add .field { flex: 1; min-width: 0; resize: vertical; }
.notes-file { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.notes-file > li { padding-left: 14px; border-left: 2px solid color-mix(in oklab, var(--c, var(--prusse)) 55%, transparent); }
.notes-file-date { margin: 0 0 2px; font: 500 11.5px/1.3 var(--f-donnees); color: var(--ardoise); }
.notes-file-text p { margin: 0 0 4px; line-height: 1.5; }
.brain-card-reason { display: flex; align-items: center; gap: 6px; margin: -4px 0 var(--sp-2); font-size: 12.5px; color: var(--ardoise); }

/* Journal des rangements de l'IA */
.placement-item { box-shadow: inset 3px 0 0 var(--c); padding-left: var(--sp-3); }
.placement-move { display: flex; gap: 6px; align-items: center; }
.placement-move .field { max-width: 220px; }
@media (max-width: 640px) { .placement-move { flex-wrap: wrap; } .placement-move .field { max-width: none; flex: 1 1 100%; } }


/* Cerveau sur mobile : liste aérée, actions toujours visibles, fiche en plein écran avec « Retour » */
.brain-sheet-back { display: none; }
@media (hover: none) {
  .brain-row-grip { display: none; }
  .row-menu > summary { opacity: 1; }
}
@media (max-width: 700px) {
  .brain-list { padding: var(--sp-2); }
  .brain-row-main { padding: 12px 6px; }
  .brain-row-date { display: none; }
  .row-menu > summary { width: 40px; height: 40px; }
  .row-menu-pop { min-width: 210px; }
  .row-menu-pop a, .row-menu-pop button { padding: 12px; font-size: 15px; }
  .brain-list-head { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: 6px 0; }
  .crumb-back { width: 34px; height: 34px; }
  .brain-detail[src] { position: fixed; inset: 0; z-index: 70; max-height: none; border-radius: 0; padding: var(--sp-3) var(--sp-3) calc(var(--sp-6) + env(safe-area-inset-bottom)); overflow-y: auto; animation: brain-sheet-in .18s ease-out; }
  .brain-detail[src] .brain-sheet-back { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px 8px 6px; border-radius: 10px; background: var(--surface-2); font-weight: 600; }
  .brain-card-head { position: sticky; top: calc(-1 * var(--sp-3)); z-index: 2; background: var(--surface); padding: var(--sp-2) 0; }
  .brain-card-title { font-size: 22px; }
  .brain-card-buttons .btn { min-height: 42px; }
  .drive-preview iframe { height: 70vh; }
}
@keyframes brain-sheet-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .brain-detail[src] { animation: none; } }
@media (max-width: 1100px) {
  .tree-wrap > summary.tree-title { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding-bottom: 4px; }
  .tree-wrap > summary.tree-title::after { content: "Afficher ▾"; font: 500 12px/1 var(--f-texte); text-transform: none; letter-spacing: 0; color: var(--prusse); }
  .tree-wrap[open] > summary.tree-title::after { content: "Masquer ▴"; }
}

/* Réglages › Instructions IA : le champ Markdown */
.instructions-field { width: 100%; min-height: 280px; font: 13px/1.6 var(--f-donnees); resize: vertical; }
.brain-card-path[hidden] { display: none; }
.brain-branch-peek a { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; }
.brain-branch-peek a:hover { background: var(--surface-2); text-decoration: none; }
.brain-branch-peek a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-branch-peek svg.icon { flex: none; color: var(--ardoise); }

/* Liens fiche ↔ tâche (fiche › « Tâches liées », tâche › « Fiches du cerveau liées ») */
.task-links { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--trait); padding-top: var(--sp-3); }
.task-links .label { display: flex; align-items: center; gap: 6px; margin: 0; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.link-list li { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 4px 2px 8px; border-radius: 8px; font-size: 13.5px; }
.link-list li:hover { background: var(--surface-2); }
.link-list li > svg.icon { flex: none; color: var(--ardoise); }
.link-list .link-list-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list .link-list-title:hover { text-decoration: underline; }
.link-list li > .muted { flex: none; font-size: 12px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list li.is-done .link-list-title { color: var(--ardoise); text-decoration: line-through; }
.link-list li.is-done > svg.icon { color: var(--succes); }
.link-list form { display: inline; }
.link-add > summary { display: inline-flex; align-items: center; gap: 4px; width: max-content; cursor: pointer; font-size: 13px; list-style: none; }
.link-add > summary::-webkit-details-marker { display: none; }
.link-add-form { display: flex; gap: 6px; margin-top: 6px; }
.link-add-form .field { flex: 1; min-width: 0; }
.task-brain-links { margin-top: var(--sp-4); }

/* Contenu d'une branche ou d'un projet : dossiers puis fiches, avec type et aperçu */
.brain-contents { display: flex; flex-direction: column; gap: 6px; }
.brain-contents-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
.brain-contents-head .muted { font-size: 12px; font-weight: 400; }
.brain-contents-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.brain-contents-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.brain-contents-list a:hover { background: var(--surface-2); }
.bc-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--c, var(--cal-pro)); background: color-mix(in oklab, var(--c, var(--cal-pro)) 14%, var(--surface)); }
.bc-icon svg { width: 16px; height: 16px; }
.bc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bc-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-text .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-go { flex: none; color: var(--ardoise); }
.bc-date { flex: none; font-size: 11.5px; color: var(--ardoise); }
.bc-more { padding: 4px 8px; font-size: 12.5px; }
/* Pager et plein écran de la fiche */
.brain-card-pager { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.brain-card-pager .mini-btn.off { opacity: .35; pointer-events: none; }
.brain-card-pager .mini-btn { display: inline-grid; place-items: center; }
.brain-fs-btn .fs-off, .brain-detail.is-fullscreen .brain-fs-btn .fs-on { display: none; }
.brain-detail.is-fullscreen .brain-fs-btn .fs-off { display: inline-block; }
.brain-detail.is-fullscreen { position: fixed; inset: 0; z-index: 70; max-height: none; border-radius: 0; overflow-y: auto; padding: var(--sp-5) max(var(--sp-4), calc((100vw - 880px) / 2)); background: var(--surface); }
.brain-detail.is-fullscreen .brain-card { max-width: 880px; margin: 0 auto; }
.brain-detail.is-fullscreen .brain-card-body, .brain-detail.is-fullscreen .mail-html-body { font-size: 16px; max-width: 72ch; }
.brain-detail.is-fullscreen .drive-preview iframe { height: 78vh; }
body.brain-fs-open { overflow: hidden; }
@media (max-width: 1100px) { .brain-fs-btn { display: none; } }

/* « Élargir » : la fiche remplace la colonne du milieu (la liste) ; le pager et le chemin permettent de naviguer */
.brain-wide-btn[aria-pressed="true"] { background: var(--graphite); color: var(--surface); }
@media (min-width: 1101px) {
  .brain-cols.detail-wide:has(.brain-detail .brain-card) { grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); }
  .brain-cols.detail-wide:has(.brain-detail .brain-card) > .brain-list { display: none; }
  .brain-cols.detail-wide:has(.brain-detail .brain-card) .brain-detail { grid-column: 2; }
  .brain-cols.detail-wide:has(.brain-card) .brain-card-body, .brain-cols.detail-wide:has(.brain-card) .mail-html-body { max-width: 78ch; }
}
@media (max-width: 1100px) { .brain-wide-btn { display: none; } }
.brain-origin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.brain-origin-label { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; font-size: 12.5px; font-weight: 600; color: var(--ardoise); }

/* Sélecteur de branche sans liste déroulante : on tape, les branches trouvées s'affichent, ou « Créer… » */
.bp-field { position: relative; flex: 1; min-width: 180px; }
.bp-field .field { width: 100%; }
.bp-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: 240px; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 12px 30px -14px rgb(0 0 0 / .35); max-height: 260px; overflow-y: auto; }
.bp-option { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; overflow-wrap: anywhere; }
.bp-option.active, .bp-option:hover { background: var(--surface-2); }
.bp-option.create { color: var(--prusse); font-weight: 600; }
.bp-mark { flex: none; width: 14px; color: var(--ardoise); }
.placement-move .field { max-width: none; }
.placement-move { flex: 1; min-width: 280px; }

.project-paused-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; background: color-mix(in oklab, var(--cal-brique) 10%, var(--surface)); }
.project-paused-note svg.icon { flex: none; margin-top: 2px; color: var(--cal-brique); }


/* Carte du cerveau (vue « Réseau ») : arbre de gauche à droite, sobre, lisible en clair comme en sombre */
.brain-net { display: flex; flex-direction: column; gap: var(--sp-3); }
.brain-net-path { font-size: 14px; gap: 4px; align-items: center; }
.mm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.mm-search { flex: 1; min-width: 240px; max-width: 440px; }
.mm-tools { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.mm-all { display: inline-flex; align-items: center; gap: 6px; }
.mm-all[aria-pressed="true"] { background: var(--surface-2); }
.brain-zoom { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.brain-zoom .mini-btn { display: inline-grid; place-items: center; font: 600 15px/1 var(--f-texte); width: 32px; height: 30px; }

.mm-stage { position: relative; height: min(70vh, 660px); overflow: hidden; border: 1px solid var(--trait); border-radius: 12px; background: var(--porcelaine); cursor: grab; touch-action: none; }
.mm-stage.panning { cursor: grabbing; }
.mm-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mm-links { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.mm-link { fill: none; stroke: color-mix(in oklab, var(--c) 40%, var(--trait)); stroke-width: 1.5; }
.mm-link.lit { stroke: var(--c); stroke-width: 2.2; }
.mm-node { position: absolute; left: 0; top: 0; display: flex; align-items: center; height: 32px; white-space: nowrap; will-change: transform; }
.mm-main { display: inline-flex; align-items: center; gap: 8px; height: 32px; max-width: 280px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 8px;
           background: var(--surface); color: var(--graphite); font: 500 13.5px/1 var(--f-texte); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.mm-main:hover { border-color: color-mix(in oklab, var(--c) 55%, var(--trait)); }
.mm-main:focus-visible { outline: 2px solid var(--prusse); outline-offset: 2px; }
.mm-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mm-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.mm-count { flex: none; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: var(--surface-2); font: 600 11.5px/1.2 var(--f-donnees); color: var(--ardoise); text-align: center; }
.mm-count:empty { display: none; }
.mm-chev { flex: none; width: 7px; height: 7px; margin-left: 2px; border-right: 1.5px solid var(--ardoise); border-bottom: 1.5px solid var(--ardoise); rotate: -45deg; transition: rotate .2s; }
.mm-node.open .mm-chev { rotate: 135deg; }
.mm-node svg.icon { flex: none; color: color-mix(in oklab, var(--c) 70%, var(--ardoise)); }
.mm-info { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 4px; border: 0; border-radius: 7px; background: none; color: var(--ardoise); cursor: pointer; opacity: 0; transition: opacity .15s; }
.mm-node:hover .mm-info, .mm-node:focus-within .mm-info, .mm-node.selected .mm-info { opacity: 1; }
.mm-info:hover { background: var(--surface-2); color: var(--graphite); }
/* Racine : sobre et affirmée ; branches : point de couleur ; branches dépliées : fond teinté ; fiches : plus légères */
.kind-root .mm-main { height: 36px; padding: 0 14px; background: var(--graphite); border-color: var(--graphite); color: var(--surface); font: 650 15px/1 var(--f-titre); }
.kind-root .mm-count { background: color-mix(in oklab, var(--surface) 22%, transparent); color: var(--surface); }
.kind-branch .mm-main, .kind-project .mm-main, .kind-loose .mm-main { font-weight: 600; }
.mm-node.open .mm-main { background: color-mix(in oklab, var(--c) 9%, var(--surface)); border-color: color-mix(in oklab, var(--c) 45%, var(--trait)); }
.kind-note .mm-main, .kind-link .mm-main, .kind-access .mm-main, .kind-drive .mm-main { border-color: transparent; background: color-mix(in oklab, var(--surface) 75%, transparent); font-size: 13px; }
.kind-note .mm-main:hover, .kind-link .mm-main:hover, .kind-access .mm-main:hover, .kind-drive .mm-main:hover { border-color: var(--trait); background: var(--surface); }
.kind-guide .mm-main { background: var(--ambre-doux); border-color: color-mix(in oklab, var(--ambre) 45%, transparent); font-weight: 600; }
.kind-guide svg.icon { color: var(--ambre); }
.kind-more .mm-main { border-style: dashed; color: var(--prusse); font-size: 12.5px; background: transparent; }
.mm-node.on-path .mm-main { border-color: color-mix(in oklab, var(--c) 60%, var(--trait)); }
.mm-node.selected .mm-main { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c) 18%, transparent); background: var(--surface); }
.kind-root.selected .mm-main { background: var(--graphite); }
.mm-hint { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: 12px; color: var(--ardoise); pointer-events: none; }

/* Panneau de la fiche ouverte, à droite de la carte */
.mm-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: min(440px, 46%); overflow-y: auto; padding: var(--sp-4); padding-top: 44px; background: var(--surface);
             border-left: 1px solid var(--trait); box-shadow: -18px 0 40px -30px rgb(0 0 0 / .45); cursor: auto; animation: mm-drawer-in .2s ease-out; }
.mm-drawer[hidden] { display: none; }
.mm-drawer-close { position: absolute; top: 10px; right: 10px; display: inline-grid; place-items: center; }
.mm-drawer .brain-wide-btn, .mm-drawer .brain-fs-btn, .mm-drawer .brain-sheet-back { display: none; }
@keyframes mm-drawer-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mm-drawer { animation: none; } .mm-chev { transition: none; } }

.net-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: var(--sp-6) var(--sp-3); text-align: center; color: var(--ardoise); }
.net-empty svg.icon { width: 34px; height: 34px; }
.brain-outline-wrap > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--prusse); list-style: none; }
.brain-outline-wrap > summary::-webkit-details-marker { display: none; }
.brain-outline-wrap[open] > summary { margin-bottom: var(--sp-3); }
.brain-outline { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--sp-3); }
.brain-hub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.brain-hub i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.brain-hub .muted { font-size: 12px; width: 100%; padding-left: 17px; }
.brain-branch ul { list-style: none; margin: 6px 0 0 4px; padding-left: 12px; border-left: 2px solid color-mix(in oklab, var(--c) 45%, transparent); font-size: 13px; }
.brain-branch li + li { margin-top: 3px; }
.brain-branch li.sub a { font-weight: 600; }
/* Téléphone : la carte serait trop petite, la vue en liste (même contenu) prend le relais ; la recherche reste. */
@media (max-width: 640px) { .mm-stage, .mm-tools { display: none; } .mm-search { max-width: none; } }

/* Lier fiches et tâches : cases à cocher, recherche avec suggestions, choix dans le cerveau */
.tbl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tbl-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.tbl-help { margin: 0; font-size: 12.5px; }
.tbl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tbl-list li { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 4px 2px 6px; border-radius: 8px; }
.tbl-list li:hover { background: var(--surface-2); }
.tbl-list li.is-suggested .tbl-title { color: var(--ardoise); }
.tbl-form { flex: 1; min-width: 0; display: flex; }
.tbl-check { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; font-size: 13.5px; }
.tbl-check input { width: 16px; height: 16px; flex: none; accent-color: var(--prusse); cursor: pointer; }
.tbl-check svg.icon { flex: none; color: var(--ardoise); }
.tbl-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-path { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tbl-list .mini-btn { display: inline-grid; place-items: center; flex: none; }
.lookup { margin-top: 4px; }
.lookup-field { position: relative; display: flex; align-items: center; }
.lookup-field > svg.icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--ardoise); pointer-events: none; }
.lookup-field .field { width: 100%; padding-left: 32px; }
.lookup-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 14px 32px -16px rgb(0 0 0 / .35); max-height: 300px; overflow-y: auto; }
.lk-option { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.lk-option b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-option span { font-size: 12px; color: var(--ardoise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-option.active, .lk-option:hover { background: var(--surface-2); }
.lk-empty { padding: 8px 10px; font-size: 13px; color: var(--ardoise); }
.brain-picker-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(78vh, 720px); padding: 0; border: 1px solid var(--trait); border-radius: 14px; background: var(--surface); color: var(--graphite); }
.brain-picker-dialog::backdrop { background: rgb(0 0 0 / .35); }
.bpd-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--trait); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.bpd-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.bpd-tree { display: flex; flex-direction: column; gap: 2px; }
.bpd-branch > summary { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; list-style: none; font-size: 14px; }
.bpd-branch > summary::-webkit-details-marker { display: none; }
.bpd-branch > summary::before { content: "›"; width: 10px; color: var(--ardoise); transition: rotate .15s; }
.bpd-branch[open] > summary::before { rotate: 90deg; }
.bpd-branch > summary:hover { background: var(--surface-2); }
.bpd-branch > summary i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.bpd-branch > summary .muted { margin-left: auto; font-size: 12px; }
.bpd-branch[hidden] { display: none; }
.bpd-children { margin-left: 16px; padding-left: 8px; border-left: 2px solid color-mix(in oklab, var(--c) 35%, transparent); }
.bpd-note { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; }
.bpd-note[hidden] { display: none; }
.bpd-note:hover { background: var(--surface-2); }
.bpd-note svg.icon { flex: none; color: var(--ardoise); }
.bpd-note .tbl-title { flex: 1; }
.bpd-note form { display: inline; }
.bpd-note .btn { padding: 3px 10px; font-size: 12.5px; }

/* Vidéo YouTube dans une fiche : 16/9, coins arrondis */
.note-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.note-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* « Suggérer des fiches » : fiches du cerveau proposées seulement sur demande */
.tbl-suggest { margin: var(--sp-2) 0; }
.tbl-suggest > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; font-size: 13px; }
.tbl-suggest > summary::-webkit-details-marker { display: none; }
.tbl-suggest[open] > summary { margin-bottom: var(--sp-2); }

/* Haut du cerveau : la recherche prend la place, « Ajouter au cerveau » est un bouton qui ouvre le champ libre */
.brain-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.brain-answer { padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); border-left: 3px solid var(--prusse); }
.brain-answer-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--sp-2); font-size: 13px; color: var(--ardoise); }
.brain-answer-text p { margin: 0 0 var(--sp-2); font-size: 15px; line-height: 1.6; max-width: 75ch; }
.brain-cite { font-size: 12px; font-weight: 600; color: var(--prusse); text-decoration: none; vertical-align: super; padding: 0 1px; }
.brain-answer-sources { margin: var(--sp-3) 0 0; padding-left: 24px; font-size: 13px; display: grid; gap: 2px; }
.brain-answer-note { margin: var(--sp-2) 0 0; font-size: 12px; }
.brain-top .brain-search { flex: 1 1 320px; max-width: none; margin: 0; }
.brain-add { flex: none; }
.brain-add > summary { list-style: none; cursor: pointer; height: 36px; }
.brain-add[open] > summary { margin-bottom: var(--sp-2); }
.brain-add > summary::-webkit-details-marker { display: none; }
.brain-add[open] { flex-basis: 100%; order: 3; }
.brain-add .brain-quick { margin: 0; }

/* Carte Drive « dossier » : la liste de ses fichiers */
.drive-folder-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: 2px; }
.drive-folder-list li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding: 6px 8px; border-radius: var(--r-ctrl); }
.drive-folder-list li:hover { background: var(--surface-2); }
.dfl-name { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.dfl-name span, .dfl-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfl-name b { font-weight: 500; }
.drive-folder-list .muted { flex: none; font-size: 12px; }
