/* Mise en page des leçons : tableaux de signes et de variations, encadrés par type, aération */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- Tableaux de signes et de variations ---------- */
.tv-wrap{margin:1.4rem 0;overflow-x:auto;-webkit-overflow-scrolling:touch}
main table.tv{--w:5.6rem;--h:2.6rem;--c:#1a140f;display:table;width:auto;margin:0 auto;border-collapse:collapse;font-size:1rem;overflow:visible;border:1.5px solid var(--c);background:var(--paper)}
table.tv th,table.tv td{border:0;padding:0;text-align:center;vertical-align:middle;background:transparent}
table.tv tr{height:var(--h)}
table.tv .tl{background:var(--wash);border-right:1.5px solid var(--c);padding:.2rem .8rem;min-width:4.4rem;max-width:12rem;text-align:center;font-family:'Sora',system-ui,sans-serif;font-weight:600;font-size:.82rem;line-height:1.3}
table.tv .tl .katex{font-size:1.08em}
table.tv .tp{position:relative;min-width:2.2rem;padding:0 .35rem;white-space:nowrap}
table.tv .tp::before{content:"";display:none;position:absolute;top:0;bottom:0;left:calc(50% - .75px);width:1.5px;background:var(--c)}
table.tv tr.tv-s .tp:not(.tp-first):not(.tp-last)::before{display:block}
table.tv .tp-first{text-align:left}
table.tv .tp-last{text-align:right}
table.tv .tp-dbl::before{display:block!important;width:6px;left:calc(50% - 3px);background:linear-gradient(90deg,var(--c) 0 1.5px,transparent 1.5px 4.5px,var(--c) 4.5px 6px)}
table.tv .tv-v{position:relative;z-index:1;background:var(--paper);padding:0 .25rem;display:inline-block;line-height:1.25}
table.tv tr.tv-x .tp{font-size:1.02rem}
table.tv .ti{width:var(--w);min-width:var(--w);padding:0}
table.tv .tv-sg{font-size:1.1rem}
table.tv tr.tv-s>*,table.tv tr.tv-first>*{border-top:1.5px solid var(--c)}
table.tv tr.tv-x>*{border-top:0}
table.tv .tv-ar-c{padding:0;position:relative;height:calc(var(--h)*2);vertical-align:top}
table.tv .tv-ar{display:block;width:var(--w);height:calc(var(--h)*2);margin:0;overflow:visible}
table.tv .tv-ar line{stroke:var(--c);stroke-width:1.7;stroke-linecap:round}
table.tv .tv-ar polygon{fill:var(--c)}
@media (max-width:560px){main table.tv{--w:4.4rem;font-size:.92rem}table.tv .tl{font-size:.74rem;padding:.2rem .5rem;min-width:3.2rem}}
@media print{table.tv{break-inside:avoid}}

table.tv .tv-sg{font-size:1.3rem;font-weight:600}

/* ---------- Encadrés : une couleur par type ---------- */
main .box{--bx:#8f6630;--bg:#f8f0e2;margin:1.6rem 0;padding:1rem 1.25rem;border-radius:10px;background:var(--bg);border:1px solid color-mix(in srgb,var(--bx) 22%,transparent);border-left:6px solid var(--bx)}
main .box.def{--bx:#2b5fa8;--bg:#edf3fc}
main .box.prop{--bx:#6a4aa6;--bg:#f3effb}
main .box.meth{--bx:#2f7d4f;--bg:#eaf6ee}
main .box.ex{--bx:#55606e;--bg:#f2f4f6}
main .box.demo{--bx:#7a6f60;--bg:#f8f5f0;border-left-style:double;border-left-width:7px}
main .box.note{--bx:#1f7a80;--bg:#e9f6f7}
main .box.tip{--bx:#8f6630;--bg:#fcf4dc}
main .box.warn{--bx:#9a4a2a;--bg:#fcede6}
main .box strong{color:var(--bx);font-weight:600}
main .box.ex strong,main .box.demo strong{color:var(--ink)}
.bx-l{display:block;width:max-content;max-width:100%;margin:0 0 .55rem;padding:.2rem .7rem;border-radius:999px;background:var(--bx);color:#fff;font-family:'Sora',system-ui,sans-serif;font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;line-height:1.5}
main .box .bx-n{display:inline;color:var(--ink);font-family:'Fraunces',Georgia,serif;font-style:italic;font-size:1.08rem}
main .box p.bx-t{margin:0 0 .4rem}

/* ---------- Aération ---------- */
main p{margin:.85rem 0}
main .corr p,main .box p,main blockquote p{margin:.8rem 0}
main .box>p:first-child,main .corr>p:first-child{margin-top:.2rem}
main .box>p:last-child{margin-bottom:.2rem}
main .box ul,main .box ol,main .corr ul,main .corr ol{margin:.7rem 0 .7rem}
main li{margin:.35rem 0}
main .mathline{margin:.9rem 0}
main strong{font-weight:600}
@media (max-width:560px){
  main table.tv.n3{--w:4rem}main table.tv.n4{--w:3.3rem}main table.tv.n5{--w:2.9rem}main table.tv.n6{--w:2.6rem}
  table.tv .tp{min-width:1.6rem;padding:0 .2rem}
  .tv-wrap{margin-left:-.4rem;margin-right:-.4rem}
}
@media (max-width:560px){main table.tv.n4{--w:2.9rem}main table.tv.n5{--w:2.5rem}table.tv .tl{padding:.2rem .35rem;font-size:.7rem;min-width:2.6rem}}
@media (max-width:560px){main table.tv.n4{--w:2.45rem}main table.tv.n5{--w:2.1rem}table.tv .tp{min-width:1.3rem}table.tv .tv-v{padding:0 .1rem}}
.qrev{background:var(--wash);border-left:4px solid var(--gold);padding:.6rem .9rem;border-radius:6px;font-weight:600}

/* ---- Parties repliables (cours) et blocs secondaires ---- */
details.fold{margin:12px 0;border:1.5px solid #e1d6c2;border-radius:12px;background:#fffdf9}
details.fold>summary,details.fold2>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:10px;min-height:48px;padding:10px 16px;-webkit-tap-highlight-color:transparent}
details.fold>summary::-webkit-details-marker,details.fold2>summary::-webkit-details-marker{display:none}
details.fold>summary::before,details.fold2>summary::before{content:"";flex:none;width:9px;height:9px;border-right:2.5px solid #8f6630;border-bottom:2.5px solid #8f6630;transform:rotate(-45deg);transition:transform .15s}
details.fold[open]>summary::before,details.fold2[open]>summary::before{transform:rotate(45deg)}
details.fold>summary h3{margin:0;padding:0;border:0;font-size:1.05rem;line-height:1.3;flex:1}
details.fold>summary:hover,details.fold2>summary:hover{background:#faf3e6;border-radius:11px}
details.fold>.fold-b{padding:2px 18px 16px}
details.fold.sec2{border-style:dashed;background:#faf7f1}
details.fold.sec2>summary::after{content:"Bonus";flex:none;font:600 .7rem Sora,system-ui,sans-serif;letter-spacing:.05em;text-transform:uppercase;color:#8f6630;background:#f3e8d2;border-radius:999px;padding:3px 9px}
details.fold2{margin:12px 0}
details.fold2>summary{font-weight:700;padding:10px 14px}
details.fold2>.fold-b{padding:0 14px 12px}
details.fold2>.fold-b>p:first-child{margin-top:4px}
.to-ex{margin:10px 0 4px}.to-ex a{display:inline-block;padding:9px 16px;border-radius:999px;background:#1a140f;color:#fff;font:600 .88rem Sora,system-ui,sans-serif;text-decoration:none}.to-ex a:hover{background:#8f6630}
@media print{details.fold>.fold-b,details.fold2>.fold-b{display:block}}
details.fold>summary h3::after,details.fold>summary h3::before{display:none!important}
details.fold>summary h3{border:0!important;text-decoration:none}
details.box.fold2>summary{padding:6px 0}details.box.fold2{padding-top:6px;padding-bottom:6px}
