.automatismes-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1rem;margin:1.2rem 0}.automatismes-card{display:flex;flex-direction:column;gap:.65rem;padding:1.2rem;border:1px solid #cbd8ec;border-radius:1rem;background:#fff;color:#153766;text-decoration:none;min-width:0}.automatismes-card:hover,.automatismes-card:focus-visible{border-color:#173f8f;box-shadow:0 4px 18px #173f8f14}.automatismes-card strong{font-size:1.12rem;line-height:1.4}.automatismes-card span{font-size:.9rem}.automatismes-kicker{color:#476789;text-transform:uppercase;letter-spacing:.04em}.automatismes-target{background:#f1f6ff;padding:clamp(1rem,3vw,2rem);border-radius:1.2rem}.automatismes-secondary{display:flex;flex-wrap:wrap;gap:1rem;margin:1.2rem 0}.automatismes-links{columns:2;column-gap:2rem}.automatismes-links li{break-inside:avoid;margin:.7rem 0}.automatismes-aid-link{display:inline-flex;margin:1rem 0;padding:.65rem 1rem;background:#eef7f1;border-radius:.6rem;color:#185a38}:is(.automatismes-reader,.automatismes-protected-page) .written-exercise-figure img{max-width:100%;height:auto}:is(.automatismes-reader,.automatismes-protected-page) .written-exercise__body{min-width:0;overflow-wrap:anywhere}:is(.automatismes-reader,.automatismes-protected-page) .written-exercise__body pre,:is(.automatismes-reader,.automatismes-protected-page) .written-exercise__body table{max-width:100%;overflow-x:auto}:is(.automatismes-reader,.automatismes-protected-page) .written-exercise__body .site-ready-table-wrapper{overflow-x:auto}@media(max-width:600px){.automatismes-links{columns:1}.automatismes-card{padding:1rem}.automatismes-grid{gap:.7rem}}
.automatismes-document-actions{display:inline-flex;flex-wrap:wrap;gap:.5rem 1rem}.automatismes-plus-link{font-size:.95rem;color:#315776}.automatismes-print-notice{display:none}@media print{.automatismes-reader [data-site-ready-role="D3"],.automatismes-reader .written-correction-panel--deep,.automatismes-reader .automatismes-aid-link,.automatismes-protected-page{display:none!important}.automatismes-print-notice{display:block!important}}

/* Small source tables fit the reader; the shared 34rem mobile minimum is
   intended for larger legacy tables. Keep overflow local when actually needed. */
.automatismes-reader .written-exercise-table table,
.automatismes-protected-page .written-exercise-table table {
    min-width: 0;
    width: auto;
    max-width: 100%;
}

/* Reuse the native V2 math-container rules for this batch's D1 bodies and
   review surfaces too. A long expression scrolls locally, never the page. */
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-math {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: baseline;
}
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-math mjx-container:not([display="true"]) {
    max-width: none;
    overflow: visible;
}
/* A scrolling inline-block uses its bottom border as its text baseline.
   Short prose mathematics must participate in the actual text line instead.
   Keep multi-line calculations and native table labels on their own rules. */
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-paragraph > [data-site-ready-math="inline"]:not(.site-ready-math--aligned) {
    display: inline;
    max-width: none;
    overflow: visible;
    vertical-align: baseline;
}
/* Keep the assistive MathML available to screen readers without letting its
   clipped, wider font create a scrollbar around a single printed digit. */
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-math mjx-assistive-mml {
    width: 1px !important;
    height: 1px !important;
}

/* An aligned calculation is a multi-line object. Its top belongs to the first
   prose/list line; the scroll wrapper's bottom is not that line's baseline. */
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-math--aligned {
    vertical-align: top;
}
:is(.automatismes-reader,.automatismes-protected-page) .site-ready-inline-code {
    font-family: ui-monospace, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
