/* Dowze Note Web — même identité que l'app de bureau (apps/dowze-note-desktop/ui/theme.slint) :
   papier chaud, sarcelle #1d8582, coins 10 px, icônes Lucide. */
:root {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #eeebe4; --sidebar: #ebe7de;
  /* Contrastes vérifiés WCAG 2.2 AA (texte ≥ 4,5:1 sur bg, surface, surface-2, sidebar et
     accent-soft ; bordures des champs ≥ 3:1) : bench/a11y.mjs, docs/BUILD.md. */
  --text: #1c1d1f; --text-dim: #5d5c57; --border: #dad5ca; --border-strong: #858177;
  --accent: #136966; --accent-soft: #13696618; --on-accent: #fff;
  --danger: #b3322b; --danger-fill: #b3322b; --on-danger: #fff;
  --scrim: #00000066; --shadow: 0 6px 24px #0000002a, 0 1px 3px #00000018;
  --radius: 10px; --radius-s: 6px; --quick: 120ms;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141619; --surface: #1e2125; --surface-2: #282c31; --sidebar: #181a1e;
  --text: #ecebe7; --text-dim: #b0b5bc; --border: #353a40; --border-strong: #7a808a;
  --accent: #4fc2ba; --accent-soft: #4fc2ba24; --on-accent: #0b1514;
  --danger: #f29088; --danger-fill: #b3322b; --on-danger: #fff;
  --shadow: 0 6px 24px #00000088, 0 1px 3px #00000066;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 87.5%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 1rem/1.4 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 1.571rem; } h2 { font-size: 1.143rem; } h3 { font-size: 1rem; }
.dim { color: var(--text-dim); } .small { font-size: 0.8571rem; } .upper { text-transform: uppercase; letter-spacing: .05em; }
.block { display: block; } .grow { flex: 1; min-width: 0; } .row { display: flex; align-items: center; } .gap { gap: 8px; } .between { justify-content: space-between; }

/* Démarrage */
#boot { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; font-size: 1.857rem; font-weight: 700; color: var(--accent); background: var(--bg); z-index: 50; }
#boot .boot-sub { font-size: 0.9286rem; font-weight: 400; color: var(--text-dim); }
#main:not(:empty) ~ #boot { display: none; }
.boot-error { max-width: 420px; text-align: center; color: var(--text); font-size: 1rem; font-weight: 400; }

/* Icônes (masque CSS) */
.ic { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 2.429rem; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface); transition: background var(--quick); white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled, .icon-btn:disabled, .tool:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.danger.primary, .modal-actions .btn.danger { background: var(--danger-fill); color: var(--on-danger); border-color: var(--danger-fill); }
.btn.small { min-height: 2rem; padding: 0 9px; font-size: 0.9286rem; }
.btn.tiny { min-height: 1.714rem; padding: 0 7px; font-size: 0.8571rem; }
.btn.large { min-height: 3.143rem; padding: 0 22px; font-size: 1.143rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-s); border: 0; background: transparent; color: var(--text); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.icon-btn.small { width: 28px; height: 28px; } .icon-btn.small .ic { width: 16px; height: 16px; }
.icon-btn.tiny { width: 24px; height: 24px; } .icon-btn.tiny .ic { width: 14px; height: 14px; }
.chip { white-space: nowrap; flex: none; min-height: 2rem; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 0.9286rem; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kbd { color: var(--text-dim); font-size: 0.8571rem; }
.badge { font-size: 0.8571rem; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-dim); }
.split { display: inline-flex; } .split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } .split-more { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; padding: 0 8px !important; border-left: 1px solid #ffffff44 !important; }

/* Mise en page générale */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.screens { flex: 1; min-height: 0; position: relative; }
.library, .editor { position: absolute; inset: 0; display: flex; }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 0.9286rem; border-bottom: 1px solid var(--border); }
.banner.warn { background: #f6e7c4; color: #4d3a0c; } .banner.danger { background: #f6d2cf; color: #5b1712; } .banner.info { background: var(--accent-soft); }
:root[data-theme="dark"] .banner.warn { background: #4a3d1c; color: #f6e7c4; } :root[data-theme="dark"] .banner.danger { background: #5b2420; color: #f6d2cf; }

/* Barre latérale */
.sidebar { width: 260px; flex: none; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 10px 8px; gap: 6px; overflow-x: hidden; overflow-y: auto; }
.sb-head { display: flex; align-items: center; padding: 4px 6px 6px; }
.brand { font-size: 1.571rem; font-weight: 700; color: var(--accent); flex: 1; }
.sb-actions { display: flex; gap: 2px; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { position: relative; display: flex; align-items: center; gap: 6px; min-height: 2.571rem; padding: 0 8px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--border-strong); margin: 0 4px 4px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; }
.search .ic { color: var(--text-dim); width: 16px; height: 16px; }
.recent { position: absolute; left: 0; right: 0; top: 40px; z-index: 30; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.recent li { display: flex; align-items: center; }
.recent-title { padding: 2px 6px 4px; }
.recent-item { flex: 1; text-align: left; background: transparent; border: 0; padding: 6px; border-radius: 4px; }
.recent-item:hover { background: var(--surface-2); }
.sb-list, .tree { list-style: none; margin: 0; padding: 0; }
.tree { flex: 1; overflow: auto; min-height: 40px; }
.sb-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-s); background: transparent; text-align: left; position: relative; }
.sb-row:hover { background: #00000008; } :root[data-theme="dark"] .sb-row:hover { background: #ffffff0a; }
.sb-row[data-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-row .count { font-size: 0.8571rem; font-weight: 400; }
.sb-row.folder { gap: 6px; padding-right: 4px; }
.row-btn { border: 0; background: transparent; text-align: left; padding: 6px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; font-weight: inherit; }
.chev { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: transparent; padding: 0; color: var(--text-dim); }
.chev .ic { width: 14px; height: 14px; } .chev-space { width: 20px; flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; } .dot.subject { width: 4px; height: 18px; border-radius: 2px; }
.emoji { width: 18px; text-align: center; flex: none; }
.hover-only { opacity: 0; } .sb-row:hover .hover-only, .hover-only:focus-visible, .tree-divider:hover .hover-only { opacity: 1; }
.tree-item[data-drop="inside"] > .sb-row { outline: 2px solid var(--accent); }
.tree-item[data-drop="before"] > .sb-row { box-shadow: inset 0 3px 0 var(--accent); }
.tree-item[data-drop="after"] > .sb-row { box-shadow: inset 0 -3px 0 var(--accent); }
.tree-divider { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 2px; }
.tree-empty { padding: 6px 12px; font-size: 0.8571rem; }
.sb-section { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 2px; font-size: 0.7857rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.rename { flex: 1; min-width: 0; min-height: 1.857rem; border: 1px solid var(--accent); border-radius: 4px; padding: 0 6px; background: var(--surface); }
.sb-foot { border-top: 1px solid var(--border); padding-top: 6px; }
.storage-line { display: flex; gap: 6px; align-items: center; padding: 4px 10px; margin: 2px 0 0; }
.storage-line .ic { width: 14px; height: 14px; }

/* Liste des notes */
.notes-area { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: auto; padding: 18px 26px 90px; outline: none; position: relative; }
.lib-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; position: sticky; top: -18px; padding: 8px 0; background: var(--bg); z-index: 5; }
.lib-head h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-actions { display: flex; align-items: center; gap: 6px; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(172px, 12.3rem), 1fr)); gap: 22px 18px; }
.notes.list { display: flex; flex-direction: column; gap: 2px; }
.note-card { position: relative; border-radius: var(--radius); }
.card-main { display: flex; flex-direction: column; align-items: stretch; width: 100%; border: 0; background: transparent; padding: 0; text-align: center; }
.notes.grid .thumb { position: relative; aspect-ratio: 612 / 792; border-radius: 8px; overflow: hidden; background: #fbfaf6; border: 1px solid var(--border); box-shadow: 0 1px 3px #0000001a; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.paper-ph { position: absolute; inset: 0; background: repeating-linear-gradient(#fbfaf6 0 15px, #cfdbe8 15px 16px); }
:root[data-theme="dark"] .notes.grid .thumb { background: #e9e6df; }
.card-main:hover .thumb, .card-main:focus-visible .thumb { box-shadow: 0 0 0 2px var(--accent); }
.note-card[data-selected="true"] .thumb { box-shadow: 0 0 0 3px var(--accent); }
.fav { position: absolute; top: 6px; right: 6px; color: #e0a23a; } .fav .ic { width: 18px; height: 18px; }
.check { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: #00000033; display: grid; place-items: center; color: #fff; }
.check[data-on="true"] { background: var(--accent); }
.check .ic { width: 14px; height: 14px; }
.meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px 0; min-width: 0; }
.meta .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.card-more { position: absolute; top: 4px; left: 4px; opacity: 0; background: var(--surface) !important; box-shadow: var(--shadow); }
.note-card:hover .card-more, .card-more:focus-visible { opacity: 1; }
.notes.list .card-main { flex-direction: row; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-s); text-align: left; }
.notes.list .card-main:hover { background: var(--surface-2); }
.notes.list .thumb { width: 34px; height: 44px; flex: none; position: relative; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); background: #fbfaf6; }
.notes.list .meta { flex-direction: row; justify-content: space-between; flex: 1; padding: 0; gap: 16px; }
.notes.list .card-more { left: auto; right: 8px; top: 14px; }
.notes.list .fav { top: 2px; right: 2px; } .notes.list .fav .ic { width: 12px; height: 12px; }
.card-actions { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-dim); text-align: center; padding: 40px; }
.empty .ic { width: 48px; height: 48px; opacity: .5; }
.folder-results { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.selection-bar { position: sticky; bottom: -72px; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 6; }

/* Menus et popovers */
.backdrop { position: fixed; inset: 0; z-index: 40; }
.menu { position: fixed; z-index: 41; min-width: 230px; max-width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); outline: none; }
.menu.anchored { position: absolute; top: calc(100% + 6px); left: 0; }
.menu.anchored.right { left: auto; right: 0; }
.anchor { position: relative; }
.menu-title { padding: 6px 10px 4px; font-size: 0.8571rem; font-weight: 600; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--radius-s); text-align: left; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--surface-2); }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item.danger { color: var(--danger); }
.menu-item:disabled, .menu-item[aria-disabled="true"] { opacity: .45; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.zoom-presets { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }

/* Modales */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 60; }
.modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(max(440px, 31.4rem), calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.modal.wide { width: min(max(820px, 58.6rem), calc(100vw - 32px)); height: min(max(600px, 42.9rem), calc(100vh - 48px)); padding: 0; }
.modal p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9286rem; }
.field input, .field select, .setting select, .hex { min-height: 2.429rem; border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 0 10px; background: var(--surface); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.9286rem; }
.move-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-s); }
.cust-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cust-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--radius-s); background: var(--surface-2); }
.modal.wide:has(.cust-list) { padding: 22px; height: auto; }

