:root {
  --bg: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #1a2332;
  --ink-2: #5b6678;
  --line: #dfe3ea;
  --accent: #fe9c00;
  --accent-ink: #1a1200;
  --accent-soft: #fff2d9;
  --side: #131c2b;
  --side-2: #1c2739;
  --side-ink: #e8ecf3;
  --side-mute: #8d99ae;
  --ok: #1f9d6b;
  --warn: #d97706;
  --bad: #d64545;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.05);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d121b; --surface: #161e2c; --surface-2: #1b2535; --ink: #e8ecf3; --ink-2: #93a0b5;
    --line: #28344a; --accent-soft: #3a2a08; --side: #0a0f17; --side-2: #131b29;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 0; color: var(--ink-2); font-weight: 650; }

.app { display: grid; grid-template-columns: var(--side-w, 300px) 1fr; height: 100vh; }

/* Barre latérale */
.side { background: var(--side); color: var(--side-ink); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 4px; }
.brand b { display: block; letter-spacing: .22em; font-size: 17px; line-height: 1.1; }
.brand small { color: var(--accent); font-size: 10px; letter-spacing: .12em; font-weight: 600; }
.client-pick { display: flex; gap: 6px; }
.client-pick select { flex: 1; min-width: 0; background: var(--side-2); color: var(--side-ink); border: 1px solid #2c3a52; border-radius: 10px; padding: 9px 10px; font-weight: 600; }
.side .card { background: var(--side-2); border-radius: var(--radius); padding: 10px 12px; min-height: 0; }
.side .card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.side h2 { color: var(--side-mute); }
.side .projects { flex: 1; display: flex; flex-direction: column; }
.plist { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.plist li { display: flex; align-items: center; border-radius: 8px; cursor: pointer; padding: 6px 8px; gap: 6px; }
.plist li:hover { background: rgba(255,255,255,.06); }
.plist li.sel { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.plist li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li .edit { opacity: 0; background: none; border: 0; cursor: pointer; padding: 0 2px; }
.plist li:hover .edit { opacity: .8; }
.trello a { color: var(--accent); word-break: break-all; }
.side .muted, .side .empty { color: var(--side-mute); }
.extra div, .trello div { line-height: 1.45; }
.extra dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.extra dt { color: var(--side-mute); }
.extra dd { margin: 0; word-break: break-word; }
.sync { background: transparent; border: 1px dashed #3a4a66; color: var(--side-mute); border-radius: 10px; padding: 8px; cursor: pointer; }
.sync:hover { color: var(--side-ink); border-color: var(--accent); }

/* Zone principale */
.main { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px; min-height: 0; min-width: 0; }
.bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; min-width: 0; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(200px, 300px) 1fr; min-height: 0; min-width: 0; overflow: hidden; }
.panel.docs { grid-template-columns: minmax(170px, 36%) 1fr; }
.panel.tasks { grid-template-columns: minmax(150px, min(var(--tw, 36%), 60%)) 1fr; }
.col { min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.col.list { border-right: 1px solid var(--line); background: var(--surface-2); }
.col > header { padding: 12px 14px 8px; }
.col.detail { padding: 0; overflow: auto; }
.empty { color: var(--ink-2); padding: 18px; text-align: center; margin: auto; }

.tbl { width: 100%; border-collapse: collapse; display: block; overflow: auto; flex: 1; }
.tbl thead, .tbl tbody { display: table; width: 100%; table-layout: fixed; }
.tbl th { text-align: left; font-size: 11px; color: var(--ink-2); font-weight: 600; padding: 4px 10px; }
.tbl th:first-child, .tbl td:first-child { width: 100px; }
.tbl td { padding: 8px 10px; border-top: 1px solid var(--line); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tbody tr:hover { background: var(--accent-soft); }
.tbl tbody tr.sel { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--line); color: var(--ink-2); margin-right: 6px; vertical-align: 1px; }
.tag.cr { background: #dff3ea; color: #0f6e4a; }

.fab { position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(254,156,0,.45); }
.fab:hover { filter: brightness(1.07); }
.icon { background: transparent; border: 1px solid transparent; color: inherit; border-radius: 8px; cursor: pointer; width: 30px; height: 30px; font-size: 16px; }
.side .icon { color: var(--side-mute); border-color: #2c3a52; }
.icon:hover { border-color: var(--accent); color: var(--accent); }

/* Éditeurs */
.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.editor .bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.editor .bar input[type=text] { flex: 1; min-width: 140px; font-weight: 650; font-size: 15px; }
.editor .tools { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tools button { background: none; border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer; min-width: 28px; }
.tools button:hover { background: var(--line); }
.body { flex: 1; overflow: auto; padding: 14px 18px; outline: none; line-height: 1.55; }
.body table { border-collapse: collapse; } .body td, .body th { border: 1px solid var(--line); padding: 4px 8px; }
.body a { color: #b36b00; }
input[type=text], input[type=date], input[type=url], select, textarea, .fld {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; width: 100%; }
.actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); align-items: center; }
.actions .sp { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.form { padding: 14px; display: grid; gap: 10px; align-content: start; overflow: auto; flex: 1; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label input, .form label select, .form label textarea { color: var(--ink); font-weight: 400; font-size: 14px; }

/* Tâches */
.tlist { list-style: none; margin: 0; padding: 0 6px 56px; overflow: auto; flex: 1; }
.tlist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; align-items: start; }
.tlist li:hover, .tlist li.sel { background: var(--accent-soft); }
.tlist li.sel { box-shadow: inset 3px 0 var(--accent); }
.tlist input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; }
.tlist .t { overflow: hidden; text-overflow: ellipsis; }
.tlist .m { font-size: 11px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; }
.tlist li.done .t { text-decoration: line-through; color: var(--ink-2); }
.tlist .late { color: var(--bad); font-weight: 650; }
.p-high { color: var(--bad); font-weight: 650; } .p-low { opacity: .7; }
.st { font-weight: 650; } .st.doing { color: var(--warn); } .st.done { color: var(--ok); }

/* Documents */
.tree { overflow: auto; flex: 1; padding: 0 6px 10px; font-size: 13px; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.tree > ul { padding-left: 0; }
.tree .it { display: flex; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree .it:hover { background: var(--accent-soft); }
.tree .it.sel { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.preview { display: flex; flex-direction: column; height: 100%; }
.preview .bar { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.preview .bar b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.preview img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; padding: 12px; }
.preview pre { margin: 0; padding: 14px; overflow: auto; flex: 1; font: 12.5px/1.5 Consolas, monospace; white-space: pre-wrap; }

/* Dialogue + toast */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,15,25,.55); }
dialog h3 { margin: 0; padding: 16px 18px 0; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 20px); background: #111a29; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 10; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .side { max-height: none; } .plist { max-height: 220px; }
  .main { grid-template-rows: none; } .bottom { grid-template-columns: 1fr; }
  .panel { min-height: 420px; }
}

/* Disposition haute : synthèse projet (moitié de la largeur d'un panneau du bas) + notes */
.top { display: grid; grid-template-columns: calc((100% - 12px) / 4) minmax(0, 1fr); gap: 12px; min-height: 0; min-width: 0; }
.panel.proj { grid-template-columns: 1fr; }
.panel.notes { grid-template-columns: min(var(--nw, 260px), 60%) 1fr; }
.panel.proj .col > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel.proj h2 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel.proj .icon { color: var(--ink-2); border-color: var(--line); flex: none; }
.stats { padding: 4px 14px 14px; overflow: auto; display: grid; gap: 12px; align-content: start; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--ink-2); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pbar { height: 12px; border-radius: 99px; background: var(--line); position: relative; margin: 10px 0 6px; overflow: visible; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.pbar.over i { background: var(--bad); }
.pbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; }
.pmsg { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.pmsg.over { color: var(--bad); font-weight: 650; } .pmsg.ok { color: var(--ok); font-weight: 650; }

/* Connexion */
.whoami { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--side-mute); padding: 0 4px; }
.link { background: none; border: 0; color: var(--side-mute); cursor: pointer; text-decoration: underline; }
.link:hover { color: var(--accent); }
.login { width: min(360px, 92vw); margin: 12vh auto 0; background: var(--surface); padding: 28px; border-radius: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login .brand b { color: var(--ink); }
.login p { margin: 0; color: var(--ink-2); }
.login label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.login input { font-size: 15px; padding: 9px 10px; font-weight: 400; }
.login .err { color: var(--bad); min-height: 1.2em; font-size: 13px; }
@media (max-width: 1100px) { .top { grid-template-columns: 1fr; } .panel.notes { min-height: 420px; } }

.sub { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 10px; }
.sub h3 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.sub .stat { background: var(--surface); }
.sub .pbar { margin-top: 4px; }
.stats { gap: 6px; padding-bottom: 10px; }
.sub { padding: 6px 9px; gap: 5px; }
.sub .stat { padding: 4px 9px; }
.sub .stat .k { font-size: 10px; }
.sub .stat .v { font-size: 15px; margin-top: 1px; }
.sub .pmsg { font-size: 10.5px; }

/* Logo clair (transparent) pour fonds sombres */
.brand { padding: 0; }
.brand img { display: block; width: 100%; height: auto; }
.login .brand { background: var(--side); border-radius: 12px; padding: 14px 18px; }
.login .brand img { width: 100%; }

/* Zones agrandissables */
.main { position: relative; }
.col > header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.maxbtn { margin-left: auto; width: 26px; height: 26px; font-size: 14px; color: var(--ink-2); border-color: var(--line); flex: none; }
.panel.proj header .maxbtn { margin-left: auto; }
.panel.max { position: absolute; inset: 12px; z-index: 5; box-shadow: 0 8px 40px rgba(10,20,40,.25); }
.panel.max.proj .stats { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-content: start; }
.panel.max.docs { grid-template-columns: minmax(240px, 30%) 1fr; }
.panel.max.tasks { grid-template-columns: minmax(240px, min(var(--twm, 30%), 60%)) 1fr; }
.panel.max.notes { grid-template-columns: min(var(--nwm, 340px), 60%) 1fr; }
.ph { visibility: hidden; }

/* Bouton d'agrandissement : toujours dans le coin supérieur droit de la zone */
.panel { position: relative; }
.maxbtn { position: absolute; top: 10px; right: 10px; z-index: 3; margin: 0; background: var(--surface); }
.panel .detail .bar, .panel.proj .col > header { padding-right: 46px; }
.panel.tasks .detail .form { padding-top: 14px; }
/* le bouton d'agrandissement flotte à droite : seule la première ligne (titre / mention « réalisée ») lui laisse la place */
.panel.tasks .detail .form > :first-child { padding-right: 38px; }

/* Poignée de redimensionnement de la colonne gauche */
.side { position: relative; }
.side-grip { position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; cursor: col-resize; z-index: 20; touch-action: none; }
.side-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.side-grip:hover::after, .side-grip.drag::after, .side-grip:focus-visible::after { opacity: .9; }
body.resizing { cursor: col-resize; user-select: none; }
@media (max-width: 1100px) { .side-grip { display: none; } }

/* Logo à taille fixe (la hauteur du bloc ne change pas quand la colonne est redimensionnée) */
.side .brand { display: flex; justify-content: center; flex: none; }
/* Logo : taille proportionnelle à la hauteur de la fenêtre (portable / zoom 125 % : plus petit, plus de place pour les projets) */
.side { --logo-h: clamp(40px, 6.6vh, 85px); }
.side .brand img { height: var(--logo-h); width: calc(var(--logo-h) * 2.82); max-width: 100%; object-fit: contain; flex: none; }

/* Barre d'outils de l'éditeur : taille, couleurs, images */
.tools { align-items: center; flex-wrap: wrap; }
.tools select { padding: 3px 6px; border-radius: 6px; font-size: 12px; }
.tools .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.clr { position: relative; display: inline-flex; width: 28px; height: 26px; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; }
.clr:hover { background: var(--line); }
.clr .a { font-weight: 800; padding: 0 5px; border-radius: 3px; line-height: 1.2; }
.clr input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.clr .a { pointer-events: none; }
.body img { max-width: 100%; height: auto; border-radius: 4px; }

/* Cadre de sélection / poignée de redimensionnement des images */
#imgFrame { position: fixed; z-index: 30; border: 2px solid var(--accent); border-radius: 3px; pointer-events: none; box-sizing: border-box; }
#imgFrame .grip { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; border-radius: 4px; cursor: nwse-resize; pointer-events: auto; touch-action: none; }
.body img { cursor: pointer; }
body.resizing-img { cursor: nwse-resize; user-select: none; }
[hidden] { display: none !important; }

/* Contacts */
.side .contacts { max-height: 200px; display: flex; flex-direction: column; flex: none; }
.side .contacts #contactsBox { overflow: auto; min-height: 0; }
.clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.clist li { line-height: 1.35; font-size: 13px; }
.clist .cn { font-weight: 650; }
.clist .cm { color: var(--side-mute); font-size: 12px; }
.clist a { color: var(--accent); font-size: 12px; word-break: break-all; }
dialog.wide { width: min(900px, 96vw); }
.contacts-edit { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.chead, .crow { display: grid; grid-template-columns: 22px 1fr 1fr 1fr 1.4fr 1fr 30px; gap: 6px; align-items: center; }
.chead { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.crow input { width: 100%; font-size: 13px; padding: 6px 8px; }
.crow .cdel { width: 30px; height: 30px; color: var(--bad); border-color: var(--line); }
.contacts-edit > .btn { justify-self: start; }
@media (max-width: 720px) { .chead { display: none; } .crow { grid-template-columns: 22px 1fr 1fr; } }

/* Barres de défilement discrètes, assorties au thème */
:root { --sb-thumb: rgba(26, 35, 50, .22); --sb-thumb-hover: rgba(26, 35, 50, .42); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sb-thumb: rgba(255, 255, 255, .22); --sb-thumb-hover: rgba(255, 255, 255, .42); } }
.side { --sb-thumb: rgba(255, 255, 255, .26); --sb-thumb-hover: rgba(255, 255, 255, .5); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border: 3px solid transparent; background-clip: padding-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; } }

/* Tâches : validation et responsables multiples */
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(1.08); }
.doneinfo { background: #dff3ea; color: #0f6e4a; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; }
.fgroup { display: grid; gap: 6px; }
.flabel { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--ink); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 600; }
.chip .x { background: none; border: 0; cursor: pointer; color: var(--ink-2); border-radius: 50%; width: 20px; height: 20px; line-height: 1; padding: 0; }
.chip .x:hover { background: rgba(0,0,0,.1); color: var(--bad); }
.fgroup .muted { color: var(--ink-2); font-size: 13px; }
.todo-state { font-size: 12px; color: var(--ink-2); }
.todo-state .bad { color: var(--bad); font-weight: 600; }

/* Contacts : une ligne par contact, 6 visibles puis défilement */
.side .contacts { max-height: none; }
.side .contacts #contactsBox { max-height: 78px; overflow-y: auto; }
.clist { gap: 0; }
.clist li { display: flex; align-items: baseline; gap: 6px; height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; }
.clist .cn { font-weight: 650; flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.clist .cm { color: var(--side-mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clist a.cn { color: inherit; font-size: inherit; text-decoration: none; word-break: normal; }
.clist a.cn:hover { color: var(--accent); text-decoration: underline; }

/* Contacts : bouton « copier l'adresse » visible au survol */
.clist li { position: relative; }
.ccopy { margin-left: auto; flex: none; opacity: 0; background: none; border: 0; color: var(--side-mute); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; height: 26px; }
.clist li:hover .ccopy, .ccopy:focus-visible { opacity: 1; }
.ccopy:hover { color: var(--accent); }
.clist a.cn { cursor: grab; }

/* Tâches : case « afficher les tâches terminées » */
.showdone { display: flex; align-items: center; gap: 6px; padding: 0 14px 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.showdone input { accent-color: var(--accent); margin: 0; width: 14px; height: 14px; flex: none; }
.showdone b { font-weight: 600; }

/* Réglage « tâches terminées » : sur la ligne du titre, sous forme d'interrupteur (distinct des cases des tâches) */
.col > header .showdone { padding: 0; margin-left: auto; text-align: right; line-height: 1.2; font-size: 11px; max-width: 70%; flex-direction: row-reverse; gap: 7px; }
.showdone input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 26px; height: 14px; border-radius: 99px; background: var(--line); border: 0; position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.showdone input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.showdone input[type=checkbox]:checked { background: var(--accent); }
.showdone input[type=checkbox]:checked::after { transform: translateX(12px); }
.showdone input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Projets créés uniquement dans l'application */
.tag-local { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.12); color: var(--side-mute); border: 1px solid rgba(255,255,255,.18); line-height: 1.4; }
.plist li.sel .tag-local { background: rgba(26,18,0,.14); color: var(--accent-ink); border-color: rgba(26,18,0,.3); }

/* Temps du projet : heures à gauche, jours à droite en bleu sur fond orange (charte) */
:root { --blue: #1b3a73; }
.stat .v { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .v .hh { min-width: 0; }
.stat .v .dd { margin-left: auto; flex: none; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--accent); border-radius: 99px; padding: 1px 10px; line-height: 1.5; }
/* Jours : même taille de texte que les heures */
.stat .v .dd { font-size: inherit; font-weight: 700; padding: 0 10px; line-height: 1.3; }
.stat .v .hh { white-space: nowrap; }
.sub .stat small { font-size: 11px; }

/* Présents aux notes */
.attbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.attbar .chips { min-height: 0; flex: 0 1 auto; }
.attbar select { max-width: 230px; font-size: 12px; padding: 4px 6px; }
.attbar .muted { color: var(--ink-2); font-size: 12px; }
.chip.contact { background: #e3ecff; border-color: #7aa0e6; }
.chip.other { background: var(--surface-2); border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.contact { background: #1f3358; border-color: #4a6db3; } }

/* Projets archivés */
.side .card header .showdone { padding: 0; margin: 0 6px 0 auto; font-size: 11px; color: var(--side-mute); flex-direction: row-reverse; gap: 6px; }
.side .card header .showdone input[type=checkbox] { background: rgba(255,255,255,.18); }
.side .card header .showdone input[type=checkbox]:checked { background: var(--accent); }
.plist li.arch .nm { opacity: .6; font-style: italic; }
/* Projets archivés : même interrupteur que « tâches terminées » (libellé à gauche, interrupteur à droite) */
.side .card header .showdone { text-align: right; line-height: 1.2; max-width: 68%; margin: 0 8px 0 auto; gap: 7px; }
.side .card header .showdone span { display: block; }

/* ---------- Éditeur collaboratif ---------- */
.ProseMirror { outline: none; min-height: 100%; }
.ProseMirror > :first-child { margin-top: 0; }
.ProseMirror p { margin: 0 0 .55em; }
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3, .ProseMirror h4 { margin: .5em 0 .12em; line-height: 1.2; }
.ProseMirror ul, .ProseMirror ol { margin: 0 0 .55em; padding-left: 1.6em; }
.ProseMirror li > p { margin: 0 0 .2em; }
.ProseMirror blockquote { margin: .5em 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--ink-2); }
.ProseMirror pre { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; overflow: auto; }
.ProseMirror code { background: var(--surface-2); border-radius: 4px; padding: 1px 4px; font-size: .92em; }
.ProseMirror a { color: #b36b00; cursor: pointer; }
.ProseMirror img { max-width: 100%; height: auto; }
.ProseMirror table { border-collapse: collapse; margin: .5em 0; width: 100%; table-layout: fixed; }
.ProseMirror td, .ProseMirror th { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; position: relative; }
.ProseMirror th { background: var(--surface-2); font-weight: 700; text-align: left; }
.ProseMirror td > p, .ProseMirror th > p { margin: 0; }
.ProseMirror .selectedCell::after { content: ""; position: absolute; inset: 0; background: rgba(254,156,0,.22); pointer-events: none; }
.imgwrap { position: relative; display: inline-block; line-height: 0; max-width: 100%; vertical-align: bottom; }
.imgwrap img { max-width: 100%; height: auto; border-radius: 4px; display: block; }
.imgwrap .grip { display: none; position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; border-radius: 4px; cursor: nwse-resize; touch-action: none; }
.imgwrap.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.imgwrap.sel .grip { display: block; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--ink); animation: pmblink 1.1s steps(2, start) infinite; }
@keyframes pmblink { to { visibility: hidden; } }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
/* curseurs des autres personnes */
.rcaret { position: relative; display: inline-block; width: 0; height: 1.15em; border-left: 2px solid; margin-left: -1px; margin-right: -1px; vertical-align: text-bottom; pointer-events: none; }
.rname { position: absolute; bottom: 100%; left: -2px; font-size: 10px; line-height: 1.5; color: #fff; padding: 0 5px; border-radius: 4px 4px 4px 0; white-space: nowrap; font-weight: 600; font-family: inherit; z-index: 2; }
.rsel { border-radius: 2px; }
/* barre d'outils et état */
.tools button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tblcmds { display: inline-flex; align-items: center; gap: 2px; }
.tblcmds[hidden] { display: none; }
.tblcmds button { font-size: 12px; }
.sstatus { font-size: 12px; color: var(--ink-2); margin-left: 12px; }
.sstatus.saved { color: var(--ok); }
.sstatus.offline { color: var(--bad); font-weight: 600; }
.pres { font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pdot { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.pdot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }

/* ---------- Zone agrandie : texte un peu plus grand (≈ +2 px) ---------- */
.panel.max { font-size: 16px; }
.panel.max .col > header h2 { font-size: 13px; }
.panel.max.proj .col > header h2 { font-size: 17px; }
.panel.max .stat .k, .panel.max .sub h3 { font-size: 12.5px; }
.panel.max .stat .v { font-size: 24px; }
.panel.max .sub .stat .v { font-size: 22px; }
.panel.max .pmsg { font-size: 13px; }
.panel.max .tbl th { font-size: 12.5px; }
.panel.max .tree { font-size: 15px; }
.panel.max .tlist .m, .panel.max .showdone { font-size: 12.5px; }
.panel.max .form label, .panel.max .flabel { font-size: 13px; }
.panel.max .chip, .panel.max .attbar select, .panel.max .tools select { font-size: 14px; }
.panel.max .tools button { font-size: 15px; }
.panel.max .sstatus, .panel.max .pres, .panel.max .doneinfo { font-size: 13px; }
.panel.max .editor .body, .panel.max .ProseMirror { font-size: 16px; line-height: 1.6; }

/* ---------- Paramètres personnels ---------- */
.whoami { flex-wrap: wrap; gap: 2px 8px; }
.wh-actions { display: inline-flex; gap: 10px; }
.pintro { margin: 0; color: var(--ink-2); }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pbox { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 12px; margin: 0; min-width: 0; background: var(--surface-2); }
.pbox legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.psub { font-size: 12px; color: var(--ink-2); margin: -2px 0 8px; }
.pnone { margin: 0; color: var(--ink-2); font-style: italic; font-size: 13px; }
.pgroup { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.prad { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.prad:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.prad input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.prad span { display: grid; gap: 2px; }
.prad small { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
/* Barre du document : une seule ligne. Libellés complets si la zone est large, icônes seules sinon */
.preview { container-type: inline-size; }
.preview .bar { flex-wrap: nowrap; gap: 6px; }
.preview .bar b { min-width: 60px; }
.preview .bar { padding-left: 10px; }
.preview .bar .btn { flex: none; padding: 5px 8px; line-height: 1.2; text-decoration: none; color: var(--ink); }
.preview .bar .btn.primary { color: var(--accent-ink); }
.preview .bar .lbl { display: none; }
@container (min-width: 830px) { .preview .bar .lbl { display: inline; } .preview .bar .btn { padding: 7px 12px; } }
@media (max-width: 720px) { .pgrid { grid-template-columns: 1fr; } }
.wh-actions { align-items: center; }
.whoami .icon { width: 26px; height: 26px; font-size: 14px; }
.form .prad { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); font-weight: 400; }
.form .prad span { display: grid; gap: 2px; }
.form .prad b { font-weight: 650; }


/* Version locale (OneDrive) et assistant */
.plocal { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.plocal input { font: inherit; font-weight: 400; color: var(--ink); }
.phint { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.phint code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.phelper { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.phelper a, .linkbtn { color: #b36b00; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; font-weight: 600; }
.lclist { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px 4px 2px 0; }
.form .lcrow { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.form .lcrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form .lcrow input { font-size: 12.5px; padding: 5px 8px; font-weight: 400; }
.hsteps { margin: 12px 0 8px; padding-left: 20px; display: grid; gap: 10px; line-height: 1.5; }
.hsteps .btn { margin: 2px 0; }
.hsteps a.btn { text-decoration: none; display: inline-block; }
.hsteps li .btn { vertical-align: baseline; }

/* Attribution des tâches : bouton + et fenêtre de sélection */
.chip.add { cursor: pointer; background: var(--surface); border: 1px dashed var(--accent); padding: 2px 11px; font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink-2); }
.chip.add:hover { background: var(--accent-soft); color: var(--ink); }
#dlgForm .form:has(.picklist) { gap: 10px; }
#dlgForm input[type=search] { font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.picklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 340px; overflow: auto; padding: 2px; }
.form .pk { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 500; min-width: 0; transition: background .12s, border-color .12s; }
.form .pk:hover { background: var(--surface-2); }
.form .pk.on { background: var(--accent-soft); border-color: var(--accent); }
.form .pk[hidden] { display: none; }
.pk .av { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.pk.on .av { background: var(--accent); color: var(--blue); }
.pk .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form .pk input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.pkcount { font-size: 12px; color: var(--ink-2); }
@media (max-width: 560px) { .picklist { grid-template-columns: 1fr; } }
dialog:has(.picklist) { width: min(560px, 94vw); }

/* Fenêtre de sélection : groupes, sous-titre et ajout d'une personne libre */
.pkh { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 8px 2px 0; }
.pkh:first-child { padding-top: 0; }
.pkh[hidden] { display: none; }
.pk .nm small { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.pkadd { display: flex; gap: 8px; }
.pkadd input { flex: 1; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
dialog:has(.pkadd) { width: min(600px, 94vw); }

/* Styles de paragraphe : Titre 1 à 4, numérotés en plan (I. / A. / 1. / a)) comme dans Word */
.stylegrp { display: inline-flex; gap: 4px; align-items: center; }
.tools .stylegrp .st { height: 28px; padding: 0 9px; font-size: 12.5px; line-height: 1; white-space: nowrap; }
.stylegrp .st1 { color: #fe9c00; font-weight: 600; }
.stylegrp .st2 { color: #2b3445; font-weight: 600; }
.stylegrp .st3 { color: #7a8494; font-weight: 600; }
.stylegrp .st4 { color: #1b5e8a; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stylegrp .st2 { color: #d5dbe6; } :root:not([data-theme="light"]) .stylegrp .st4 { color: #6fb3dd; } }
.ProseMirror { counter-reset: n1 n2 n3 n4; }
.ProseMirror h1 { counter-increment: n1; counter-reset: n2 n3 n4; font-size: 1.7em; font-weight: 600; color: #fe9c00; margin-top: .7em; }
.ProseMirror h2 { counter-increment: n2; counter-reset: n3 n4; font-size: 1.35em; font-weight: 600; color: #2b3445; margin-top: .5em; margin-left: 3rem; text-transform: none; letter-spacing: 0; }
.ProseMirror h3 { counter-increment: n3; counter-reset: n4; font-size: 1.15em; font-weight: 600; color: #7a8494; margin-left: 6rem; }
.ProseMirror h4 { counter-increment: n4; font-size: .92em; font-weight: 600; color: #1b5e8a; margin-left: 9rem; }
.ProseMirror h1::before { content: counter(n1, upper-roman) ". "; }
.ProseMirror h2::before { content: counter(n1, upper-roman) ". " counter(n2, upper-alpha) ". "; }
.ProseMirror h3::before { content: counter(n1, upper-roman) ". " counter(n2, upper-alpha) ". " counter(n3) ". "; }
.ProseMirror h4::before { content: counter(n1, upper-roman) ". " counter(n2, upper-alpha) ". " counter(n3) ". " counter(n4, lower-alpha) ") "; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ProseMirror h2 { color: #d5dbe6; } :root:not([data-theme="light"]) .ProseMirror h4 { color: #6fb3dd; } }
/* Titres enchaînés : peu d'espace entre un titre et celui qui le suit */
.ProseMirror :is(h1, h2, h3, h4) + :is(h1, h2, h3, h4) { margin-top: .1em; }

/* Images des notes : déplaçables à la souris */
.ProseMirror .imgwrap img { cursor: default; }
.ProseMirror .imgwrap.sel img { cursor: grab; }
.ProseMirror .imgwrap.sel img:active { cursor: grabbing; }

/* Aperçu pendant le glissé d'une image */
.ProseMirror .dropghost { display: inline-block; vertical-align: bottom; line-height: 0; max-width: 100%; pointer-events: none; opacity: .6; outline: 2px dashed var(--accent); outline-offset: 1px; border-radius: 4px; }
.ProseMirror .dropghost img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.ProseMirror .dragsrc { opacity: .3; }

/* Colonne « liste des notes » : largeur ajustable à la souris */
.col-grip { position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; cursor: col-resize; z-index: 20; touch-action: none; }
.col-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.col-grip:hover::after, .col-grip.drag::after, .col-grip:focus-visible::after { opacity: .9; }

/* Liens du client (Trello, SharePoint) : icônes au-dessus du nom de l'utilisateur */
.sidelinks { display: flex; gap: 10px; padding: 0 4px; flex: none; }
.sidelinks .sl { width: 40px; height: 40px; border-radius: 10px; background: var(--side-2); display: grid; place-items: center; text-decoration: none; transition: background .15s, transform .15s; }
.sidelinks a.sl:hover { background: #26324a; transform: translateY(-1px); }
.sidelinks .sl img { width: 22px; height: 22px; display: block; }
.sidelinks .sl b { color: var(--side-ink); font-size: 15px; }
.sidelinks .sl.off { opacity: .35; filter: grayscale(1); cursor: default; }

/* Déconnexion : icône rouge */
.whoami .icon.logout { color: #ef4b4b; border-color: rgba(239, 75, 75, .45); display: inline-grid; place-items: center; padding: 0; }
.whoami .icon.logout:hover { background: rgba(239, 75, 75, .16); border-color: #ef4b4b; color: #ff6b6b; }
/* La poignée de la liste des notes n'existe que si la zone Notes est visible (pas quand une autre zone est agrandie) */
.app:has(.panel.max) .panel:not(.max) .col-grip { display: none; }

/* Fenêtre peu haute (portable, affichage à 125 %) : colonne de gauche resserrée pour montrer plus de projets */
@media (min-width: 1101px) and (max-height: 960px) {
  .side { padding: 10px 12px; gap: 7px; }
  .client-pick select { padding: 6px 10px; }
  .side .card { padding: 7px 10px; }
  .side .card header { margin-bottom: 4px; }
  .plist li { padding: 3px 8px; }
  .side .contacts #contactsBox { max-height: 66px; }
  .clist li { height: 22px; line-height: 22px; }
  .sidelinks { gap: 8px; }
  .sidelinks .sl { width: 34px; height: 34px; }
  .sidelinks .sl img { width: 20px; height: 20px; }
  .sync { padding: 5px; }
  .whoami { padding: 0 4px; }
}

/* Contacts : poignée de réorganisation par glisser-déposer */
.crow .cgrip { cursor: grab; color: var(--ink-2); text-align: center; font-size: 17px; line-height: 1; user-select: none; touch-action: none; border-radius: 6px; padding: 6px 0; }
.crow .cgrip:hover { background: var(--line); color: var(--ink); }
.crow.dragging { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.crow.dragging .cgrip { cursor: grabbing; }

/* Temps du projet, fenêtre peu haute (portable, affichage à 125 %) : une ligne par indicateur, sans défilement */
@media (min-width: 1101px) and (max-height: 960px) {
  .panel.proj:not(.max) .stats { gap: 6px; padding: 2px 12px 8px; }
  .panel.proj:not(.max) .sub { padding: 6px 8px; gap: 2px; }
  .panel.proj:not(.max) .sub h3 { font-size: 10.5px; margin-bottom: 2px; }
  .panel.proj:not(.max) .stat-grid { grid-template-columns: 1fr; gap: 0; }
  .panel.proj:not(.max) .sub .stat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; padding: 3px 2px; background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
  .panel.proj:not(.max) .sub .stat-grid .stat:last-child { border-bottom: 0; }
  .panel.proj:not(.max) .sub .stat .k { font-size: 10.5px; letter-spacing: .03em; }
  .panel.proj:not(.max) .sub .stat .v { font-size: 15px; margin: 0; gap: 8px; justify-content: flex-end; }
  .panel.proj:not(.max) .sub .stat .v .dd { font-size: 12.5px; padding: 0 9px; line-height: 1.4; }
  .panel.proj:not(.max) .sub .stat > .pmsg { flex-basis: 100%; text-align: right; font-size: 10.5px; margin: 0 !important; }
  /* barre « consommé / prévu » : titre, barre, message restent empilés mais serrés */
  .panel.proj:not(.max) .sub > .stat:has(.pbar), .panel.proj:not(.max) .sub > .stat:has(> .pmsg:only-of-type) { display: block; border-bottom: 0; padding: 4px 2px 2px; }
  .panel.proj:not(.max) .sub .pbar { height: 9px; margin: 4px 0 3px; }
  .panel.proj:not(.max) .sub .stat .pmsg { font-size: 10.5px; }
}

/* Liste des notes : texte et marges réduits pour que la date complète (jj/mm/aaaa) et le titre tiennent */
.panel.notes .tbl th { padding: 3px 8px; }
.panel.notes .tbl td { padding: 6px 8px; font-size: 13px; }
.panel.notes .tbl th:first-child, .panel.notes .tbl td:first-child { width: 94px; }
.panel.notes .col.list > header { padding: 0 10px; }
.panel.notes .col.list > header h2 { font-size: 11px; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel.max.notes .tbl td { font-size: 14px; }
.panel.max.notes .tbl th:first-child, .panel.max.notes .tbl td:first-child { width: 104px; }

/* Note ouverte, fenêtre peu haute (portable, affichage à 125 %) : en-tête, présents, outils et boutons resserrés pour laisser la place au texte */
@media (min-width: 1101px) and (max-height: 960px) {
  .panel.notes:not(.max) .editor .bar { padding: 6px 46px 6px 10px; gap: 6px; }
  .panel.notes:not(.max) .editor .bar select, .panel.notes:not(.max) .editor .bar input { font-size: 12.5px; padding: 4px 7px; }
  .panel.notes:not(.max) .editor .bar #nTitle { flex: 2 1 170px; min-width: 130px; font-size: 13.5px; }
  .panel.notes:not(.max) .editor .bar #nProj { flex: 1 1 130px; min-width: 110px; max-width: 300px; }
  .panel.notes:not(.max) .attbar { padding: 3px 10px; gap: 6px; flex-wrap: nowrap; align-items: flex-start; }
  .panel.notes:not(.max) .attbar .flabel { font-size: 11px; padding-top: 3px; flex: none; }
  .panel.notes:not(.max) .attbar .chips { flex: 1 1 auto; gap: 4px; min-height: 0; }
  .panel.notes:not(.max) .chip { font-size: 12px; padding: 1px 3px 1px 8px; gap: 2px; }
  .panel.notes:not(.max) .chip .x { width: 16px; height: 16px; font-size: 11px; }
  .panel.notes:not(.max) .chip.add { padding: 0 9px; font-size: 13px; }
  .panel.notes:not(.max) .editor .tools { padding: 2px 8px; gap: 1px; }
  .panel.notes:not(.max) .tools button { padding: 2px 5px; min-width: 24px; font-size: 12.5px; }
  .panel.notes:not(.max) .tools select { padding: 2px 4px; font-size: 11.5px; }
  .panel.notes:not(.max) .tools .stylegrp .st { height: 24px; padding: 0 7px; font-size: 12px; }
  .panel.notes:not(.max) .tools .sep { margin: 0 2px; height: 14px; }
  .panel.notes:not(.max) .tools .clr { width: 24px; height: 22px; }
  .panel.notes:not(.max) .editor .actions { padding: 6px 10px; gap: 6px; }
  .panel.notes:not(.max) .editor .actions .btn { padding: 5px 12px; font-size: 13px; }
  .panel.notes:not(.max) .editor .body { padding: 10px 14px; }
}

/* Bouton agrandir ⤢ : même position et même alignement dans toutes les zones. Chaque zone a une première ligne de hauteur --hh dont le bouton est centré. */
.panel { --hh: 44px; }
.panel.max { --hh: 52px; }
.maxbtn { top: calc((var(--hh) - 26px) / 2); right: 10px; }
.panel .editor .bar { padding: 6px 46px 6px 10px; }
.panel .editor .bar > select, .panel .editor .bar > input { height: calc(var(--hh) - 12px); box-sizing: border-box; }
.panel .preview .bar { padding: 6px 46px 6px 10px; min-height: var(--hh); box-sizing: border-box; }
.panel.proj .col > header { min-height: var(--hh); padding: 0 46px 0 14px; box-sizing: border-box; }
.panel .col.list > header { min-height: var(--hh); padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.panel.tasks .detail .form { padding-top: calc((var(--hh) - 16px) / 2); }

/* Boutons de style : « T1 » à « T4 » quand la fenêtre est réduite (portable, affichage à 125 %) */
.stylegrp .st .sh { display: none; }
@media (min-width: 1101px) and (max-height: 960px) {
  .panel.notes:not(.max) .stylegrp .st .lg { display: none; }
  .panel.notes:not(.max) .stylegrp .st .sh { display: inline; }
  .panel.notes:not(.max) .tools .stylegrp .st:not(.stp) { padding: 0 6px; }
}

/* Tâches, fenêtre peu haute (portable, affichage à 125 %) : liste et formulaire resserrés, comme pour les notes */
@media (min-width: 1101px) and (max-height: 960px) {
  .panel.tasks:not(.max) .col.list > header h2 { font-size: 11px; }
  .panel.tasks:not(.max) .col.list > header { padding-left: 12px; padding-right: 10px; }
  .panel.tasks:not(.max) .showdone { font-size: 10.5px; }
  .panel.tasks:not(.max) .tlist li { padding: 5px 6px; gap: 6px; grid-template-columns: 20px 1fr; }
  .panel.tasks:not(.max) .tlist .t { font-size: 13px; line-height: 1.25; }
  .panel.tasks:not(.max) .tlist .m { font-size: 10.5px; gap: 6px; }
  .panel.tasks:not(.max) .tlist input { width: 15px; height: 15px; }
  .panel.tasks:not(.max) .detail .form { gap: 5px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; }
  .panel.tasks:not(.max) .form label { font-size: 11px; gap: 2px; }
  .panel.tasks:not(.max) .form label input, .panel.tasks:not(.max) .form label select, .panel.tasks:not(.max) .form label textarea { font-size: 12.5px; padding: 4px 8px; }
  .panel.tasks:not(.max) .form .row { gap: 8px; }
  .panel.tasks:not(.max) .form textarea { min-height: 54px; height: 64px; }
  .panel.tasks:not(.max) .fgroup { gap: 3px; }
  .panel.tasks:not(.max) .flabel { font-size: 11px; }
  .panel.tasks:not(.max) .chips { gap: 4px; min-height: 0; }
  .panel.tasks:not(.max) .chip { font-size: 12px; padding: 1px 3px 1px 8px; gap: 2px; }
  .panel.tasks:not(.max) .chip .x { width: 16px; height: 16px; font-size: 11px; }
  .panel.tasks:not(.max) .chip.add { padding: 0 9px; font-size: 13px; }
  .panel.tasks:not(.max) .todo-state { font-size: 10.5px; }
  .panel.tasks:not(.max) .editor .actions { padding: 6px 10px; gap: 6px; }
  .panel.tasks:not(.max) .editor .actions .btn { padding: 5px 12px; font-size: 13px; }
  .panel.tasks:not(.max) .fab { width: 32px; height: 32px; font-size: 20px; right: 10px; bottom: 10px; }
}

/* Tâches, fenêtre peu haute : titre sur une ligne, date / priorité / responsable / projet sur une seule ligne d'infos */
@media (min-width: 1101px) and (max-height: 960px) {
  .panel.tasks:not(.max) .tlist .t { white-space: nowrap; }
  .panel.tasks:not(.max) .tlist .m { flex-wrap: nowrap; overflow: hidden; }
  .panel.tasks:not(.max) .tlist .m > span { flex: none; white-space: nowrap; }
  .panel.tasks:not(.max) .tlist .m > .pj { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ================= Diagramme de Gantt ================= */
.app { position: relative; }
/* languette sur le bord de la colonne de gauche */
.g-toggle { position: absolute; z-index: 60; left: calc(var(--side-w, 300px) - 12px); top: 50%; transform: translateY(-50%); width: 26px; height: 58px; padding: 0; border-radius: 10px; background: var(--side); border: 0; outline: 0; color: var(--accent); cursor: pointer; display: grid; place-items: center; box-shadow: none; transition: background .15s; }
.g-toggle:hover { background: #1c2740; }
.g-toggle:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.g-toggle svg { width: 13px; height: 13px; transition: transform .2s; }
.g-toggle[aria-pressed="true"] svg { transform: rotate(180deg); }
@media (max-width: 1100px) { .g-toggle, .gantt { display: none !important; } }

.gantt { position: absolute; inset: 12px; z-index: 50; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; user-select: none; opacity: 0; transform: translateX(-10px); transition: opacity .18s, transform .18s; }
.gantt.on { opacity: 1; transform: none; }
.gantt[hidden] { display: none; }
.g-top { position: absolute; top: 8px; left: 14px; right: 14px; height: 36px; display: flex; align-items: center; gap: 8px; }
.g-top h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.g-sub { color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.g-sp { flex: 1; }
.g-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.g-f input { font-size: 12.5px; padding: 4px 7px; border-radius: 8px; }
.g-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.g-seg button, .g-ic, .g-fit { background: var(--surface); border: 0; color: var(--ink); font-size: 12.5px; font-weight: 600; padding: 5px 10px; cursor: pointer; }
.g-seg button + button { border-left: 1px solid var(--line); }
.g-seg button:hover, .g-ic:hover, .g-fit:hover { background: var(--accent-soft); }
.g-ic { border: 1px solid var(--line); border-radius: 8px; width: 28px; padding: 3px 0; font-size: 16px; line-height: 1; }
.g-fit { border: 1px solid var(--line); border-radius: 8px; }

/* échelle de temps : bandeau aligné sur la ligne « Tous » de la liste des projets */
.g-head { position: absolute; left: 14px; right: 14px; background: var(--side); color: var(--side-ink); border-radius: 8px; overflow: hidden; }
.g-cell { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; overflow: hidden; border-left: 1px solid rgba(255, 255, 255, .14); box-sizing: border-box; }
.g-cell:first-child { border-left: 0; }
.g-cell.we { color: var(--side-mute); }
/* lignes des projets : alignées sur la liste de gauche */
.g-body { position: absolute; left: 14px; right: 14px; overflow: hidden; }
.g-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-we { position: absolute; top: 0; bottom: 0; background: rgba(19, 28, 43, .045); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: .8; z-index: 2; pointer-events: none; }
.g-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid rgba(19, 28, 43, .05); }
.g-row.rw.nodate { cursor: crosshair; }
.g-row.rw:hover { background: rgba(254, 156, 0, .07); }
.g-row.rw.nodate:hover::after { content: "Glisser pour définir la plage · double-clic : 7 jours · clic droit : évènement"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--ink-2); opacity: .8; pointer-events: none; white-space: nowrap; }
.g-row.arch { opacity: .55; }
.g-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(19, 28, 43, .22); display: flex; align-items: center; padding: 0 12px; overflow: hidden; z-index: 3; box-sizing: border-box; }
.g-row.rw .g-bar { cursor: grab; }
.g-bar.sub { background: var(--blue); color: #fff; }
.g-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-row.sel .g-bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.g-lbl { font-size: 11px; font-weight: 650; white-space: nowrap; pointer-events: none; }
.gh { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.gh.l { left: 0; } .gh.r { right: 0; }
.gh::after { content: ""; position: absolute; top: 28%; bottom: 28%; left: 3px; width: 2px; border-radius: 2px; background: rgba(19, 28, 43, .35); opacity: 0; transition: opacity .12s; }
.g-bar.sub .gh::after { background: rgba(255, 255, 255, .75); }
.g-bar:hover .gh::after { opacity: 1; }
.gx { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; font-size: 9px; line-height: 16px; cursor: pointer; background: rgba(19, 28, 43, .28); color: inherit; display: none; }
.gx:hover { background: rgba(19, 28, 43, .55); color: #fff; }
.g-bar:hover .gx { display: block; }
.g-tip { position: absolute; z-index: 10; background: #111a29; color: #fff; padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.g-tip[hidden] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-we { background: rgba(255, 255, 255, .04); } :root:not([data-theme="light"]) .g-row { border-bottom-color: rgba(255, 255, 255, .06); } }

/* Plage automatique d'un projet parent (englobe ses sous-projets) : hachures */
.g-bar.auto { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .3) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1.5px rgba(19, 28, 43, .35), 0 1px 3px rgba(19, 28, 43, .18); }
.g-bar.sub.auto { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45), 0 1px 3px rgba(19, 28, 43, .18); }

/* Échelle de temps à plusieurs bandeaux : année / mois / semaine / jour */
.g-tier { position: absolute; left: 0; right: 0; }
.g-tier + .g-tier { border-top: 1px solid rgba(255, 255, 255, .13); }
.g-tier:not(.bot) .g-cell { font-size: 10.5px; }
.g-tier.t-year .g-cell { color: var(--accent); font-weight: 750; letter-spacing: .04em; }
.g-tier.t-month .g-cell { font-weight: 650; }
.g-tier.t-week .g-cell { font-weight: 600; color: var(--side-ink); }
.g-tier.t-week:not(.bot) .g-cell { color: var(--side-mute); }
.g-tier.t-day .g-cell { font-weight: 600; font-size: 11px; }
.g-tier.t-day .g-cell.we { color: var(--side-mute); font-weight: 500; }
.g-line.l1 { background: color-mix(in srgb, var(--line) 55%, var(--ink-2) 45%); }
.g-line.l2 { background: color-mix(in srgb, var(--line) 25%, var(--ink-2) 75%); width: 1.5px; }

/* Échelle de temps : camaïeu de bleus, du plus sombre (année) au plus clair (jours) */
.g-tier.t-year { background: #0d1522; }
.g-tier.t-month { background: #132038; }
.g-tier.t-week { background: #1a2d50; }
.g-tier.t-day { background: #234078; }
.g-tier.t-day .g-cell.we { background: rgba(8, 14, 28, .3); }
.g-tier.t-week:not(.bot) .g-cell { color: #a9b7d6; }
.g-tier.t-week.bot .g-cell { color: #dbe4f7; }
.g-tier.t-month .g-cell { color: #f2f5fb; }
.g-tier + .g-tier { border-top-color: rgba(255, 255, 255, .1); }
.g-cell { border-left-color: rgba(255, 255, 255, .12); }

/* Période en cours (la plus basse de l'échelle) : orange de la charte */
.g-tier.bot .g-cell.now, .g-tier.bot .g-cell.we.now { background: var(--accent); color: var(--accent-ink); font-weight: 800; border-left-color: transparent; }

/* Période en cours dans les bandeaux du dessus (année, mois, semaine) : soulignement orange */
.g-tier:not(.bot) .g-cell.now { box-shadow: inset 0 -2px 0 var(--accent); color: #fff; }
.g-tier.t-year:not(.bot) .g-cell.now { color: var(--accent); }

/* Évènements des projets : losange coloré par type, avec son titre */
.g-ev { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; z-index: 5; cursor: pointer; }
.g-ev::before { content: ""; position: absolute; inset: 2px; transform: rotate(45deg); background: var(--c, var(--accent)); border: 2px solid #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(19, 28, 43, .4); transition: transform .12s; }
.g-ev:hover::before { transform: rotate(45deg) scale(1.18); }
.g-ev .gl { position: absolute; left: 21px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-weight: 750; color: var(--ink); background: rgba(255, 255, 255, .88); padding: 0 5px; border-radius: 5px; line-height: 16px; white-space: nowrap; pointer-events: none; box-shadow: 0 0 0 1px rgba(19, 28, 43, .08); }
.g-add { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.g-add:hover { background: var(--accent); filter: brightness(1.07); }

/* ================= Table des matières de la note (haut de la colonne de gauche des notes) ================= */
.toc-btn { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; padding: 0; color: var(--ink-2); border-color: var(--line); }
.toc-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.toc { flex: none; max-height: 46%; overflow-y: auto; border-bottom: 1px solid var(--line); background: var(--surface); padding: 2px 4px 6px; }
.toc[hidden] { display: none; }
.toc-t { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 6px 8px 3px; }
.toc-e { font-size: 12px; color: var(--ink-2); padding: 4px 8px 6px; line-height: 1.35; }
.toc-i { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 3px 8px; cursor: pointer; font: inherit; font-size: 12.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.toc-i:hover { background: var(--accent-soft); }
.toc-i.cur { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.toc-i .n { margin-right: 6px; font-weight: 600; opacity: .8; }
.toc-i.l1 { font-weight: 650; color: #d98200; }
.toc-i.l2 { padding-left: 18px; color: #2b3445; font-weight: 600; }
.toc-i.l3 { padding-left: 28px; color: #7a8494; font-weight: 600; }
.toc-i.l4 { padding-left: 38px; color: #1b5e8a; font-weight: 600; font-size: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toc-i.l2 { color: #d5dbe6; } :root:not([data-theme="light"]) .toc-i.l4 { color: #6fb3dd; } }
.ProseMirror .toc-flash { animation: tocFlash 1.4s ease-out; }
@keyframes tocFlash { 0% { background: rgba(254, 156, 0, .35); } 100% { background: transparent; } }

/* Séparateur daté des notes : trait gris clair et date du jour en petit, en gris */
.ProseMirror .daterule { display: flex; align-items: center; gap: 10px; margin: .25em 0; color: #a3a9b4; line-height: 1.2; font-size: .82em; font-weight: 500; letter-spacing: .01em; user-select: none; cursor: default; }
.ProseMirror .daterule::before { content: ""; flex: 0 0 14%; height: 2px; border-radius: 2px; background: #e3e6eb; }
.ProseMirror .daterule::after { content: ""; flex: 1 1 auto; height: 2px; border-radius: 2px; background: #e3e6eb; }
.ProseMirror .daterule span { flex: none; }
.ProseMirror .daterule.ProseMirror-selectednode { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ProseMirror .daterule::before, :root:not([data-theme="light"]) .ProseMirror .daterule::after { background: #3a4458; } }

/* Date du séparateur : modifiable d'un clic (calendrier) */
.ProseMirror .daterule .drl { position: relative; flex: none; cursor: pointer; padding: 0 4px; margin: 0 -4px; border-radius: 4px; transition: background .12s, color .12s; }
.ProseMirror .daterule .drl:hover { color: #6e7686; background: rgba(19, 28, 43, .06); }
.ProseMirror .daterule .drl input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* État d'un évènement : petite pastille en bas à droite du losange (à planifier / proposé / validé), losange estompé une fois passé */
.g-ev .gs { position: absolute; right: -7px; bottom: -7px; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #fff; box-sizing: border-box; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(19, 28, 43, .35); z-index: 2; pointer-events: none; }
.g-ev .gs svg { width: 10px; height: 10px; display: block; }
.g-ev.st-a_planifier .gs { background: #6b7a99; }
.g-ev.st-propose .gs { background: #e08a00; }
.g-ev.st-valide .gs { background: #1a9a6b; }
.g-ev.st-passe { opacity: .8; filter: grayscale(.3); }
.g-ev.st-passe:hover { opacity: 1; filter: none; }

/* Projet sélectionné : fond orange léger sur sa ligne du Gantt ; losanges et icônes d'état proportionnels à la hauteur de la ligne */
.g-row.sel { background: rgba(254, 156, 0, .08); }
.g-ev { width: var(--s, 24px); height: var(--s, 24px); margin: calc(var(--s, 24px) / -2) 0 0 calc(var(--s, 24px) / -2); }
.g-ev::before { inset: calc(var(--s, 24px) * .14); border-width: max(2px, calc(var(--s, 24px) * .08)); border-radius: calc(var(--s, 24px) * .14); }
.g-ev .gs { width: calc(var(--s, 24px) * .52); height: calc(var(--s, 24px) * .52); right: calc(var(--s, 24px) * -.2); bottom: calc(var(--s, 24px) * -.2); border-width: max(1.5px, calc(var(--s, 24px) * .06)); }
.g-ev .gs svg { width: 66%; height: 66%; }
.g-ev .gl { left: calc(var(--s, 24px) * .98); font-size: clamp(10.5px, calc(var(--s, 24px) * .42), 14px); line-height: calc(var(--s, 24px) * .7); padding: 0 calc(var(--s, 24px) * .22); }

.g-head { z-index: 4; }

/* Poignées de l'échelle de temps : changer le début / la fin de la période à la souris */
.g-hdl { position: absolute; top: 0; bottom: 0; width: 13px; z-index: 6; cursor: col-resize; touch-action: none; display: grid; place-items: center; transition: background .12s; }
.g-hdl.l { left: 0; border-radius: 8px 0 0 8px; }
.g-hdl.r { right: 0; border-radius: 0 8px 8px 0; }
.g-hdl::after { content: ""; width: 3px; height: min(70%, 34px); border-radius: 3px; background: rgba(255, 255, 255, .42); transition: background .12s, height .12s; }
.g-hdl:hover { background: rgba(255, 255, 255, .1); }
.g-hdl:hover::after { background: var(--accent); height: min(86%, 40px); }

/* Jours fériés (Alsace-Moselle) : gris, dans l'échelle (jours) et en colonne dans le tableau */
.g-ho { position: absolute; top: 0; bottom: 0; background: rgba(125, 135, 156, .24); pointer-events: none; }
.g-tier.t-day .g-cell.ho { background: #7d879c; color: #fff; font-weight: 700; }
.g-tier.t-day .g-cell.ho.now { background: var(--accent); color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-ho { background: rgba(160, 172, 196, .16); } }

/* Survol d'une ligne du Gantt : le projet de la liste de gauche s'éclaire aussi (et inversement) */
.plist li.ghov:not(.sel) { background: rgba(254, 156, 0, .24); }
.g-row.hv { background: rgba(254, 156, 0, .07); }

/* Synchronisation ikatime : simple icône à côté des paramètres */
#btnSync svg { display: block; }
#btnSync.spin svg { animation: syncspin 1s linear infinite; }
@keyframes syncspin { to { transform: rotate(360deg); } }

/* Ligne des liens : Trello / SharePoint à gauche, synchronisation ikatime à droite */
.linkrow { display: flex; align-items: center; justify-content: space-between; flex: none; }
.linkrow .sidelinks { flex: 0 1 auto; }

/* Résumé des évènements à venir (à planifier / proposés) : 3 lignes visibles, au-delà une barre de défilement */
.side .upcoming { flex: none; }
.side .upcoming #upcomingBox { max-height: 78px; overflow-y: auto; }
.ulist { list-style: none; margin: 0; padding: 0; }
.ulist li { display: flex; align-items: center; gap: 6px; height: 26px; font-size: 13px; white-space: nowrap; overflow: hidden; cursor: pointer; border-radius: 6px; }
.ulist li:hover { background: rgba(255, 255, 255, .07); }
.ulist .ud { flex: none; width: 9px; height: 9px; background: var(--c); transform: rotate(45deg); border-radius: 2px; margin: 0 2px; }
.ulist b { font-weight: 650; flex: none; }
.ulist .ut { flex: none; color: var(--accent); font-size: 12px; }
.ulist .up { color: var(--side-mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ulist .gs { flex: none; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; }
.ulist .gs svg { width: 9px; height: 9px; }
.ulist .gs.st-a_planifier { background: #6b7a99; }
.ulist .gs.st-propose { background: #e08a00; }
@media (min-width: 1101px) and (max-height: 960px) { .side .upcoming #upcomingBox { max-height: 66px; } .ulist li { height: 22px; } }

/* Cartes réductibles (Contacts, Évènements à venir) : chevron à droite de l'en-tête ; réduite = seul l'en-tête reste */
.side .card header .fold { background: none; border: 0; padding: 2px 4px; margin-left: auto; cursor: pointer; color: var(--side-mute); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.side .card header .fold:hover { color: var(--side-ink); background: rgba(255, 255, 255, .08); }
.side .card header .fold::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .15s; }
.side .card.folded header .fold::before { transform: rotate(-45deg); }
.side .card.folded > :not(header) { display: none; }
.side .card.folded header { margin-bottom: 0; }
.ucount { font-weight: 600; color: var(--accent); margin-left: 4px; }

/* Résumé des évènements quand le Gantt est ouvert : carte en bas à gauche du diagramme */
.gantt > .upcoming { position: absolute; left: 14px; bottom: 14px; width: min(460px, calc(100% - 28px)); z-index: 5; box-sizing: border-box; background: var(--side-2); color: var(--side-ink); border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 4px 16px rgba(19, 28, 43, .25); user-select: none; }
.gantt > .upcoming[hidden] { display: none; }
.gantt > .upcoming header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gantt > .upcoming h2 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-mute); }
.gantt > .upcoming #upcomingBox { max-height: 78px; overflow-y: auto; }
.gantt > .upcoming header .fold { background: none; border: 0; padding: 2px 4px; margin-left: auto; cursor: pointer; color: var(--side-mute); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.gantt > .upcoming header .fold:hover { color: var(--side-ink); background: rgba(255, 255, 255, .08); }
.gantt > .upcoming header .fold::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .15s; }
.gantt > .upcoming.folded header .fold::before { transform: rotate(-45deg); }
.gantt > .upcoming.folded > :not(header) { display: none; }
.gantt > .upcoming.folded header { margin-bottom: 0; }

/* ---------- Étapes d'un projet (analyse / développement / recette) ---------- */
.plist li { position: relative; }
.plist li.step { font-size: 12px; padding-top: 2px; padding-bottom: 2px; color: var(--side-mute); }
.plist li.step .nm { flex: none; max-width: 60%; color: var(--side-ink); }
.plist li.step .sd { margin-left: auto; font-size: 11px; opacity: .8; white-space: nowrap; }
.plist li.step.nodates .sd { font-style: italic; opacity: .55; }
.sdot { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--c, #8d99ae); }
.plist li .addstep { position: absolute; right: 22px; bottom: -10px; width: 20px; height: 20px; padding: 0; margin: 0; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--accent); background: var(--side); color: var(--accent); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 4; }
.plist li .addstep svg { display: block; }
.plist li.nearb .addstep { opacity: 1; pointer-events: auto; }
.plist li .addstep:hover { transform: scale(1.12); }
.stepmenu { position: fixed; z-index: 400; min-width: 180px; background: var(--side-2, #1c2739); color: var(--side-ink, #e8ecf3); border: 1px solid #3a4a66; border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.stepmenu .smh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--side-mute, #8d99ae); padding: 4px 8px 6px; }
.stepmenu button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: inherit; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.stepmenu button:hover { background: rgba(255, 255, 255, .1); }
.g-row.step .g-bar { top: 3px; bottom: 3px; padding: 0 8px; }
.g-row.step .g-lbl { font-size: 10.5px; line-height: 1; }
.g-bar.step { background: var(--kc, #8d99ae); }
.stepmenu .smsep { height: 1px; background: #3a4a66; margin: 4px 0; }
.stepmenu .smmanage { color: var(--side-mute, #8d99ae); font-size: 12px; }
.krow { display: grid; grid-template-columns: 38px 1fr 28px; gap: 8px; align-items: center; margin-bottom: 6px; }
.krow input[type=color] { width: 38px; height: 30px; padding: 2px; border-radius: 6px; cursor: pointer; }
/* « + » des étapes : 50 % transparent tant qu'on ne le survole pas */
.plist li.nearb .addstep { opacity: .5; }
.plist li.nearb .addstep:hover, .plist li .addstep:focus-visible { opacity: 1; }

/* Repère « ce projet a des étapes » : petits carrés aux couleurs des natures, à droite du nom */
.plist li .stepdots { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.plist li .stepdots i { width: 6px; height: 6px; border-radius: 1.5px; background: var(--c, #8d99ae); box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }
.plist li .stepdots b { font-size: 10px; line-height: 1; opacity: .8; }

/* Table des matières : initiales des personnes en ligne, dans un cercle à leur couleur, sur le titre où se trouve leur curseur */
.toc-i { position: relative; }
.toc-i.hasp { padding-right: 52px; }
.toc-p { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; }
.toc-p i { box-sizing: border-box; width: 20px; height: 20px; margin-left: -5px; border-radius: 50%; background: var(--c); color: #fff; font-family: inherit; font-size: 9px; font-weight: 700; line-height: 1; font-style: normal; letter-spacing: 0; text-transform: none; overflow: hidden; display: grid; place-items: center; border: 2px solid var(--surface, #fff); }

/* Mentions « @ » dans les notes */
.ProseMirror .mention { display: inline-block; padding: 0 7px; margin: 0 1px; border-radius: 10px; font-weight: 600; font-size: .94em; line-height: 1.5; white-space: nowrap; background: #fdecc8; color: #a85f00; cursor: default; }
.ProseMirror .mention[data-mention="contact"] { background: #dbe9f7; color: #1b5e8a; }
.ProseMirror .mention.ProseMirror-selectednode { outline: 2px solid var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ProseMirror .mention { background: #4a3510; color: #ffc766; } :root:not([data-theme="light"]) .ProseMirror .mention[data-mention="contact"] { background: #17344d; color: #8fc6ec; } }
.mentionbox { position: fixed; z-index: 500; width: 290px; max-height: 280px; overflow-y: auto; background: var(--surface, #fff); color: var(--ink, #1b2434); border: 1px solid var(--line, #d7dce5); border-radius: 10px; box-shadow: 0 8px 26px rgba(19, 28, 43, .28); padding: 4px; }
.mentionbox .mb-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2, #6b7587); padding: 4px 8px; }
.mentionbox .mb-i { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 5px 8px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; color: inherit; }
.mentionbox .mb-i.on, .mentionbox .mb-i:hover { background: var(--accent-soft, #fdecc8); }
.mentionbox .mb-av { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: #d98200; }
.mentionbox .mb-av.contact { background: #2e86ab; }
.mentionbox .mb-n { flex: none; font-weight: 600; }
.mentionbox .mb-s { color: var(--ink-2, #6b7587); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Personnes en ligne : un clic mène à leur curseur */
.pdot[data-uid], .toc-p i[data-uid] { cursor: pointer; }
.pdot[data-uid]:hover { text-decoration: underline; }

/* Tâches : clients concernés */
.chip.fixed { background: var(--accent-soft, #fdecc8); border-color: transparent; font-weight: 600; cursor: default; }
#taskList .m .oc { color: #1b5e8a; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* Types d'évènements : bloc (ligne + documents nécessaires) */
.kblock { margin-bottom: 10px; }
.kblock .krow { margin-bottom: 4px; }
.kblock .kdocs { width: 100%; box-sizing: border-box; font: inherit; font-size: 12.5px; line-height: 1.4; resize: vertical; padding: 6px 8px; border-radius: 8px; }
/* Documents d'un évènement */
.evdocs { border-top: 1px solid var(--line, #d7dce5); padding-top: 8px; display: grid; gap: 4px; }
.evd-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2, #6b7587); }
.evd-sub { font-size: 11.5px; font-weight: 700; color: var(--ink-2, #6b7587); margin-top: 6px; }
.evd-row { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.evd-st { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent-soft, #fdecc8); color: #a85f00; }
.evd-st.ok { background: #d8f0e4; color: #1a7a54; }
.evd-l { flex: none; font-weight: 600; min-width: 130px; }
.evd-f { color: var(--link, #0b5cad); cursor: pointer; text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.evd-x { flex: none; background: none; border: 0; cursor: pointer; color: var(--ink-2, #6b7587); padding: 0 4px; }
.evd-x:hover { color: #c0392b; }
.evd-find { padding: 3px 10px; font-size: 12.5px; }
.evd-s { background: var(--accent-soft, #fdf4e0); border-radius: 10px; padding: 8px; display: grid; gap: 6px; margin-top: 4px; }
.evd-t { font-size: 12px; font-weight: 700; }
.evd-r { max-height: 190px; overflow-y: auto; display: grid; gap: 2px; }
.evd-hit { display: grid; text-align: left; background: var(--surface, #fff); border: 1px solid var(--line, #d7dce5); border-radius: 8px; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 12.5px; color: inherit; }
.evd-hit:hover { border-color: var(--accent); }
.evd-hit span { font-size: 11px; color: var(--ink-2, #6b7587); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ulist .ud-d { flex: none; font-size: 11px; color: #e0a040; }
.ulist .ud-d.ok { color: #5cc49a; }

/* Fenêtre de choix d'un document SharePoint (arborescence + recherche) */
dialog.docpick { width: min(1120px, 96vw); height: min(680px, 88vh); padding: 0; display: none; flex-direction: column; overflow: hidden; }
dialog.docpick[open] { display: flex; }
.docpick .dp-h { padding-bottom: 4px; }
.docpick .dp-hint { padding: 2px 18px 0; font-size: 12.5px; color: var(--ink-2, #6b7587); }
.docpick .dp-s { padding: 10px 18px 6px; }
.docpick .dp-s input { width: 100%; box-sizing: border-box; }
.docpick .dp-b { flex: 1; min-height: 0; display: flex; gap: 10px; margin: 0 12px; }
.docpick .dp-l { flex: 0 0 40%; min-width: 0; overflow: auto; border: 1px solid var(--line, #d7dce5); border-radius: 10px; }
.docpick .dp-p { flex: 1; min-width: 0; border: 1px solid var(--line, #d7dce5); border-radius: 10px; overflow: auto; display: flex; background: var(--surface, #fff); }
.docpick .dp-p iframe { flex: 1; border: 0; width: 100%; height: 100%; }
.docpick .dp-p img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.docpick .dp-p pre { margin: 0; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; width: 100%; box-sizing: border-box; }
.docpick .dp-p .empty { margin: auto; padding: 16px; text-align: center; color: var(--ink-2, #6b7587); }
@media (max-width: 820px) { .docpick .dp-p { display: none; } .docpick .dp-l { flex-basis: 100%; } }
.docpick .dp-tree { padding: 6px; }
.docpick .dp-res { padding: 6px; display: grid; gap: 2px; align-content: start; }
.docpick .dp-hit { display: grid; text-align: left; background: none; border: 0; border-radius: 8px; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.docpick .dp-hit:hover { background: var(--accent-soft, #fdecc8); }
.docpick .dp-hit.sel { background: var(--accent-soft, #fdecc8); box-shadow: inset 3px 0 var(--accent); }
.docpick .dp-hit span { font-size: 11.5px; color: var(--ink-2, #6b7587); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docpick .dp-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; }
.docpick .dp-f .sp { flex: 1; }
.docpick .dp-sel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; min-width: 0; }

/* ---------- Fiche d'un évènement : plein espace, évènement à gauche, notes à droite ---------- */
.evsheet { position: absolute; inset: 12px; z-index: 60; background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 40px rgba(10, 20, 40, .35); display: flex; flex-direction: column; overflow: hidden; }
.evsheet .evs-h { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line, #d7dce5); }
.evsheet .evs-h h3 { margin: 0; padding: 0; font-size: 16px; }
.evsheet .evs-sub { color: var(--ink-2, #6b7587); font-size: 13px; font-weight: 600; }
.evsheet .sp { flex: 1; }
.evsheet .evs-b { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 14px 18px; }
.evsheet .evs-form { flex: 0 0 clamp(330px, 30%, 440px); min-width: 0; overflow-y: auto; display: grid; gap: 10px; align-content: start; padding-right: 6px; }
.evsheet .evs-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.evsheet .evs-form label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2, #6b7587); }
.evsheet .evs-form input, .evsheet .evs-form select { width: 100%; box-sizing: border-box; }
.evsheet .evs-notes { flex: 1; min-width: 0; min-height: 0; display: flex; }
.evsheet .evs-notes > .panel.notes { flex: 1; height: 100%; box-shadow: none; border: 1px solid var(--line, #d7dce5); min-width: 0; grid-template-columns: min(var(--nwm, 300px), 40%) 1fr; }
.evsheet .evs-notes .maxbtn { display: none; }
.evsheet .evs-nonotes { margin: auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.evsheet .evs-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line, #d7dce5); }
.panel.evx { font-size: 16px; }
.panel.evx .col > header h2 { font-size: 13px; }
.panel.evx .tbl th { font-size: 12.5px; }
.panel.evx .form label, .panel.evx .flabel { font-size: 13px; }
.panel.evx .chip, .panel.evx .attbar select, .panel.evx .tools select { font-size: 14px; }
.panel.evx .tools button { font-size: 15px; }
.panel.evx .sstatus, .panel.evx .pres { font-size: 13px; }
.panel.evx .editor .body, .panel.evx .ProseMirror { font-size: 16px; line-height: 1.6; }
.panel.evx #evsLink { margin-left: auto; }
.tag.ev { background: #dbe9f7; color: #1b5e8a; border-color: transparent; margin-right: 4px; }
@media (max-width: 1000px) { .evsheet .evs-b { flex-direction: column; } .evsheet .evs-form { flex: none; max-height: 45%; } }
/* Fiche d'évènement : colonne de gauche étroite (champs empilés sur toute la hauteur), place aux notes */
.evsheet .evs-form { flex: 0 0 clamp(210px, 17%, 250px); }
.evsheet .evs-form .row { grid-template-columns: 1fr; }
.evsheet .evd-row { flex-wrap: wrap; row-gap: 2px; }
.evsheet .evd-l { min-width: 0; flex: 1 1 calc(100% - 30px); }
.evsheet .evd-row > .evd-f, .evsheet .evd-row > .evd-find { margin-left: 28px; }
.evsheet .evd-row > .evd-f { max-width: calc(100% - 64px); }
.evsheet .evd-row > .evd-st + .evd-f, .evsheet .evd-row > .evd-st + .evd-x { margin-left: 0; }
.evsheet .evs-notes > .panel.notes { grid-template-columns: min(var(--nwm, 300px), 32%) 1fr; }
.evsheet .evs-form { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.evsheet .evs-form .row { grid-template-columns: minmax(0, 1fr); }
.evsheet .evs-form label, .evsheet .evs-form input, .evsheet .evs-form select { min-width: 0; max-width: 100%; }
.evsheet .evdocs { min-width: 0; }
.evsheet .evdocs { grid-template-columns: minmax(0, 1fr); }
.evsheet .evdocs > *, .evsheet #evdList { min-width: 0; }
.evsheet .evd-f { min-width: 0; flex: 0 1 auto; }
/* Fiche d'évènement : colonne de gauche condensée (champs serrés, un document par ligne) */
.evsheet .evs-form { gap: 5px; }
.evsheet .evs-form label { gap: 2px; font-size: 11.5px; }
.evsheet .evs-form input, .evsheet .evs-form select { padding: 3px 7px; height: 28px; font-size: 13px; }
.evsheet .evs-form .row { gap: 5px; }
.evsheet .evdocs { padding-top: 5px; gap: 1px; }
.evsheet .evd-h { font-size: 11px; }
.evsheet .evd-sub { margin-top: 3px; font-size: 11px; }
.evsheet .evd-row { min-height: 24px; row-gap: 0; gap: 6px; }
.evsheet .evd-l { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; min-width: 0; }
.evsheet .evd-st { width: 17px; height: 17px; font-size: 10px; }
.evsheet .evd-find { padding: 1px 8px; font-size: 12px; height: 24px; }
.evsheet .evd-ico { padding: 1px 6px; flex: none; }
/* un document attaché : le nom du fichier passe sous le titre, sur toute la largeur */
.evsheet .evd-row:has(> .evd-f) { flex-wrap: wrap; }
.evsheet .evd-row:has(> .evd-f) > .evd-l { flex: 1 1 calc(100% - 26px); }
.evsheet .evd-row > .evd-f { margin-left: 23px; font-size: 12px; max-width: calc(100% - 52px); }
.evsheet .evd-row > .evd-st + .evd-f, .evsheet .evd-row > .evd-st + .evd-x { margin-left: 0; }
.evsheet .evd-row > .evd-find:not(.evd-ico) { margin-left: 0; }
.evsheet .evd-none { font-size: 12px; }

/* Types d'évènements : poignée de réorganisation */
.kblock .krow { grid-template-columns: 22px 38px 1fr 28px; }
.kblock.dragging { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.kblock .kgrip { cursor: grab; color: var(--ink-2); text-align: center; font-size: 17px; line-height: 1; user-select: none; touch-action: none; border-radius: 6px; padding: 6px 0; }
.kblock .kgrip:hover { background: var(--line); color: var(--ink); }
.kblock.dragging .kgrip { cursor: grabbing; }

/* Liste déroulante du type d'évènement : losange de la couleur du type */
.evsheet .tsel { position: relative; }
.evsheet .tsel-b { width: 100%; height: 28px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 3px 7px; font: inherit; font-size: 13px; text-align: left; color: inherit; background: var(--surface, #fff); border: 1px solid var(--line, #d7dce5); border-radius: 8px; cursor: pointer; }
.evsheet .tsel-b:focus-visible, .evsheet .tsel-b[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 0; }
.evsheet .tsel-b span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evsheet .tsel-c { flex: none; font-size: 11px; color: var(--ink-2, #6b7587); }
.evsheet .tsel-l { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: var(--surface, #fff); border: 1px solid var(--line, #d7dce5); border-radius: 8px; box-shadow: 0 8px 24px rgba(19, 28, 43, .22); padding: 3px; }
.evsheet .tsel-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 13px; color: inherit; text-align: left; cursor: pointer; }
.evsheet .tsel-i:hover { background: var(--accent-soft, #fdecc8); }
.evsheet .tsel-i.on { font-weight: 700; background: var(--accent-soft, #fdecc8); }
.evsheet .tsel-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdia { flex: none; width: 9px; height: 9px; margin: 0 2px; background: var(--c, #8d99ae); transform: rotate(45deg); border-radius: 2px; }

/* Heures de début / fin de l'évènement : sur une même ligne, sous la date */
.evsheet .evs-form .row.tm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.evsheet .evs-form input[type=time] { padding-right: 2px; }

/* Métiers : lignes réorganisables */
.krow.trow { grid-template-columns: 22px 1fr 28px; }
.krow.trow.dragging { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.krow.trow .kgrip { cursor: grab; color: var(--ink-2); text-align: center; font-size: 17px; line-height: 1; user-select: none; touch-action: none; border-radius: 6px; padding: 6px 0; }
.krow.trow .kgrip:hover { background: var(--line); color: var(--ink); }
.krow.trow.dragging .kgrip { cursor: grabbing; }

/* Participants d'un évènement */
.evsheet .evatt { display: grid; gap: 3px; min-width: 0; }
.evsheet .evatt .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.evsheet .evatt .chip { font-size: 12px; padding: 2px 8px; max-width: 100%; }

/* Note d'un évènement : récupération des participants */
.attbar .chip.evfrom { white-space: nowrap; }

/* Évènements qui se recouvrent : un losange « empilé » avec le nombre d'évènements ; un clic ouvre la liste */
.g-ev.grp::after { content: ""; position: absolute; inset: calc(var(--s, 24px) * .14); transform: rotate(45deg) translate(calc(var(--s, 24px) * .16), calc(var(--s, 24px) * -.16)); background: var(--c2, var(--accent)); border: max(2px, calc(var(--s, 24px) * .08)) solid #fff; border-radius: calc(var(--s, 24px) * .14); z-index: -1; }
.g-ev .gn { position: absolute; right: calc(var(--s, 24px) * -.2); bottom: calc(var(--s, 24px) * -.2); min-width: calc(var(--s, 24px) * .52); height: calc(var(--s, 24px) * .52); padding: 0 3px; box-sizing: border-box; border-radius: 99px; background: #131c2b; color: #fff; border: 1.5px solid #fff; font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1; font-style: normal; letter-spacing: 0; display: grid; place-items: center; overflow: hidden; z-index: 2; pointer-events: none; }
.evgrp { position: fixed; z-index: 450; min-width: 250px; max-width: 360px; background: var(--surface, #fff); color: var(--ink, #1b2434); border: 1px solid var(--line, #d7dce5); border-radius: 12px; box-shadow: 0 10px 30px rgba(19, 28, 43, .3); padding: 5px; display: grid; gap: 2px; }
.evgrp .eg-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2, #6b7587); padding: 5px 9px; }
.evgrp .eg-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 2px 8px; text-align: left; padding: 6px 9px; background: none; border: 0; border-radius: 8px; font: inherit; font-size: 13px; color: inherit; width: 100%; box-sizing: border-box; }
.evgrp button.eg-row { cursor: pointer; }
.evgrp button.eg-row:hover { background: var(--accent-soft, #fdecc8); }
.evgrp .eg-t { color: var(--ink-2, #6b7587); font-size: 12px; }
.evgrp .eg-s { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #e8ebf2; color: #4a5468; }
.evgrp .eg-s.st-propose { background: #fdecc8; color: #a85f00; }
.evgrp .eg-s.st-valide { background: #d8f0e4; color: #1a7a54; }
.evgrp small { grid-column: 2 / -1; color: var(--ink-2, #6b7587); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Création d'un évènement Outlook */
.evsheet .evs-ol { font-size: 13px; padding: 4px 12px; }
.olmenu { position: fixed; z-index: 480; width: 320px; background: var(--surface, #fff); color: var(--ink, #1b2434); border: 1px solid var(--line, #d7dce5); border-radius: 12px; box-shadow: 0 10px 30px rgba(19, 28, 43, .3); padding: 5px; display: grid; gap: 2px; }
.olmenu .ol-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2, #6b7587); padding: 5px 9px; }
.olmenu button { display: grid; gap: 1px; text-align: left; padding: 7px 10px; background: none; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: inherit; }
.olmenu button:hover { background: var(--accent-soft, #fdecc8); }
.olmenu small { font-weight: 400; font-size: 11.5px; color: var(--ink-2, #6b7587); }

.evgrp small.eg-p { font-weight: 700; color: var(--ink, #1b2434); }
.evgrp small.eg-w { color: var(--ink, #1b2434); white-space: normal; }
.evgrp small.eg-m { font-size: 11.5px; }
.evgrp .eg-row + .eg-row { border-top: 1px solid var(--line, #e6e9f0); border-radius: 0; }
.evgrp small { white-space: normal; overflow: visible; }
.evgrp.evtip { pointer-events: none; z-index: 470; max-width: 380px; }

/* Fenêtres : titre et boutons (Supprimer / Annuler / Enregistrer) restent en place, seule la zone des champs défile */
#dlg[open] { display: flex; flex-direction: column; max-height: min(92vh, 1000px); overflow: hidden; }
#dlg #dlgForm { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
#dlg #dlgForm > h3, #dlg #dlgForm > .actions { flex: none; }
#dlg #dlgForm > .form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.olmenu .ol-main { background: var(--accent-soft, #fdecc8); }
.olmenu .ol-sep { height: 1px; background: var(--line, #e6e9f0); margin: 3px 4px; }

/* Liste des notes : titre sur une ligne (deux au plus), puis date et pastilles */
#noteTable thead { display: none; }
#noteTable td.nt-c { width: auto; white-space: normal; padding: 6px 10px; }
#noteTable .nt-t { font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
#noteTable .nt-m { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .86em; color: var(--ink-2, #6b7587); }
#noteTable .nt-m .tag { margin: 0; }
/* Liste des notes : titre sur une seule ligne, « … » s'il est trop long */
#noteTable .nt-t { display: block; -webkit-line-clamp: unset; -webkit-box-orient: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }

/* Boutons-icônes de la note (dupliquer, brouillon Outlook) */
.editor .actions .icon-btn { padding: 5px 9px; display: inline-grid; place-items: center; }
.editor .actions .icon-btn svg { display: block; }

/* Paramètres : signature des mails */
.plocal textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; resize: vertical; margin-top: 4px; }

/* Paramètres : signature HTML des mails */
.sigbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2, #6b7587); margin: 4px 0; }
.sigedit { min-height: 90px; max-height: 240px; overflow: auto; border: 1px solid var(--line, #d7dce5); border-radius: 8px; padding: 8px 10px; background: #fff; color: #1b2434; font-size: 13px; line-height: 1.4; }
.sigedit:empty::before { content: attr(data-ph); color: #9aa1ad; }
.sigedit img { max-width: 100%; height: auto; }
.sigsrc { width: 100%; box-sizing: border-box; font: 12px/1.4 Consolas, "Courier New", monospace; padding: 8px; border-radius: 8px; resize: vertical; }

/* Dépôt d'un rendez-vous Outlook (.ics) */
.dropveil { position: fixed; inset: 0; z-index: 900; background: rgba(19, 28, 43, .55); display: grid; place-items: center; pointer-events: none; }
.dropveil[hidden] { display: none; }
.dropveil > div { background: var(--surface, #fff); color: var(--ink, #1b2434); border: 3px dashed var(--accent); border-radius: 18px; padding: 34px 54px; display: grid; gap: 6px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dropveil b { font-size: 20px; }
.dropveil span { color: var(--ink-2, #6b7587); }

/* Écran de connexion : compte Microsoft (SSO) */
.login .ms-sso { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1b2434; border: 1px solid #8c95a6; font-weight: 600; text-decoration: none; padding: 10px 14px; }
.login .ms-sso:hover { background: #f3f5f9; }
.login .ssosep { text-align: center; color: var(--ink-2, #6b7587); font-size: 13px; margin: 6px 0 0; }

/* Zone Évènements (bas gauche) : liste des évènements du client */
.panel.events { grid-template-columns: 1fr; }
.elist { list-style: none; margin: 0; padding: 0 6px 56px; overflow: auto; flex: 1; }
.elist li { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 8px; font-size: 13px; white-space: nowrap; overflow: hidden; cursor: pointer; border-radius: 8px; }
.elist li:hover { background: var(--accent-soft); }
.elist li.empty { cursor: default; color: var(--ink-2); justify-content: center; white-space: normal; text-align: center; padding: 18px 8px; }
.elist li.empty:hover { background: none; }
.elist li.past { opacity: .55; }
.elist .ud { flex: none; width: 10px; height: 10px; background: var(--c); transform: rotate(45deg); border-radius: 2px; margin: 0 3px; }
.elist b { font-weight: 650; flex: none; }
.elist .ut { flex: none; color: var(--accent-ink-2, #b36b00); font-size: 12px; }
.elist .ud-d { flex: none; font-size: 11.5px; color: var(--ink-2); }
.elist .ud-d.ok { color: #2e8b57; }
.elist .up { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.elist .gs { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; }
.elist .gs svg { width: 10px; height: 10px; }
.elist .gs.st-a_planifier { background: #6b7a99; }
.elist .gs.st-propose { background: #e08a00; }
.elist .gs.st-valide { background: #2e8b57; }
.elist .gs.st-passe { background: #9aa3b2; }
.panel.max.events .elist li { font-size: 15px; min-height: 36px; }
.panel.events .ucount { font-size: inherit; }

/* Zone Documents : ouverte en grand par l'icône SharePoint */
.panel.docs[hidden] { display: none; }
.sidelinks button.sl { border: 0; cursor: pointer; padding: 0; }
.sidelinks button.sl:hover { background: #26324a; transform: translateY(-1px); }
.sidelinks button.sl[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.spext { margin-left: auto; padding: 3px 10px; font-size: 12px; text-decoration: none; margin-right: 38px; }
.panel.events .col > header { padding-right: 52px; }   /* laisse la place au bouton d'agrandissement */
.elist .tr { flex: none; color: var(--ink); font-size: 12px; background: var(--line); border-radius: 99px; padding: 1px 8px; }
.elist .gs { width: 24px; height: 24px; }
.elist .gs svg { width: 15px; height: 15px; }
.panel.max.events .elist .gs { width: 28px; height: 28px; }
.panel.max.events .elist .gs svg { width: 17px; height: 17px; }
.panel.events .col > header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
