/* Édition mauve — vues publiques et espace élève. Voyager reste indépendant. */
:root{--edition-bg:#faf8fc;--edition-soft:#eee7f2;--edition-ink:#342a3d;--edition-muted:#706377;--edition-accent:#745584;--edition-line:#d9cedf;--edition-serif:Georgia,'Times New Roman',serif;--edition-sans:system-ui,-apple-system,'Segoe UI',sans-serif}
html{scroll-padding-top:110px}
:root[data-theme=dark]{--edition-bg:#1c1721;--edition-soft:#2b2332;--edition-ink:#eee7f3;--edition-muted:#bdb0c7;--edition-accent:#cfabdf;--edition-line:#493a53}
.edition-theme-toggle{position:fixed;right:calc(20px + env(safe-area-inset-right,0px));bottom:calc(20px + env(safe-area-inset-bottom,0px));z-index:1050;width:44px;height:44px;display:grid;place-items:center;padding:10px;border:1px solid var(--edition-line);border-radius:50%;background:var(--edition-bg);color:var(--edition-accent);box-shadow:0 4px 18px #0002;cursor:pointer}
.edition-theme-toggle[hidden]{display:none}.edition-theme-toggle:hover{background:var(--edition-soft)}
/* Soleil et lune se croisent en rotation, uniquement à l'intérieur du bouton. */
.edition-theme-toggle{overflow:hidden}
.edition-theme-toggle svg{grid-area:1 / 1;display:block;width:22px;height:22px;pointer-events:none;transform-origin:50% 65%;transition:transform .55s cubic-bezier(.22,1,.36,1),opacity .35s ease}
.edition-theme-toggle .edition-icon-moon{opacity:1;transform:rotate(0) scale(1)}
.edition-theme-toggle .edition-icon-sun{opacity:0;transform:rotate(-150deg) scale(.35)}
[data-theme=dark] .edition-theme-toggle .edition-icon-sun{opacity:1;transform:rotate(0) scale(1)}
[data-theme=dark] .edition-theme-toggle .edition-icon-moon{opacity:0;transform:rotate(150deg) scale(.35)}
@media(prefers-reduced-motion:reduce){.edition-theme-toggle svg{transition:none}}
[data-theme=dark] .edition-theme .edition-button,[data-theme=dark] .edition-theme .btn-primary,[data-theme=dark] .edition-theme [buttonstyle=flat]{color:#24192d;background:var(--edition-accent);border-color:var(--edition-accent)}
[data-theme=dark] .edition-theme .edition-button:hover,[data-theme=dark] .edition-theme .btn-primary:hover,[data-theme=dark] .edition-theme [buttonstyle=flat]:hover{background:#e1c4ed;color:#24192d!important}
[data-theme=dark] .edition-theme .dropdown-menu,[data-theme=dark] .edition-theme .card,[data-theme=dark] .edition-theme .panel-group-evaluation,[data-theme=dark] .edition-theme .list-group-item{background:var(--edition-soft);color:var(--edition-ink);border-color:var(--edition-line)}
[data-theme=dark] .edition-theme .dropdown-item:hover,[data-theme=dark] .edition-theme .table-hover tbody tr:hover{background:var(--edition-soft);color:var(--edition-ink)}
[data-theme=dark] .edition-theme .form-control:disabled,[data-theme=dark] .edition-theme .form-control[readonly]{background:var(--edition-soft);color:var(--edition-muted)}
[data-theme=dark] .edition-theme .form-control::placeholder{color:var(--edition-muted);opacity:1}
[data-theme=dark] .edition-theme .color0,[data-theme=dark] .edition-theme .close{color:var(--edition-ink)}
[data-theme=dark] .edition-theme .color2{color:var(--edition-accent)}
[data-theme=dark] .edition-theme .mathematicianportrait{background:var(--edition-soft)}
[data-theme=dark] .edition-theme .edition-brand-image img{border-radius:50%}
body:has(.phpdebugbar) .edition-theme-toggle{bottom:calc(60px + env(safe-area-inset-bottom,0px))}
body.edition-theme{min-width:0;min-height:100vh;height:auto;background:var(--edition-bg);color:var(--edition-ink);font:15px/1.7 var(--edition-sans)}
.edition-theme *,.edition-theme *::before,.edition-theme *::after{box-sizing:border-box}
.edition-theme a{color:inherit}
.edition-theme a:hover,.edition-theme a:focus{color:var(--edition-accent)!important}
.edition-theme :focus-visible{outline:2px solid var(--edition-accent);outline-offset:4px}
.edition-theme #main:focus{outline:none}
.edition-theme button,.edition-theme input,.edition-theme textarea,.edition-theme select{font-family:var(--edition-sans)}
.edition-theme input,.edition-theme textarea,.edition-theme select{font-size:16px!important}
.edition-theme h1,.edition-theme h2,.edition-theme h3,.edition-theme h4,.edition-theme .panel-heading{font-family:var(--edition-serif);font-weight:400;color:var(--edition-ink)}
.edition-theme h1{font-size:clamp(36px,4.5vw,60px);line-height:1.15;margin-bottom:28px}
.edition-theme h2{font-size:32px}.edition-theme h3{font-size:26px}
.edition-theme #content,.edition-theme #content.active{position:static;display:block;width:100%;min-height:0;padding:0;background:none;transition:none}
.edition-theme .wrapper{display:flex;flex-direction:column;min-height:calc(100vh - 88px)}
.edition-theme #main{width:100%;max-width:1200px;min-height:0;flex:1;margin:0 auto;padding:56px 34px 72px;font:15px/1.7 var(--edition-sans)}
.edition-home #main{padding-top:0;padding-bottom:0}
.edition-skip{position:fixed;top:-80px;left:16px;z-index:1200;padding:12px 20px;background:var(--edition-bg);border:1px solid var(--edition-accent)}.edition-skip:focus{top:12px}
.edition-header{position:sticky;top:0;z-index:100;border-bottom:1px solid var(--edition-line);background:var(--edition-bg)}
.edition-header-inner{max-width:1268px;min-height:88px;padding:18px 34px;margin:auto;display:flex;gap:30px;align-items:center}
.edition-brand{font:29px/1.2 var(--edition-serif);white-space:nowrap;letter-spacing:-.6px}.edition-brand span{color:var(--edition-accent)}
.edition-brand-image{display:inline-flex;align-items:center;flex-shrink:0}
.edition-brand-image img{display:block;width:56px;height:56px;object-fit:contain}
.edition-navigation{display:flex;align-items:center;flex-wrap:wrap;gap:12px 23px;flex:1;font-size:13px}
.edition-navigation>a,.edition-menu summary{padding:8px 0}
.edition-navigation [aria-current=page]{color:var(--edition-accent);text-decoration:underline!important;text-underline-offset:7px}
.edition-account{display:flex;align-items:center;gap:16px;font-size:12px;margin-left:auto}
.edition-account summary{max-width:220px;overflow-wrap:anywhere}
.edition-register{border:1px solid var(--edition-accent);padding:7px 14px}
.edition-menu{position:relative}.edition-menu summary{cursor:pointer;list-style:none}.edition-menu summary::-webkit-details-marker{display:none}.edition-menu summary::after{
    display:inline-block;
    margin-left:0.255em;
    vertical-align:0.255em;
    content:"";
    border-top:0.3em solid;
    border-right:0.3em solid transparent;
    border-bottom:0;
    border-left:0.3em solid transparent;
}
.edition-menu-panel{position:absolute;top:100%;left:-16px;width:max-content;min-width:220px;max-width:min(320px,calc(100vw - 40px));padding:12px;border:1px solid var(--edition-line);background:var(--edition-bg);box-shadow:0 12px 25px #342a3d12;z-index:2}
.edition-account-menu .edition-menu-panel{left:auto;right:0}
.edition-menu-panel a,.edition-menu-panel button{display:block;width:100%;text-align:left;padding:9px 12px;white-space:normal;font:13px/1.5 var(--edition-sans);background:transparent;color:var(--edition-ink);border:0;cursor:pointer}
.edition-menu-panel a:hover,.edition-menu-panel button:hover{background:var(--edition-soft)}
.edition-menu-panel form{margin:0;border-top:1px solid var(--edition-line);padding-top:6px}
.edition-menu-toggle{display:none;padding:6px 13px;background:none;border:1px solid var(--edition-line);color:var(--edition-ink);font-size:13px;cursor:pointer}
.edition-text-button{border:0;background:none;padding:8px 0;color:inherit;font-size:inherit;cursor:pointer}
.edition-hero{text-align:center;padding:85px 20px 65px}
.edition-theme .edition-eyebrow{text-transform:uppercase;letter-spacing:.18em;font-size:11px;font-weight:600;color:var(--edition-accent);margin:0 0 23px}
.edition-theme .edition-hero h1{font-size:clamp(44px,5.8vw,82px);line-height:1.08;letter-spacing:-2.5px;margin-bottom:24px}
.edition-hero h1 em{color:var(--edition-accent);font-weight:400}
.edition-intro{max-width:49ch;font-size:17px;color:var(--edition-muted);margin:24px auto 30px}
.edition-theme .edition-button{display:inline-block;background:var(--edition-accent);color:#fff;padding:13px 26px;font-size:13px;border:1px solid var(--edition-accent)}
.edition-theme .edition-button:hover,.edition-theme .edition-button:focus{background:#5d426d;color:#fff!important}
.edition-formula{font:italic 27px/1.5 var(--edition-serif);color:var(--edition-accent);margin-top:30px}
.edition-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--edition-line);margin-bottom:40px}
.edition-card{padding:32px;border-right:1px solid var(--edition-line);border-bottom:1px solid var(--edition-line);transition:background .18s,transform .2s ease,box-shadow .2s ease}
.edition-card:nth-child(3n),.edition-card:last-child{border-right:0}.edition-card:hover{background:var(--edition-soft)}
@media(hover:hover){.edition-card:hover{transform:translateY(-4px);box-shadow:0 8px 20px #342a3d12}}
.edition-theme .edition-card h2{font-size:26px;line-height:1.2;margin-bottom:12px}
.edition-card p{font-size:13px;color:var(--edition-muted);min-height:44px;margin-bottom:18px}
.edition-card-link{font-size:13px;color:var(--edition-accent)}.edition-card-link span{padding-left:8px}
.edition-resources{max-width:800px;margin:0 auto;padding:28px 0 48px}
.edition-resources>.edition-eyebrow,.edition-resources>h2{text-align:center}.edition-resources>h2{margin-bottom:30px}
.edition-welcome{font-size:15px;color:var(--edition-muted);overflow-wrap:anywhere}
.edition-welcome a{color:var(--edition-accent);text-decoration:underline!important;text-underline-offset:4px}
.edition-welcome img{max-width:100%;height:auto}
.edition-week{padding:46px 30px;background:var(--edition-soft);text-align:center;margin-bottom:50px}.edition-week h2{margin-bottom:30px}
.edition-portraits{display:flex;flex-wrap:wrap;justify-content:center;gap:35px}
.edition-gallery-link{display:inline-block;margin-top:25px;font-size:13px;border-bottom:1px solid var(--edition-accent)}
.edition-theme .mathematicianframe{width:160px;height:auto;display:inline-flex;flex-direction:column;background:transparent;border:0;margin:8px 12px;overflow:visible}
.edition-theme .mathematicianname{position:static;width:100%;height:auto;order:2;font:19px/1.3 var(--edition-serif);padding:15px 0 0}
.edition-theme .mathematicianframe .mathematicianfirstname{display:inline}
.edition-theme .mathematicianportrait{position:static;width:100%;height:190px;display:block;background:#e1d7e7}
.edition-theme .mathematicianimage{position:static;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:cover;object-position:top;border:0;padding:0;filter:grayscale(1)}
.edition-theme .edition-footer{position:static;width:100%;height:auto;min-height:0;padding:38px 24px;border-top:1px solid var(--edition-line);background:transparent;text-align:center;color:var(--edition-muted);font:12px/1.7 var(--edition-sans)}
.edition-footer .edition-brand{display:inline-block;color:var(--edition-ink);margin-bottom:14px;font-size:26px}
.edition-footer p{max-width:680px;margin:0 auto 14px}.edition-footer nav{display:flex;justify-content:center;gap:24px}
/* Harmonisation des composants existants, sans changer leurs actions. */
.edition-theme .panel-heading{font-size:36px;margin-bottom:28px}.edition-theme .panel-body{padding-top:12px}
.edition-theme .form-control{color:var(--edition-ink);background:transparent;border:1px solid var(--edition-line);border-radius:0;padding:10px 12px;min-height:44px}
.edition-theme .form-control:focus{border-color:var(--edition-accent);box-shadow:0 0 0 2px #74558420}
.edition-theme .input-group input{max-width:none;min-width:0}
.edition-theme .input-group-prepend .input-group-text{background:var(--edition-soft);color:var(--edition-accent);border-color:var(--edition-line);border-radius:0}
.edition-theme #contactformblock textarea{width:100%;max-width:100%}.edition-theme #contactformblock input.form-control{width:1%}
.edition-theme .btn{font-family:var(--edition-sans);border-radius:0;font-size:14px;padding:9px 18px}
.edition-theme .btn-primary,.edition-theme [buttonstyle=flat]{background:var(--edition-accent);color:#fff;border:1px solid var(--edition-accent);font-weight:400;font-size:14px}
.edition-theme .btn-primary:hover,.edition-theme .btn-primary:focus,.edition-theme [buttonstyle=flat]:hover,.edition-theme [buttonstyle=flat]:focus{background:#5d426d;border-color:#5d426d;color:#fff!important}
.edition-theme .custom-checkbox{font-size:15px}.edition-theme .checkmark,.edition-theme .nocheckmark{font-size:23px;color:var(--edition-accent)}
.edition-theme .row-item{background:transparent;border:0;border-bottom:1px solid var(--edition-line);padding:16px 0;margin:0;border-radius:0;font-weight:400;align-items:center}
.edition-theme .row-item-icon{border-color:var(--edition-line);flex-shrink:0}.edition-theme .filelistsection{margin-bottom:32px}
.edition-theme .fileitem{padding:18px 0;border-bottom:1px solid var(--edition-line);overflow-wrap:anywhere;line-height:1.7}
.edition-theme .edition-document-row{display:grid;grid-template-columns:minmax(0,1fr) 6rem 6rem;gap:24px;align-items:baseline;padding:20px 0}
.edition-document-title{min-width:0;font-size:18px;font-weight:400;overflow-wrap:anywhere}
.edition-theme .edition-document-action{justify-self:end;color:var(--edition-accent);font-size:14px;border-bottom:1px solid currentColor;white-space:nowrap;line-height:1.5}
.edition-document-statement{grid-column:2}.edition-document-last{grid-column:3}
.edition-delete-link{grid-column:2;justify-self:end;margin:0}
.edition-delete-link button{padding:0;border:0;background:transparent;cursor:pointer}
@media(max-width:560px){.edition-theme .edition-document-row{grid-template-columns:minmax(0,1fr) auto auto;gap:12px}.edition-document-title{font-size:16px}}
.edition-theme .filelistsection>p{font-size:11px;text-transform:uppercase;letter-spacing:.15em;color:var(--edition-muted);margin:30px 0 5px}
.edition-theme .fileitem img{max-width:24px;max-height:28px;object-fit:contain}
.edition-theme .panel-heading-evaluation{font-size:22px;margin-bottom:0}
.edition-theme .panel-evaluation{border-color:var(--edition-line);background:transparent}
.edition-theme .edition-page-heading{padding-bottom:25px;border-bottom:1px solid var(--edition-line);margin-bottom:32px}
.edition-theme .edition-page-heading h1{margin-bottom:14px}
.edition-document-heading-row{display:flex;align-items:center;justify-content:space-between;gap:20px}
.edition-theme .edition-document-heading-row h1{min-width:0;margin-bottom:0;overflow-wrap:anywhere}
.edition-document-heading-row>.btn{flex-shrink:0}
.edition-theme .edition-page-heading p{color:var(--edition-muted);max-width:65ch;margin-bottom:0}
.edition-exercise-toolbar{flex-wrap:wrap;gap:12px 0;margin-bottom:24px}
.edition-theme .table{color:var(--edition-ink);font-size:14px}.edition-theme .table td,.edition-theme .table th{border-color:var(--edition-line)}.edition-theme .table thead th{font-weight:600;background:var(--edition-soft)}.edition-theme .table-hover tbody tr:hover{background:#eee7f280}
.edition-theme .modal-content{border:1px solid var(--edition-line);border-radius:0;background:var(--edition-bg);color:var(--edition-ink)}.edition-theme .modal-header,.edition-theme .modal-footer{border-color:var(--edition-line)}
.edition-theme .tooltip{font-family:var(--edition-sans);font-size:13px}.edition-theme .dropdown-menu{font-family:var(--edition-sans);font-size:14px}
@media(max-width:1100px){.edition-header-inner{gap:20px;padding-inline:24px}.edition-navigation{gap:10px 15px}.edition-account summary{max-width:160px}}
@media(max-width:900px){
html{scroll-padding-top:150px}.edition-header-inner{flex-wrap:wrap;gap:15px;min-height:76px;padding:18px 22px}.edition-brand{margin-right:auto;font-size:26px}.edition-header.edition-enhanced .edition-menu-toggle{display:block}.edition-menu-toggle[hidden]{display:none}.edition-navigation{order:4;flex:0 0 100%;display:flex;align-items:flex-start;flex-direction:column;gap:4px;padding-top:15px;border-top:1px solid var(--edition-line)}.edition-enhanced .edition-navigation{display:none}.edition-enhanced.edition-navigation-open .edition-navigation{display:flex;max-height:65vh;overflow-y:auto}.edition-navigation>a,.edition-navigation>details{width:100%}.edition-navigation .edition-menu-panel{position:static;width:100%;max-width:none;border:0;border-left:1px solid var(--edition-line);box-shadow:none}.edition-account{margin-left:0;font-size:12px}.edition-account summary{max-width:180px}.edition-theme #main{padding:36px 22px 50px}.edition-home #main{padding-top:0;padding-bottom:0}.edition-hero{padding:58px 0 45px}.edition-theme .edition-hero h1{font-size:clamp(42px,7vw,64px);letter-spacing:-1.6px}.edition-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.edition-card:nth-child(3n){border-right:1px solid var(--edition-line)}.edition-card:nth-child(2n),.edition-card:last-child{border-right:0}
}
@media(max-width:560px){
.edition-header-inner{gap:12px}.edition-account{width:100%;justify-content:flex-end}.edition-account summary{max-width:none}.edition-intro{font-size:15px}.edition-theme .edition-eyebrow{font-size:10px;letter-spacing:.12em}.edition-cards{grid-template-columns:1fr}.edition-card,.edition-card:nth-child(3n){border-right:0;padding:25px 10px}.edition-card p{min-height:0}.edition-week{padding:32px 16px}.edition-week h2{font-size:28px}.edition-portraits{gap:22px}.edition-theme .mathematicianframe{width:125px;margin:5px 0}.edition-theme .mathematicianportrait{height:160px}.edition-theme .mathematicianname{font-size:18px}.edition-theme .modal-dialog{width:auto;margin:12px}.edition-theme .row-item{overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){.edition-card{transition:none}.edition-card:hover{transform:none}}

.edition-navigation-separator{align-self:stretch;border-left:1px solid var(--edition-line);margin:8px 0;min-height:20px}
@media(max-width:900px){.edition-navigation-separator{align-self:stretch;border-left:0;border-top:1px solid var(--edition-line);min-height:0;margin:10px 0}}
.edition-theme .edition-footer{padding-bottom:80px}
