
/* Accueil de l’éditeur */
.annotate-start{max-width:760px;margin:0 auto}.annotate-start h1{font-size:clamp(36px,4.5vw,56px);font-weight:730;letter-spacing:-2.3px;line-height:1.07;margin:18px 0}.annotate-start>p{font-size:16px;line-height:1.7;color:var(--muted);margin-bottom:30px}.annotate-start .dropzone{padding:46px 20px;background-color:#fff}
.annotate-error{font-size:13px;color:#ad432e;background:#fff5f1;border-radius:9px;padding:12px}.annotate-error:empty{display:none}

/* Barre d’outils */
.annotate-page main{padding-top:28px}
.editor-bar{position:sticky;top:10px;z-index:20;display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#fffffff2;backdrop-filter:blur(8px);border:1px solid var(--line);border-radius:16px;padding:10px 10px 10px 18px;box-shadow:0 8px 24px #26304a0f}
.bar-file{display:flex;align-items:baseline;gap:6px;min-width:0;margin-right:auto}.bar-file strong{font-size:14px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-file .text-button{font-size:12px;white-space:nowrap}
.bar-tools{display:flex;background:#eef1fa;border-radius:11px;padding:4px;gap:2px}.tool{border:0;background:none;border-radius:8px;padding:9px 14px;font-size:14px;font-weight:600;color:#5c6b88;display:flex;gap:7px;align-items:center}.tool span{font-size:16px;width:16px;text-align:center}.tool:hover{color:var(--blue)}.tool.active{background:#fff;color:var(--blue);box-shadow:0 1px 3px #26304a1a}
.bar-colors{display:flex;gap:8px;padding:0 4px}.swatch{width:28px;height:28px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #d6dcea;padding:0;background:var(--c)}.swatch[data-color="#1d2433"]{--c:#1d2433}.swatch[data-color="#2f49d8"]{--c:#2f49d8}.swatch[data-color="#d93a2b"]{--c:#d93a2b}.swatch.active{box-shadow:0 0 0 2px var(--c)}
.bar-pen{display:flex;gap:2px;background:#eef1fa;border-radius:11px;padding:4px}.pen-size{width:34px;height:34px;border:0;border-radius:8px;background:none;display:grid;place-items:center;padding:0}.pen-size span{display:block;border-radius:50%;background:#5c6b88}.pen-size[data-width="1.5"] span{width:4px;height:4px}.pen-size[data-width="3"] span{width:8px;height:8px}.pen-size[data-width="6"] span{width:14px;height:14px}.pen-size:hover span{background:var(--blue)}.pen-size.active{background:#fff;box-shadow:0 1px 3px #26304a1a}.pen-size.active span{background:var(--blue)}.editor:not([data-tool=pen]) .bar-pen{display:none}
.undo{font-size:14px;font-weight:600;white-space:nowrap}.undo span{font-size:16px}
.download-pdf{padding:13px 20px;white-space:nowrap;display:flex;gap:8px;align-items:center}.download-pdf span{font-size:17px;line-height:1}
.editor-hint{font-size:12px;color:var(--muted);text-align:center;margin:14px 0 18px;min-height:18px}

/* Pages */
.pages{display:flex;flex-direction:column;align-items:center;gap:26px;padding-bottom:20px}
.page{position:relative;background:#fff;border-radius:4px;box-shadow:0 1px 2px #26304a14,0 10px 30px #26304a12;flex:none}
.page canvas{position:absolute;inset:0;width:100%;height:100%;border-radius:4px}
.page-ink{touch-action:none;cursor:crosshair}
.editor[data-tool=text] .page-ink{touch-action:auto;cursor:text}
.editor[data-tool=eraser] .page-ink{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%23ffffffcc' stroke='%2326304a' stroke-width='1.5'/%3E%3C/svg%3E") 8 8,cell}
.editor[data-tool=eraser] .bar-colors{opacity:.35;pointer-events:none}
.page-texts{position:absolute;inset:0;pointer-events:none}
.page-label{position:absolute;top:100%;left:0;right:0;text-align:center;font-size:11px;color:#9aa5b8;margin-top:6px}

/* Zones de texte */
.text-box{position:absolute;pointer-events:auto}
.text-content{white-space:pre;outline:1px dashed transparent;border-radius:3px;cursor:text;min-height:1em;caret-color:currentColor}
.text-box:hover .text-content{outline-color:#9aabff}
.text-box.selected .text-content{outline:1.5px solid var(--blue);background:#ffffffb3}
.text-tools{position:absolute;bottom:calc(100% + 6px);left:0;display:none;gap:2px;background:#26304a;border-radius:9px;padding:3px;box-shadow:0 4px 12px #26304a33;white-space:nowrap}
.text-box.selected .text-tools,.text-box.moving .text-tools{display:flex}
.text-tools button{border:0;background:none;color:#fff;font-size:13px;font-weight:650;min-width:32px;height:30px;border-radius:7px;padding:0 6px}.text-tools button:hover{background:#ffffff22}
.text-tools .grip{cursor:grab;touch-action:none;font-size:16px}.text-box.moving .grip{cursor:grabbing}.text-tools .remove{color:#ffb3a8;display:grid;place-items:center}.text-tools .remove:hover{background:#d93a2b;color:#fff}

@media(max-width:900px){
 .editor-bar{gap:10px;padding:10px}
 .bar-file{flex:1 0 100%;margin:0 0 2px 6px}
 .download-pdf{margin-left:auto}
}
@media(max-width:600px){
 .annotate-page main{padding:20px 3% 90px}
 .annotate-start>p br{display:none}
 .editor-bar{top:6px;border-radius:14px;gap:8px;backdrop-filter:none;background:#fff}
 .bar-file{margin-bottom:0}.bar-file strong{font-size:13px}
 .tool{padding:8px 11px;font-size:13px}
 .bar-colors{gap:6px}.swatch{width:26px;height:26px}.pen-size{width:30px;height:30px}
 .undo{padding:6px 8px;margin-left:auto}.undo .undo-label{display:none}.undo span{font-size:22px}
 .download-pdf{position:fixed;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));justify-content:center;padding:16px;font-size:15px;z-index:30;box-shadow:0 8px 24px #354edb40}
 .pages{gap:22px}
 .text-tools button{min-width:36px;height:34px}
}