/* Réglages */
.settings { display: flex; height: 100%; }
.settings-nav { width: auto; min-width: min(max(230px, 16.4rem), 40%); max-width: 40%; flex: none; overflow-y: auto; overflow-wrap: anywhere; background: var(--sidebar); padding: 18px 8px; border-right: 1px solid var(--border); }
.settings-nav h2 { padding: 0 10px 12px; }
.settings-nav ul { list-style: none; margin: 0; padding: 0; }
.settings-body { flex: 1; overflow: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.setting { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-s); }
.setting input[type="checkbox"] { width: 40px; height: 22px; accent-color: var(--accent); }
.s-label { font-weight: 550; min-width: min(8em, 100%); }
.card { padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.card p { margin: 0; }
.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.segmented button { min-height: 2rem; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 0.9286rem; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px #0000001f; }
.setting .segmented { background: var(--surface); }

/* Bienvenue */
.welcome { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 20; }
.welcome-card { width: min(460px, calc(100vw - 32px)); padding: 34px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.welcome-logo { width: 84px; height: 84px; }
.welcome-points { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.welcome-points li { display: flex; gap: 10px; align-items: center; } .welcome-points .ic { color: var(--accent); }

/* Toasts, attente, dépôt */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: #26292d; color: #f1efe9; box-shadow: var(--shadow); font-size: 0.9286rem; }
.toast .btn { background: transparent; color: #8fe0d9; border-color: #ffffff33; }
.busy { position: fixed; inset: auto 0 80px 0; margin: auto; width: fit-content; display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 72; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop-overlay { position: fixed; inset: 0; z-index: 80; background: #1d858233; display: grid; place-items: center; pointer-events: none; border: 3px dashed var(--accent); }
.drop-card { display: flex; gap: 10px; align-items: center; padding: 16px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 600; }

/* Éditeur */
.ed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-top { min-height: 3.714rem; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.title-input { min-width: 80px; width: 38%; max-width: 460px; min-height: 2.429rem; border: 1px solid transparent; border-radius: var(--radius-s); padding: 0 8px; background: transparent; font-size: 1.214rem; font-weight: 650; }
.title-input:hover, .title-input:focus { border-color: var(--border-strong); background: var(--bg); }
.ed-body { flex: 1; min-height: 0; display: flex; }
.canvas-host { flex: 1; min-width: 0; position: relative; overflow: hidden; background: var(--bg); }
#ink { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: crosshair; }
#ink:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.toolbox-wrap { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; align-items: center; max-width: calc(100% - 24px); }
.toolbox-wrap.bottom { top: auto; bottom: 14px; flex-direction: column-reverse; }
.toolbox { display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.tool { position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.tool .ic { width: 20px; height: 20px; }
.tool:hover:not(:disabled) { background: var(--surface-2); }
.tool[data-active="true"], .tool[data-toggled="true"], .tool[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }
.tool-ink { position: absolute; left: 9px; right: 9px; bottom: 3px; height: 3px; border-radius: 2px; }
.eraser-dot { position: absolute; right: 3px; bottom: 3px; border-radius: 50%; border: 1.5px solid currentColor; transform: scale(.45); transform-origin: bottom right; }
.sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: none; }
.popover { position: relative; z-index: 41; margin-top: 8px; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100vh - 160px); overflow: auto; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.toolbox-wrap.bottom .popover { margin: 0 0 8px; }
.pop-head { display: flex; align-items: center; justify-content: space-between; }
.pop-sec { display: flex; flex-direction: column; gap: 8px; }
.pop-sec .label { font-size: 0.8571rem; font-weight: 600; color: var(--text-dim); }
.pop-sec .value { font-size: 0.8571rem; font-variant-numeric: tabular-nums; }
.pad { padding: 4px; margin: 0; }
.swatches { display: flex; gap: 6px; } .swatches.wrap { flex-wrap: wrap; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.palette.ext { grid-template-columns: repeat(14, 1fr); gap: 3px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #0000002a; padding: 0; flex: none; display: grid; place-items: center; }
.palette .swatch { width: 100%; height: auto; aspect-ratio: 1; }
.swatch.small { width: 20px; height: 20px; }
.swatch.empty { border: 1.5px dashed var(--border); background: transparent; }
.swatch.none .ic { width: 14px; height: 14px; }
.swatch[data-on="true"], .swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.hex { width: 96px; font-family: ui-monospace, monospace; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { display: flex; align-items: center; gap: 2px; padding: 2px 2px 2px 6px; border: 1px solid var(--border); border-radius: 8px; }
.preset-btn { width: 44px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; }
.preset-line { display: block; width: 34px; border-radius: 4px; }
.dot-preview { border-radius: 50%; background: var(--text); flex: none; }
.shape-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.menu-list { display: flex; flex-direction: column; }
.zoom-bar { position: absolute; right: 14px; bottom: 14px; z-index: 9; display: flex; align-items: center; gap: 2px; min-height: 3.143rem; padding: 0 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.zoom-pct { min-width: 58px; min-height: 2.143rem; border: 0; background: transparent; border-radius: 6px; font-variant-numeric: tabular-nums; }
.zoom-pct:hover { background: var(--surface-2); }
.page-nav { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); opacity: .9; }
.page-field { width: 40px; min-height: 2rem; text-align: center; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); font-variant-numeric: tabular-nums; }
.ed-banner { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #26292d; color: #f1efe9; border-radius: var(--radius); }
.ed-banner .btn { background: transparent; color: #8fe0d9; border-color: #ffffff33; }
.text-bar, .sel-bar { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: calc(100% - 24px); overflow-x: auto; }
.toolbox-wrap.bottom ~ .text-bar, .toolbox-wrap.bottom ~ .sel-bar { bottom: 74px; }
.gpu-error { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 30px; background: var(--bg); }
.gpu-error p { margin: 0; max-width: 460px; }

/* Texte : pont IME (le texte, le curseur et la sélection sont dessinés par le canevas) */
.ime-bridge { position: absolute; left: -10px; top: 0; width: 2px; height: 20px; padding: 0; border: 0; margin: 0; opacity: 0; resize: none; overflow: hidden; z-index: 2; color: transparent; background: transparent; caret-color: transparent; white-space: pre; }

/* Gestionnaire de pages */
.page-manager { width: 230px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--sidebar); }
.pm-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.pm-list { list-style: none; margin: 0; padding: 8px 18px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.pm-item { display: flex; flex-direction: column; gap: 4px; }
.pm-item[data-over="true"] .pm-thumb { box-shadow: 0 -3px 0 var(--accent); }
.pm-thumb { position: relative; width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 0; box-shadow: 0 1px 3px #0000001a; }
.pm-item[data-current="true"] .pm-thumb { box-shadow: 0 0 0 2.5px var(--accent); }
.pm-row { display: flex; align-items: center; gap: 2px; }
.pdf-tag { position: absolute; left: 6px; bottom: 6px; font-size: 0.7857rem; padding: 1px 6px; border-radius: 8px; background: #26292dcc; color: #fff; }
.bm { position: absolute; right: 4px; top: 2px; color: #e14e41; }
.pm-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.paper { background-color: #fbfaf6; }
.paper.lined { background-image: repeating-linear-gradient(transparent 0 11px, #c9d8ea 11px 12px); }
.paper.grid { background-image: linear-gradient(#d3dce6 1px, transparent 1px), linear-gradient(90deg, #d3dce6 1px, transparent 1px); background-size: 12px 12px; }
.paper.dotted { background-image: radial-gradient(#b8c3cf 1px, transparent 1.2px); background-size: 12px 12px; }
.paper-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.paper-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.paper-choice[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); color: var(--accent); font-weight: 600; }
.swatch-page { width: 56px; height: 72px; border-radius: 4px; border: 1px solid var(--border); }

/* Petits écrans */
.only-narrow { display: none; }
@media (max-width: 760px) {
  .only-narrow { display: inline-grid; } .only-wide { display: none !important; }
  .library .sidebar { position: absolute; z-index: 30; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .library[data-sidebar-open="true"] .sidebar { transform: none; }
  /* Barre latérale repliée : hors de l'ordre de tabulation et de l'arbre d'accessibilité. */
  .library:not([data-sidebar-open="true"]) .sidebar { visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  .notes-area { padding: 12px 14px 90px; }
  .notes.grid { grid-template-columns: repeat(auto-fill, minmax(max(130px, 9.3rem), 1fr)); gap: 16px 12px; }
  .lib-actions .split .btn:first-child span { display: none; }
  .title-input { width: auto; flex: 1; }
  .page-manager { position: absolute; right: 0; top: 0; bottom: 0; z-index: 15; }
  .settings-nav { width: 64px; min-width: 64px; padding: 18px 4px; } .settings-nav h2, .settings-nav .sb-row span:not(.ic) { display: none; }
  .page-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.pm-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }

/* Phase 2 : onglets, vue partagée, concentration */
.tab-bar { display: flex; align-items: center; gap: 4px; min-height: 2.714rem; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--sidebar); overflow-x: auto; flex: none; }
.tab { display: flex; align-items: center; gap: 2px; max-width: 220px; min-height: 2.143rem; padding: 0 2px 0 10px; border-radius: 8px; border: 1px solid transparent; }
.tab[data-active="true"] { background: var(--surface); border-color: var(--border); }
.tab-btn { border: 0; background: transparent; padding: 0; min-width: 0; }
.tab-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.canvas-host[data-split="true"]::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 4px); width: 8px; background: var(--border); pointer-events: none; z-index: 1; }
.editor[data-focus="true"] .page-nav, .editor[data-focus="true"] .zoom-bar { opacity: .35; }
.focus-exit { position: absolute; left: 12px; top: 12px; z-index: 12; opacity: .55; }
.focus-exit:hover, .focus-exit:focus-visible { opacity: 1; }
.sync-dot { display: inline-grid; place-items: center; color: var(--text-dim); }
.sync-dot[data-status="Synchronisé"] { color: var(--accent); }
.danger-text { color: var(--danger); }

/* Recherche dans la note, liens, barre de texte flottante, menu « / » */
.find-bar { position: absolute; right: 14px; top: 76px; z-index: 13; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: calc(100% - 28px); }
.find-row { display: flex; align-items: center; gap: 4px; }
.find-input { width: 220px; min-height: 2.143rem; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); }
.find-status { min-width: 80px; }
.link-pop { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); z-index: 14; width: 320px; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.link-pop input { min-height: 2.286rem; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-bar.floating { transform: none; bottom: auto; }
.text-bar .sep, .sel-bar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; flex: none; }
.slash-menu { position: absolute; z-index: 14; max-height: 260px; overflow: auto; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.slash-menu .menu-item[aria-selected="true"] { background: var(--accent-soft); }

/* Sélecteur de notes, modèles, autocollants */
.switcher-input { min-height: 2.714rem; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); font-size: 1.071rem; }
.switcher-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.switcher-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.switcher-item[aria-selected="true"], .switcher-item:hover { background: var(--accent-soft); }
.switcher-title { font-weight: 600; }
.modal.wide:has(.tpl-grid) { padding: 22px; overflow: auto; }
.tpl-cat { margin: 6px 0 0; font-size: 0.9286rem; color: var(--text-dim); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.tpl-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tpl-item:hover { border-color: var(--accent); }
.tpl-img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--border); }
.tpl-img.placeholder { background: var(--surface-2); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; padding: 4px 6px; }
.sticker { width: 56px; height: 56px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 2px; overflow: hidden; }
.sticker img { width: 100%; height: 100%; object-fit: contain; }
.pad { padding: 4px 10px; margin: 0; }

/* Extraits de recherche (bibliothèque) */
.snippet { display: block; color: var(--text-dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.snippet mark { background: #ffe58a; color: inherit; border-radius: 2px; }
.snip-src { font-weight: 600; }

/* Cartes d'étude */
.study-panel { width: 320px; flex: none; display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; border-left: 1px solid var(--border); background: var(--sidebar); overflow: auto; }
.study-panel .pm-head { padding: 12px 0 0; }
.deck-list, .card-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.deck-row, .card-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.card-row[data-suspended="true"] { opacity: .55; }
.deck-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; background: transparent; text-align: left; padding: 0; }
.deck-name { font-weight: 600; }
.study-card { min-height: 160px; padding: 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 1.143rem; display: flex; flex-direction: column; gap: 10px; }
.study-card hr { border: 0; border-top: 1px dashed var(--border); width: 100%; }
.study-rates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.study-rates .btn { flex-direction: column; height: auto; padding: 6px; gap: 0; }
.study-add { display: flex; flex-direction: column; gap: 6px; }
.study-add textarea, .study-panel input[type="text"] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; }

/* Audio */
.audio-bar { position: absolute; left: 14px; bottom: 14px; z-index: 12; display: flex; align-items: center; gap: 6px; min-height: 3.143rem; padding: 0 10px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.audio-bar select { min-height: 2rem; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0453a; animation: blink 1.2s steps(1) infinite; flex: none; }
@keyframes blink { 50% { opacity: .35; } }
.meter { width: 60px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) calc(var(--level) * 100%), var(--surface-2) 0); }
.scrub { width: 180px; accent-color: var(--accent); }
.audio-panel { position: absolute; left: 14px; bottom: 66px; z-index: 12; width: min(520px, calc(100% - 24px)); padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.timeline { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.timeline .seg { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: var(--accent-soft); border: 1px solid var(--accent); }
.timeline .playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rec-row { display: flex; align-items: center; gap: 6px; }
.rec-row[data-playing="true"] { color: var(--accent); }
.rec-row input { min-height: 2rem; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 0 6px; }
.rec-row input:focus { border-color: var(--border); background: var(--bg); }
.btn.primary .dim { color: inherit; opacity: .85; }

/* Transcription (panneau Audio) */
.audio-panel { max-height: min(70vh, 640px); overflow: auto; }
.transcripts { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.transcripts h3 { margin: 0; font-size: 1rem; }
.tr-head select { min-height: 2rem; max-width: 170px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); }
.tr-search { min-height: 2.143rem; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); font: inherit; }
.tr-hits, .tr-segments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-segments { max-height: 220px; overflow: auto; }
.tr-seg, .tr-hit { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; color: inherit; font: inherit; font-size: 0.9286rem; }
.tr-seg:hover, .tr-hit:hover { background: var(--surface-2); }
.tr-segments li[data-active="true"] .tr-seg { background: var(--accent-soft); color: var(--accent); }
.tr-section { display: flex; flex-direction: column; gap: 4px; }

/* Learn et Chat */
.learn-panel { width: 360px; }
.learn-panel .tabs { display: flex; }
.learn-panel .tabs button { flex: 1; }
.learn-job { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.learn-text { white-space: pre-wrap; font-size: 0.9286rem; line-height: 1.45; max-height: 260px; overflow: auto; }
.quiz { display: flex; flex-direction: column; gap: 8px; }
.quiz-q { font-weight: 600; margin: 0; }
.quiz-choices { display: flex; flex-direction: column; gap: 6px; }
.quiz-choice { justify-content: flex-start; height: auto; min-height: 34px; padding: 6px 10px; text-align: left; white-space: normal; }
.quiz-choice[data-state="right"] { border-color: #2e9d57; background: color-mix(in srgb, #2e9d57 14%, var(--surface)); }
.quiz-choice[data-state="wrong"] { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.chat-log { flex: 1; min-height: 160px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 0.9286rem; display: flex; flex-direction: column; gap: 4px; }
.chat-msg[data-role="user"] { align-self: flex-end; max-width: 85%; background: var(--accent-soft); border-color: transparent; }
.chat-text { white-space: pre-wrap; line-height: 1.45; }
.chat-tool { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; background: var(--surface-2); }
.chat-compose { display: flex; gap: 6px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: vertical; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font: inherit; }
.caret { animation: blink 1s steps(1) infinite; }

/* Calendrier */
.upcoming { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.upcoming h2 { margin: 0; font-size: 1.071rem; display: flex; gap: 6px; align-items: center; }
.cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface); }
.cal-item[data-ended="true"] { opacity: .6; }
.cal-time { width: 96px; flex: none; color: var(--text-dim); }
.cal-title { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.cal-modal { display: flex; flex-direction: column; }
.cal-modal .pm-head { padding: 14px 18px 0; display: flex; align-items: center; gap: 8px; }
.cal-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; padding: 12px 18px 18px; overflow: auto; flex: 1; min-height: 0; }
.cal-side { display: flex; flex-direction: column; gap: 8px; }
.cal-side h3, .cal-day h3 { margin: 6px 0 0; font-size: 1rem; }
.cal-side input[type="url"], .cal-form input, .syl-review input[type="text"] { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; }
.cal-form { display: flex; flex-direction: column; gap: 6px; }
.center { text-align: center; }
.reminder-card { position: fixed; right: 16px; bottom: 16px; z-index: 70; width: min(340px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.linkish { border: 0; background: transparent; color: var(--accent); padding: 0; text-align: left; text-decoration: underline; }
@media (max-width: 720px) { .cal-body { grid-template-columns: 1fr; } }

/* Abonnement */
.gauge { display: flex; flex-direction: column; gap: 2px; }
.gauge progress { width: 100%; accent-color: var(--accent); }
.plans { display: flex; flex-wrap: wrap; gap: 6px; }
.paywall h2 { margin: 0; }

/* Reconnaissance */
.recog-status { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); z-index: 14; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.9286rem; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; }
.convert-menu { display: inline-flex; gap: 2px; }

/* Assets en cours de téléchargement (synchronisation) */
.asset-ph { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 70%, transparent); pointer-events: none; overflow: hidden; }
.asset-chip { position: absolute; right: 14px; bottom: 14px; z-index: 12; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Transcription en direct */
.live-caption { position: absolute; left: 14px; bottom: 66px; z-index: 12; width: min(520px, calc(100% - 24px)); max-height: 30vh; overflow: auto; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.9286rem; }
.live-caption p { margin: 2px 0; }
.live-partial { font-style: italic; color: var(--text-dim); }


/* ------------------------------------------------------------------ accessibilité */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-s); background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--bg); }
.danger-text { color: var(--danger); }
.tab-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; min-width: 0; overflow-x: auto; }
.sb-list { list-style: none; margin: 0; padding: 0; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.tpl-grid { list-style: none; margin: 0; padding: 0; }
.tpl-cell { display: contents; }
.move-list li { list-style: none; }
.tree-empty { margin: 4px 10px; }
/* Plan de la note : lu par les lecteurs d'écran, affiché quand un de ses éléments a le focus. */
.note-outline { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.note-outline:focus-within { clip-path: none; white-space: normal; width: min(420px, calc(100% - 24px)); height: auto; max-height: calc(100% - 24px); overflow: auto; left: 12px; top: 12px; z-index: 20; padding: 14px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.note-outline h2 { font-size: 1.143rem; margin-bottom: 4px; } .note-outline h3 { font-size: 1rem; margin: 12px 0 4px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.note-outline .outline-text { margin: 4px 0; white-space: pre-wrap; } .note-outline ul { list-style: none; margin: 6px 0 0; padding: 0; }
#help-dialog { padding: 20px 24px; overflow: auto; height: auto; max-height: calc(100vh - 48px); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 22px; margin: 6px 0 12px; }
.help-grid h3 { margin: 8px 0 6px; }
.shortcuts { margin: 0; } .shortcut { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--border); }
.shortcut dt { flex: none; min-width: 7.5em; } .shortcut dd { margin: 0; }
kbd { font: 600 0.857rem/1.4 var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); white-space: nowrap; }

/* Mouvement réduit : ni animation, ni transition, ni défilement animé. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .rec-dot { animation: none; }
}
/* Contraste renforcé (réglage du système) : bordures et texte secondaire plus marqués. */
@media (prefers-contrast: more) {
  :root { --text-dim: #3f3e3a; --border: #858177; --border-strong: #4d4a44; --accent: #0d4f4c; --accent-soft: #0d4f4c22; }
  :root[data-theme="dark"] { --text-dim: #d4d7dc; --border: #7a808a; --border-strong: #b8bdc4; --accent: #7fdcd5; --accent-soft: #7fdcd533; }
  .btn, .chip, .icon-btn, .tool, .segmented button { border: 1px solid var(--border-strong); }
  :focus-visible { outline-width: 3px; }
}
/* Couleurs forcées (contraste élevé de Windows) : couleurs du système, icônes visibles, états
   indiqués par la bordure. */
@media (forced-colors: active) {
  .ic { forced-color-adjust: none; background: CanvasText; }
  button .ic, [role="button"] .ic { background: ButtonText; }
  button:disabled .ic { background: GrayText; }
  .btn, .icon-btn, .chip, .tool, .segmented button, .sb-row, .menu-item, .tab-btn, .swatch { border: 1px solid ButtonText; }
  [aria-pressed="true"], [aria-checked="true"], [aria-selected="true"], [aria-current="page"], [data-selected="true"], .tool[data-active="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  [aria-pressed="true"] .ic, [aria-checked="true"] .ic, [aria-current="page"] .ic, .tool[data-active="true"] .ic { background: Highlight; }
  :focus-visible { outline: 3px solid Highlight !important; }
  .modal, .menu, .popover, .toast, .note-outline:focus-within, .audio-bar, .zoom-bar, .toolbox { border: 1px solid CanvasText; }
  .scrim { background: transparent; }
  .swatch { forced-color-adjust: none; }
  #ink { forced-color-adjust: none; }
}
