:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #1D2433;
  --muted: #5B6475;
  --line: #DCE1E8;
  --accent: #2F45A6;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EAF8;
  --danger: #B42318;
  --ok: #18794E;
  --warn: #9A6700;
  --marker: #F5D90A;
  --radius: 6px;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --read: "Iowan Old Style", "Charter", "Sitka Text", Cambria, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151922;
    --surface: #1D2230;
    --ink: #E5E8EF;
    --muted: #9AA3B4;
    --line: #2F3647;
    --accent: #93A5FF;
    --accent-ink: #10142A;
    --accent-soft: #262E4D;
    --danger: #FF8A80;
    --ok: #6EDDA5;
    --warn: #F2C14E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151922;
  --surface: #1D2230;
  --ink: #E5E8EF;
  --muted: #9AA3B4;
  --line: #2F3647;
  --accent: #93A5FF;
  --accent-ink: #10142A;
  --accent-soft: #262E4D;
  --danger: #FF8A80;
  --ok: #6EDDA5;
  --warn: #F2C14E;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--ui); }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* Marque : le mot passé au surligneur */
/* Logo : icône « page codée » et mot Glane en Newsreader (police hébergée sur le site, licence OFL) */
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/newsreader-600-latin.woff2") format("woff2"); }
.brand { --logo-paper: var(--surface); display: inline-flex; align-items: center; gap: .32em; font-family: "Newsreader", var(--read); font-size: 1.5rem; font-weight: 600; letter-spacing: -.005em; color: var(--ink); text-decoration: none; line-height: 1; }
.brand .logo-icon { width: 1.3em; height: 1.3em; flex: none; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid var(--line); background: var(--surface); padding: .45em .9em; border-radius: var(--radius); cursor: pointer; text-decoration: none; color: var(--ink); line-height: 1.3; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: .25em .6em; font-size: .875rem; }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: grid; gap: .3em; margin-bottom: .9em; }
.field label { font-weight: 600; font-size: .9rem; }
.input, textarea.input, select.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .55em .7em; }
textarea.input { resize: vertical; min-height: 5em; }
.row { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.notice { border-left: 3px solid var(--warn); background: var(--surface); padding: .6em .8em; border-radius: 0 var(--radius) var(--radius) 0; font-size: .9rem; margin-bottom: 1em; }

/* Connexion */
.login { min-height: calc(100% - 5rem); display: grid; place-items: center; padding: 2rem 1rem; }
.login-box { width: min(420px, 100%); }
.login-box .brand { font-size: 2.7rem; margin-bottom: .3em; }
.login-box .lead { color: var(--muted); margin-bottom: 2rem; font-family: var(--read); font-size: 1.1rem; }
.code-input { font-size: 1.8rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* Structure */
.top { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top nav { display: flex; gap: .25rem; }
.top nav a { text-decoration: none; color: var(--muted); padding: .35em .7em; border-radius: var(--radius); }
.top nav a.on, .top nav a:hover { color: var(--ink); background: var(--accent-soft); }
.page { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Liste des projets */
.projects { display: grid; gap: .75rem; margin-top: 1.5rem; }
.project-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.project-row:hover { border-color: var(--accent); }
.project-row .name { font-weight: 650; font-size: 1.05rem; }
.project-row .stats { color: var(--muted); font-size: .875rem; text-align: right; }
.project-row .desc { color: var(--muted); font-size: .9rem; grid-column: 1 / -1; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted); }

/* Espace de travail */
.work { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 57px); }
.work.with-panel { grid-template-columns: 270px minmax(0, 1fr) 330px; }
.side { border-right: 1px solid var(--line); background: var(--surface); padding: 1rem; overflow-y: auto; height: calc(100vh - 57px); position: sticky; top: 57px; }
.side h2 { font-size: 1rem; margin-top: 1.4rem; display: flex; align-items: center; gap: .5rem; }
.side .pname { font-size: 1.1rem; font-weight: 650; text-decoration: none; color: var(--ink); display: block; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: flex; align-items: center; gap: .5em; padding: .35em .5em; border-radius: var(--radius); text-decoration: none; color: var(--ink); font-size: .92rem; }
.side li a:hover { background: var(--accent-soft); }
.side li a.on { background: var(--accent-soft); font-weight: 600; }
.side li a .count { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.side li a .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: .8em; height: .8em; border-radius: 3px; flex: none; background: var(--c, var(--marker)); }
.dot.inherit { width: .6em; height: .6em; margin: 0 .1em; border-radius: 50%; }
.side .tree li a { padding-left: calc(.5em + var(--d, 0) * 1.1em); }
.side .tree li a.group .t { font-weight: 600; }
.side form.new-code { flex-wrap: wrap; }
.side form.new-code .input { flex: 1 1 100%; }
.side form { margin-top: .5rem; display: flex; gap: .35rem; }
.side form .input { padding: .35em .55em; font-size: .9rem; }
.main { padding: 1.5rem 2rem 4rem; min-width: 0; }
.panel { border-left: 1px solid var(--line); background: var(--surface); padding: 1rem; overflow-y: auto; height: calc(100vh - 57px); position: sticky; top: 57px; }

/* Lecture et surlignage */
.doc-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; max-width: 68ch; }
.doc-head h1 { font-family: var(--read); font-weight: 600; margin: 0; }
.doc { font-family: var(--read); font-size: 1.075rem; line-height: 1.8; white-space: pre-wrap; max-width: 68ch; overflow-wrap: anywhere; }
.doc .mark { border-radius: 2px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.doc .mark.sel { box-shadow: 0 2px 0 var(--accent); }
.hint { color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
.hint .spacer { min-width: 16rem; max-width: 60ch; }

/* Bascule des couleurs */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: .3em .7em; font-size: .82rem; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* Bulle de codage */
.pop { position: absolute; z-index: 50; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgb(15 20 40 / .18); padding: .6rem; }
.pop .input { padding: .4em .6em; font-size: .9rem; margin-bottom: .5rem; }
.pop .chips { max-height: 220px; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .4em; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .2em .7em .2em .5em; font-size: .85rem; cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--c) 40%, var(--surface)); border-color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.chip.new { border-style: dashed; }
.chip-groups { display: grid; gap: .45rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .35rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
.chip-group:last-child { border-bottom: 0; padding-bottom: 0; }
.chip-groups > .chip { justify-self: start; }
a.chip { text-decoration: none; color: var(--ink); }

/* Extraits */
.excerpt { position: relative; background: var(--surface); padding: .6rem .8rem .6rem 1rem; border-radius: var(--radius); margin-bottom: .6rem; overflow: hidden; }
.excerpt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stripe, var(--c, var(--marker))); }
.panel .excerpt { cursor: pointer; border: 1px solid var(--line); }
.panel .excerpt:hover, .panel .excerpt.on { border-color: var(--accent); }
.excerpt .text { font-family: var(--read); font-size: .98rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.excerpt .meta { font-size: .8rem; color: var(--muted); margin-top: .35rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.excerpt .note { font-size: .88rem; margin-top: .35rem; color: var(--muted); font-style: italic; }
.editor { border: 1px solid var(--accent); border-radius: 8px; padding: .8rem; margin-bottom: 1.25rem; background: var(--accent-soft); }
.editor .text { font-family: var(--read); font-size: .95rem; line-height: 1.55; max-height: 9em; overflow: auto; margin-bottom: .7rem; white-space: pre-wrap; }
.group-title { font-size: .9rem; color: var(--muted); margin: 1.5rem 0 .6rem; }
.code-head { display: grid; gap: .6rem; max-width: 640px; margin-bottom: 1.5rem; }
.code-head .colour { width: 3rem; height: 2.4rem; padding: .15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Vue d'ensemble */
.stats-line { display: flex; gap: 2rem; margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.stats-line div { font-size: .9rem; color: var(--muted); }
.stats-line strong { display: block; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; max-width: 720px; }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 1.25rem; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* Administration */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.status { font-size: .8rem; font-weight: 600; }
.status.pending { color: var(--warn); }
.status.active { color: var(--ok); }
.status.disabled { color: var(--danger); }
tr.pending td { background: color-mix(in srgb, var(--warn) 9%, transparent); }

/* Messages */
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6em 1.1em; border-radius: var(--radius); font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); color: #fff; }

@media (max-width: 1100px) {
  .work.with-panel { grid-template-columns: 240px minmax(0, 1fr); }
  .work.with-panel .panel { grid-column: 1 / -1; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .work, .work.with-panel { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 1.25rem 1rem 3rem; }
  .top { flex-wrap: wrap; position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Projets partagés */
.badge { display: inline-block; margin-left: .6em; padding: .1em .55em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600; vertical-align: .15em; }
.notice.ok { border-left-color: var(--ok); }
.members { list-style: none; margin: 0 0 1rem; padding: 0; }
.members li { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.members li:last-child { border-bottom: 0; }
.members .who { flex: 1 1 220px; display: grid; }
.members li.invited .who strong { font-weight: 500; font-style: italic; }
.members .role-label { color: var(--muted); font-size: .875rem; }
select.input.role { width: auto; padding: .25em .5em; font-size: .875rem; }
.invite select.input.role { padding: .5em .6em; font-size: inherit; }
.excerpt .meta .author { margin-left: auto; font-style: italic; }

/* Pied de page */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.5rem; padding: 1.5rem 1.25rem 2rem; color: var(--muted); font-size: .85rem; text-align: center; }
.foot a { color: inherit; }

/* Taille du texte des documents (profil) */
:root[data-text="large"] .doc { font-size: 1.22rem; }
:root[data-text="xlarge"] .doc { font-size: 1.4rem; }
:root[data-text="large"] .excerpt .text, :root[data-text="xlarge"] .excerpt .text { font-size: 1.08rem; }

/* Profil */
.me { display: inline-flex; align-items: center; gap: .5em; text-decoration: none; color: var(--ink); padding: .2em .55em .2em .25em; border-radius: 999px; border: 1px solid transparent; }
.me:hover, .me.on { border-color: var(--line); background: var(--accent-soft); }
.avatar { --size: 2rem; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--av, var(--marker)); color: #1D2433; font-weight: 700; font-size: calc(var(--size) * .4); letter-spacing: .02em; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { --size: 5.5rem; }
.profile-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.profile-head h1 { margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--c); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.prefs { display: grid; gap: 1.1rem; }
.prefs .label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.box.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.box.danger-zone h2 { color: var(--danger); }
.btn.red { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.red:hover { filter: brightness(1.08); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .9rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.sync { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35em; }
.sync::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--ok); }
.sync.off::before { background: var(--warn); }

/* Animaux et partage */
.avatar.animal { background: var(--av, var(--marker)); }
.avatar.animal svg { width: 100%; height: 100%; display: block; }
.animals { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr)); gap: .55rem; }
.animal-pick { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; background: var(--av); padding: 0; cursor: pointer; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: transform .12s ease; }
.animal-pick svg { width: 100%; height: 100%; display: block; }
.animal-pick:hover { transform: scale(1.07); }
.animal-pick.on { border-color: var(--surface); box-shadow: 0 0 0 3px var(--accent); }
@media (prefers-reduced-motion: reduce) { .animal-pick { transition: none; } .animal-pick:hover { transform: none; } }
.members .avatar { --size: 2.2rem; }
.side .share { margin-top: .8rem; width: 100%; justify-content: flex-start; text-decoration: none; color: var(--ink); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
.side .share:hover { border-color: var(--accent); }
.share .faces { display: inline-flex; }
.share .faces .avatar { --size: 1.45rem; border: 2px solid var(--accent-soft); }
.share .faces .avatar + .avatar { margin-left: -.45rem; }
#membres { scroll-margin-top: 4.5rem; }

/* Exports */
.exports { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.export { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: .15rem .6rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--surface); min-width: 0; }
.export:hover { border-color: var(--accent); }
.export .fmt { grid-row: 1 / 3; align-self: start; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .25em .5em; border-radius: 4px; color: #FFFFFF; background: var(--muted); }
.export .fmt-word { background: #2B579A; }
.export .fmt-excel { background: #217346; }
.export-t { font-weight: 600; }
.export-d { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.main > .foot { margin-top: 3rem; padding-bottom: 0; }

/* Filtre « Afficher le travail de » */
.work-filter { display: grid; gap: .2rem; margin-top: 1rem; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.wf-label { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 .3rem .2rem; }
.wf { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: .3rem .4rem; cursor: pointer; color: var(--ink); }
.wf:hover { background: var(--accent-soft); }
.wf.on { background: var(--surface); border-color: var(--accent); font-weight: 600; }
.wf .avatar { --size: 1.6rem; }
.wf .faces { display: inline-flex; }
.wf .faces .avatar { --size: 1.25rem; border: 2px solid var(--bg); }
.wf .faces .avatar + .avatar { margin-left: -.4rem; }
.wf .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.wf .count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.filter-banner { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .6rem .8rem; margin-bottom: 1.2rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); font-size: .92rem; }
.filter-banner > span:not(.avatar) { flex: 1 1 260px; }
.filter-banner .avatar { --size: 1.9rem; }

/* Remarques (post-it) */
.doc-wrap { display: grid; grid-template-columns: minmax(0, auto) minmax(2.4rem, 1fr); gap: .9rem; }
.note-margin { position: relative; }
.doc .noted { text-decoration: underline dotted #C9A400 2px; text-underline-offset: .22em; }
.doc span.noted:not(.mark) { cursor: pointer; }
.doc .noted { -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: box-shadow .12s ease, background-color .12s ease; }
/* Passage annoté mis en avant (survol du texte ou du post-it) */
.doc .noted.hot { text-decoration-color: #B38F00; text-decoration-thickness: 3px; box-shadow: 0 0 0 2px #E8C200, 0 3px 10px rgb(232 194 0 / .45); border-radius: 3px; }
.doc span.noted.hot:not(.mark) { background: #FFF0A0; color: #1D2433; }
.postit.hot { transform: scale(1.22) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .doc .noted { transition: none; } }
.postit { position: relative; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; background: transparent; cursor: pointer; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .25)); transition: transform .12s ease; }
/* Un seul post-it sur la ligne : centré sur la ligne */
.postit.solo { position: absolute; left: 0; translate: 0 -50%; }
.note-margin .postit.solo { transition: transform .12s ease, left .15s ease; }
/* Plusieurs post-it sur la ligne : pile entourée, ouverte en éventail au survol */
.note-cluster { position: absolute; left: 0; margin-left: -.25rem; translate: 0 -50%; width: 2.2rem; height: 1.85rem; border: 1.5px solid #D9B300; border-radius: 9px; background: color-mix(in srgb, #FFE066 18%, var(--surface)); z-index: 5; }
.note-cluster:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-count { position: absolute; right: -.5rem; top: -.55rem; z-index: 3; min-width: 1.1rem; height: 1.1rem; padding: 0 .28rem; border-radius: 999px; background: #B38F00; color: #FFFFFF; font-size: .66rem; font-weight: 700; line-height: 1.1rem; text-align: center; }
.cl-stack { position: absolute; inset: 0; }
.cl-stack .postit { position: absolute; width: 1.45rem; height: 1.45rem; left: calc(.2rem + var(--i) * 3px); top: calc(.1rem + var(--i) * 2px); transition: transform .15s ease, left .15s ease, top .15s ease; }
.cl-stack .postit .n { display: none; }
.note-cluster.open, .note-cluster.peek { z-index: 30; }
.note-cluster.open .cl-stack, .note-cluster.peek .cl-stack { inset: auto; right: -.2rem; top: 50%; translate: 0 -50%; display: flex; flex-direction: row-reverse; width: max-content; gap: .45rem; padding: .35rem .5rem; border: 1.5px solid #D9B300; border-radius: 10px; background: var(--surface); box-shadow: 0 8px 22px rgb(15 20 40 / .18); }
.note-cluster.open .cl-stack .postit, .note-cluster.peek .cl-stack .postit { position: relative; left: auto; top: auto; width: 1.75rem; height: 1.75rem; }
.note-cluster.open .cl-stack .postit .n, .note-cluster.peek .cl-stack .postit .n { display: block; }
.note-cluster.open .cl-count, .note-cluster.peek .cl-count { display: none; }
.postit svg { width: 100%; height: 100%; display: block; }
.postit:hover, .postit.on { transform: scale(1.15) rotate(-4deg); }
.postit .n { position: absolute; right: -.45rem; top: -.4rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .65rem; font-weight: 700; line-height: 1.05rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { .postit, .cl-stack .postit { transition: none; } }
.pop-row { display: flex; gap: .4rem; align-items: flex-start; }
.pop-row .input { flex: 1; min-width: 0; }
.postit-btn { flex: none; width: 2.1rem; height: 2.1rem; padding: .25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.postit-btn:hover { border-color: #C9A400; background: #FFF8D6; }
.postit-btn svg, .postit-ico svg { width: 100%; height: 100%; display: block; }
.note-pop { display: grid; gap: .55rem; max-height: min(80vh, 640px); overflow-y: auto; }
.note-head { display: flex; align-items: center; gap: .45rem; }
.postit-ico { width: 1.3rem; height: 1.3rem; display: inline-block; }
.note-quote { margin: 0; padding: .35rem .6rem; border-left: 3px solid #FFE066; background: var(--bg); font-family: var(--read); font-size: .88rem; color: var(--muted); }
.note-body { white-space: pre-wrap; font-size: .95rem; }
.note-meta { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); }
.note-meta .avatar, .comment .avatar { --size: 1.5rem; }
.comments { border-top: 1px solid var(--line); padding-top: .55rem; display: grid; gap: .55rem; }
.c-title { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.comment { display: flex; gap: .5rem; align-items: flex-start; }
.c-main { flex: 1; min-width: 0; }
.c-head { font-size: .8rem; }
.c-body { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-actions { display: flex; gap: .7rem; margin-top: .1rem; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-size: .78rem; cursor: pointer; }
.linkish.danger { color: var(--danger); }

/* Info-bulles instantanées */
#tip { position: fixed; left: 0; top: 0; z-index: 100; max-width: min(340px, calc(100vw - 16px)); padding: .5rem .65rem; border-radius: 7px; background: #1D2433; color: #F3F4F7; font: .82rem/1.45 var(--ui); white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; opacity: 0; transition: opacity .1s ease; box-shadow: 0 6px 20px rgb(10 14 30 / .25); }
#tip.show { opacity: 1; }
:root[data-theme="dark"] #tip { background: #F3F4F7; color: #1D2433; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #tip { background: #F3F4F7; color: #1D2433; } }

/* Chat du projet */
.chat-btn { position: relative; width: 2.3rem; height: 2.3rem; padding: .4rem; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.chat-btn svg { width: 100%; height: 100%; display: block; }
.chat-btn:hover, .chat-btn.on { background: var(--accent-soft); border-color: var(--line); }
.chat-badge { position: absolute; right: -.15rem; top: -.15rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--danger); color: #FFFFFF; font-size: .68rem; font-weight: 700; line-height: 1.15rem; text-align: center; }
:root { --chat-w: 360px; }
.chat { position: fixed; z-index: 40; top: 3.4rem; right: 0; bottom: 0; width: min(var(--chat-w), 100vw); display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgb(15 20 40 / .12); transform: translateX(105%); transition: transform .18s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
.chat.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .chat, #tip { transition: none; } }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem .7rem 1rem; border-bottom: 1px solid var(--line); }
.chat-title { display: grid; flex: 1; min-width: 0; }
.chat-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .faces { display: inline-flex; }
.chat-head .faces .avatar { --size: 1.5rem; border: 2px solid var(--surface); }
.chat-head .faces .avatar + .avatar { margin-left: -.45rem; }
.chat-list { overflow-y: auto; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.chat-day { align-self: center; margin: .7rem 0 .4rem; padding: .15rem .6rem; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .72rem; font-weight: 600; }
.msg { display: flex; gap: .45rem; align-items: flex-end; margin-top: .45rem; max-width: 92%; }
.msg.grouped { margin-top: .1rem; }
.msg .avatar { --size: 1.7rem; }
.msg .av-space { width: 1.7rem; flex: none; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { min-width: 0; padding: .45rem .65rem; border-radius: 12px 12px 12px 4px; background: var(--bg); border: 1px solid var(--line); }
.msg.mine .bubble { border-radius: 12px 12px 4px 12px; background: var(--accent-soft); border-color: transparent; }
.msg-author { font-size: .74rem; font-weight: 600; color: var(--muted); margin-bottom: .1rem; }
.msg-body { font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: flex; gap: .6rem; justify-content: flex-end; font-size: .68rem; color: var(--muted); margin-top: .15rem; }
.msg-meta .linkish { font-size: .68rem; visibility: hidden; }
.msg:hover .msg-meta .linkish, .msg-meta .linkish:focus { visibility: visible; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 2rem 1rem; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; padding: .7rem .8rem; border-top: 1px solid var(--line); }
.chat-form .input { min-height: 2.6rem; max-height: 9rem; resize: vertical; font-size: .92rem; }
@media (max-width: 700px) { .chat { top: 0; width: 100vw; z-index: 60; } }

/* Chat ancré à droite sur écran large : la page se resserre au lieu d'être recouverte */
#app { transition: margin-right .18s ease; }
@media (min-width: 1000px) {
  body.with-chat #app { margin-right: var(--chat-w); }
  body.with-chat .chat { box-shadow: none; }
  body.with-chat .work.with-panel { grid-template-columns: 240px minmax(0, 1fr) 300px; }
}
/* Chat ouvert sur un écran moyen : le panneau des extraits passe sous le document */
@media (min-width: 1000px) and (max-width: 1499px) {
  body.with-chat .work.with-panel { grid-template-columns: 240px minmax(0, 1fr); }
  body.with-chat .work.with-panel .panel { grid-column: 1 / -1; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 999px) { .chat-grip { display: none; } }
.chat-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; }
.chat-grip::after { content: ""; position: absolute; left: 3px; top: 50%; width: 2px; height: 2.4rem; translate: 0 -50%; border-radius: 2px; background: var(--line); }
.chat-grip:hover::after, .chat-grip:focus-visible::after, body.resizing .chat-grip::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing #app { transition: none; }
@media (prefers-reduced-motion: reduce) { #app { transition: none; } }

/* Numéros de ligne */
.doc .nl { display: none; }
/* Mise en page unique en lignes de 90 caractères, numéros affichés ou non (aucune coupure ne change) */
.doc.lined { max-width: calc(75ch + 3rem); } /* 90 caractères tiennent sur une ligne en plein écran */
.doc.lined .line { position: relative; padding-left: 3rem; } /* place des numéros réservée : le texte ne bouge pas */
@media (max-width: 759px) { .doc.lined .line { padding-left: 2.2rem; } .doc.numbered .line::before { width: 1.6rem; } }
.doc.numbered .line::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 2.1rem; text-align: right; font-family: var(--ui); font-size: .68em; line-height: calc(1.8em / .68); color: var(--muted); opacity: .75; font-variant-numeric: tabular-nums; user-select: none; pointer-events: none; }
.doc.numbered .line:nth-child(5n)::before { opacity: 1; font-weight: 600; }
.doc.lined .line.blank { min-height: 1.8em; }
.lines-btn { gap: .4em; }
.lines-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.lines-ico { white-space: pre; font: 700 .42rem/1 var(--ui); letter-spacing: 0; text-align: right; }
.line-ref { font-size: .72rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: .1rem; }
.note-quote .line-ref { display: inline; font-family: var(--ui); }

/* Pile ouverte vers la droite quand la marge est large */
.note-cluster.to-right.open .cl-stack, .note-cluster.to-right.peek .cl-stack { right: auto; left: -.2rem; flex-direction: row; }
.cl-count { white-space: nowrap; }

/* Rôles et journal des accès */
.members .role-label.admin { color: var(--accent); font-weight: 600; }
table.log td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.creator-tag { margin-left: .5em; padding: .05em .45em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 600; vertical-align: .1em; }

/* Fenêtre de choix du nouvel admin */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1rem; background: rgb(15 20 40 / .45); }
.modal { width: min(460px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border-radius: 12px; padding: 1.3rem 1.4rem; box-shadow: 0 20px 60px rgb(10 14 30 / .35); }
.modal h2 { margin: 0 0 .4rem; }
.succ-list { display: grid; gap: .4rem; margin-top: .6rem; }
.succ { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.succ:hover { border-color: var(--accent); }
.succ:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.succ .who { display: grid; }
.succ .avatar { --size: 2rem; }
.succession { padding: .7rem .9rem; margin-bottom: 1rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.succession .field { margin-bottom: .6rem; }

/* Tutoriel vidéo (public/tutoriel.js) : sommaire à gauche, tous les chapitres visibles, vidéo à droite */
.tuto-lien { display: inline-block; margin-top: 1.6rem; color: var(--accent); }
.tuto { width: min(1280px, 100%); margin: 0 auto; padding: 2.5rem 1.25rem 1rem; border-top: 1px solid var(--line); }
.tuto-tete h2 { margin: 0 0 .3rem; font-size: 1.6rem; }
.tuto-tete p { margin: 0 0 1.2rem; }
.tuto-grille { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.tuto-video { min-width: 0; }
.tuto-film { display: block; width: 100%; aspect-ratio: 16 / 9; background: transparent; }
.tuto-menu { display: flex; flex-direction: column; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .75rem .6rem; }
.tuto-menu .input { font-size: .9rem; padding: .45em .6em; }
.tuto-info { margin: 0 .4rem; }
.tuto-info:empty { display: none; }
.tuto-label { display: block; margin: 0 0 0 .4rem; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tuto-chapitres { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.tuto-chapitres > li { margin: 0; }
.tuto-chap { width: 100%; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .45rem; align-items: center; text-align: left; border: 0; background: none; color: var(--ink); padding: .28rem .4rem; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .9rem; line-height: 1.25; }
.tuto-chap:hover { background: var(--accent-soft); }
.tuto-chap:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tuto-chap .n { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--bg); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tuto-chap .d { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.tuto-chapitres li.on > .tuto-chap { background: var(--accent-soft); font-weight: 600; }
.tuto-phrases { list-style: none; margin: .1rem 0 .3rem 2rem; padding: 0; display: grid; gap: 1px; }
.tuto-phrases button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; font-size: .82rem; line-height: 1.35; padding: .25rem .4rem; border-radius: var(--radius); cursor: pointer; }
.tuto-phrases button:hover { background: var(--accent-soft); }
.tuto-phrases button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tuto-phrases .d { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.tuto mark { background: var(--marker); color: #1D2433; border-radius: 2px; padding: 0 .1em; }
.tuto-chapitres li.on > .tuto-chap .n { background: var(--marker); color: #1D2433; }
@media (max-width: 900px) {
  .tuto-grille { grid-template-columns: 1fr; }
  .tuto-video { order: -1; }
}

/* Page Contact : adresse du compte grisée, non modifiable */
.contact input:disabled, .contact textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.contact .btn.envoye, .contact .btn.envoye:disabled { background: var(--ok); border-color: var(--ok); color: var(--surface); opacity: 1; cursor: default; }
.contact textarea { resize: vertical; }
/* La page Contact tient dans l'écran sans ascenseur : marges plus serrées, et la zone du message prend la hauteur qui reste */
.contact-page { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.contact-page h1 { margin-bottom: .25rem; }
.contact-page > p { margin: 0 0 .8rem; }
.contact .field { margin-bottom: .7em; }
.contact textarea { height: clamp(4.5rem, calc(100vh - 630px), 18rem); height: clamp(4.5rem, calc(100dvh - 630px), 18rem); min-height: 4.5rem; }
.contact-page + .foot { padding-top: .8rem; padding-bottom: 1rem; }

/* Administration : domaines validés */
.domaines { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.domaines li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }

/* Page Tutoriel : le tutoriel occupe la page, sans le filet du haut */
.tuto-page .tuto { border-top: 0; padding-top: 2rem; }
/* Page Tutoriel : au moins la hauteur de l'écran, pour que la taupe soit toujours tout en bas */
#app:has(> .tuto-page) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#app:has(> .tuto-page) > .tuto-page { flex: 1 0 auto; }

/* Page d'accueil : présentation animée et connexion sur un seul écran */
.landing { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); grid-template-rows: 1fr auto; column-gap: clamp(1.5rem, 5vw, 5rem); padding: 1rem clamp(1rem, 4vw, 3.5rem) 0; overflow: clip; } /* les éléments en vol hors de l'écran ne créent pas d'ascenseur */
.landing .login-box { grid-column: 2; grid-row: 1; align-self: center; }
.landing .login-box .brand { font-size: 2.5rem; margin-bottom: .2em; }
.landing .login-box .lead { margin-bottom: 1.4rem; }
.landing .tuto-lien { display: inline-block; margin-top: 1.1rem; }
.landing .foot { grid-column: 1 / -1; grid-row: 2; padding: .5rem 0 .9rem; }
.intro { position: relative; grid-column: 1; grid-row: 1; align-self: center; height: min(calc(100dvh - 5rem), 680px); min-height: 360px; }
.intro-cap { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; gap: .15rem; min-height: 4.4rem; }
.intro-cap .n { font: 600 .72rem var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-height: 1em; }
.intro-cap strong { font-family: "Newsreader", var(--read); font-weight: 600; font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.15; color: var(--ink); }
.intro-cap .s { font-size: .92rem; color: var(--muted); }
.intro-stage { position: absolute; left: 50%; top: 4.6rem; width: 600px; height: 520px; transform-origin: top center; pointer-events: none; }
.intro-dots { position: absolute; left: 0; right: 0; bottom: .2rem; display: flex; justify-content: center; gap: .5rem; z-index: 2; }
.intro-dot { width: .6rem; height: .6rem; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.intro-dot.on { background: var(--accent); width: 1.6rem; border-radius: 999px; }
.intro-pause { position: absolute; right: 0; bottom: -.15rem; z-index: 2; border: 0; background: none; color: var(--muted); font-size: .78rem; cursor: pointer; text-decoration: underline; }
/* Éléments dessinés (taille de dessin 600 × 520, mis à l'échelle) */
.intro-stage > * { position: absolute; }
.i-page { left: 150px; top: 40px; width: 280px; height: 340px; background: #FFFFFF; border-radius: 10px; box-shadow: 0 18px 40px rgb(20 28 50 / .16), 0 2px 6px rgb(20 28 50 / .08); transform-origin: center; }
.i-title { position: absolute; left: 22px; top: 20px; font: 600 15px "Newsreader", Georgia, serif; color: #1D2433; }
.i-line { position: absolute; left: 22px; height: 7px; border-radius: 4px; background: #CBD1DB; }
.i-hl { position: absolute; height: 15px; border-radius: 3px; opacity: .85; mix-blend-mode: multiply; }
.i-file { width: 92px; height: 112px; background: #FFFFFF; border-radius: 8px; box-shadow: 0 10px 24px rgb(20 28 50 / .18); padding: 12px; display: grid; align-content: start; gap: 8px; }
.i-file b { justify-self: start; color: #FFFFFF; font: 700 11px var(--ui); letter-spacing: .06em; padding: 3px 6px; border-radius: 4px; }
.i-file span { height: 6px; border-radius: 3px; background: #D5DAE2; }
.i-file span:nth-child(3) { width: 75%; }
.i-chip, .i-tree-r, .i-point, .i-export, .i-bubble { font: 500 14px var(--ui); color: #1D2433; }
.i-chip { display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: #FFFFFF; box-shadow: 0 6px 16px rgb(20 28 50 / .16); white-space: nowrap; }
.i-chip i, .i-tree-r i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.i-cursor { width: 0; height: 0; border-left: 9px solid #1D2433; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transform-origin: left; rotate: -30deg; }
.i-tree { width: 210px; padding: 14px 14px 10px; background: #FFFFFF; border-radius: 12px; box-shadow: 0 14px 34px rgb(20 28 50 / .16); }
.i-tree-t { font: 700 12px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: #5B6475; margin-bottom: 8px; }
.i-tree-r { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.i-tree-r.g { font-weight: 700; }
.i-av { width: 70px; height: 70px; border-radius: 50%; background: #FDE68A; box-shadow: 0 10px 24px rgb(20 28 50 / .2); overflow: hidden; }
.i-av svg { width: 100%; height: 100%; display: block; }
.i-postit { width: 34px; height: 34px; filter: drop-shadow(0 3px 4px rgb(0 0 0 / .2)); }
.i-postit svg { width: 100%; height: 100%; }
.i-bubble { max-width: 240px; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: #FFFFFF; box-shadow: 0 10px 24px rgb(20 28 50 / .16); }
.i-bubble.mine { border-radius: 14px 14px 4px 14px; background: #E6EAF8; }
.i-export { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #FFFFFF; border-radius: 10px; box-shadow: 0 14px 30px rgb(20 28 50 / .2); white-space: nowrap; }
.i-export b { color: #FFFFFF; font: 700 11px var(--ui); letter-spacing: .06em; padding: 4px 7px; border-radius: 4px; }
.i-logo { left: 195px; top: 165px; width: 210px; display: grid; justify-items: center; gap: 6px; }
.i-logo svg { width: 110px; height: 110px; filter: drop-shadow(0 14px 24px rgb(20 28 50 / .2)); }
.i-logo span { font: 600 44px "Newsreader", Georgia, serif; color: var(--ink); }
.i-point { width: 120px; text-align: center; padding: 8px 0; border-radius: 999px; background: #FFFFFF; box-shadow: 0 8px 20px rgb(20 28 50 / .15); font-weight: 600; }
/* Écran étroit : présentation au-dessus, formulaire en dessous */
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; grid-template-rows: auto auto auto; row-gap: .4rem; padding-top: .6rem; }
  .intro { grid-column: 1; height: 37dvh; min-height: 220px; }
  .landing .foot { font-size: .74rem; gap: .1rem 1rem; padding: .2rem 0 .5rem; }
  .landing .tuto-lien { margin-top: .6rem; }
  .intro-cap { min-height: 3.6rem; }
  .intro-cap .s { display: none; }
  .intro-stage { top: 3.6rem; }
  .landing .login-box { grid-column: 1; grid-row: 2; justify-self: center; width: min(420px, 100%); }
  .landing .foot { grid-row: 3; }
  .landing .login-box .brand { font-size: 2rem; }
  .landing .login-box .lead { margin-bottom: .9rem; font-size: 1rem; }
  /* Étapes suivantes du formulaire (code, nom, motif) : place au formulaire */
  .landing.compact .intro { display: none; }
}
/* Petits téléphones (écran court) : présentation plus basse, phrase d'accroche masquée */
@media (max-width: 860px) and (max-height: 620px) {
  .intro { height: 30dvh; min-height: 170px; }
  .intro-cap { min-height: 2.6rem; }
  .intro-cap .n { display: none; }
  .intro-stage { top: 2.6rem; }
  .landing .login-box .lead { display: none; }
  .landing .login-box .brand { font-size: 1.7rem; margin-bottom: .5rem; }
}
.word-count { font-size: .8rem; color: var(--muted); margin-top: -.1rem; } .word-count.ok { color: var(--ok); font-weight: 600; }
.i-tree-r { border-radius: 6px; }
/* Scène « Annotez et discutez » : remarque commentée et chat du projet */
.i-mini { width: 22px; height: 22px; border-radius: 50%; background: #FDE68A; overflow: hidden; display: inline-block; flex: none; }
.i-mini svg { width: 100%; height: 100%; display: block; }
.i-note { width: 220px; padding: 12px 14px; background: #FFFFFF; border-radius: 12px; box-shadow: 0 14px 32px rgb(20 28 50 / .2); font: 14px/1.4 var(--ui); color: #1D2433; display: grid; gap: 7px; }
.i-note-h { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.i-note-h svg { width: 18px; height: 18px; }
.i-note p { margin: 0; padding: 6px 9px; border-left: 3px solid #FFE066; background: #F6F7FA; font-family: "Newsreader", Georgia, serif; font-size: 15px; }
.i-note-by, .i-note-c { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #5B6475; }
.i-note-c { padding-top: 7px; border-top: 1px solid #E3E6EC; color: #1D2433; }
.i-chatp { left: 332px; top: 30px; width: 268px; height: 430px; background: #FFFFFF; border-radius: 14px; box-shadow: 0 14px 34px rgb(20 28 50 / .16); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.i-chatp-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #E3E6EC; font: 14px var(--ui); color: #1D2433; }
.i-chatp-h > span { display: flex; }
.i-chatp-h .i-mini + .i-mini { margin-left: -7px; }
.i-chatp-l { display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; padding: 14px 12px; }
.i-msg { display: flex; align-items: flex-end; gap: 7px; max-width: 100%; }
.i-msg-b { white-space: nowrap; font-size: 12.8px !important; padding: 7px 10px !important; }
.i-msg.mine { align-self: flex-end; }
.i-msg-b { padding: 8px 11px; border-radius: 12px 12px 12px 4px; background: #F3F5F8; border: 1px solid #E3E6EC; font: 13.5px/1.35 var(--ui); color: #1D2433; }
.i-msg.mine .i-msg-b { border-radius: 12px 12px 4px 12px; background: #E6EAF8; border-color: transparent; }
.i-msg-b { position: relative; } .i-like { position: absolute; left: -10px; bottom: -11px; padding: 1px 6px; border-radius: 999px; background: #FFFFFF; border: 1px solid #E3E6EC; font-size: 11px; box-shadow: 0 2px 6px rgb(20 28 50 / .12); }
