/* Établi — feuille de style unique. Inspiration Notion : blanc, gris chauds très légers, peu de cadres, typographie système. */
:root {
  --bg: #FFFFFF; --side: #F7F7F5; --surface: #FFFFFF; --sunken: #F7F7F5; --hover: rgba(55, 53, 47, .06); --hover-2: rgba(55, 53, 47, .1);
  --ink: #37352F; --ink-2: #5F5E5B; --ink-3: #9B9A97;
  --line: #E9E9E7; --line-2: #F1F1EF;
  --accent: #2383E2; --accent-ink: #FFFFFF; --accent-soft: rgba(35, 131, 226, .12);
  --ok: #448361; --ok-soft: #EDF3EC; --warn: #CB912F; --warn-soft: #FBF3DB; --bad: #D44C47; --bad-soft: #FDEBEC;
  --t-gris: #F1F1EF; --t-gris-i: #787774; --t-bleu: #E7F3F8; --t-bleu-i: #337EA9; --t-vert: #EDF3EC; --t-vert-i: #448361;
  --t-jaune: #FBF3DB; --t-jaune-i: #9F6B1A; --t-rouge: #FDEBEC; --t-rouge-i: #C4554D; --t-violet: #F6F3F9; --t-violet-i: #9065B0;
  --shadow: rgba(15, 15, 15, .05) 0 0 0 1px, rgba(15, 15, 15, .1) 0 3px 6px, rgba(15, 15, 15, .2) 0 9px 24px;
  --card: rgba(15, 15, 15, .1) 0 0 0 1px, rgba(15, 15, 15, .1) 0 2px 4px;
  --r: 4px; --r-lg: 6px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --side-w: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #191919; --side: #202020; --surface: #202020; --sunken: #252525; --hover: rgba(255, 255, 255, .055); --hover-2: rgba(255, 255, 255, .09);
  --ink: #D4D4D4; --ink-2: #A5A5A5; --ink-3: #7F7F7F;
  --line: #2F2F2F; --line-2: #262626;
  --accent: #3D8FE0; --accent-ink: #FFFFFF; --accent-soft: rgba(61, 143, 224, .2);
  --ok: #5AA27C; --ok-soft: #22302A; --warn: #D9A24A; --warn-soft: #383022; --bad: #E06B66; --bad-soft: #3A2423;
  --t-gris: #2F2F2F; --t-gris-i: #A5A5A5; --t-bleu: #1F2E3A; --t-bleu-i: #6AA7D4; --t-vert: #22302A; --t-vert-i: #6FB08B;
  --t-jaune: #383022; --t-jaune-i: #D9A24A; --t-rouge: #3A2423; --t-rouge-i: #E07A73; --t-violet: #2E2638; --t-violet-i: #B48ED6;
  --shadow: rgba(0, 0, 0, .3) 0 0 0 1px, rgba(0, 0, 0, .35) 0 3px 6px, rgba(0, 0, 0, .45) 0 9px 24px;
  --card: rgba(255, 255, 255, .08) 0 0 0 1px, rgba(0, 0, 0, .3) 0 2px 4px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink-3); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .6em; }
