/* ===== DONAT STEM · visual polish (update 154) ===== */

/* ---- Phones: one compact header line + one swipeable row per menu ---- */
.menu-btn{display:none}
@media (max-width:720px){
  html body header.top .wrap{display:flex !important; flex-direction:row !important; justify-content:flex-start !important; flex-wrap:wrap !important; align-items:center !important; gap:8px !important; padding:8px 14px !important; row-gap:8px !important; position:relative}
  html body header.top .brand{order:1; flex:1 1 auto !important; min-width:0}
  html body header.top .dss-hb{order:2; position:static !important}
  html body header.top .lang-top{order:3; position:static !important; display:inline-flex !important; margin:0 !important}
  html body header.top .brand{justify-content:flex-start !important; margin:0 !important}
  html body header.top .menu-btn{order:4; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:38px; min-width:38px; padding:0 11px; border-radius:999px; border:1.5px solid #102b46; background:#102b46; color:#fff; font:700 14px/1 "Source Sans 3","Segoe UI",system-ui,sans-serif; cursor:pointer}
  html body header.top .menu-btn svg{width:18px; height:18px}
  html body header.top nav.links{order:9; display:none !important; flex:1 1 100% !important; flex-wrap:wrap !important; overflow:visible !important; gap:8px !important; padding:4px 0 6px !important; -webkit-mask-image:none !important; mask-image:none !important}
  html body header.top.menu-open nav.links{display:flex !important}
  html body header.top nav.links a{flex:1 1 calc(50% - 8px) !important; justify-content:flex-start; font-size:15px !important; padding:9px 12px !important; min-height:42px; white-space:nowrap}
  html body header.top nav.links .lang-nav{display:none !important}

  /* subjects: one line of coloured pills */
  html body nav.subjects .wrap.wrap{display:flex !important; flex-wrap:nowrap !important; overflow-x:auto !important; gap:6px !important; padding:6px 14px !important; scrollbar-width:none; -webkit-mask-image:linear-gradient(90deg,#000 90%,transparent); mask-image:linear-gradient(90deg,#000 90%,transparent)}
  html body nav.subjects .wrap.wrap::-webkit-scrollbar{display:none}
  html body nav.subjects .wrap.wrap > a{flex:0 0 auto !important; display:inline-flex !important; flex-direction:row !important; padding:7px 13px !important; min-height:36px !important; border-radius:999px !important}
  html body nav.subjects .wrap.wrap > a b{font-size:14px !important; white-space:nowrap !important; display:inline !important}
  html body nav.subjects .wrap.wrap > a small{display:none !important}

  /* section menu (Books, Simulations…): one line too */
  html body nav.subnav .wrap{display:flex !important; flex-wrap:nowrap !important; overflow-x:auto !important; gap:6px !important; padding:6px 14px !important; scrollbar-width:none; -webkit-mask-image:linear-gradient(90deg,#000 90%,transparent); mask-image:linear-gradient(90deg,#000 90%,transparent)}
  html body nav.subnav .wrap::-webkit-scrollbar{display:none}
  html body nav.subnav a{flex:0 0 auto !important; min-height:36px !important; padding:6px 12px !important; font-size:14px !important}
}
@media (max-width:420px){
  html body header.top .lang-top .g{display:none}
  html body header.top .menu-btn .mb-t{display:none}
}
@media (max-width:360px){ html body header.top .brand-t small{display:none} }

/* ---- Accessibility and search buttons: a neat round button in the corner on phones ---- */
@media (max-width:720px){
  html body .dpa-btn{right:12px !important; bottom:14px !important; width:46px !important; height:46px !important; border-radius:50% !important; border:2px solid #000 !important; padding:0 !important; opacity:.9}
  html body .dpa-min.small{right:16px !important; bottom:66px !important; width:24px !important; height:24px !important; border-radius:50% !important; border:2px solid #000 !important; font-size:12px !important}
  html body .dpa-min.strip{bottom:14px !important}
  html body .dpa-panel{right:12px !important; bottom:70px !important; width:calc(100vw - 24px) !important; max-height:calc(100vh - 140px) !important}
  html body .dss-tab{display:none !important}
}

/* ---- Photos: wide banners without the printed logo and slogans ---- */
html body .ds-photo img{aspect-ratio:12/5 !important; object-fit:cover !important; object-position:50% 51%; border-radius:18px !important; box-shadow:0 8px 28px rgba(16,43,70,.14) !important}
html body .ds-photo img[src*="every-learner"]{object-position:50% 72%}
html body .ds-photo img[src*="wherever-you-are"], html body .ds-photo img[src*="parents-support"]{object-position:50% 59%}
html body .ds-photo img[src*="learn-anywhere"], html body .ds-photo img[src*="parents-books"], html body .ds-photo img[src*="maths-simulations"], html body .ds-photo img[src*="quiz-tablet"]{object-position:50% 56%}

/* ---- Quiz and activity pages: the frame (titles, score, tabs, buttons) in the site font; questions keep the exam font ---- */
html body .app-header, html body .app-header *, html body .quiz-header, html body .quiz-header *, html body a.back, html body .back-btn, html body .btn, html body .actions button, html body .score-pill, html body .score-pill *, html body .eyebrow, html body details > summary, html body .qmeta{font-family:"Source Sans 3","Segoe UI",system-ui,sans-serif !important}
html body .app-header h1, html body .quiz-header .t{font-family:"Bricolage Grotesque","Source Sans 3",system-ui,sans-serif !important}
html body .score-pill b, html body .score-pill strong{font-family:"JetBrains Mono",ui-monospace,monospace !important}
html body .qcard .qtext, html body .qcard .opt, html body .qs-list, html body .qs-opts{font-family:var(--act,"Bookman Activity"),"Bookman Old Style",Georgia,serif !important}

/* ---- French titles never break inside a word like "Entraînez-vous" ---- */
.nobr{white-space:nowrap}
h1, h2{text-wrap:balance}

/* ---- Footer ---- */
footer .ft-brand{display:flex; align-items:center; gap:10px; margin:0 0 14px}
footer .ft-brand img{width:38px; height:38px; background:#fff; border-radius:10px; padding:3px}
footer .ft-brand b{display:block; font:800 19px/1.1 "Bricolage Grotesque","Source Sans 3",system-ui,sans-serif; color:#fff; letter-spacing:.3px}
footer .ft-brand small{display:block; color:#9fd8b1; font-size:13px; margin-top:2px}
footer .ft-links, footer .ft-soc{display:flex !important; flex-wrap:wrap; gap:8px; margin:0 0 12px !important}
footer .ft-links a, footer .ft-soc a{display:inline-flex; align-items:center; min-height:36px; padding:6px 12px; border-radius:999px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.22); text-decoration:none !important; font-size:14.5px; font-weight:600}
footer .ft-links a:hover, footer .ft-soc a:hover{background:rgba(255,255,255,.18)}
footer .ft-soc .ft-lab{width:100%; font-size:13px; text-transform:uppercase; letter-spacing:.08em; color:#9fb3c8 !important; margin-bottom:-2px}
footer .ft-legal{display:block; font-size:13.5px; line-height:1.5; color:#a9bcd0 !important; border-top:1px solid rgba(255,255,255,.14); padding-top:12px; margin-top:6px}
footer .ft-legal + .ft-legal{border-top:0; padding-top:4px; margin-top:0}

/* dark mode: the menu button stays visible */
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) header.top .menu-btn{background:#e6eef5; color:#102b46; border-color:#e6eef5} }
:root[data-theme="dark"] header.top .menu-btn{background:#e6eef5; color:#102b46; border-color:#e6eef5}
html.dpa-contrast header.top .menu-btn{background:#ffd500; color:#000; border-color:#000}

/* ===== Clearer subject colours (update 155): Chemistry orange, Interactive Labs pink, Challenge gold ===== */
/* Chemistry pages */
html[data-subject="chemistry"]:not(.dpa-contrast), html[data-subject="chemistry"]:not(.dpa-contrast) .site-chrome{
  --blue:#c2410c !important; --blue-soft:#fff1e8 !important; --accent:#c2410c !important; --accent-ink:#ffffff !important;
  --brand:#c2410c !important; --brand-d:#9a3412 !important; --brand-l:#fff1e8 !important; --sky:#ffe6d5 !important; --sky-line:#ea580c !important;}
@media (prefers-color-scheme: dark){ html[data-subject="chemistry"]:not([data-theme="light"]):not(.dpa-contrast), html[data-subject="chemistry"]:not([data-theme="light"]):not(.dpa-contrast) .site-chrome{
  --blue:#fdba8c !important; --blue-soft:#2c1608 !important; --accent:#fb923c !important; --accent-ink:#0b0b14 !important;
  --brand:#fb923c !important; --brand-d:#fdba8c !important; --brand-l:#2c1608 !important; --sky:#2a1609 !important; --sky-line:#ea580c !important;} }
html[data-subject="chemistry"][data-theme="dark"]:not(.dpa-contrast), html[data-subject="chemistry"][data-theme="dark"]:not(.dpa-contrast) .site-chrome{
  --blue:#fdba8c !important; --blue-soft:#2c1608 !important; --accent:#fb923c !important; --accent-ink:#0b0b14 !important;
  --brand:#fb923c !important; --brand-d:#fdba8c !important; --brand-l:#2c1608 !important; --sky:#2a1609 !important; --sky-line:#ea580c !important;}
/* Interactive Labs pages */
html[data-subject="labs"]:not(.dpa-contrast), html[data-subject="labs"]:not(.dpa-contrast) .site-chrome{
  --blue:#be185d !important; --blue-soft:#fde7f1 !important; --accent:#be185d !important; --brand:#be185d !important; --sky:#fde4ef !important; --sky-line:#db2777 !important;
  --il:#be185d !important; --il-p:#9d174d !important; --il-soft:#fde7f1 !important; --il-q:#fdf0f6 !important;}
@media (prefers-color-scheme: dark){ html[data-subject="labs"]:not([data-theme="light"]):not(.dpa-contrast), html[data-subject="labs"]:not([data-theme="light"]):not(.dpa-contrast) .site-chrome{
  --blue:#f9a8d4 !important; --blue-soft:#2c0f1e !important; --accent:#f472b6 !important; --brand:#f472b6 !important; --sky:#2a0e1c !important;
  --il:#db2777 !important; --il-p:#9d174d !important; --il-soft:#2c0f1e !important; --il-q:#2a1420 !important;} }
html[data-subject="labs"][data-theme="dark"]:not(.dpa-contrast), html[data-subject="labs"][data-theme="dark"]:not(.dpa-contrast) .site-chrome{
  --blue:#f9a8d4 !important; --blue-soft:#2c0f1e !important; --accent:#f472b6 !important; --brand:#f472b6 !important; --sky:#2a0e1c !important;
  --il:#db2777 !important; --il-p:#9d174d !important; --il-soft:#2c0f1e !important; --il-q:#2a1420 !important;}
/* subject tabs */
html body .subjects a[data-subj="chemistry"]{--sc:#c2410c !important; --sl:#fff1e8 !important}
html body .subjects a[data-subj="labs"]{--sc:#be185d !important; --sl:#fde7f1 !important}
html body .subjects a[data-subj="labs"] b{color:#be185d !important}
html body .subjects a[data-subj="world"]{--sc:#a16207 !important; --sl:#fef6d8 !important}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) body .subjects a[data-subj="chemistry"]{--sc:#fdba8c !important; --sl:#2c1608 !important}
  :root:not([data-theme="light"]) body .subjects a[data-subj="labs"]{--sc:#f9a8d4 !important; --sl:#2c0f1e !important}
  :root:not([data-theme="light"]) body .subjects a[data-subj="labs"] b{color:#f9a8d4 !important}
  :root:not([data-theme="light"]) body .subjects a[data-subj="world"]{--sc:#facc15 !important; --sl:#2a2208 !important} }
:root[data-theme="dark"] body .subjects a[data-subj="chemistry"]{--sc:#fdba8c !important; --sl:#2c1608 !important}
:root[data-theme="dark"] body .subjects a[data-subj="labs"]{--sc:#f9a8d4 !important; --sl:#2c0f1e !important}
:root[data-theme="dark"] body .subjects a[data-subj="labs"] b{color:#f9a8d4 !important}
:root[data-theme="dark"] body .subjects a[data-subj="world"]{--sc:#facc15 !important; --sl:#2a2208 !important}

/* ===== Less empty space between sections (update 155) ===== */
html body main section.block, html body main > .block{padding-top:30px !important; padding-bottom:30px !important}
html body .page-hero{padding-top:28px !important; padding-bottom:24px !important}
html body main h2{margin-top:.2em}
html body main section.block + section.block{padding-top:6px !important}
@media (max-width:720px){
  html body main section.block, html body main > .block{padding-top:20px !important; padding-bottom:20px !important}
  html body main section.block + section.block{padding-top:4px !important}
  html body .page-hero{padding-top:18px !important; padding-bottom:18px !important}
  html body .hero{padding-top:12px !important; padding-bottom:14px !important}
}

/* International Challenge form: radio choices on one line, clear start button */
html body .sx-form label.sx-o{display:flex !important; align-items:center; gap:10px; font-weight:600}
html body .sx-form label.sx-o input{width:auto !important; margin:0 !important; flex:0 0 auto; transform:scale(1.2)}
html body .sx-form select{min-height:44px; padding:8px 10px; border:1.5px solid var(--line,#d3e3ee); border-radius:10px; background:var(--surface,#fff); font:inherit}
html body .sx-form #cx-go, html body #cx-go{background:#a16207; color:#fff; border:0; border-radius:12px; min-height:48px; padding:10px 22px; font-weight:800; cursor:pointer}
/* empty message lines take no space until they show a message */
html body main p:empty{display:none}

/* update 156: language welcome = small bar, never covers the page */
html body .lang-wel{padding:10px 44px 10px 14px !important;border-radius:14px !important;border-top-width:4px !important;bottom:10px !important;left:10px !important;right:10px !important;font-size:14px !important;box-shadow:0 6px 22px rgba(16,43,70,.22) !important}
html body .lang-wel h2,html body .lang-wel .fr{display:none !important}
html body .lang-wel p{margin:0 !important;font-weight:700}
html body .lang-wel .b{margin-top:8px !important;gap:8px !important}
html body .lang-wel .b button{padding:7px 8px !important;font-size:14px !important;border-radius:10px !important}
html body .lang-wel .x{top:4px !important;right:6px !important}
html body .lang-wel p:not(.fr)::after{content:" / Choisissez votre langue.";font-weight:400;color:#475569}

/* update 157: end-of-quiz next steps */
html body .px-end{margin:16px auto 6px;max-width:560px;text-align:left;border:1px solid var(--line,#d3e3ee);border-left:4px solid var(--blue,#2563eb);border-radius:14px;padding:12px 14px;background:var(--surface,#fff)}
html body .px-end .px-end-h{margin:0 0 8px;font-weight:800;font-size:1.05rem}
html body .px-end ul{list-style:none;margin:0;padding:0}
html body .px-end li{margin:0 0 8px;line-height:1.45}
html body .px-end a{font-weight:700}
html body .px-end small{display:block;font-size:.86em;opacity:.8}
