/* Atelier littéraire : disposition commune, palette et polices du thème choisi. */
/* La première saisie peut être un texte direct, sans <p> créé par le navigateur. */
#editor{text-indent:1.8em}
#editor>:is(h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table,figure,.texto-bloc,.texto-bulle,.texto-controls){text-indent:0}
#carnet-view,#carnet-editor{min-width:0;min-height:0}
@media(max-width:640px){
 #carnet-view{flex-direction:column!important}
 #carnet-sidebar{max-height:28vh;max-height:28dvh}
 #carnet-list{min-height:0}
 #carnet-header{padding:12px 18px}
 #carnet-body{padding:18px;min-height:0}
 #carnet-meta{gap:8px;flex-wrap:wrap}
 #carnet-genre-input{min-width:0;width:100px;flex:1}
}
.module-label{font:400 12px var(--font-mono);color:var(--ink3);letter-spacing:.08em;text-transform:uppercase}
html body.atelier #db-topbar>.module-label{display:block}
html body.atelier #db-topbar>.tb-sep{display:block;background:var(--paper3)!important}
#db-navigation button[aria-current],#carnet-navigation button[aria-current]{font-weight:600}
body.editor-plan #etb{display:none!important}
#plan-heading{font:400 24px var(--font-display);color:var(--ink);padding:20px 24px 8px;margin:0}
#chap-plan{max-width:720px;margin:0 auto 20px;border:1px solid var(--paper3);border-radius:6px;background:var(--paper2);color:var(--ink2)}
#chap-plan[hidden]{display:none!important}
#chap-plan summary{padding:10px 14px;cursor:pointer;font:400 16px var(--font-serif)}
#chap-plan textarea{display:block;width:100%;min-height:110px;resize:vertical;border:0;border-top:1px solid var(--paper3);padding:12px 14px;background:var(--paper);color:var(--ink);font:400 17px/1.5 var(--font-serif)}
body.editor-concentration #chap-plan{display:none!important}
@media(max-width:640px){html body.atelier #db-topbar,html body.atelier #carnet-page>div:first-child{flex-wrap:wrap}.module-label{font-size:10px}}
.db-card-cover{position:relative;margin-bottom:14px}
html body.atelier .db-card-cover.has-indicators .db-card-couv-placeholder{padding-bottom:65px!important}
html body.atelier .db-card-cover .db-card-couv,html body.atelier .db-card-cover .db-card-couv-placeholder{display:block;margin-bottom:0}
.db-card-indicators{position:absolute;bottom:8px;left:8px;right:8px;display:flex;flex-wrap:wrap;gap:5px;pointer-events:none}
.db-card-indicator{display:inline-flex;align-items:center;gap:5px;background:var(--paper);color:var(--ink);border:1px solid var(--paper3);border-radius:5px;padding:4px 7px;font:400 12px/1.2 var(--font-serif);box-shadow:0 2px 6px rgba(0,0,0,.15)}
.db-card-indicator svg{width:14px;height:14px;flex-shrink:0}
html.zine .db-card-indicator{border-color:var(--zine-pink);color:var(--accent2)}
/* Éditeur commun aux cinq thèmes ; les préférences de police/zoom restent prioritaires. */
/* Menu d’origine : bandeau compact et noms visibles ; retour à la ligne si nécessaire. */
body.editor-atelier #topbar{height:auto;min-height:42px;flex-wrap:wrap}
body.editor-atelier #topbar .tb-btn-label{display:inline}
body.editor-atelier #sidebar{width:220px}
body.editor-atelier #sb-projet{padding:20px 16px}
body.editor-atelier #sbp-titre{font-size:19px;font-weight:400}
body.editor-atelier .ci{padding-top:10px;padding-bottom:10px}
body.editor-atelier #ez{min-width:0}
body.editor-atelier #etb{padding:18px 24px;gap:12px;flex-wrap:wrap}
body.editor-atelier #chap-ti,body.editor-atelier #chap-titre2{font-size:23px;font-weight:400}
body.editor-atelier #chap-narr{font-size:16px}
body.editor-atelier #wc{font-size:12px;color:var(--ink3);white-space:nowrap}
body.editor-atelier #fmt-bar{background:var(--paper);padding:10px 20px;overflow-x:auto;flex-wrap:nowrap;min-height:50px}
body.editor-atelier #fmt-bar>*{flex-shrink:0}
body.editor-atelier #fmt-bar .fmt-btn{min-height:36px}
body.editor-atelier #es{padding:32px clamp(22px,5vw,72px)}
body.editor-atelier #editor{max-width:720px;font-size:21px;line-height:1.8}
html.zine body.editor-atelier #editor{font-family:'Crimson Pro',Georgia,serif}
html.zine body.editor-atelier #chap-ti,html.zine body.editor-atelier #chap-titre2{color:var(--accent2);font-family:'Crimson Pro',Georgia,serif}
html.vintage body.editor-atelier #etb{border-bottom:1px solid var(--paper3)}
body.editor-atelier #sb{background:var(--paper);color:var(--ink3);padding:10px 20px;border-top:1px solid var(--paper3);gap:16px;flex-wrap:wrap}
#editor-mobile-header{display:none}
body.editor-atelier .editor-focus-btn[aria-pressed="true"]{color:var(--accent2)!important;background:var(--paper2)}
body.editor-concentration #sidebar,body.editor-concentration #panel,body.editor-concentration #fmt-bar{display:none!important}
body.editor-concentration #es{padding-top:40px}
@media(min-width:901px){
 body.editor-atelier #panel{display:flex;width:280px}
}
@media(max-width:900px){
 #editor-mobile-header{display:flex;align-items:center;gap:8px;min-height:62px;padding:10px 16px;flex-shrink:0;background:var(--paper);border-bottom:1px solid var(--paper3);--encre-logo-color:var(--ink)}
 #editor-mobile-header .logo{background:none;border:0;margin:0 auto 0 0;padding:0;cursor:pointer}
 #editor-mobile-header .tb-btn{color:var(--ink);min-height:40px;padding:6px 8px;font-size:13px}
 body.editor-atelier #sidebar{width:100%}
 body.editor-atelier #etb{padding:12px 18px;gap:8px;display:grid;grid-template-columns:auto minmax(0,1fr) auto}
 body.editor-atelier #chap-n{grid-column:1;grid-row:1}
 body.editor-atelier #chap-ti{grid-column:2;grid-row:1;width:100%;font-size:19px}
 body.editor-atelier #wc{grid-column:3;grid-row:1}
 body.editor-atelier #chap-titre2{grid-column:1 / -1;grid-row:2;width:100%;font-size:20px}
 body.editor-atelier #chap-narr{grid-column:1 / -1;grid-row:3;width:100%;font-size:16px}
 body.editor-atelier #fmt-bar{padding:6px 12px}
 body.editor-atelier #es{padding:24px 22px}
 body.editor-atelier #editor{font-size:20px}
 body.editor-atelier #mobile-nav{background:var(--paper);border-top:1px solid var(--paper3);height:calc(56px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
 body.editor-atelier .mnav-btn{color:var(--ink3)}
 body.editor-atelier .mnav-btn.active{color:var(--accent2)}
 body.editor-atelier #app{padding-bottom:calc(56px + env(safe-area-inset-bottom))}
 body.editor-atelier #mobile-save{bottom:calc(64px + env(safe-area-inset-bottom))}
}
html body.atelier #db-topbar{background:var(--paper);color:var(--ink);height:auto;min-height:72px;border-bottom:1px solid var(--paper3);padding:12px 32px;gap:16px;position:relative;z-index:5}
html body.atelier #db-topbar .logo{color:var(--ink);font-family:var(--font-display);font-size:26px;margin-right:0}
html body.atelier #db-topbar .logo em{color:var(--ink)}
html body.atelier #db-user{color:var(--ink3);margin-left:auto;font-size:12px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#db-plus summary,.db-card-tools summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:8px 14px;border:1px solid var(--paper3);border-radius:8px;color:var(--ink);font-family:var(--font-serif)}
#db-plus summary::-webkit-details-marker,.db-card-tools summary::-webkit-details-marker{display:none}
html body.atelier #db-topbar-right{position:absolute;right:24px;top:calc(100% - 6px);z-index:10;width:min(320px,calc(100vw - 32px));max-height:calc(100dvh - 160px);overflow-y:auto;background:var(--paper);border:1px solid var(--paper3);border-radius:12px;padding:10px;display:flex;flex-direction:column;align-items:stretch;gap:2px;box-shadow:0 10px 30px rgba(0,0,0,.15)}
html body.atelier #db-topbar-right>*{color:var(--ink)!important;font:400 16px/1.4 var(--font-serif);padding:10px 12px!important;border:0!important;border-radius:6px;min-height:44px;height:auto;justify-content:flex-start;text-decoration:none;opacity:1!important;margin:0!important}
html body.atelier #db-topbar-right>*:hover{background:var(--paper2)}
html body.atelier #db-topbar-right .tb-desktop-only{display:flex}
html body.atelier #db-body{padding:28px clamp(20px,5vw,72px) 36px;width:100%;max-width:1280px;align-self:center;min-height:0;scroll-padding:24px}
html body.atelier #db-greeting{font-family:var(--font-display)!important;font-size:28px!important;margin-bottom:24px!important}
html body.atelier #db-greeting>span{font-family:var(--font-serif);font-size:18px!important}
#db-reprendre{position:relative;background:var(--paper2);border:1px solid var(--paper3);border-radius:14px;padding:28px 32px;margin-bottom:36px;max-width:760px}
#db-reprendre[hidden]{display:none}
.atelier-eyebrow{font-family:var(--font-mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink3)}
html body.atelier #db-reprendre h2{font-size:30px;margin:12px 0 8px;overflow-wrap:anywhere}
#db-reprendre p{color:var(--ink3);margin:0 0 22px;font-size:17px}
.atelier-continue{border:0;border-radius:8px;background:var(--ink);color:var(--paper);font:400 17px var(--font-serif);padding:12px 20px;min-height:46px;cursor:pointer}
.atelier-library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:22px}
html body.atelier .atelier-library-heading h2{margin:0;font-size:25px}
.atelier-new{color:var(--ink);background:var(--paper);border:1px solid var(--paper3);border-radius:8px;min-height:44px;padding:9px 14px;font:400 16px var(--font-serif);cursor:pointer}
html body.atelier #db-projets-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:24px;align-items:start;margin-bottom:24px}
html body.atelier .db-projet-card{min-width:0;background:var(--paper);border:0;border-radius:10px;padding:0;box-shadow:none;transform:none;cursor:default}
html body.atelier .db-projet-card.actif{background:var(--paper);border:0}
html body.atelier .db-card-couv{height:190px;border-radius:4px 12px 12px 4px;margin-bottom:14px;object-fit:cover}
html body.atelier .db-card-couv-placeholder{width:100%;height:190px;min-height:190px;background:var(--paper2);color:var(--ink);border:1px solid var(--paper3);border-left:5px solid var(--accent);border-radius:4px 12px 12px 4px;font:400 26px/1.35 var(--font-display);text-transform:none;letter-spacing:0;text-align:center;padding:22px;margin-bottom:14px;overflow-wrap:anywhere}
html body.atelier .db-card-titre{font-size:20px;white-space:normal;overflow-wrap:anywhere;font-weight:400;line-height:1.3}
html body.atelier .db-card-auteur{font-size:15px;color:var(--ink3)}
html body.atelier .db-card-mots,html body.atelier .db-card-date{font-size:11px;color:var(--ink3)}
html body.atelier .db-card-statut{background:var(--paper2)!important;color:var(--ink3)!important;font-size:11px}
.db-card-actions{margin-top:12px;display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}
html body.atelier .db-card-actions>button{background:var(--ink)!important;color:var(--paper)!important;font-size:16px!important;min-height:44px;border-radius:8px!important;flex:1}
.db-card-tools{flex:1;min-width:0}
.db-card-tools-list{display:flex;flex-direction:column;gap:3px;padding-top:8px}
html body.atelier .db-card-tools-list button{display:flex;align-items:center;gap:8px;text-align:left;width:100%;min-height:44px;position:static;opacity:1;color:var(--ink)!important;background:var(--paper2)!important;border:1px solid var(--paper3)!important;font:400 15px/1.35 var(--font-serif)!important;padding:9px!important;border-radius:6px;overflow-wrap:anywhere;white-space:normal}
html body.atelier .db-new-card{display:none}
body[data-accueil-vue="projets"] #db-stats-section,body[data-accueil-vue="projets"] #db-gantt-section{display:none}
body[data-accueil-vue="stats"] #db-bibliotheque{display:none}
#db-navigation{display:flex;justify-content:center;gap:8px;background:var(--paper);border-top:1px solid var(--paper3);padding:10px 24px;flex-shrink:0}
#db-navigation button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:8px 24px;background:none;color:var(--ink3);border:0;border-radius:8px;font:400 16px var(--font-serif);cursor:pointer}
#db-navigation button[aria-current]{background:var(--paper2);color:var(--ink)}
#db-navigation button>span{font-size:22px;line-height:1}
html body.atelier #suggestion-fab{display:none}
/* Le bouton flottant reste accessible dans Plus, sans occuper la bibliothèque. */
html body.atelier #carnet-page>div:first-child{background:var(--paper)!important;border-bottom:1px solid var(--paper3);color:var(--ink);height:60px!important}
html body.atelier #carnet-page>div:first-child .logo,html body.atelier #carnet-page>div:first-child .logo em,html body.atelier #carnet-page>div:first-child button{color:var(--ink)!important}
html body.atelier #carnet-page>div:first-child>span{color:var(--ink3)!important;font-size:12px!important}
/* Navigation identique dans le carnet : pas besoin du logo pour revenir. */
#carnet-navigation{display:flex;justify-content:flex-start;gap:8px;background:var(--paper);border-top:1px solid var(--paper3);padding:10px 24px;flex-shrink:0}
#carnet-navigation button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:8px 24px;background:none;color:var(--ink3);border:0;border-radius:8px;font:400 16px var(--font-serif);cursor:pointer}
#carnet-navigation button[aria-current]{background:var(--paper2);color:var(--ink)}
#carnet-navigation button>span{font-size:22px;line-height:1}
.db-card-tools{display:contents}
.db-card-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.db-card-tools-list[hidden]{display:none!important}
.db-card-options{color:var(--ink)!important;background:var(--paper)!important;border:1px solid var(--paper3)!important;border-radius:8px;min-height:44px;font:400 16px var(--font-serif);cursor:pointer}
.db-card-tools-list{grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding-top:4px}
html body.atelier .db-card-tools-list button{align-items:center;justify-content:center;padding:10px 4px!important;min-width:0!important;min-height:44px;border:0!important;background:var(--paper2)!important}
html body.atelier .db-card-tools-list button svg{width:20px;height:20px;flex-shrink:0}
html body.atelier .db-card-tools-list button>span{display:none}
html body.atelier #db-topbar-right>*{display:flex;align-items:center;text-align:left}
/* Le carnet reprend les dimensions et les marges de l’en-tête des projets. */
html body.atelier #carnet-page>div:first-child{height:auto!important;min-height:72px;padding:12px 24px!important;gap:12px}
html body.atelier #carnet-page>div:first-child .logo{margin-right:0}
/* Plus compact sur mobile : icône et nom court, sans empiler deux menus. */
@media(max-width:640px){
 .db-card-tools-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 html body.atelier .db-card-tools-list button{flex-direction:column;gap:6px;font-size:12px!important}
 html body.atelier .db-card-tools-list button>span{display:block;text-align:center;overflow-wrap:normal}
 html body.atelier #db-topbar-right{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px}
 html body.atelier #db-topbar-right>*{flex-direction:column;justify-content:center;gap:8px;padding:10px 6px!important;text-align:center;font-size:13px;min-width:0;overflow-wrap:anywhere}
 html body.atelier #db-topbar-right svg{width:22px;height:22px}
 #carnet-navigation{padding:8px 6px max(10px,env(safe-area-inset-bottom));gap:0}
 #carnet-navigation button{flex:1;min-width:0;padding:6px 2px;flex-direction:column;gap:5px;font-size:13px}
}
/* Sur PC, outils visibles en haut, noms au survol, navigation alignée à gauche. */
@media(min-width:641px){
 html body.atelier #db-topbar{flex-wrap:wrap;gap:12px;padding:12px 24px}
 html body.atelier #db-user{display:none}
 html body.atelier #db-plus{margin-left:auto}
 #db-plus>summary{display:none}
 html body.atelier #db-topbar-right{position:static;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;width:auto;max-width:100%;max-height:none;overflow:visible;padding:0;border:0;background:transparent;box-shadow:none;gap:4px}
 html body.atelier #db-topbar-right>*{width:40px;min-height:40px;height:40px;justify-content:center;padding:8px!important}
 html body.atelier #db-topbar-right>*>span{display:none}
 html body.atelier #db-topbar-right>a[title="Guide d’utilisation"]{font-size:18px}
 #db-navigation{order:1;justify-content:flex-start;border-top:0;border-bottom:1px solid var(--paper3);padding:6px 24px}
 html body.atelier #db-body{order:2}
 #db-navigation>button:last-child{display:none}
 #carnet-navigation{order:1;border-top:0;border-bottom:1px solid var(--paper3);padding:6px 24px}
 #carnet-view{order:2;min-height:0}
 #carnet-navigation>button:last-child{display:none}
 #db-reprendre{max-width:none;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:24px;padding:22px 28px;margin-bottom:28px;align-items:center}
 #db-reprendre .atelier-eyebrow,#db-reprendre h2,#db-reprendre p{grid-column:1}
 html body.atelier #db-reprendre h2{font-size:27px;margin:8px 0}
 #db-reprendre p{margin:0}
 #db-reprendre .atelier-continue{grid-column:2;grid-row:1 / span 3}
}
@media(max-width:360px){
 html body.atelier #db-projets-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:640px){
 html body.atelier #db-topbar{padding:10px 18px;min-height:62px;gap:10px}
 html body.atelier #carnet-page>div:first-child{min-height:62px;padding:10px 18px!important;gap:10px}
 html body.atelier #db-topbar .logo{font-size:23px}
 html body.atelier #db-user{display:none}
 html body.atelier #db-plus{margin-left:auto}
 html body.atelier #db-body{padding:20px 18px 24px}
 html body.atelier #db-greeting{font-size:24px!important}
 #db-reprendre{padding:22px;margin-bottom:28px}
 html body.atelier #db-reprendre h2{font-size:27px}
 .atelier-continue{width:100%}
 html body.atelier #db-projets-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 16px}
 html body.atelier .db-card-couv,html body.atelier .db-card-couv-placeholder{height:150px;min-height:150px}
 html body.atelier .db-card-couv-placeholder{font-size:20px;padding:14px}
 html body.atelier .db-card-titre{font-size:18px}
 .db-card-actions{gap:6px}
 .db-card-tools{flex-basis:100%}
 #db-navigation{padding:8px 6px max(10px,env(safe-area-inset-bottom));gap:0}
 #db-navigation button{flex:1;min-width:0;padding:6px 2px;flex-direction:column;gap:5px;font-size:13px}
 html body.atelier #db-topbar-right{position:fixed;right:12px;top:72px;width:calc(100vw - 24px);max-height:calc(100dvh - 160px)}
 html body.atelier .atelier-library-heading h2{font-size:23px}
 #db-plus summary{padding:8px 10px}
 /* Conserver tous les outils de l’éditeur, en évitant les boutons trop petits. */
 #fmt-bar{overflow-x:auto;flex-shrink:0}
 #fmt-bar .fmt-btn{min-height:36px;flex-shrink:0}
 #es{padding:24px 22px}
 #editor{font-size:20px;line-height:1.8}
}