.num, td.n, .tab-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
::selection { background: var(--accent-soft); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lien { color: var(--accent); text-decoration: none; cursor: pointer; }
.lien:hover { text-decoration: underline; }

/* Structure ----------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; transition: grid-template-columns .2s ease; }
.app.side-cachee { grid-template-columns: 0 1fr; }
.app.side-cachee .side { visibility: hidden; }
.side { background: var(--side); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; box-shadow: inset -1px 0 0 var(--line-2); }
.brand { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 14px; font-weight: 600; font-size: 14px; height: 46px; }
.brand-mark { width: 22px; height: 22px; flex: none; border-radius: 4px; }
.brand .replier { margin-left: auto; opacity: 0; transition: opacity .12s; }
.side:hover .brand .replier { opacity: 1; }
.side-search, .nav a, .side-projects a { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; margin: 0 6px; border-radius: var(--r); color: var(--ink-2); font-weight: 500; text-decoration: none; transition: background .06s; }
.side-search { border: 0; background: none; cursor: pointer; font-size: 14px; width: calc(100% - 12px); text-align: left; }
.side-search kbd { margin-left: auto; }
.side-search:hover, .nav a:hover, .side-projects a:hover { background: var(--hover); color: var(--ink); }
.nav { padding: 2px 0 6px; display: flex; flex-direction: column; gap: 1px; }
.nav a.on, .side-projects a.on { background: var(--hover-2); color: var(--ink); }
.nav svg.i, .side-search svg.i { width: 18px; height: 18px; color: var(--ink-3); }
.nav .count { margin-left: auto; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; text-align: center; font-weight: 600; }
.side-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px 16px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.side-title .icon-btn { opacity: 0; }
.side:hover .side-title .icon-btn { opacity: 1; }
.side-projects { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; display: flex; flex-direction: column; gap: 1px; }
.side-projects a { font-weight: 400; }
.chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.side-projects .chip { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; }
.side-foot { padding: 8px 6px; display: flex; align-items: center; gap: 6px; box-shadow: inset 0 1px 0 var(--line-2); }
.side-foot > button.row { padding: 4px 8px; border-radius: var(--r); }
.side-foot > button.row:hover { background: var(--hover); }
.presence { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.top { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; height: 45px; flex: none; }
.top .crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; color: var(--ink-2); font-size: 14px; }
.top .crumbs a { color: var(--ink-2); text-decoration: none; padding: 2px 6px; border-radius: var(--r); }
.top .crumbs a:hover { background: var(--hover); }
.top .crumbs b { color: var(--ink); font-weight: 500; padding: 2px 6px; }
.top .crumbs svg.i { width: 12px; height: 12px; color: var(--ink-3); }
.top .actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.view { flex: 1; overflow: auto; min-height: 0; }
.view.entree > * { animation: apparait .18s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(4px); } }
.page { padding: 28px 56px 96px; }
.page-narrow, .lecture { max-width: 960px; margin: 0 auto; width: 100%; }
.icon-btn.menu-btn, .icon-btn.deplier { display: none; }
.app.side-cachee .icon-btn.deplier { display: inline-grid; }

/* Titre de page façon Notion */
.tete { margin-bottom: 22px; }
.tete h1 { margin: 6px 0 4px; }
.tete .sous { color: var(--ink-3); font-size: 14px; }
.tete-ico { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.proprietes { display: grid; grid-template-columns: 170px 1fr; row-gap: 2px; margin: 14px 0 6px; font-size: 14px; }
.proprietes > .cle { display: flex; align-items: center; gap: 8px; color: var(--ink-3); min-height: 32px; }
.proprietes > .val { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-radius: var(--r); cursor: default; min-width: 0; }
.proprietes > .val.edit { cursor: pointer; }
.proprietes > .val.edit:hover { background: var(--hover); }
.proprietes > .val .vide { color: var(--ink-3); }
.sep-page { height: 1px; background: var(--line); margin: 18px 0 22px; }

/* Boutons, champs -------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r); border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--ink); transition: background .06s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); box-shadow: none; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(.94); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { box-shadow: none; color: var(--ink-2); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink-3); cursor: pointer; flex: none; transition: background .06s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.sm { width: 22px; height: 22px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-lg); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button { border: 0; background: none; padding: 0 10px; height: 26px; border-radius: var(--r); cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--bg); color: var(--ink); font-weight: 500; box-shadow: rgba(15, 15, 15, .1) 0 0 0 1px, rgba(15, 15, 15, .06) 0 1px 2px; }
.input, select.input, textarea.input { width: 100%; height: 32px; padding: 0 10px; border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r); background: var(--sunken); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); background: var(--bg); }
.input.bare { box-shadow: none; background: transparent; padding-left: 6px; }
.input.bare:hover { background: var(--hover); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--ink-3); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
kbd { font: 11px var(--sans); padding: 0 5px; border-radius: 3px; color: var(--ink-3); background: var(--hover); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }

/* Éléments ------------------------------------------------------------- */
.panel { background: transparent; }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; min-height: 30px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 14px; font-weight: 600; }
.panel-h svg.i { color: var(--ink-3); }
.panel-h a { color: var(--ink-3); text-decoration: none; font-size: 13px; }
.panel-h a:hover { color: var(--ink); }
.panel-b { padding: 12px 2px; }
.panel-b.flush { padding: 0; }
.encadre { border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 40px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 36px 44px; align-items: start; }
.grid-main > *, .grid-2 > *, .grid-3 > *, .stack > * { min-width: 0; }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 600; color: #fff; flex: none; letter-spacing: 0; }
.av.lg { width: 30px; height: 30px; font-size: 12.5px; }
.av.sm { width: 18px; height: 18px; font-size: 9px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12.5px; background: var(--t-gris); color: var(--t-gris-i); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--t-vert); color: var(--t-vert-i); }
.pill.warn { background: var(--t-jaune); color: var(--t-jaune-i); }
.pill.bad { background: var(--t-rouge); color: var(--t-rouge-i); }
.pill.acc { background: var(--t-bleu); color: var(--t-bleu-i); }
.pill-btn { cursor: pointer; border: 0; }
.tag { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 3px; background: var(--t-gris); color: var(--ink-2); font-size: 12.5px; line-height: 20px; white-space: nowrap; }
.prio-urgente { color: var(--bad); }
.prio-haute { color: var(--warn); }
.prio-basse { color: var(--ink-3); }
.bar { height: 4px; border-radius: 2px; background: var(--hover-2); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s ease; }
.kpis { display: flex; flex-wrap: wrap; gap: 14px 44px; padding: 4px 2px 18px; }
.kpi { min-width: 110px; }
.kpi b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--ink-3); }
.kpi .pos { color: var(--ok); } .kpi .neg { color: var(--bad); }
.empty { padding: 32px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.empty .btn { margin-top: 12px; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.spin { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: tourne .7s linear infinite; display: inline-block; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
.note { padding: 10px 14px; border-radius: var(--r); background: var(--sunken); color: var(--ink-2); font-size: 13.5px; }
.note.warn { background: var(--warn-soft); color: var(--t-jaune-i); }
.note.bad { background: var(--bad-soft); color: var(--t-rouge-i); }

/* Onglets */
.tabs { display: flex; gap: 2px; padding: 0 56px; flex: none; overflow-x: auto; box-shadow: inset 0 -1px 0 var(--line); }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 8px; margin-bottom: 0; color: var(--ink-3); font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* Tableaux */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 400; font-size: 13px; color: var(--ink-3); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg); position: sticky; top: 0; z-index: 1; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { background: var(--hover); color: var(--ink); }
.tbl th .arrow { font-size: 9px; margin-left: 4px; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl td.n, .tbl th.n { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl .w-check { width: 34px; }
.tbl td.actions { width: 1%; white-space: nowrap; text-align: right; }
.tbl td.actions .icon-btn { opacity: 0; }
.tbl tr:hover td.actions .icon-btn, .tbl td.actions .icon-btn:focus-visible { opacity: 1; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* Listes */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; margin: 0 -6px; border-radius: var(--r); color: var(--ink); text-decoration: none; transition: background .06s; }
a.li:hover, .li.click:hover { background: var(--hover); cursor: pointer; }
.li .meta { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.col { border-radius: var(--r-lg); padding: 4px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; transition: background .1s; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; font-weight: 500; font-size: 14px; }
.col-h .muted { font-weight: 400; }
.col.drop { background: var(--hover); }
.card { background: var(--bg); box-shadow: var(--card); border-radius: var(--r-lg); padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: background .06s; }
:root[data-theme="dark"] .card { background: var(--sunken); }
.card:hover { background: var(--sunken); }
.card.dragging { opacity: .35; }
.card-t { font-weight: 500; line-height: 1.35; }
.card-m { display: flex; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.card-m .av { margin-left: auto; }
.drop-line { height: 3px; background: var(--accent); border-radius: 2px; margin: -4px 0; opacity: .7; }
.add-inline { display: flex; align-items: center; gap: 6px; padding: 5px 6px; color: var(--ink-3); border-radius: var(--r); cursor: pointer; background: none; border: 0; text-align: left; font-size: 14px; }
.add-inline:hover { background: var(--hover); color: var(--ink); }
.late { color: var(--bad); }

/* Panneau latéral (aperçu sur le côté) */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 15, 15, .08); z-index: 40; animation: fond .15s ease-out; }
@keyframes fond { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: entre .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes entre { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 6px; padding: 8px 12px; height: 45px; font-size: 14px; color: var(--ink-2); }
.drawer-h a { text-decoration: none; padding: 2px 6px; border-radius: var(--r); }
.drawer-h a:hover { background: var(--hover); }
.drawer-b { flex: 1; overflow: auto; padding: 18px 44px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer-b > *, .flow-side > *, .versions-liste > * { flex-shrink: 0; }
.title-input { font-size: 28px; font-weight: 700; border: 0; background: none; width: 100%; padding: 0; resize: none; overflow: hidden; line-height: 1.25; }
.title-input:focus { outline: none; }
.props { display: grid; grid-template-columns: 150px 1fr; gap: 2px 8px; align-items: center; font-size: 14px; }
.props > span { color: var(--ink-3); display: flex; align-items: center; gap: 8px; min-height: 32px; }
.props .input { height: 30px; background: transparent; box-shadow: none; }
.props .input:hover { background: var(--hover); }
.props .input:focus { background: var(--bg); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }

/* Fenêtres */
.overlay { position: fixed; inset: 0; background: rgba(15, 15, 15, .4); z-index: 60; display: grid; place-items: start center; padding: 12vh 16px 16px; overflow: auto; animation: fond .12s ease-out; }
.modal { background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow); width: min(520px, 100%); animation: monte .16s cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="dark"] .modal, :root[data-theme="dark"] .palette, :root[data-theme="dark"] .pop { background: var(--surface); }
.modal.wide { width: min(760px, 100%); }
@keyframes monte { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-h { padding: 18px 22px 0; display: flex; align-items: center; gap: 8px; }
.modal-b { padding: 14px 22px; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 10px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #2F2F2F; color: #fff; padding: 9px 14px; border-radius: var(--r-lg); box-shadow: var(--shadow); font-size: 14px; pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: 560px; animation: monte .18s cubic-bezier(.2, .8, .2, 1); }
.toast.bad { background: var(--bad); }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font-weight: 600; }
.pop { position: fixed; z-index: 80; background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px; min-width: 200px; max-height: 60vh; overflow: auto; animation: monte .1s ease-out; }
.pop button { display: flex; width: 100%; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border: 0; background: none; border-radius: var(--r); cursor: pointer; text-align: left; font-size: 14px; }
.pop button:hover, .pop button.sel, .pop button:focus-visible { background: var(--hover); outline: none; }
.pop button.danger { color: var(--bad); }
.pop button svg.i { color: var(--ink-3); }
.pop .pop-titre { padding: 6px 8px 4px; font-size: 12px; color: var(--ink-3); }
.pop .pop-aide { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* Palette de commandes */
.palette { width: min(640px, 100%); background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; animation: monte .14s cubic-bezier(.2, .8, .2, 1); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; background: none; }
.palette input:focus { outline: none; }
.palette .res { max-height: 56vh; overflow: auto; padding: 6px; }
.palette .grp { padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); }
.palette .it { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 34px; border-radius: var(--r); cursor: pointer; }
.palette .it svg.i { color: var(--ink-3); }
.palette .it.sel { background: var(--hover); }
.palette .it .hint { margin-left: auto; color: var(--ink-3); font-size: 13px; }

/* Écrans d'accès */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-box { width: min(380px, 100%); }
.gate-box .brand { padding: 0 0 22px; font-size: 20px; justify-content: center; height: auto; }
.gate-box .brand-mark { width: 30px; height: 30px; }
.gate-box .panel-b { padding: 0; display: flex; flex-direction: column; gap: 14px; }
.gate-box h2 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.gate-alt { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-3); }
.gate .btn-primary { height: 36px; justify-content: center; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-lg); background: var(--bg); cursor: pointer; font-size: 15px; transition: background .08s; }
.who button:hover { background: var(--hover); }

/* Discussion */
.chat { display: grid; grid-template-columns: 240px 1fr; height: 100%; min-height: 0; }
.chat-side { box-shadow: inset -1px 0 0 var(--line-2); overflow: auto; padding: 8px 4px; }
.chat-side a { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; margin: 0 4px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; }
.chat-side a:hover { background: var(--hover); }
.chat-side a.on { background: var(--hover-2); color: var(--ink); font-weight: 500; }
.chat-side a.unread { color: var(--ink); font-weight: 600; }
.chat-side a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chat-side .side-title { padding: 14px 14px 4px; }
.thread { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.msgs { flex: 1; overflow: auto; padding: 18px max(28px, calc((100% - 860px) / 2)) 8px; display: flex; flex-direction: column; }
.day { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); margin: 18px 0 8px; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 5px 8px; margin: 0 -8px; border-radius: var(--r); position: relative; }
.msg:hover { background: var(--hover); }
.msg.cont { padding-top: 1px; }
.msg.cont .av { visibility: hidden; height: 0; }
.msg-h { display: flex; align-items: baseline; gap: 8px; }
.msg-h b { font-weight: 600; }
.msg-h time { font-size: 12px; color: var(--ink-3); }
.msg-tools { position: absolute; top: -12px; right: 8px; display: none; background: var(--bg); border-radius: var(--r-lg); padding: 2px; box-shadow: var(--shadow); }
.msg:hover .msg-tools { display: flex; }
.mention { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.mention.moi { background: var(--t-jaune); color: var(--t-jaune-i); }
.composer { padding: 10px max(28px, calc((100% - 860px) / 2)) 18px; }
.composer-box { box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-lg); background: var(--bg); padding: 9px 10px 9px 14px; display: flex; gap: 8px; align-items: flex-end; transition: box-shadow .1s; }
.composer-box:focus-within { box-shadow: inset 0 0 0 1px var(--ink-3), 0 2px 8px rgba(15, 15, 15, .06); }
.composer textarea { flex: 1; border: 0; resize: none; background: none; max-height: 200px; min-height: 22px; line-height: 1.5; padding: 2px 0; }
.composer textarea:focus { outline: none; }

/* Texte riche (rendu Markdown) */
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1 { font-size: 24px; margin: 1.1em 0 .3em; }
.md h2 { font-size: 19px; margin: 1.1em 0 .3em; }
.md h3 { font-size: 16px; margin: 1em 0 .2em; }
.md p, .md ul, .md ol, .md pre, .md blockquote, .md table { margin: 0 0 .6em; }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .1em 0; }
.md li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
.md code { font: 85% var(--mono); background: var(--t-gris); color: var(--t-rouge-i); padding: 1px 5px; border-radius: 3px; }
.md pre { background: var(--sunken); padding: 14px 16px; border-radius: var(--r); overflow: auto; }
.md pre code { background: none; padding: 0; color: var(--ink); }
.md blockquote { border-left: 3px solid var(--ink); padding-left: 14px; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; }
.md th { background: var(--sunken); font-weight: 500; text-align: left; }
.md img { max-width: 100%; border-radius: var(--r); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md a { color: var(--ink); }

/* Documents */
.docs { display: grid; grid-template-columns: 250px 1fr; height: 100%; min-height: 0; }
.tree { box-shadow: inset -1px 0 0 var(--line-2); overflow: auto; padding: 10px 6px; }
.tree-h { display: flex; align-items: center; gap: 2px; padding: 0 4px 6px 8px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.node-row { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; border-radius: var(--r); cursor: pointer; color: var(--ink-2); user-select: none; transition: background .06s; }
.node-row:hover { background: var(--hover); color: var(--ink); }
.node-row.on { background: var(--hover-2); color: var(--ink); font-weight: 500; }
.node-row.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.node-row .twist { width: 16px; display: inline-grid; place-items: center; color: var(--ink-3); }
.node-row .twist svg.i { width: 12px; height: 12px; }
.node-row svg.i { color: var(--ink-3); }
.node-row .more { margin-left: auto; visibility: hidden; }
.node-row:hover .more { visibility: visible; }
.doc { overflow: auto; min-height: 0; }
.doc-in { max-width: 820px; margin: 0 auto; padding: 56px 56px 30vh; }
.doc-in.large { max-width: none; padding-left: 56px; padding-right: 56px; }
.doc-title { font-size: 40px; font-weight: 700; line-height: 1.2; border: 0; background: none; width: 100%; padding: 0; margin-bottom: 8px; letter-spacing: -.01em; }
.doc-title::placeholder { color: var(--line); }
.doc-title:focus { outline: none; }
.doc-bar { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.doc .md { font-size: 16px; }
.drop-zone { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 22px; text-align: center; color: var(--ink-3); transition: background .1s; }
.drop-zone.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.file-ico { width: 36px; height: 44px; box-shadow: inset 0 0 0 1px var(--line); border-radius: 4px; display: grid; place-items: end center; font-size: 9px; font-weight: 600; color: var(--ink-3); padding-bottom: 4px; flex: none; }

/* Éditeur par blocs */
.blocs { font-size: 16px; line-height: 1.5; padding-bottom: 20vh; }
.bloc { position: relative; display: flex; align-items: flex-start; margin: 1px 0; border-radius: 3px; }
.bloc.sel { background: var(--accent-soft); }
.bloc.survol-haut { box-shadow: 0 -3px 0 var(--accent-soft), 0 -2px 0 var(--accent); }
.bloc.survol-bas { box-shadow: 0 3px 0 var(--accent-soft), 0 2px 0 var(--accent); }
.bloc-poignees { position: absolute; left: -50px; top: 3px; display: flex; opacity: 0; transition: opacity .1s; }
.bloc:hover .bloc-poignees, .bloc.focus .bloc-poignees { opacity: 1; }
.bloc-poignees .icon-btn { width: 22px; height: 24px; color: var(--ink-3); }
.bloc-poignees .grip { cursor: grab; }
.bloc-txt { flex: 1; min-width: 0; padding: 3px 2px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.5em; }
.bloc-txt:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }
.bloc-txt:not(:focus):empty::before { content: ""; }
.blocs.vide .bloc:only-child .bloc-txt:empty::before { content: attr(data-ph); }
.bloc-txt code { font: 85% var(--mono); background: var(--t-gris); color: var(--t-rouge-i); padding: 1px 4px; border-radius: 3px; }
.bloc-txt a { color: var(--ink); }
.b-h1 .bloc-txt { font-size: 30px; font-weight: 700; line-height: 1.25; margin-top: 18px; }
.b-h2 .bloc-txt { font-size: 23px; font-weight: 600; line-height: 1.3; margin-top: 14px; }
.b-h3 .bloc-txt { font-size: 19px; font-weight: 600; line-height: 1.3; margin-top: 10px; }
.bloc .puce { width: 26px; flex: none; text-align: center; padding-top: 3px; user-select: none; color: var(--ink); }
.bloc .puce input { margin-top: 5px; }
.b-todo.fait .bloc-txt { text-decoration: line-through; color: var(--ink-3); }
.b-citation .bloc-txt { border-left: 3px solid var(--ink); padding-left: 14px; }
.b-code .bloc-txt { font: 14px/1.6 var(--mono); background: var(--sunken); border-radius: var(--r); padding: 14px 16px; margin: 4px 0; white-space: pre; overflow-x: auto; }
.b-encart .bloc-txt { background: var(--sunken); border-radius: var(--r); padding: 14px 16px 14px 44px; position: relative; }
.b-encart .bloc-txt::after { content: ""; position: absolute; left: 16px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-3); }
.b-separateur .bloc-txt { min-height: 0; padding: 12px 0; }
.b-separateur hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.b-brut .bloc-txt { cursor: text; }
.b-brut .bloc-txt.edition { font: 14px/1.6 var(--mono); background: var(--sunken); border-radius: var(--r); padding: 10px 12px; }
.menu-blocs { width: 300px; }
.menu-blocs button { height: auto; padding: 5px 8px; }
.menu-blocs .ico-bloc { width: 40px; height: 40px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; font-weight: 600; color: var(--ink-2); flex: none; background: var(--bg); font-size: 15px; }
.menu-blocs .t { display: block; font-size: 14px; }
.menu-blocs .d { display: block; font-size: 12px; color: var(--ink-3); }

/* Versions */
.versions { display: grid; grid-template-columns: 240px 1fr; height: 70vh; }
.versions-liste { overflow: auto; box-shadow: inset -1px 0 0 var(--line); padding: 6px; }
.versions-liste button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r); cursor: pointer; }
.versions-liste button:hover { background: var(--hover); }
.versions-liste button.on { background: var(--hover-2); }
.versions-diff { overflow: auto; padding: 14px 20px; font-size: 14px; line-height: 1.6; }
.diff-l { white-space: pre-wrap; padding: 0 8px; border-radius: 2px; }
.diff-l.plus { background: var(--ok-soft); color: var(--t-vert-i); }
.diff-l.moins { background: var(--bad-soft); color: var(--t-rouge-i); text-decoration: line-through; }

/* Bases de données */
.base-barre { display: flex; align-items: center; gap: 6px; padding: 6px 0; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 0; flex-wrap: wrap; }
.base-barre .seg { margin-right: 6px; }
.grille { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.grille th { text-align: left; font-weight: 400; color: var(--ink-3); font-size: 13px; padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; height: 33px; }
.grille th > button { display: flex; align-items: center; gap: 6px; width: 100%; height: 33px; border: 0; background: none; padding: 0 8px; cursor: pointer; color: inherit; font-size: 13px; }
.grille th > button:hover { background: var(--hover); }
.grille th:last-child, .grille td:last-child { border-right: 0; }
.grille td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; height: 33px; vertical-align: middle; min-width: 120px; max-width: 320px; }
.grille td .cel { display: flex; align-items: center; gap: 6px; min-height: 33px; padding: 4px 8px; cursor: text; overflow: hidden; }
.grille td .cel:hover { background: var(--hover); }
.grille td .cel.case { justify-content: center; cursor: default; }
.grille td input.input, .grille td select.input { height: 33px; border-radius: 0; box-shadow: inset 0 0 0 2px var(--accent); background: var(--bg); }
.grille td.titre .cel { font-weight: 500; }
.grille .ajout td { border-right: 0; }
.grille tfoot td { border-bottom: 0; color: var(--ink-3); font-size: 12.5px; text-align: right; padding: 6px 8px; }
.opt { display: inline-flex; padding: 0 7px; border-radius: 3px; font-size: 13px; line-height: 20px; white-space: nowrap; }

/* Calendrier et planning */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-tete { padding: 6px 8px; font-size: 12.5px; color: var(--ink-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-j { min-height: 112px; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-j.hors { background: var(--sunken); }
.cal-j .num { align-self: flex-end; font-size: 13px; color: var(--ink-3); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-j.auj .num { background: var(--bad); color: #fff; font-weight: 600; }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 6px; border-radius: 3px; box-shadow: var(--card); background: var(--bg); cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev:hover { background: var(--sunken); }
.cal-ev.fait { color: var(--ink-3); text-decoration: line-through; }
.cal-ev .chip { width: 8px; height: 8px; border-radius: 2px; }
.gantt { position: relative; font-size: 13px; }
.gantt-l { display: grid; grid-template-columns: 220px 1fr; align-items: center; min-height: 34px; border-bottom: 1px solid var(--line-2); }
.gantt-l .nom { padding: 0 10px 0 2px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.gantt-l .piste { position: relative; height: 34px; }
.gantt-b { position: absolute; top: 8px; height: 18px; border-radius: 4px; min-width: 6px; cursor: pointer; display: flex; align-items: center; padding: 0 6px; color: #fff; font-size: 11.5px; overflow: hidden; white-space: nowrap; }
.gantt-b.tache { top: 11px; height: 12px; opacity: .85; }
.gantt-b .avance { position: absolute; inset: 0 auto 0 0; background: rgba(0, 0, 0, .18); }
.gantt-jalon { position: absolute; top: 10px; width: 12px; height: 12px; transform: rotate(45deg); border-radius: 2px; }
.gantt-auj { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .7; z-index: 2; pointer-events: none; }
.gantt-mois { display: grid; grid-template-columns: 220px 1fr; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); height: 28px; align-items: center; }
.gantt-mois .piste { position: relative; height: 28px; }
.gantt-mois .piste span { position: absolute; top: 6px; padding-left: 6px; border-left: 1px solid var(--line); height: 22px; white-space: nowrap; }

/* Carte d'activité (façon contributions GitHub) */
.contrib { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.contrib-j { display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; font-size: 10px; color: var(--ink-3); padding-top: 16px; }
.contrib-g { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, 11px); gap: 3px; }
.contrib-g .m { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.contrib-g .c { width: 11px; height: 11px; border-radius: 2px; background: var(--hover-2); }
.contrib-leg { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-3); justify-content: flex-end; margin-top: 6px; }
.contrib-leg i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* Idées */
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.idea { background: var(--bg); box-shadow: var(--card); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: background .06s; }
:root[data-theme="dark"] .idea { background: var(--sunken); }
.idea:hover { background: var(--sunken); }
.idea p { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.vote { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: var(--r); border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--bg); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.vote:hover { background: var(--hover); }
.vote.on { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Graphiques */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font-size: 11.5px; font-family: var(--sans); }
.chart .lbl { fill: var(--ink-2); font-size: 12.5px; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 500; }
.chart .grid { stroke: var(--line-2); }
.chart .axis { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.trait { height: 2px; vertical-align: 3px; width: 14px; }
.legend i.tirets { height: 0; border-top: 2px dashed; background: none !important; vertical-align: 3px; width: 14px; }
.tip { position: fixed; z-index: 95; background: #2F2F2F; color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 5px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.chiffre-cle { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chiffre-cle b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chiffre-cle span { color: var(--ink-3); font-size: 13px; }

/* Automatisations */
.flow { display: grid; grid-template-columns: 1fr 340px; height: 100%; min-height: 0; }
.flow.no-side { grid-template-columns: 1fr; }
.canvas-wrap { position: relative; overflow: hidden; background-color: var(--sunken); background-image: radial-gradient(var(--line) 1.1px, transparent 1.1px); background-size: 20px 20px; min-height: 0; }
.canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.canvas svg.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: var(--ink-3); stroke-width: 1.6; pointer-events: stroke; cursor: pointer; }
.edges path:hover { stroke: var(--bad); stroke-width: 2.4; }
.edges path.tmp { stroke: var(--accent); stroke-dasharray: 5 4; pointer-events: none; }
.fnode { position: absolute; width: 214px; background: var(--bg); box-shadow: var(--card); border-radius: var(--r-lg); user-select: none; }
.fnode.sel { box-shadow: 0 0 0 2px var(--accent), var(--card); }
.fnode-h { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: grab; }
.fnode-h .ico { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.fnode-h .t { font-weight: 600; font-size: 13px; line-height: 1.2; }
.fnode-h .s { font-size: 11.5px; color: var(--ink-3); line-height: 1.2; }
.fnode-st { border-top: 1px solid var(--line); padding: 5px 10px; font-size: 12px; display: flex; gap: 6px; align-items: center; color: var(--ink-3); }
.fnode-st.ok { color: var(--ok); } .fnode-st.bad { color: var(--bad); }
.port { position: absolute; top: 19px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink-3); cursor: crosshair; }
.port.in { left: -7px; } .port.out { right: -7px; }
.port:hover { border-color: var(--accent); background: var(--accent); }
.flow-side { box-shadow: inset 1px 0 0 var(--line); background: var(--bg); overflow: auto; display: flex; flex-direction: column; }
.flow-side .sec { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.palette-nodes { display: grid; grid-template-columns: 1fr; gap: 2px; }
.palette-nodes button { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 6px; border: 0; border-radius: var(--r); background: none; cursor: pointer; text-align: left; font-size: 14px; }
.palette-nodes button:hover { background: var(--hover); }
.palette-nodes .ico { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: #fff; flex: none; }
.canvas-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 2px; background: var(--bg); box-shadow: var(--card); border-radius: var(--r-lg); padding: 3px; z-index: 3; }
.out-panel { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: var(--bg); box-shadow: 0 -1px 0 var(--line), 0 -6px 16px rgba(15, 15, 15, .06); display: flex; flex-direction: column; z-index: 4; }
.out-panel .panel-h { padding: 6px 12px; }
.out-panel .tbl-wrap { flex: 1; }
.code { font: 13px/1.55 var(--mono); }
textarea.code { tab-size: 2; white-space: pre; }

/* Atelier */
.nb { max-width: 960px; margin: 0 auto; padding: 32px 56px 120px; display: flex; flex-direction: column; gap: 2px; }
.cell { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.cell-gutter { padding-top: 8px; text-align: right; font: 11.5px var(--mono); color: var(--ink-3); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cell-box { box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-lg); overflow: hidden; transition: box-shadow .1s; }
.cell.focus .cell-box { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.cell-bar { display: flex; align-items: center; gap: 2px; padding: 3px 6px 3px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--sunken); }
.cell-bar .lang { font-weight: 600; color: var(--ink-2); }
.cell-src { display: block; width: 100%; border: 0; resize: none; background: var(--bg); padding: 12px 14px; min-height: 44px; overflow: hidden; }
.cell-src:focus { outline: none; }
.cell-out { border-top: 1px solid var(--line); padding: 10px 14px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; background: var(--sunken); }
.cell-out .err { color: var(--bad); }
.cell-out img { max-width: 100%; background: #fff; border-radius: 4px; display: block; margin: 6px 0; }
.cell-out table { border-collapse: collapse; font-size: 12px; margin: 4px 0; }
.cell-out th, .cell-out td { border: 1px solid var(--line); padding: 2px 6px; text-align: right; }
.cell-text { padding: 10px 14px; min-height: 40px; cursor: text; }
.add-cell { display: flex; gap: 6px; justify-content: center; opacity: 0; transition: opacity .12s; padding: 2px 0; }
.add-cell:hover, .add-cell:focus-within { opacity: 1; }

/* Prospection */
.search-bar { display: grid; grid-template-columns: 240px 1fr 1fr auto; gap: 10px; align-items: end; }
.contact-list { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.contact-list a { text-decoration: none; color: var(--ink-2); }
.contact-list a:hover { color: var(--ink); }
.contact-list svg.i { width: 14px; height: 14px; color: var(--ink-3); }
.funnel { display: flex; gap: 6px; flex-wrap: wrap; }
.funnel button { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-lg); background: var(--bg); padding: 8px 14px; text-align: left; cursor: pointer; min-width: 120px; transition: background .06s; }
.funnel button:hover { background: var(--hover); }
.funnel button.on { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.funnel b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.funnel span { font-size: 12.5px; color: var(--ink-3); }

/* Fil d'activité */
.feed .li { align-items: flex-start; }
.feed .li .av { margin-top: 2px; }
.feed .txt { font-size: 14px; line-height: 1.45; }
.feed .txt a { color: var(--ink); font-weight: 500; text-decoration: none; }
.feed .txt a:hover { text-decoration: underline; }
.feed time { font-size: 12px; color: var(--ink-3); display: block; }

/* Notifications */
.cloche { position: relative; }
.cloche .pastille { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
.notifs { width: 380px; padding: 0; }
.notifs .notif { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.notifs .notif:hover { background: var(--hover); }
.notifs .notif.nouvelle { background: var(--accent-soft); }
.notifs .notif p { margin: 2px 0 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sous-tâches */
.sous { display: flex; flex-direction: column; }
.sous-l { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 4px; border-radius: var(--r); }
.sous-l:hover { background: var(--hover); }
.sous-l input[type="text"] { flex: 1; border: 0; background: none; padding: 4px 0; }
.sous-l input[type="text"]:focus { outline: none; }
.sous-l.fait input[type="text"] { text-decoration: line-through; color: var(--ink-3); }
.sous-l .icon-btn { opacity: 0; }
.sous-l:hover .icon-btn { opacity: 1; }

/* Réactivité ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 260px); overflow-x: auto; }
  .flow { grid-template-columns: 1fr; }
  .flow-side { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; z-index: 5; box-shadow: var(--shadow); }
  .page { padding: 24px 32px 80px; }
  .tabs { padding: 0 32px; }
}
@media (max-width: 820px) {
  .app, .app.side-cachee { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; visibility: visible !important; }
  .app.nav-open .side { transform: none; box-shadow: var(--shadow); }
  .icon-btn.menu-btn { display: inline-grid; }
  .icon-btn.deplier { display: none !important; }
  .top { padding: 0 8px; }
  .tabs { padding: 0 14px; }
  .page { padding: 18px 16px 60px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .chat, .docs { grid-template-columns: 1fr; }
  .chat-side, .tree { display: none; }
  .chat.list-mode .chat-side, .docs.list-mode .tree { display: block; }
  .chat.list-mode .thread, .docs.list-mode .doc { display: none; }
  .search-bar { grid-template-columns: 1fr; }
  .doc-in, .doc-in.large { padding: 24px 18px 40vh; }
  .doc-title { font-size: 30px; }
  .bloc-poignees { display: none; }
  .drawer-b { padding: 14px 18px 30px; }
  .proprietes, .props { grid-template-columns: 120px 1fr; }
  .top .hide-sm { display: none; }
  .li .tag { display: none; }
  .gantt-l, .gantt-mois { grid-template-columns: 120px 1fr; }
  .cal-j { min-height: 70px; }
  .versions { grid-template-columns: 1fr; height: auto; }
  .notifs { width: calc(100vw - 24px); }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.btn-danger-fill, .btn-primary.btn-danger-fill { background: var(--bad); color: #fff; }

/* Prospection : carte et fiche entreprise */
.carte { width: 100%; border-radius: var(--r); overflow: hidden; position: relative; z-index: 0; isolation: isolate; background: var(--sunken); }
.carte-erreur { display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 10px 12px; }
.popup-ent { display: flex; flex-direction: column; gap: 6px; min-width: 200px; font-size: 13px; }
.popup-ent .btn { align-self: flex-start; }
.fiche-titre { font-size: 22px; margin: 0 0 4px; }
.fiche-rub { display: flex; flex-direction: column; gap: 8px; }
.fiche-rub h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0; font-weight: 600; }
.horaires { border-collapse: collapse; font-size: 13.5px; align-self: flex-start; }
.horaires td { padding: 3px 18px 3px 0; }
.horaires tr.auj td { font-weight: 600; }
.btn.on { background: var(--hover); }
