/* Footer refinement: shared by every language. */
#mad-footer .footer-resources { grid-template-columns: minmax(140px,.65fr) minmax(0,1.8fr); gap: 2rem; padding-block: 2rem; align-items:center; }
#mad-footer .footer-resource-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; align-items:stretch; }
#mad-footer .footer-pdf-button, #mad-footer .footer-health-badge { box-sizing:border-box; width:100%; min-width:0; min-height:112px; border-radius:16px; padding:1.25rem; }
#mad-footer .footer-pdf-button { gap:1rem; box-shadow:0 8px 24px rgba(87,60,45,.12); }
#mad-footer .footer-pdf-icon { width:44px; height:44px; flex:0 0 44px; border-radius:12px; background:rgba(255,255,255,.08); }
#mad-footer .footer-pdf-copy { min-width:0; }
#mad-footer .footer-pdf-button strong, #mad-footer .footer-pdf-button small { text-align:start; line-height:1.5; }
#mad-footer .footer-pdf-button strong { font-size:1rem; }
#mad-footer .footer-pdf-button small { font-size:.8rem; opacity:1; color:#fff3e9; }
#mad-footer .footer-pdf-button:focus-visible, #mad-footer a:focus-visible { outline:3px solid #9b5b38; outline-offset:5px; }
#mad-footer .footer-health-badge { display:flex; align-items:center; justify-content:center; background:#fff; border:1px solid #e8ded5; }
#mad-footer .footer-health-badge img { display:block; width:180px; max-width:100%; height:auto; }
#mad-footer .latest-update { display:flex; flex-wrap:wrap; align-items:baseline; gap:.5rem 1.5rem; padding:1.15rem 1.4rem; border:1px solid #e8ded5; border-inline-start:3px solid #9b5b38; border-radius:12px; background:rgba(255,255,255,.9); text-align:start; font-size:.875rem; line-height:1.7; }
#mad-footer .latest-update strong { margin:0; font-size:.95rem; }
#mad-footer .footer-update-details { display:flex; flex-wrap:wrap; gap:.25rem 1rem; }
#mad-footer .footer-update-details > span { min-width:0; }
#mad-footer .latest-update a { color:#79472d; font-weight:600; text-decoration:underline; text-underline-offset:3px; }
#mad-footer .mad-footer-bottom .mad-hr-list { flex-wrap:wrap; }
#mad-footer[dir="rtl"] .footer-brand-panel { align-items:flex-start; }
#mad-footer[dir="rtl"] .footer-brand-logo img { object-position:right center; }
@media(max-width:991px) { #mad-footer .footer-resources { grid-template-columns:1fr; gap:1.5rem; } #mad-footer .footer-brand-panel { align-items:center; } #mad-footer .footer-brand-logo { display:flex; justify-content:center; } #mad-footer .footer-brand-logo img { width:120px; min-width:0; } #mad-footer[dir="rtl"] .footer-brand-panel { align-items:center; } }
@media(max-width:575px) { #mad-footer .footer-resource-actions { grid-template-columns:1fr; } #mad-footer .footer-pdf-button, #mad-footer .footer-health-badge { min-height:100px; padding:1.1rem; } #mad-footer .footer-health-badge img { width:160px; } #mad-footer .latest-update { display:block; padding:1rem; } #mad-footer .footer-update-details { display:flex; flex-direction:column; margin-top:.35rem; } #mad-footer .mad-footer-bottom { gap:1rem; } }
@media(prefers-reduced-motion:reduce) { #mad-footer .footer-pdf-button { transition:none; } #mad-footer .footer-pdf-button:hover { transform:none; } }

/* Compact update and resource row. Keep visible controls icon-only. */
#mad-footer .footer-resources { display:flex; justify-content:flex-start; padding-block:1.25rem; margin-bottom:1.25rem; }
#mad-footer .footer-info-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:1rem; align-items:stretch; margin-bottom:1.5rem; }
#mad-footer .footer-info-row .latest-update { margin:0; min-width:0; padding:.85rem 1.1rem; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:.2rem; }
#mad-footer .footer-update-details { gap:.15rem .85rem; }
#mad-footer .footer-info-row .footer-resource-actions { display:flex; flex-direction:row; gap:.65rem; width:auto; min-width:0; align-items:stretch; }
#mad-footer .footer-info-row .footer-pdf-button { flex:0 0 auto; width:104px; min-height:80px; padding:.8rem; border-radius:12px; display:flex; justify-content:center; gap:.65rem; }
#mad-footer .footer-pdf-icon { width:24px; height:24px; flex:0 0 24px; border:0; border-radius:0; background:none; }
#mad-footer .footer-document-icon { flex:0 0 30px; }
#mad-footer .footer-info-row .footer-health-badge { flex:0 0 auto; width:148px; min-height:80px; padding:.25rem .6rem; border-radius:12px; }
#mad-footer .footer-health-badge img { width:126px; max-width:100%; height:auto; }
@media(max-width:767px) {
 #mad-footer .footer-resources { justify-content:center; }
 #mad-footer .footer-info-row { grid-template-columns:minmax(0,1fr); gap:.75rem; }
 #mad-footer .footer-info-row .footer-resource-actions { justify-content:center; }
 #mad-footer .footer-info-row .latest-update { padding:.9rem 1rem; }
 #mad-footer .footer-update-details { flex-direction:column; margin-top:0; }
}

/* Single PDF control and balanced compact spacing at every viewport. */
#mad-footer .footer-info-row { gap:.875rem; }
#mad-footer .footer-info-row .footer-pdf-button { width:76px; min-height:76px; padding:1rem; border-radius:12px; gap:0; box-shadow:0 4px 12px rgba(87,60,45,.1); }
#mad-footer .footer-document-icon { display:block; width:30px; height:34px; flex:0 0 30px; }
#mad-footer .footer-info-row .footer-health-badge { width:144px; min-height:76px; border-radius:12px; padding:.25rem .5rem; }
#mad-footer .footer-info-row .latest-update { overflow-wrap:anywhere; }
@media(max-width:767px) {
 #mad-footer .footer-info-row { gap:.875rem; }
 #mad-footer .footer-info-row .footer-resource-actions { width:100%; justify-content:center; gap:.75rem; }
 #mad-footer .footer-info-row .latest-update { width:100%; box-sizing:border-box; border-radius:12px; padding:1rem; font-size:.85rem; line-height:1.65; }
 #mad-footer .footer-info-row .latest-update strong { font-size:.95rem; }
 #mad-footer .footer-info-row .footer-update-details { gap:.15rem; }
 #mad-footer .footer-info-row .footer-pdf-button { width:72px; min-height:72px; }
 #mad-footer .footer-info-row .footer-health-badge { width:136px; min-height:72px; }
 #mad-footer .footer-health-badge img { width:120px; }
}
@media(max-width:359px) {
 #mad-footer > .container-fluid { padding-inline:.75rem; }
 #mad-footer .footer-info-row .latest-update { padding:.8rem; }
 #mad-footer .footer-info-row .footer-resource-actions { gap:.5rem; }
}

/* Brand, certificate previews, and accreditation share the top footer row. */
#mad-footer .footer-resources { display:block; margin:0 0 1rem; padding:1.25rem 0; border-top:1px solid rgba(87,60,45,.12); border-bottom:1px solid rgba(87,60,45,.12); }
#mad-footer .footer-top-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:1rem; }
#mad-footer .footer-brand-panel { min-height:0; padding:0; align-items:flex-start; }
#mad-footer .footer-brand-logo { width:auto; }
#mad-footer .footer-brand-logo img { width:125px; max-width:100%; min-width:0; max-height:150px; object-fit:contain; object-position:left center; }
#mad-footer .footer-resource-actions { display:flex; flex:0 0 auto; width:auto; align-items:center; justify-content:flex-end; gap:.65rem; }
#mad-footer .footer-certificate-thumb,
#mad-footer .footer-info-row .footer-health-badge { box-sizing:border-box; flex:0 0 auto; width:88px; height:76px; min-height:76px; padding:.35rem; overflow:hidden; border:1px solid #e8ded5; border-radius:12px; background:#fff; box-shadow:0 4px 12px rgba(87,60,45,.1); }
#mad-footer .footer-certificate-thumb { display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform .2s ease, box-shadow .2s ease; }
#mad-footer .footer-certificate-thumb:hover { transform:translateY(-2px); box-shadow:0 7px 16px rgba(87,60,45,.16); }
#mad-footer .footer-certificate-thumb img { display:block; width:100%; height:100%; object-fit:contain; }
#mad-footer .footer-resource-actions .footer-health-badge { display:flex; align-items:center; justify-content:center; width:144px; height:76px; min-height:76px; padding:.25rem .5rem; background:#fff; }
#mad-footer .footer-resource-actions .footer-health-badge img { display:block; width:126px; max-width:100%; height:auto; }
#mad-footer .footer-certificate-thumb:focus-visible,
#mad-footer .footer-certificate-close:focus-visible { outline:3px solid #9b5b38; outline-offset:3px; }
#mad-footer .footer-info-row { grid-template-columns:minmax(0,1fr); margin:0 0 1.5rem; }
#mad-footer .footer-info-row .latest-update { width:100%; box-sizing:border-box; }
#mad-footer .footer-certificate-dialog { width:min(92vw, 1040px); max-width:none; max-height:90vh; padding:1rem; border:1px solid #e8ded5; border-radius:14px; background:#fff; box-shadow:0 20px 70px rgba(0,0,0,.3); }
#mad-footer .footer-certificate-dialog::backdrop { background:rgba(18,14,12,.78); }
#mad-footer .footer-certificate-dialog-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
#mad-footer .footer-certificate-dialog-header h2 { margin:0; color:#573c2d; font-size:1.1rem; line-height:1.35; }
#mad-footer .footer-certificate-close { display:inline-flex; flex:0 0 2.5rem; width:2.5rem; height:2.5rem; align-items:center; justify-content:center; padding:0; border:1px solid #e8ded5; border-radius:50%; color:#573c2d; background:#fff; font-size:1.7rem; line-height:1; cursor:pointer; }
#mad-footer .footer-certificate-full { display:block; width:100%; max-height:calc(90vh - 6rem); object-fit:contain; }
@media(max-width:767px) {
 #mad-footer .footer-top-row { grid-template-columns:minmax(0,1fr); justify-items:center; gap:1rem; }
 #mad-footer .footer-brand-panel { align-items:center; }
 #mad-footer .footer-brand-logo { justify-content:center; }
 #mad-footer .footer-brand-logo img { width:min(36vw,125px); object-position:center; }
 #mad-footer .footer-resource-actions { width:100%; flex-direction:row; justify-content:center; flex-wrap:wrap; }
 #mad-footer .footer-info-row { grid-template-columns:minmax(0,1fr); }
 #mad-footer .footer-info-row .latest-update { padding:1rem; }
}
@media(max-width:420px) {
 #mad-footer .footer-certificate-thumb { width:72px; height:66px; min-height:66px; }
 #mad-footer .footer-resource-actions .footer-health-badge { width:122px; height:66px; min-height:66px; }
 #mad-footer .footer-resource-actions .footer-health-badge img { width:108px; }
}
@media(max-width:359px) {
 #mad-footer .footer-certificate-dialog { padding:.7rem; }
 #mad-footer .footer-certificate-dialog-header h2 { font-size:.95rem; }
}
@media(prefers-reduced-motion:reduce) {
 #mad-footer .footer-certificate-thumb { transition:none; }
 #mad-footer .footer-certificate-thumb:hover { transform:none; }
}

/* Keep the native modal centered regardless of the theme's global dialog rules. */
#mad-footer .footer-certificate-dialog[open] { position:fixed; inset:auto; top:50%; left:50%; transform:translate(-50%,-50%); margin:0; box-sizing:border-box; width:min(92vw,1040px); max-width:calc(100vw - 2rem); max-height:90vh; max-height:90dvh; overflow:auto; }
#mad-footer .footer-certificate-full { width:100%; max-height:calc(90vh - 7rem); max-height:calc(90dvh - 7rem); object-fit:contain; }
#mad-footer .footer-certificate-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
#mad-footer .footer-certificate-dialog-header { justify-content:flex-end; margin-bottom:.5rem; }
#mad-footer .footer-certificate-thumb { position:relative; width:104px; height:86px; min-height:86px; padding:.35rem; border:1px solid #e2d3c6; border-radius:14px; background:linear-gradient(145deg,#fff 12%,#f7f0e9 100%); box-shadow:0 5px 14px rgba(87,60,45,.12), inset 0 0 0 3px rgba(255,255,255,.8); }
#mad-footer .footer-certificate-thumb img { border:1px solid rgba(121,71,45,.12); border-radius:9px; background:#fff; transition:transform .25s ease; }
#mad-footer .footer-certificate-thumb:hover img { transform:scale(1.04); }
#mad-footer .footer-certificate-thumb-badge { position:absolute; right:.2rem; bottom:.2rem; display:flex; width:26px; height:26px; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.9); border-radius:50%; color:#fff; background:#8d5335; box-shadow:0 2px 7px rgba(45,30,20,.3); }
#mad-footer .footer-certificate-thumb-badge svg { display:block; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
#mad-footer .footer-certificate-thumb:hover .footer-certificate-thumb-badge { background:#6f4029; }
@media(max-width:767px) {
 #mad-footer .footer-certificate-dialog[open] { width:calc(100vw - 1.5rem); max-width:calc(100vw - 1.5rem); max-height:92vh; max-height:92dvh; padding:.8rem; border-radius:12px; }
 #mad-footer .footer-certificate-full { max-height:calc(92vh - 6.5rem); max-height:calc(92dvh - 6.5rem); }
 #mad-footer .footer-certificate-dialog-header { gap:.5rem; margin-bottom:.55rem; }
 #mad-footer .footer-certificate-dialog-header h2 { font-size:1rem; }
 #mad-footer .footer-certificate-close { width:2.2rem; height:2.2rem; flex-basis:2.2rem; }
}
@media(max-width:420px) {
 #mad-footer .footer-certificate-thumb { width:72px; height:66px; min-height:66px; padding:.25rem; }
 #mad-footer .footer-certificate-thumb-badge { right:.1rem; bottom:.1rem; width:22px; height:22px; }
 #mad-footer .footer-certificate-thumb-badge svg { width:14px; height:14px; }
}
@media(prefers-reduced-motion:reduce) {
 #mad-footer .footer-certificate-thumb img { transition:none; }
}
