:root {
  --bg: #EEF0F3;
  --panel: #FFFFFF;
  --panel-2: #F8F9FB;
  --line: #DDE1E7;
  --line-2: #EEF0F3;
  --line-strong: #C9CED6;
  --text: #16181D;
  --muted: #586170;
  --accent: #2F5BEA;
  --accent-strong: #1E3FB0;
  --accent-soft: #EAF0FE;
  --zone: #E8590C;
  --zone-strong: #8A3A0B;
  --zone-soft: #FFF4EC;
  --danger: #B42318;
  --danger-soft: #FDECEC;
  --ok: #0F766E;
  --ok-soft: #E6F4F2;
  --ink: #0B1F66;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(22, 24, 29, 0.10);
  --shadow-lg: 0 20px 60px rgba(22, 24, 29, 0.28);
  --ui: 'Folio UI', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Folio Display', 'Folio UI', system-ui, sans-serif;
  --contrast: #16181D;
  --on-accent: #FFFFFF;
  --chip: #F1F3F6;
  --grain: 0;
  --on-contrast: #FFFFFF;
  --hero: #16181D;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--ui); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(47, 91, 234, 0.45); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 26px; height: 26px; }

.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.88); opacity: 0.6; } }

/* ------------------------------------------------------------ boutons et champs */
.btn { height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background 0.12s, border-color 0.12s; text-decoration: none; }
.btn:hover { background: var(--panel-2); color: var(--text); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.danger { color: var(--danger); border-color: #F1B5AE; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.dark { background: var(--contrast); border-color: var(--contrast); color: var(--on-contrast); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.zonebtn { background: var(--zone-soft); border-color: #F2C9A8; color: var(--zone-strong); font-weight: 600; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.big { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn.icon { width: 38px; padding: 0; }
.btn.small.icon { width: 32px; }
.btn.block { width: 100%; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 12px; background: var(--panel); font-size: 14px; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: 3px solid rgba(47, 91, 234, 0.18); outline-offset: 0; }
.input.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row > .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1 1 auto; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.seg button { height: 38px; border: 0; border-right: 1px solid var(--line-strong); background: var(--panel); font-size: 13px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--text); white-space: nowrap; }
.chip.blue { background: var(--accent-soft); color: var(--accent-strong); }
.chip.orange { background: var(--zone-soft); color: var(--zone-strong); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: 0 0 auto; }
.avatar { width: 32px; height: 32px; border-radius: 16px; color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 2px solid #fff; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.error-text { color: var(--danger); font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg.i { width: 34px; height: 34px; color: var(--line-strong); }
.kbd { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; background: var(--panel); color: var(--muted); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--on-accent); flex: 0 0 auto; }
.logo-mark svg.i { width: 16px; height: 16px; }
.logo-name { font-family: var(--display); font-weight: 600; font-size: 18px; }

/* ------------------------------------------------------------ toasts, modales, menus */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; width: min(520px, calc(100vw - 24px)); }
.toast { background: var(--contrast); color: var(--on-contrast); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; pointer-events: auto; display: flex; gap: 10px; align-items: center; animation: rise 0.18s ease-out; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast button { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; border-radius: 7px; height: 28px; padding: 0 10px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.backdrop { position: fixed; inset: 0; background: rgba(22, 24, 29, 0.5); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 920px; }
.modal.medium { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); gap: 12px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); padding: 0 22px; overflow-x: auto; }
.tabs button { padding: 12px 12px; border: 0; background: transparent; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.menu { position: fixed; z-index: 600; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; display: flex; flex-direction: column; animation: fade 0.1s; }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; text-align: left; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: var(--panel-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; width: 100%; }

/* ------------------------------------------------------------ pages d'accès */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-side { flex: 1 1 420px; background: var(--hero); color: #fff; padding: 56px; display: flex; flex-direction: column; gap: 28px; }
.auth-side .logo { color: #fff; }
.auth-side h1 { font-size: 40px; line-height: 1.15; max-width: 460px; margin-top: auto; }
.auth-points { display: flex; flex-direction: column; gap: 16px; max-width: 460px; }
.auth-points div { display: flex; gap: 12px; color: #D4D8DF; font-size: 14px; }
.auth-points svg.i { color: #9DB4FF; margin-top: 2px; }
.auth-main { flex: 999 1 520px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 24px; }
.auth-card .sub { color: var(--muted); margin-top: -10px; }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp input { width: 46px; height: 52px; border: 1px solid var(--line-strong); border-radius: 10px; text-align: center; font-size: 22px; padding: 0; }
.otp input:focus { border: 2px solid var(--accent); outline: none; }
.qr { display: flex; justify-content: center; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr img { width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 40px; height: 40px; border-radius: 20px; border: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.colors button.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--text); }
.doc-badge { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }

/* ------------------------------------------------------------ espace de travail */
.shell { min-height: 100vh; display: flex; }
.side { flex: 0 0 248px; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 0 8px 18px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.side a.nav:hover { background: var(--panel-2); }
.side a.nav.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.side a.nav .count { margin-left: auto; font-size: 12px; background: var(--accent); color: var(--on-accent); border-radius: 10px; padding: 0 8px; }
.side a.nav .count.warn { background: var(--zone); }
.side hr { border: 0; border-top: 1px solid var(--line-2); margin: 10px 0; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line-2); margin-top: 8px; }
.side .me .grow { min-width: 0; }
.side .me .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage { padding: 12px 8px 6px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 3px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head .titles { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { font-size: 28px; }
.mobile-top { display: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 17px; font-size: 13px; }
.filters button.on { background: var(--contrast); border-color: var(--contrast); color: var(--on-contrast); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--panel); color: var(--muted); width: 280px; max-width: 100%; }
.search input { flex: 1 1 auto; border: 0; background: transparent; outline: none; min-width: 0; color: var(--text); }

.drop { border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--panel); padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: border-color 0.12s, background 0.12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.drop h2 { font-size: 22px; }
.drop.compact { flex-direction: row; padding: 16px 20px; text-align: left; }
.drop.compact h2 { font-size: 16px; }

.grid-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.doc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--text); position: relative; transition: box-shadow 0.12s, border-color 0.12s; }
.doc-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--text); }
.doc-thumb { height: 200px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-thumb img { max-width: 86%; max-height: 88%; box-shadow: 0 1px 4px rgba(22,24,29,0.18); background: #fff; }
.doc-info { padding: 12px 12px 12px 14px; display: flex; gap: 8px; align-items: flex-start; }
.doc-info .grow { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.doc-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.doc-card .more { position: relative; z-index: 2; }
.doc-card .live { position: absolute; top: 10px; left: 10px; }
.ftype { width: 52px; height: 64px; border-radius: 8px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ftype.sm { width: 34px; height: 34px; border-radius: 7px; font-size: 10px; }
.ftype.pdf { background: var(--danger-soft); color: var(--danger); }
.ftype.word { background: #E8F0FE; color: var(--accent-strong); }
.ftype.sheet { background: var(--ok-soft); color: var(--ok); }
.ftype.slides { background: var(--zone-soft); color: var(--zone-strong); }
.ftype.image { background: #F3E8FF; color: #6D28D9; }

.table-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table.list { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 18px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--panel-2); }
.cell-doc { display: flex; align-items: center; gap: 12px; }
.cell-doc .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section > h2 { font-size: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel h3 { font-size: 16px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list-plain { display: flex; flex-direction: column; }
.list-plain > div { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.list-plain > div:last-child { border-bottom: 0; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; transition: border-color 0.12s, box-shadow 0.12s; }
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tool-card .t { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tool-card .d { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tool-card .t svg.i { color: var(--accent); }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.file-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item[draggable="true"] { cursor: grab; }
.result { border: 1px solid #B7E0DA; background: var(--ok-soft); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--line); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ éditeur */
.editor { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.ed-top, .ed-modes, .ed-tools, .ed-foot, .lockbar { flex-shrink: 0; }
.ed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 56px; }
.ed-title { display: flex; flex-direction: column; gap: 1px; padding-left: 12px; border-left: 1px solid var(--line); min-width: 0; max-width: 420px; }
.ed-title .n { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: transparent; padding: 0; text-align: left; }
.ed-title .s { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.zoom { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; height: 38px; padding: 0 4px; font-size: 13px; }
.zoom button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.zoom button:hover { background: var(--panel-2); }
.zoom .val { min-width: 52px; text-align: center; border: 0; background: transparent; font-size: 13px; }
.ed-modes { display: flex; gap: 2px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.ed-modes button { padding: 10px 12px; border: 0; background: transparent; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.ed-modes button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.ed-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.ed-tools .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-tools .btn { height: 34px; font-size: 13px; padding: 0 11px; }
.ed-body { flex: 1 1 auto; display: flex; min-height: 0; }
.ed-thumbs { flex: 0 0 156px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ed-thumb { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: transparent; font-size: 12px; color: var(--muted); padding: 0; }
.ed-thumb canvas, .ed-thumb .ph { width: 96px; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgba(22,24,29,0.08); display: block; }
.ed-thumb.on canvas, .ed-thumb.on .ph { border: 2px solid var(--accent); }
.ed-thumb.on { color: var(--text); font-weight: 600; }
.ed-view { flex: 999 1 auto; min-width: 0; overflow: auto; position: relative; padding: 22px 24px 60px; outline: none; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: min-content; }
.ed-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 auto 14px; max-width: 760px; }
.pg { position: relative; background: #fff; box-shadow: var(--shadow); flex: 0 0 auto; }
.pg canvas.pdf { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg .ov { position: absolute; inset: 0; }
.pg .pg-num { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.pg.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #fff, #f5f6f8, #fff); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.ov.tool-text, .ov.tool-date { cursor: text; }
.ov.tool-check, .ov.tool-image, .ov.tool-signature, .ov.tool-initials, .ov.tool-comment, .ov.tool-stamp { cursor: copy; }
.ov.tool-highlight, .ov.tool-whiteout, .ov.tool-rect, .ov.tool-ellipse, .ov.tool-line, .ov.tool-arrow, .ov.tool-redact, .ov.tool-ink { cursor: crosshair; }
.ov.tool-replace { cursor: pointer; }

.zone { position: absolute; border: 1.5px dashed var(--zone); background: rgba(232, 89, 12, 0.06); border-radius: 3px; cursor: pointer; padding: 0; }
.zone:hover { background: rgba(232, 89, 12, 0.13); }
.zone.done { border-color: rgba(47, 91, 234, 0.35); border-style: solid; background: transparent; }
.zone.active { border: 2px solid var(--accent); background: rgba(47, 91, 234, 0.06); }
.zone .zl { position: absolute; left: -2px; top: -19px; font-size: 10.5px; font-weight: 600; color: #fff; background: var(--zone); padding: 1px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.1s; }
.zone:hover .zl, .zone.active .zl { opacity: 1; }
.zone.active .zl { background: var(--accent); }
.zones-hidden .zone:not(.active) { opacity: 0; pointer-events: none; }

.obj { position: absolute; touch-action: none; }
.obj.sel { outline: 1.5px solid var(--accent); outline-offset: 2px; }
.obj.remote-sel { outline: 1.5px dashed var(--peer, #E8590C); outline-offset: 3px; }
.obj.locked { pointer-events: none; }
.o-text { white-space: pre; color: var(--ink); cursor: move; }
.o-text.comb { white-space: normal; }
.o-text .cc { position: absolute; top: 0; text-align: center; }
.o-check svg { width: 100%; height: 100%; display: block; }
.o-image img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.o-highlight { mix-blend-mode: multiply; }
.o-whiteout { background: #fff; box-shadow: inset 0 0 0 1px rgba(22,24,29,0.06); }
.o-redact { background: rgba(22,24,29,0.82); background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,0.08) 6px 12px); }
.o-shape svg, .o-ink svg { width: 100%; height: 100%; display: block; overflow: visible; }
.o-comment { width: 26px; height: 26px; border-radius: 13px 13px 13px 3px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.o-replace { white-space: pre; color: var(--ink); background: #fff; cursor: move; }
.o-field { display: flex; }
.o-field input, .o-field select, .o-field textarea { width: 100%; height: 100%; border: 1px solid rgba(47,91,234,0.45); background: rgba(234,240,254,0.85); padding: 0 4px; color: var(--ink); border-radius: 2px; font-family: 'PDF Sans', sans-serif; }
.o-field textarea { resize: none; padding: 2px 4px; }
.o-field input[type="checkbox"] { width: 100%; height: 100%; margin: 0; accent-color: var(--accent); }
.handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; right: -8px; bottom: -8px; cursor: nwse-resize; touch-action: none; }
.obj-tag { position: absolute; left: 0; top: -18px; font-size: 10px; color: #fff; padding: 1px 5px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.text-editor { position: absolute; border: 0; outline: 1.5px solid var(--accent); outline-offset: 2px; background: rgba(255,255,255,0.4); padding: 0; margin: 0; resize: none; overflow: hidden; white-space: pre; color: var(--ink); z-index: 20; }
.span-hit { position: absolute; border-radius: 2px; cursor: text; }
.span-hit:hover { background: rgba(47,91,234,0.12); outline: 1px solid rgba(47,91,234,0.5); }
.drag-rect { position: absolute; border: 1.5px dashed var(--accent); background: rgba(47,91,234,0.08); pointer-events: none; }
.cursor-peer { position: absolute; pointer-events: none; z-index: 40; transition: left 0.08s linear, top 0.08s linear; }
.cursor-peer svg { width: 20px; height: 20px; display: block; }
.cursor-peer span { position: absolute; left: 14px; top: 16px; font-size: 11.5px; font-weight: 600; color: #fff; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.suggest { position: absolute; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; min-width: 180px; }
.suggest button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 7px; font-size: 13px; display: flex; gap: 8px; }
.suggest button:hover, .suggest button.on { background: var(--accent-soft); }
.suggest .k { color: var(--muted); font-size: 12px; }

.ed-side { flex: 1 1 300px; max-width: 340px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.ed-side h3 { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); font-family: var(--ui); text-transform: uppercase; }
.ed-side .big { font-family: var(--display); font-size: 18px; font-weight: 600; }
.zlist { display: flex; flex-direction: column; font-size: 13px; }
.zlist button { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; border-radius: 0; }
.zlist button:hover { background: var(--panel-2); }
.zlist .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zlist .k { color: var(--muted); font-size: 12px; }
.prop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 14px; border: 0; }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.ed-foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 7px 16px; background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.conn { display: inline-flex; align-items: center; gap: 6px; }
.lockbar { background: var(--zone-soft); color: var(--zone-strong); padding: 8px 16px; font-size: 13px; border-bottom: 1px solid #F2C9A8; }

.org { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 4px; }
.org-page { background: var(--panel); border: 2px solid transparent; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; cursor: grab; user-select: none; }
.org-page.sel { border-color: var(--accent); background: var(--accent-soft); }
.org-page.dragging { opacity: 0.35; }
.org-page.drop-before::before { content: ""; position: absolute; left: -11px; top: 8px; bottom: 8px; width: 4px; border-radius: 2px; background: var(--accent); }
.org-page .pv { width: 120px; height: 160px; display: flex; align-items: center; justify-content: center; }
.org-page canvas { max-width: 120px; max-height: 160px; box-shadow: 0 1px 4px rgba(22,24,29,0.2); background: #fff; transition: transform 0.15s; }
.org-page .acts { display: flex; gap: 4px; }
.org-page .lbl { font-size: 12px; color: var(--muted); }
.org-page.blank .pv > div { width: 110px; height: 150px; background: #fff; border: 1px dashed var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }

.sig-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sig-style { height: 92px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; padding: 0 10px; }
.sig-style.on { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(47,91,234,0.15); }
.sig-style .sig-text { font-size: 32px; line-height: 1.15; white-space: nowrap; }
.sig-style .lab { font-size: 11px; color: var(--muted); }
.sig-pad { width: 100%; height: 220px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sig-pad-wrap { position: relative; }
.sig-pad-wrap .base { position: absolute; left: 24px; right: 24px; bottom: 50px; border-bottom: 1px dashed var(--line-strong); pointer-events: none; }
.sig-saved { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sig-saved button { height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 8px; position: relative; }
.sig-saved button:hover { border-color: var(--accent); }
.sig-saved img { max-width: 100%; max-height: 100%; }
.sig-preview { height: 84px; border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sig-preview img, .sig-preview canvas { max-height: 74px; max-width: 95%; }

.office { height: 100vh; display: flex; flex-direction: column; }
.office-frame { flex: 1 1 auto; min-height: 0; }
.office-frame > div, .office-frame iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 400; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .side { transform: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 300; }
  .shell { flex-direction: column; }
  .main { padding: 20px 16px 40px; }
  .ed-thumbs { display: none; }
  .ed-side { position: fixed; right: 0; top: 0; bottom: 0; z-index: 300; width: min(340px, 92vw); transform: translateX(100%); transition: transform 0.2s, visibility 0.2s; box-shadow: var(--shadow-lg); visibility: hidden; }
  .editor.side-open .ed-side { transform: none; visibility: visible; }
  .ed-tools .btn > span, .ed-top .btn > span { display: none; }
  .ed-tools .btn, .ed-top .btn { padding: 0 9px; }
  .ed-title { max-width: 46vw; }
  .ed-view { padding: 14px 8px 60px; }
  .auth-side { padding: 32px 24px; flex-basis: 100%; }
  .auth-side h1 { font-size: 28px; margin-top: 24px; }
  .auth-points { display: none; }
}
@media (min-width: 901px) {
  .only-mobile { display: none !important; }
}
@media print {
  body * { visibility: hidden; }
}

/* administration */
.admin-tabs { padding: 0; margin: 4px 0 18px; }
.admin-tabs a { padding: 11px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.admin-tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.admin-body { display: flex; flex-direction: column; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.stat strong { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.size-steps { gap: 6px; }

/* ping, rappel et suivi */
.beacon { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 46; }
.beacon i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; animation: beacon-ring 1.3s ease-out 2; }
.beacon i:nth-child(2) { animation-delay: 0.22s; }
.beacon i:nth-child(3) { animation-delay: 0.44s; }
.beacon b { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, 0.25); animation: beacon-dot 3.2s ease-out forwards; }
.beacon span { position: absolute; left: 12px; top: 10px; font-size: 11.5px; font-weight: 600; color: #fff; background: var(--c); padding: 2px 8px; border-radius: 10px; white-space: nowrap; animation: beacon-dot 3.2s ease-out forwards; }
@keyframes beacon-ring { 0% { transform: scale(0.35); opacity: 1; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes beacon-dot { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.beacon-notes { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; }
.beacon-note { pointer-events: auto; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--panel); border-radius: 10px; padding: 9px 14px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: fade 0.15s; cursor: pointer; }
.beacon-note strong { color: var(--accent); }
.follow-bar { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 16px; font-size: 13px; background: color-mix(in srgb, var(--c) 12%, var(--panel)); border-bottom: 2px solid var(--c); }
.editor.ping-armed .ov { cursor: crosshair; }
.presence .btn.on, .presence .btn.on:hover { background: var(--accent-soft, #EAF0FE); color: var(--accent); border-color: var(--accent); }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; margin-left: -8px; }
.avatars > .avatar-btn:first-child, .avatars > .avatar + .avatar-btn { margin-left: -8px; }
.avatars > :first-child { margin-left: 0; }
.avatar-btn.on .avatar { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }
.avatar-btn:hover .avatar { transform: translateY(-1px); }

/* dossiers, étiquettes, recherche, modèles */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.crumbs:empty { display: none; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .sep { color: var(--line-strong); }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .i.lg { width: 28px; height: 28px; }
.folder-card { grid-column: span 1; display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--accent)); border-radius: 14px; text-decoration: none; color: var(--text); min-height: 72px; transition: box-shadow 0.12s, border-color 0.12s, transform 0.12s; }
.folder-card:hover { box-shadow: var(--shadow); color: var(--text); }
.folder-card .grow { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.folder-card .folder-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); flex-shrink: 0; }
.folder-card .folder-ico .i { width: 22px; height: 22px; }
.folder-card.over { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); transform: scale(1.02); }
body.dragging-doc .folder-card { border-style: dashed; }
.grid-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.chip.tag { background: #F3EEFF; color: #5B21B6; }
button.chip.tag { border: 1px solid transparent; cursor: pointer; height: 30px; font-size: 13px; }
button.chip.tag.on { border-color: #7C3AED; background: #EDE5FF; font-weight: 600; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tags-filter button { height: 30px; font-size: 12.5px; }
.tree { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; margin: -6px -8px; }
.tree-row { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.tree-row:hover:not(:disabled) { background: var(--panel-2); }
.tree-row:disabled { opacity: 0.45; cursor: not-allowed; }
.swatches.big button { width: 40px; height: 40px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-results h2 { font-size: 17px; }
.sresult { display: flex; align-items: flex-start; gap: 14px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 14px 16px; width: 100%; }
.sresult:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.sresult .snippet { display: flex; gap: 10px; font-size: 13px; color: var(--text-2, #3B414B); line-height: 1.5; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.sresult .snippet:hover { background: var(--panel-2); }
.sresult .snippet .k { flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 2px; min-width: 34px; }
.sresult mark { background: #FFE58F; color: inherit; border-radius: 3px; padding: 0 1px; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.template-card .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.template-actions { padding: 0 14px 14px; }
.section-title { font-size: 17px; margin-top: 8px; }
.sresult > .grow { flex: 1 1 auto; min-width: 0; }

/* circuit de signature */
.o-slot { z-index: 12; border: 2px dashed var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); border-radius: 6px; display: flex; align-items: flex-start; }
.o-slot .slot-label { font-size: 10.5px; font-weight: 600; color: #fff; background: var(--c); padding: 1px 6px; border-radius: 0 0 6px 0; white-space: nowrap; pointer-events: none; }
.o-slot.filled { border-style: solid; border-width: 1px; background: transparent; }
.o-slot.filled .slot-label { opacity: 0.55; }
.o-slot.mine:not(.filled) { cursor: pointer; animation: slot-glow 1.8s ease-in-out infinite; }
.o-slot.other { opacity: 0.45; }
.o-slot.pulse { animation: slot-pulse 0.5s ease-in-out 3; }
@keyframes slot-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent); } }
@keyframes slot-pulse { 50% { transform: scale(1.06); } }
.sign-bar { flex-shrink: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 18px; font-size: 13.5px; background: #FFF7E6; border-bottom: 1px solid #F3D59A; }
.sign-bar.done { background: var(--ok-soft); border-bottom-color: #B7E0DA; color: var(--ok); }
.sign-bar .grow { flex: 1 1 260px; }
.signers { display: flex; flex-direction: column; gap: 6px; }
.signer { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: default; }
.signer.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.hint-box { font-size: 12.5px; border-left: 3px solid var(--c); background: var(--panel-2); padding: 8px 10px; border-radius: 6px; }
.notif-list { gap: 8px; }
.notif { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.notif.unread { border-left: 4px solid var(--accent); }
.notif:hover { box-shadow: var(--shadow); }
.notif-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.to-sign { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #FFF7E6; border: 1px solid #F3D59A; }
.to-sign-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--zone-strong); flex-shrink: 0; }
.to-sign a.chip { text-decoration: none; }

/* comparaison */
.compare { height: 100vh; display: flex; flex-direction: column; background: var(--bg, #EEF0F3); }
.cmp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13px; }
.cmp-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-side strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.cmp-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr 320px; }
.cmp-pane { overflow: auto; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; border-right: 1px solid var(--line); }
.cmp-pane .pg { position: relative; background: #fff; box-shadow: var(--shadow); flex-shrink: 0; }
.cmp-pane .pg canvas { width: 100%; height: 100%; display: block; }
.cmp-pane .ov { position: absolute; inset: 0; }
.cmp-list { overflow: auto; background: var(--panel); display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.cmp-item { display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 9px 10px; width: 100%; }
.cmp-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cmp-item .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.del-text { color: #B42318; text-decoration: line-through; }
.add-text { color: #0F766E; }
.cmp-mark { position: absolute; border-radius: 3px; cursor: pointer; mix-blend-mode: multiply; }
.cmp-mark.cmp-add { background: rgba(16, 163, 127, 0.28); border-bottom: 2px solid #0F766E; }
.cmp-mark.cmp-del { background: rgba(220, 38, 38, 0.22); border-bottom: 2px solid #B42318; }
.cmp-mark.cmp-chg { background: rgba(234, 179, 8, 0.32); border-bottom: 2px solid #B45309; }
.cmp-mark.cmp-vis { background: rgba(124, 58, 237, 0.14); border: 2px dashed #7C3AED; }
.cmp-mark.anchor { background: #B42318; width: 3px; }
.cmp-mark.flash { animation: slot-pulse 0.45s ease-in-out 3; box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.45); }
.chip.cmp-add { background: #DDF5EE; color: #0F766E; }
.chip.cmp-del { background: var(--danger-soft); color: var(--danger); }
.chip.cmp-chg { background: #FEF3C7; color: #92400E; }
.chip.cmp-vis { background: #EDE9FE; color: #6D28D9; }
@media (max-width: 900px) { .cmp-body { grid-template-columns: 1fr 1fr; } .cmp-list { display: none; } }

/* discussion et réactions */
.ed-body { position: relative; }
.chat-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; z-index: 60; }
.chat-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-head .grow { flex: 1 1 auto; }
.chat-list { flex: 1 1 auto; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; max-width: 88%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg .who { font-size: 11.5px; font-weight: 600; }
.chat-msg .bubble { background: var(--panel-2); border: 1px solid var(--line); padding: 8px 11px; border-radius: 12px 12px 12px 4px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-msg.mine .bubble { background: var(--accent); color: var(--on-accent); border-color: var(--accent); border-radius: 12px 12px 4px 12px; }
.chat-msg .when { font-size: 10.5px; color: var(--muted); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1 1 auto; resize: none; min-height: 38px; max-height: 120px; }
.btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.presence .btn { position: relative; }
.react-menu { min-width: 0; width: 260px; }
.react-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.react-grid button { font-size: 22px; height: 44px; border: 0; background: transparent; border-radius: 10px; }
.react-grid button:hover, .react-grid button.on { background: var(--panel-2); }
.reaction { position: absolute; z-index: 47; pointer-events: none; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; animation: react-float 2.6s ease-out forwards; }
.reaction .e { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)); }
.reaction .n { font-size: 10.5px; font-weight: 600; color: #fff; background: var(--c); padding: 1px 6px; border-radius: 8px; margin-top: 2px; }
@keyframes react-float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%) scale(0.9); } }

/* numérisation */
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.big { height: 48px; padding: 0 20px; font-size: 15px; }
.scan-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scan-page { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.scan-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quad { position: relative; user-select: none; touch-action: none; align-self: center; max-width: 100%; }
.quad img { display: block; max-width: 100%; max-height: 62vh; border-radius: 6px; }
.quad-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.quad-lines polygon { fill: rgba(47, 91, 234, 0.12); stroke: var(--accent); stroke-width: 0.6; vector-effect: non-scaling-stroke; stroke-width: 2px; }
.quad-handle { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: grab; touch-action: none; }
.quad-handle:focus-visible { outline: 3px solid var(--accent-soft); }
.scan-options { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
@media (max-width: 600px) { .scan-pages { grid-template-columns: 1fr; } .scan-actions .btn { flex: 1 1 100%; } }

@media (max-width: 600px) { .presence .btn:not([aria-label='Discussion']) { display: none; } }

/* ================================================================ notes */
.note-app { height: 100vh; display: flex; flex-direction: column; background: color-mix(in srgb, var(--paper, #fff) 70%, #E9ECF1); --paper: #fff; --ink: #16181D; --accent-n: #2F5BEA; --font-heading: 'Folio Display'; --font-body: 'Folio UI'; }
.note-app.dark-paper { background: color-mix(in srgb, var(--paper) 85%, #000); }
.note-top .crumb { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-top .s.warn { color: var(--zone-strong); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line-strong); }
.note-toolbar { flex-shrink: 0; display: flex; align-items: center; gap: 2px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.note-toolbar .tb, .note-bubble .tb { min-width: 32px; height: 32px; padding: 0 7px; border: 0; background: transparent; border-radius: 7px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0; }
.note-toolbar .tb:hover, .note-bubble .tb:hover { background: var(--panel-2); }
.note-toolbar .tb.on, .note-bubble .tb.on { background: var(--accent-soft); color: var(--accent-strong); }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex-shrink: 0; }
.tb-select { height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: 0 8px; font-size: 13px; flex-shrink: 0; }
.tb-color { font-weight: 700; border-bottom: 3px solid #E8590C; line-height: 1.1; }
.tb-hl { background: #FFF3A3; padding: 0 3px; border-radius: 3px; }
.tb-hint { font-size: 12px; color: var(--muted); white-space: nowrap; padding-left: 12px; }
.note-main { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
.note-scroll { flex: 1 1 auto; overflow: auto; padding: 36px 20px 120px; }
.note-paper { max-width: 820px; margin: 0 auto; background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 8px 30px rgba(16, 24, 40, 0.06); padding: 56px 72px 80px; min-height: 70vh; font-family: var(--font-body), sans-serif; position: relative; }
.note-app.wide .note-paper { max-width: none; }
.note-head { display: flex; flex-direction: column; gap: 6px; }
.note-icon { font-size: 44px; line-height: 1; border: 0; background: transparent; width: fit-content; padding: 4px; border-radius: 10px; cursor: pointer; }
.note-icon.empty { font-size: 14px; color: var(--muted); opacity: 0; transition: opacity 0.15s; }
.note-paper:hover .note-icon.empty { opacity: 1; }
.note-title { min-height: 1.2em; border: 0; outline: none; background: transparent; resize: none; overflow: hidden; font: 700 38px/1.15 var(--font-heading), sans-serif; color: var(--ink); width: 100%; padding: 0; letter-spacing: -0.01em; }
.note-title::placeholder { color: color-mix(in srgb, var(--ink) 30%, transparent); }
.note-title.static { margin: 0 0 12px; }
.note-sub { font-size: 12px; color: color-mix(in srgb, var(--ink) 50%, transparent); margin: 6px 0 22px; }
.note-body { outline: none; font-size: 16px; line-height: 1.7; color: var(--ink); caret-color: var(--accent-n); }
.note-body > * + * { margin-top: 0.55em; }
.note-body p { margin: 0; }
.note-body h1, .note-body h2, .note-body h3 { font-family: var(--font-heading), sans-serif; color: var(--ink); line-height: 1.25; margin: 1.3em 0 0.3em; letter-spacing: -0.01em; }
.note-body h1 { font-size: 30px; }
.note-body h2 { font-size: 23px; color: var(--accent-n); }
.note-body h3 { font-size: 18.5px; }
.note-body a { color: var(--accent-n); text-decoration: underline; text-underline-offset: 2px; }
.note-body a.note-link { text-decoration: none; background: color-mix(in srgb, var(--accent-n) 12%, transparent); border-radius: 5px; padding: 1px 6px; font-weight: 500; cursor: pointer; }
.note-body a.note-link::before { content: '↗ '; font-size: 0.8em; opacity: 0.6; }
.note-body ul, .note-body ol { padding-left: 1.5em; margin: 0.3em 0; }
.note-body li > p { margin: 0; }
.note-body ul[data-type='taskList'] { list-style: none; padding-left: 0.2em; }
.note-body ul[data-type='taskList'] li { display: flex; gap: 10px; align-items: flex-start; }
.note-body ul[data-type='taskList'] li > label { margin-top: 0.3em; flex-shrink: 0; }
.note-body ul[data-type='taskList'] li > label input { width: 17px; height: 17px; accent-color: var(--accent-n); cursor: pointer; }
.note-body ul[data-type='taskList'] li[data-checked='true'] > div { text-decoration: line-through; opacity: 0.55; }
.note-body ul[data-type='taskList'] li > div { flex: 1 1 auto; }
.note-body blockquote { border-left: 3px solid var(--accent-n); padding: 2px 0 2px 16px; margin-left: 0; color: color-mix(in srgb, var(--ink) 80%, transparent); font-style: italic; }
.note-body code { font-family: 'PDF Mono', monospace; font-size: 0.88em; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 4px; }
.note-body pre { background: #0F172A; color: #E2E8F0; border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.note-body pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.note-body hr { border: 0; border-top: 2px solid color-mix(in srgb, var(--ink) 12%, transparent); margin: 1.5em 0; }
.note-body img { max-width: 100%; height: auto; border-radius: 8px; }
.note-body [data-resize-container] { max-width: 100%; }
.note-body mark { border-radius: 3px; padding: 0 2px; color: inherit; }
.note-body table { border-collapse: collapse; width: 100%; margin: 0.8em 0; table-layout: fixed; overflow: hidden; }
.note-body th, .note-body td { border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); padding: 7px 10px; vertical-align: top; position: relative; min-width: 60px; }
.note-body th { background: color-mix(in srgb, var(--accent-n) 10%, transparent); font-weight: 600; text-align: left; }
.note-body .selectedCell::after { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent-n) 18%, transparent); pointer-events: none; }
.note-body .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; background: var(--accent-n); pointer-events: none; }
.note-body.resize-cursor { cursor: col-resize; }
.note-body .tableWrapper { overflow-x: auto; }
.note-body .callout { display: flex; gap: 12px; padding: 12px 16px; border-radius: 10px; background: #EEF3FF; border: 1px solid #D6E2FF; }
.note-body .callout-icon { font-size: 18px; line-height: 1.6; user-select: none; }
.note-body .callout-body { flex: 1 1 auto; min-width: 0; }
.note-body .callout-tip { background: #FFF8E1; border-color: #FBE7A9; }
.note-body .callout-warn { background: #FFF1E6; border-color: #FBD5B5; }
.note-body .callout-danger { background: #FDECEC; border-color: #F7C6C6; }
.note-body .callout-success { background: #E8F7EF; border-color: #BFE8D1; }
.note-body .callout-note { background: color-mix(in srgb, var(--ink) 5%, transparent); border-color: color-mix(in srgb, var(--ink) 10%, transparent); }
.dark-paper .note-body .callout { background: color-mix(in srgb, var(--accent-n) 16%, transparent); border-color: color-mix(in srgb, var(--accent-n) 30%, transparent); }
.note-body .details { display: flex; gap: 6px; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 10px; padding: 8px 12px; }
.note-body .details > button { border: 0; background: transparent; cursor: pointer; color: var(--accent-n); font-size: 13px; padding: 0 4px; height: 1.7em; }
.note-body .details > button::before { content: '▸'; display: inline-block; transition: transform 0.15s; }
.note-body .details.is-open > button::before { transform: rotate(90deg); }
.note-body .details > div { flex: 1 1 auto; }
.note-body .details summary { font-weight: 600; list-style: none; }
.note-body .details:not(.is-open) [data-type='detailsContent'] { display: none; }
.note-body .tiptap-mathematics-render, .note-body [data-type='inline-math'], .note-body [data-type='block-math'] { cursor: pointer; }
.note-body [data-type='block-math'] { display: block; text-align: center; padding: 8px 0; }
.note-body p.is-empty::before, .note-body h1.is-empty::before, .note-body h2.is-empty::before, .note-body h3.is-empty::before { content: attr(data-placeholder); color: color-mix(in srgb, var(--ink) 32%, transparent); pointer-events: none; float: left; height: 0; }
.note-body p.is-empty:not(.has-focus)::before { content: ''; }
.note-body .collaboration-carets__caret { position: relative; margin: 0 -1px; border-left: 2px solid; border-right: 0; word-break: normal; pointer-events: none; }
.note-body .collaboration-carets__label { position: absolute; top: -1.35em; left: -2px; font: 600 11px/1 'Folio UI', sans-serif; color: #fff; padding: 3px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; user-select: none; }
.note-body .collaboration-carets__selection { border-radius: 2px; }
/* coloration du code (palette sobre) */
.note-body pre .hljs-keyword, .note-body pre .hljs-built_in { color: #C792EA; }
.note-body pre .hljs-string, .note-body pre .hljs-attr { color: #C3E88D; }
.note-body pre .hljs-number, .note-body pre .hljs-literal { color: #F78C6C; }
.note-body pre .hljs-comment { color: #7F8C98; font-style: italic; }
.note-body pre .hljs-title, .note-body pre .hljs-function { color: #82AAFF; }
.note-body pre .hljs-variable, .note-body pre .hljs-name { color: #FFCB6B; }
.drag-handle { width: 18px; height: 24px; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--ink) 35%, transparent); cursor: grab; font-size: 13px; letter-spacing: -2px; border-radius: 4px; user-select: none; }
.drag-handle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.note-bubble { position: fixed; z-index: 400; display: flex; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.note-side { width: 300px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.seg.small button { height: 30px; font-size: 12px; }
.toc { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 8px; border-radius: 6px; font-size: 13.5px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc:hover { background: var(--panel-2); color: var(--accent); }
.toc.l2 { padding-left: 20px; }
.toc.l3 { padding-left: 32px; font-size: 13px; color: var(--muted); }
.version-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.version-preview { border-radius: 10px; padding: 28px 36px; max-height: 60vh; overflow: auto; border: 1px solid var(--line); }
.note-paper.preview { box-shadow: none; padding: 0; min-height: 0; }
.sg-menu { position: fixed; z-index: 700; width: 320px; max-height: 340px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.sg-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 8px; }
.sg-menu button.on, .sg-menu button:hover { background: var(--accent-soft); }
.sg-icon { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; background: var(--panel); }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-text strong { font-size: 13.5px; font-weight: 600; }
.sg-text small { color: var(--muted); font-size: 11.5px; }
.sg-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 8px 4px; }
.sg-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.theme-menu, .icon-menu, .color-menu { width: auto; min-width: 0; padding: 10px; gap: 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; font-size: 11.5px; padding: 4px; border-radius: 8px; }
.theme-swatch .sw { width: 60px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; font-weight: 700; border: 1px solid var(--line); }
.theme-swatch.on .sw { box-shadow: 0 0 0 2px var(--accent); }
.react-grid.six { grid-template-columns: repeat(6, 1fr); }
.color-menu .swatches button.none { background: var(--panel); border: 1px solid var(--line); }
.switcher .tree-row.on { background: var(--accent-soft); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; max-height: 62vh; overflow: auto; padding: 2px; }
.tpl-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 0; overflow: hidden; }
.tpl-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tpl-preview { height: 120px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.tpl-icon { font-size: 22px; }
.tpl-title { font-weight: 700; font-size: 15px; }
.tpl-lines { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.tpl-lines i { height: 5px; border-radius: 3px; background: currentColor; opacity: 0.15; }
.tpl-lines i:first-child { background: var(--a); opacity: 0.45; width: 50%; }
.tpl-lines i.short { width: 70%; }
.tpl-meta { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.tpl-meta .chip { align-self: flex-start; }
.modal.large { width: min(1060px, 96vw); }
.note-thumb { background: linear-gradient(180deg, #F7F8FA, #EEF1F5); }
.nt-paper { width: 72%; height: 86%; background: #fff; color: #16181D; box-shadow: 0 1px 4px rgba(22,24,29,0.18); padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.nt-icon { font-size: 20px; }
.nt-title { font-weight: 700; font-size: 12px; line-height: 1.25; max-height: 3.8em; overflow: hidden; }
.nt-paper i { height: 4px; border-radius: 2px; background: #E5E8EE; }
.nt-paper i.short { width: 60%; }
.ftype.note { background: #EDE9FE; color: #6D28D9; }
.focus-mode .ed-top, .focus-mode .note-toolbar, .focus-mode .note-side, .focus-mode .note-sub { display: none !important; }
.focus-mode .note-paper { box-shadow: none; }
/* thème cahier : papier ligné */
.note-app[data-theme='cahier'] .note-paper { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 26.2px, #DCE6F5 26.2px, #DCE6F5 27.2px); background-position: 0 6px; border-left: 3px double #F3B6B6; }
.note-app[data-theme='cahier'] .note-body h1, .note-app[data-theme='cahier'] .note-body h2, .note-app[data-theme='cahier'] .note-title { font-weight: 500; }
.note-app[data-theme='cahier'] .note-body h2 { font-size: 28px; }
.note-app[data-theme='terminal'] .note-body h2::before { content: '## '; opacity: 0.5; }
.note-app[data-theme='kraft'] .note-paper { box-shadow: 0 2px 0 #D9CBB2, 0 10px 30px rgba(59, 42, 26, 0.12); }
.note-app[data-theme='sakura'] .note-body h2 { border-bottom: 2px dashed color-mix(in srgb, var(--accent-n) 35%, transparent); padding-bottom: 4px; }
.note-app[data-theme='minimal'] .note-body h2 { color: var(--ink); text-transform: uppercase; font-size: 15px; letter-spacing: 0.08em; border-bottom: 1px solid #DDD; padding-bottom: 6px; }
.note-app[data-theme='foret'] .note-body h2, .note-app[data-theme='encre'] .note-body h2 { font-style: italic; }
.dark-paper .note-body pre { background: #000; }
.dark-paper .note-body th { background: color-mix(in srgb, var(--accent-n) 22%, transparent); }
@media (max-width: 800px) {
  .note-paper { padding: 32px 22px 60px; border-radius: 0; }
  .note-scroll { padding: 0 0 80px; }
  .note-title { font-size: 30px; }
  .note-side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
  .hide-sm { display: none !important; }
}
@media print {
  .note-app { height: auto; background: #fff; }
  .ed-top, .note-toolbar, .note-side, .lockbar, .note-sub, .drag-handle, .note-bubble, .toasts { display: none !important; }
  .note-scroll { overflow: visible; padding: 0; }
  .note-paper { box-shadow: none; max-width: none; padding: 0; min-height: 0; background-image: none !important; border: 0 !important; }
  .note-icon.empty { display: none; }
  .note-body pre, .note-body .callout, .note-body table, .note-body img { break-inside: avoid; }
  .collaboration-carets__caret, .collaboration-carets__label { display: none; }
}

/* ---------------------------------------------------------------- réglages, Google Drive, conditions */
.settings-body { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.callout-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: var(--accent-soft); color: var(--text); }
.callout-box > svg { flex: none; margin-top: 2px; color: var(--accent-strong); }
.callout-box.warn { background: var(--zone-soft); }
.callout-box.warn > svg { color: var(--zone-strong); }
.callout-box.danger { background: var(--danger-soft); }
.callout-box.danger > svg { color: var(--danger); }
.drive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.drive-list li { display: flex; gap: 10px; align-items: flex-start; }
.drive-list li svg { flex: none; color: var(--ok); margin-top: 2px; }
.btn.danger-text { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger-text:hover { background: var(--danger-soft); }
.drive-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(100deg, var(--accent-soft), var(--panel) 70%); font-size: 14px; line-height: 1.45; }
.drive-banner > svg { flex: none; width: 26px; height: 26px; color: var(--accent-strong); }
.drive-banner.danger { background: linear-gradient(100deg, var(--danger-soft), var(--panel) 70%); }
.drive-banner.danger > svg { color: var(--danger); }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.copy-row > span { grid-column: 1 / -1; }
.copy-row code { font-family: 'PDF Mono', ui-monospace, monospace; font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; overflow-x: auto; white-space: nowrap; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.terms h3 { font-size: 15px; margin: 18px 0 6px; }
.terms p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--text); }
.terms section:first-child h3 { margin-top: 4px; }
.terms-panel { max-width: 780px; }
.terms-page { min-height: 100vh; display: flex; justify-content: center; padding: 40px 18px; background: var(--bg); }
.terms-card { width: min(760px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; align-self: flex-start; }
.terms-card h1 { font-family: var(--display); font-size: 28px; margin: 6px 0 0; }
.terms-card .terms { max-height: 46vh; overflow-y: auto; padding: 4px 14px 4px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.terms-foot { display: flex; flex-direction: column; gap: 14px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check-line input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
.terms-foot .btn { align-self: flex-end; }
@media (max-width: 640px) {
  .terms-card { padding: 20px 18px; }
  .drive-banner { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- icônes au trait des notes */
.note-icon { width: 56px; height: 56px; padding: 0; display: grid; place-items: center; border-radius: 14px; color: var(--accent-n, var(--accent)); background: color-mix(in srgb, var(--accent-n, var(--accent)) 10%, transparent); }
.note-icon .i { width: 30px; height: 30px; stroke-width: 1.6; }
.note-icon:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-n, var(--accent)) 16%, transparent); }
.note-icon.empty { width: 32px; height: 32px; background: transparent; color: var(--muted); }
.note-icon.empty .i { width: 18px; height: 18px; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 4px; }
.icon-grid button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); font-size: 15px; }
.icon-grid button:hover { background: var(--panel-2); }
.icon-grid button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.icon-grid .i { width: 20px; height: 20px; }
.note-body .callout-icon { display: flex; padding-top: 3px; line-height: 1; }
.note-body .callout-icon .i { width: 19px; height: 19px; stroke-width: 2; color: #2F5BEA; }
.note-body .callout-tip .callout-icon .i { color: #B7791F; }
.note-body .callout-warn .callout-icon .i { color: #D9480F; }
.note-body .callout-danger .callout-icon .i { color: #C92A2A; }
.note-body .callout-success .callout-icon .i { color: #2B8A3E; }
.note-body .callout-note .callout-icon .i { color: #5F3DC4; }
.callout-swatch { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: #EEF3FF; color: #2F5BEA; }
.callout-swatch.callout-tip { background: #FFF8E1; color: #B7791F; }
.callout-swatch.callout-warn { background: #FFF1E6; color: #D9480F; }
.callout-swatch.callout-danger { background: #FDECEC; color: #C92A2A; }
.callout-swatch.callout-success { background: #E8F7EF; color: #2B8A3E; }
.callout-swatch.callout-note { background: #F3F0FF; color: #5F3DC4; }
.sg-icon .i { width: 16px; height: 16px; }
.qs-icon { width: 20px; display: grid; place-items: center; color: var(--muted); }
.tpl-preview { border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; width: 100%; }
.tpl-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, currentColor 12%, transparent); }
.tpl-icon .i { width: 18px; height: 18px; stroke-width: 1.8; }
.tpl-card { cursor: default; }
.tpl-meta { flex: 1 1 auto; }
.tpl-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.tpl-actions .btn { flex: 1 1 0; justify-content: center; }
.nt-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--accent); }
.nt-icon .i { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- emploi du temps */
.course-suggest { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 16px 18px; margin-bottom: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--panel); box-shadow: var(--shadow); }
.cs-time { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); min-width: 120px; }
.cs-time strong { font-size: 15px; color: var(--text); }
.cs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); margin-bottom: 4px; }
.cs-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cs-subject { font-weight: 650; font-size: 16px; }
.cs-title { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cs-title .input { max-width: 520px; }
.cs-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.agenda-nav { margin-bottom: 14px; gap: 10px; }
.week-label { min-width: 280px; text-align: center; }
.agenda { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.agenda-day h3 { font-size: 15px; margin: 0 0 8px; }
.agenda-day.today h3 { color: var(--accent-strong); }
.session { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 8px; }
.session-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.session-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session.live { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.session.past { opacity: 0.7; }
.session.ignored { opacity: 0.55; }
.subjects > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subjects > div:last-child { border-bottom: 0; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; }
.muted-row { opacity: 0.6; }
.switch-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.switch-line input { width: 16px; height: 16px; accent-color: var(--accent); }
.qr-frame { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.qr-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-aim { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,0.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,0.35); }
@media (max-width: 760px) {
  .course-suggest { grid-template-columns: 1fr; }
  .cs-actions { flex-direction: row; flex-wrap: wrap; }
  .session { grid-template-columns: 1fr; gap: 6px; }
  .week-label { min-width: 0; }
}

/* ---------------------------------------------------------------- emploi du temps : grille de la semaine */
.tt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tt-title h1 { margin: 0 0 2px; }
.tt-nav { display: flex; align-items: center; gap: 8px; }
.tt-range { font-size: 15px; font-weight: 600; margin: 0 6px 0 8px; white-space: nowrap; }
.tt-board { display: flex; flex-direction: column; gap: 12px; }
.tt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 1px 2px rgba(22,24,29,0.04); }
.tt-grid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); grid-template-rows: auto calc(var(--h) * var(--rows)); min-width: calc(56px + var(--cols) * 150px); }
.tt-corner { border-bottom: 1px solid var(--line); }
.tt-day { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); display: flex; align-items: baseline; gap: 6px; }
.tt-dname { font-weight: 650; font-size: 14px; }
.tt-ddate { font-size: 13px; color: var(--muted); }
.tt-day.today .tt-dname { color: var(--accent-strong); }
.tt-day.today .tt-ddate { color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.tt-gutter { display: flex; flex-direction: column; }
.tt-hour { height: var(--h); position: relative; }
.tt-hour span { position: absolute; top: -8px; right: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--panel); padding: 0 2px; }
.tt-hour:first-child span { display: none; }
.tt-col { position: relative; border-left: 1px solid var(--line-2); }
.tt-col.today { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.tt-slot { height: var(--h); border-top: 1px solid var(--line-2); }
.tt-slot:first-child { border-top: 0; }
.tt-block { position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 7px 9px 7px 11px; border: 0; border-radius: 10px; text-align: left; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, var(--panel)); color: color-mix(in srgb, var(--c) 55%, #16181D); box-shadow: inset 3px 0 0 var(--c); transition: transform 0.12s, box-shadow 0.12s; }
.tt-block:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--c), 0 6px 16px rgba(22,24,29,0.12); z-index: 2; }
.tt-block:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.tb-name { font-weight: 650; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tb-time, .tb-room { font-size: 11.5px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-note { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--c); color: #fff; }
.tb-note svg { width: 12px; height: 12px; }
.tt-block.compact { flex-direction: row; align-items: center; gap: 8px; padding-top: 3px; padding-bottom: 3px; }
.tt-block.compact .tb-name { -webkit-line-clamp: 1; }
.tt-block.compact .tb-room { display: none; }
.tt-block.past { opacity: 0.78; filter: saturate(0.6); }
.tt-block.ignored { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 7%, var(--panel)) 0 6px, var(--panel) 6px 12px); }
.tt-block.live { box-shadow: inset 3px 0 0 var(--c), 0 0 0 2px var(--c); }
.tt-now { position: absolute; left: 0; right: 0; height: 2px; background: #E03131; z-index: 3; pointer-events: none; }
.tt-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #E03131; }
.tt-mobile { display: none; }
.tt-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.tt-tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 12px; color: var(--muted); }
.tt-tabs button strong { font-size: 16px; color: var(--text); }
.tt-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tt-tabs button.on strong { color: var(--on-accent); }
.tt-tabs button.empty-day { opacity: 0.55; }
.tt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tt-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-radius: 12px; text-align: left; background: color-mix(in srgb, var(--c) 11%, var(--panel)); box-shadow: inset 3px 0 0 var(--c); }
.tt-item.live { box-shadow: inset 3px 0 0 var(--c), 0 0 0 2px var(--c); }
.tt-item.past { opacity: 0.6; }
.ti-time { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ti-time strong { font-size: 14px; color: var(--text); }
.ti-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session-detail .sd-band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); }
.sd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.sd-grid { display: flex; flex-direction: column; gap: 10px; }
.sd-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
@media (max-width: 760px) {
  .tt-scroll { display: none; }
  .tt-mobile { display: block; }
  .tt-range { width: 100%; margin: 4px 0 0; order: 5; }
  .tt-nav { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- réglages de l'emploi du temps */
.cal-summary { gap: 16px; }
.cal-top { display: flex; gap: 14px; align-items: flex-start; }
.cal-top h3 { margin: 0; }
.cal-top p { margin: 4px 0 0; }
.cal-tile { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.cal-parent { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-parent p { margin: 2px 0 0; }
.cal-parent .input { width: 260px; max-width: 100%; }
.subj-list { display: flex; flex-direction: column; }
.subj { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line-2); }
.subj:first-child { border-top: 0; }
.subj-dot { width: 12px; height: 12px; flex: none; border-radius: 4px; background: var(--c); }
.subj-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.subj-name { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.subj-name strong { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.subj-name .btn { opacity: 0; transition: opacity 0.15s; }
.subj:hover .subj-name .btn, .subj-name .btn:focus-visible { opacity: 1; }
.subj-name .input { width: 100%; max-width: 480px; }
.subj-folder { display: inline-flex; align-items: center; gap: 5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--text); }
.subj.off .subj-main, .subj.off .subj-dot { opacity: 0.45; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: none; font-size: 13px; color: var(--muted); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong, #C9CDD6); position: relative; transition: background 0.15s; }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .subj { flex-wrap: wrap; }
  .subj-folder { order: 4; margin-left: 26px; }
  .subj-name .btn { opacity: 1; }
}

/* ================================================================ apparence : corrections globales */
.grow { flex: 1 1 auto; min-width: 0; }

/* ================================================================ thèmes
   clair (par défaut), sombre, lofi nuit, lofi café. Les pages des documents restent blanches. */
[data-theme="dark"] {
  --bg: #0F1115; --panel: #171A21; --panel-2: #1D2129; --line: #2A2F3A; --line-2: #22262F; --line-strong: #3A404D;
  --text: #E7E9EE; --muted: #9AA3B2; --accent: #6E8BFF; --accent-strong: #A8B8FF; --accent-soft: rgba(110, 139, 255, 0.15);
  --zone: #FF8A4C; --zone-strong: #FFB98F; --zone-soft: rgba(255, 138, 76, 0.13);
  --danger: #F87171; --danger-soft: rgba(248, 113, 113, 0.14); --ok: #34D399; --ok-soft: rgba(52, 211, 153, 0.14);
  --chip: #252A34; --contrast: #E7E9EE; --on-contrast: #0F1115; --on-accent: #0B1020; --hero: #0A0C10;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.45); --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
}
[data-theme="lofi"] {
  --bg: #1E1A2B; --panel: #272237; --panel-2: #2E2840; --line: #3B3450; --line-2: #322C45; --line-strong: #4A4263;
  --text: #F4E9DC; --muted: #B8AACB; --accent: #F2A65A; --accent-strong: #FFC98F; --accent-soft: rgba(242, 166, 90, 0.16);
  --zone: #F7B267; --zone-strong: #FFD6A5; --zone-soft: rgba(247, 178, 103, 0.14);
  --danger: #FF8C8C; --danger-soft: rgba(255, 140, 140, 0.14); --ok: #8FD9B6; --ok-soft: rgba(143, 217, 182, 0.14);
  --chip: #342D4A; --radius: 14px; --contrast: #F4E9DC; --on-contrast: #1E1A2B; --on-accent: #2A1E14; --grain: 0.07;
  --hero: linear-gradient(160deg, #2B1F3F 0%, #1A1526 55%, #3A2440 100%);
  --glow-1: rgba(242, 166, 90, 0.16); --glow-2: rgba(140, 110, 220, 0.18);
  --shadow: 0 4px 18px rgba(10, 6, 20, 0.45); --shadow-lg: 0 24px 70px rgba(10, 6, 20, 0.6);
}
[data-theme="cafe"] {
  --bg: #F1E7DA; --panel: #FBF6EE; --panel-2: #F6EEE2; --line: #E2D3BF; --line-2: #ECE1D2; --line-strong: #CFBBA2;
  --text: #3A2D24; --muted: #85715E; --accent: #BF6438; --accent-strong: #8E4421; --accent-soft: rgba(191, 100, 56, 0.12);
  --zone: #D2802C; --zone-strong: #8A4B10; --zone-soft: rgba(210, 128, 44, 0.12);
  --danger: #B3412C; --danger-soft: rgba(179, 65, 44, 0.1); --ok: #5A8A5E; --ok-soft: rgba(90, 138, 94, 0.13);
  --chip: #EEE2D2; --radius: 14px; --contrast: #3A2D24; --on-contrast: #FBF6EE; --on-accent: #FFF8F0; --grain: 0.06;
  --hero: linear-gradient(160deg, #6B4A33 0%, #3E2C21 60%, #2C1F18 100%);
  --glow-1: rgba(214, 140, 80, 0.16); --glow-2: rgba(140, 170, 120, 0.12);
  --shadow: 0 2px 12px rgba(80, 50, 25, 0.1); --shadow-lg: 0 24px 60px rgba(60, 35, 15, 0.22);
}

/* ambiance lofi : halos de lumière et grain de papier */
[data-theme="lofi"] body, [data-theme="cafe"] body {
  background: radial-gradient(1200px 600px at 85% -10%, var(--glow-1), transparent 60%), radial-gradient(900px 500px at -10% 110%, var(--glow-2), transparent 60%), var(--bg);
  background-attachment: fixed;
}
[data-theme="lofi"] body::after, [data-theme="cafe"] body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="cafe"] body::after { mix-blend-mode: multiply; }
[data-theme="lofi"] :is(.page-head h1, .tt-title h1, .auth-card h1, .auth-side h1, .modal-head h2, .panel h3),
[data-theme="cafe"] :is(.page-head h1, .tt-title h1, .auth-card h1, .auth-side h1, .modal-head h2, .panel h3) { font-family: 'PDF Serif', Georgia, serif; font-weight: 600; letter-spacing: 0; }
[data-theme="lofi"] :is(.panel, .notif, .doc-card, .folder-card, .drop, .modal, .menu, .tt-scroll, .tool-card),
[data-theme="cafe"] :is(.panel, .notif, .doc-card, .folder-card, .drop, .modal, .menu, .tt-scroll, .tool-card) { border-radius: 16px; }
[data-theme="lofi"] .side, [data-theme="cafe"] .side { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px); }

/* composants teintés : versions sombres (sombre et lofi nuit) */
[data-dark] .btn.danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
[data-dark] .btn.zonebtn, [data-dark] .lockbar { border-color: color-mix(in srgb, var(--zone) 40%, transparent); }
[data-dark] .ftype.word { background: var(--accent-soft); }
[data-dark] .ftype.image, [data-dark] .ftype.note { background: rgba(167, 139, 250, 0.16); color: #C4B5FD; }
[data-dark] .result, [data-dark] .sign-bar.done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
[data-dark] .chip.tag { background: rgba(167, 139, 250, 0.16); color: #C4B5FD; }
[data-dark] button.chip.tag.on { background: rgba(167, 139, 250, 0.28); border-color: #A78BFA; }
[data-dark] .sresult mark { background: rgba(250, 204, 21, 0.35); }
[data-dark] .sresult .snippet { color: var(--muted); }
[data-dark] .sign-bar, [data-dark] .to-sign { background: var(--zone-soft); border-color: color-mix(in srgb, var(--zone) 35%, transparent); color: var(--text); }
[data-dark] .to-sign-ico { background: var(--panel); }
[data-dark] .chip.cmp-add { background: rgba(52, 211, 153, 0.16); color: #6EE7B7; }
[data-dark] .chip.cmp-chg { background: rgba(250, 204, 21, 0.16); color: #FDE68A; }
[data-dark] .chip.cmp-vis { background: rgba(167, 139, 250, 0.16); color: #C4B5FD; }
[data-dark] .del-text { color: #FCA5A5; }
[data-dark] .add-text { color: #6EE7B7; }
[data-dark] .tb-hl { background: rgba(250, 204, 21, 0.4); }
[data-dark] .callout-swatch { background: rgba(110, 139, 255, 0.16); }
[data-dark] .callout-swatch.callout-tip { background: rgba(245, 158, 11, 0.16); color: #FBBF24; }
[data-dark] .callout-swatch.callout-warn { background: rgba(249, 115, 22, 0.16); color: #FB923C; }
[data-dark] .callout-swatch.callout-danger { background: rgba(239, 68, 68, 0.16); color: #F87171; }
[data-dark] .callout-swatch.callout-success { background: rgba(34, 197, 94, 0.16); color: #4ADE80; }
[data-dark] .callout-swatch.callout-note { background: rgba(139, 92, 246, 0.16); color: #A78BFA; }
[data-dark] :is(.theme-dot) { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line-strong); }
[data-dark] .swatches button.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
[data-dark] .colors button.on { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--text); }
[data-dark] .note-thumb { background: var(--panel-2); }
[data-dark] .doc-thumb { background: var(--panel-2); }
[data-dark] .tt-block { color: color-mix(in srgb, var(--c) 35%, #FFFFFF); background: color-mix(in srgb, var(--c) 22%, var(--panel)); }
[data-dark] .tt-item { background: color-mix(in srgb, var(--c) 18%, var(--panel)); }
[data-dark] .note-app:not(.dark-paper) { background: var(--bg); }
[data-dark] .toast { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
[data-dark] :is(.input, input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.note-paper *):not(.pg *):not(.note-title) { background-color: var(--panel-2); border-color: var(--line); color: var(--text); }
[data-dark] .sig-style, [data-dark] .sig-saved button, [data-dark] .sig-preview, [data-dark] .qr { background: #FFFFFF; color: #16181D; }
[data-theme="cafe"] .note-app:not(.dark-paper) { background: var(--bg); }
[data-theme="cafe"] :is(.input, input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.note-paper *):not(.pg *):not(.note-title) { background-color: #FFFCF7; }

/* sélecteur d'apparence */
.theme-pick { margin: 0 4px 12px; display: flex; flex-direction: column; gap: 6px; }
.theme-pick .tp-label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.theme-pick .tp-label strong { color: var(--text); font-weight: 600; }
.theme-pick .tp-row { display: flex; gap: 6px; }
.theme-pick button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); padding: 0; cursor: pointer; background: var(--sw); position: relative; }
.theme-pick button.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.theme-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ================================================================ mise en page générale */
body { font-size: 14.5px; }
.small { font-size: 12.5px; }
.main { padding: 32px 40px 56px; gap: 22px; }
.main > * { width: 100%; max-width: 1400px; margin-inline: auto; }
.page-head h1 { font-size: 30px; letter-spacing: -0.015em; }
.page-head .titles .muted { font-size: 14.5px; }
.panel h3 { font-size: 16.5px; }
.side a.nav { font-size: 14.5px; padding: 9px 11px; }
.grid-docs { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.list-plain > div { font-size: 13.5px; }

/* états vides : toujours le même cadre */
.empty { padding: 48px 24px; border: 1.5px dashed var(--line); border-radius: 16px; background: color-mix(in srgb, var(--panel) 60%, transparent); font-size: 14.5px; line-height: 1.5; }
.empty > :not(svg) { max-width: 520px; }
.table-box .empty, .panel .empty, .tt-board .empty.small, .modal .empty { border: 0; background: transparent; }

/* notifications */
.notif-list { max-width: 980px; }
.notif { gap: 14px; }
.notif > .grow { max-width: none; }
.notif > .small { margin-left: auto; white-space: nowrap; padding-left: 16px; align-self: flex-start; padding-top: 2px; }
.notif .small.muted { line-height: 1.55; font-size: 13.5px; }

/* Numériser : photos à gauche, réglages à droite */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.scan-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.scan-options { position: sticky; top: 24px; max-width: none; }
.scan-options h3 { margin: 0; }
.inbox-panel p { margin: 0; line-height: 1.55; }
.inbox-panel code { font-size: 12.5px; background: var(--chip); padding: 1px 6px; border-radius: 5px; }

/* onglets : défilement doux avec fondu quand ils dépassent */
.tabs { scrollbar-width: none; scroll-behavior: smooth; }
.tabs::-webkit-scrollbar { display: none; }
.admin-tabs { padding: 0; }
.admin-tabs a, .admin-tabs button { white-space: nowrap; }

/* tableaux : défilement horizontal sur petit écran */
.table-box table { min-width: 640px; }

@media (min-width: 1800px) {
  body { font-size: 15px; }
  .main { padding: 40px 56px 64px; }
}
@media (max-width: 1100px) {
  .scan-layout { grid-template-columns: 1fr; }
  .scan-options { position: static; }
}
@media (max-width: 760px) {
  .main { padding: 20px 16px 40px; gap: 18px; }
  .page-head h1 { font-size: 26px; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .notif { flex-wrap: wrap; }
  .notif > .small { order: -1; width: 100%; padding: 0 0 0 46px; margin: 0 0 -8px; }
  .drop.compact { flex-direction: column; align-items: stretch; text-align: left; }
  .grid-docs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
.panel > .btn, .panel > a.btn { align-self: flex-start; }
