:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --surface: #fffdf8;
  --surface2: #eee7d6;
  --ink: #101d32;
  --muted: #526073;
  --line: #d8d7ce;
  --orange: #f2a93b;
  --orange-dark: #8b5708;
  --amber: #f2a93b;
  --blue: #7bbce0;
  --teal: #4f9d92;
  --red: #a7392b;
  --green: #216c61;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); }
body, button, input, select, textarea, h1, h2, h3, h4, h5, h6, .font-display, .font-mono, code, pre {
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
h2 { font-weight: 800; }
h3, h4 { font-weight: 700; }
[data-safe-area-inset-root] { background: var(--bg) !important; }
header { background: #101d32 !important; border-bottom: 3px solid #f2a93b; }
header > div { display: grid !important; grid-template-columns: 84px 1fr; gap: 8px 24px !important; padding: 18px 24px 12px !important; text-align: left !important; }
header > div > div:first-child { grid-column: 1 / -1; flex-direction: row !important; justify-content: space-between; width: 100%; border-bottom: 1px solid #344258; padding-bottom: 8px; }
header > div > img { grid-column: 1; grid-row: 2 / 4; width: 84px !important; align-self: center; }
header h1 { grid-column: 2; margin: 0 !important; }
header h1 span { font-size: clamp(25px, 4vw, 43px) !important; line-height: 1.1; }
header h1 span:first-child { color: #f2a93b !important; }
header h1 span:last-child { letter-spacing: .10em !important; }
header h1 + p { grid-column: 2; color: #d4e8f4 !important; font-size: 16px !important; }
header > div > p.text-xs, header h1 + p + div, header > div > button, header nav + p { display: none !important; }
header nav { grid-column: 1 / -1; margin-top: 8px; }
header nav > div { justify-content: flex-start !important; padding: 0 !important; }
header nav button { background: transparent !important; color: #f7f3e8 !important; border: 1px solid #526073 !important; border-radius: 8px !important; }
header nav button:hover, header nav button:focus-visible { background: #f2a93b !important; color: #101d32 !important; border-color: #f2a93b !important; }
[aria-label="Choose your level"] { background: #e8eee8 !important; color: #101d32 !important; border-bottom: 1px solid #d8d7ce !important; }
[aria-label="Choose your level"] > div > p:last-child { display: none; }
[aria-label="Choose your level"] button { border-radius: 8px; }
[data-course-filter] { background: #fffdf8 !important; }
main { padding-top: 6px; }
section { scroll-margin-top: 16px; }
#home { padding-top: 24px; padding-bottom: 24px; }
#home > div:first-child { background: #101d32 !important; border-radius: 16px; }
#home h2 { font-family: Archivo, sans-serif; font-weight: 800; line-height: 1.08; color: #f7f3e8; }
#home > div:first-child > p { color: #d7e2ef !important; }
#home button:first-child { background: #f2a93b !important; color: #101d32 !important; }
#home > div:first-child button:last-child { display: none; }
#home > div:last-child > div { border-radius: 16px; }
#home > div:last-child > div:last-child { background: #dcecf5 !important; color: #101d32 !important; }
#home > div:last-child > div:last-child p { color: #101d32 !important; }
.bg-black { background-color: #101d32; }
[class~="bg-[#ff5a00]"] { background-color: #f2a93b !important; color: #101d32 !important; }
[class~="border-[#ff5a00]"] { border-color: #f2a93b !important; }
[class~="text-[#ff5a00]"], .text-orange-600 { color: #8b5708 !important; }
.bg-amber-400, .bg-amber-300 { background-color: #f2a93b !important; color: #101d32 !important; }
.bg-emerald-500, .bg-emerald-600 { background-color: #4f9d92 !important; color: #101d32 !important; }
[role="tab"][aria-selected="true"] { outline: 2px solid #101d32; outline-offset: 2px; }
header [aria-current="page"] { box-shadow: inset 0 -3px #f2a93b; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #35799e; outline-offset: 3px; }
#quiz [class*="bg-emerald"], #quiz [class*="bg-green"] { background: #dceee8 !important; color: #164e45 !important; border-color: #216c61 !important; }
#quiz [class*="bg-red"], #quiz [class*="bg-rose"] { background: #f8ded7 !important; color: #873224 !important; border-color: #a7392b !important; }
#quiz [class*="text-emerald"], #quiz [class*="text-green"] { color: #216c61 !important; }
#quiz [class*="text-red"], #quiz [class*="text-rose"] { color: #a7392b !important; }
.learning-path { grid-column: 1 / -1; padding: 20px 0 0; border-top: 1px solid #d8d7ce; }
.learning-path-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.learning-path h3 { font-size: 22px; font-weight: 800; margin: 0; }
.learning-path p { margin: 4px 0 0; color: #526073; font-size: 14px; }
.learning-path nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.learning-path a { font-size: 14px; padding: 10px 14px; border: 1px solid #b7bdbb; border-radius: 8px; text-decoration: none; font-weight: 700; }
.learning-path a:hover { background: #e2eeea; border-color: #4f9d92; }
.learning-path .continue-learning { background: #f2a93b; color: #101d32; border-color: #f2a93b; }
.learning-path a[aria-current="step"] { background: #dceee8; border-color: #216c61; }
#root header nav > div > button { background: transparent !important; color: #f7f3e8 !important; border-color: #526073 !important; }
#root header nav > div > button:hover { background: #f2a93b !important; color: #101d32 !important; }
#root [aria-label="Choose your level"] { background: #e8eee8 !important; }
#root #home [data-course-badge] { background: #344258 !important; color: #f7f3e8 !important; }
@media (max-width: 640px) {
 header > div { grid-template-columns: 60px 1fr; gap: 6px 14px !important; padding: 12px 16px !important; }
 header > div > img { width: 60px !important; }
 header > div > div:first-child { flex-direction: column !important; align-items: flex-start !important; }
 header h1 span { font-size: 25px !important; }
 header h1 + p { font-size: 13px !important; }
 header nav button { font-size: 12px !important; padding: 8px 10px !important; }
 [aria-label="Choose your level"] > div { padding-block: 10px; }
 #home { padding-top: 18px; }
 .learning-path nav a { flex: 1 1 42%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* A consistent reading surface for the naming reference cards. */
#root #naming div[class*="rounded-"] {
  background: #fffdf8 !important;
  color: #101d32 !important;
  border: 1px solid #d8d7ce !important;
}
#root #naming h3, #root #naming li, #root #naming p { color: #101d32 !important; }
#root #naming p > span[class*="bg-"] {
  display: inline-block;
  min-width: 64px;
  margin-right: 6px;
  text-align: center;
  background: #f2a93b !important;
  color: #101d32 !important;
}
#root #naming p[class*="bg-white"] { background: #f7f3e8 !important; }

/* Course accents follow the application's existing syllabus membership. */
#root { --course-accent: #f2a93b; --course-tint: #fbe8ca; }
#root:has([data-course-pill="camb-ol"][aria-selected="true"]) { --course-accent: #216c61; --course-tint: #d4ebe5; }
#root:has([data-course-pill="camb-ig"][aria-selected="true"]) { --course-accent: #276d99; --course-tint: #d8eaf5; }
#root:has([data-course-pill="gcse"][aria-selected="true"]) { --course-accent: #8b6415; --course-tint: #f1e5c1; }
#root:has([data-course-pill="gcse-comb"][aria-selected="true"]) { --course-accent: #a64b3a; --course-tint: #f4dcd5; }
#root .element-cell.on-syllabus {
  border-color: var(--course-accent) !important;
  background-image: linear-gradient(135deg, var(--course-tint), transparent 75%);
  box-shadow: inset 0 0 0 1px var(--course-accent);
}
#root .element-cell.on-syllabus .el-sym {
  color: #fff !important;
  -webkit-text-stroke: .65px #000;
  paint-order: stroke fill;
  text-shadow: 1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
}
#root .element-cell.on-syllabus .el-star { color: var(--course-accent) !important; }
#root .syllabus-grey { filter: grayscale(1) !important; opacity: .62; }
@media (min-width: 1024px) {
  #topic-videos > .grid > div:has(#video-pear-drops) { grid-column: 3; }
}
.lesson-brand { display: block; width: 175px; height: 62px; object-fit: contain; }
header .header-brand { margin-left: auto; flex-shrink: 0; }
header > div > div:first-child > p:first-child { font-size: 13px; }
header > div > div:first-child > p:nth-child(2) { display: none; }
main > section:has(> .lesson-brand-link) { position: relative; padding-top: 88px; }
main > section > .lesson-brand-link { position: absolute; top: 12px; right: 0; }
main > #home > .lesson-brand-link { top: 8px; }
main > #home:has(> .lesson-brand-link) { padding-top: 84px; }
@media (max-width: 640px) {
  .lesson-brand { width: 135px; height: 48px; }
  header > div > div:first-child { flex-direction: row !important; align-items: center !important; gap: 12px; }
  header > div > div:first-child > p:first-child { max-width: 145px; font-size: 11px; }
  main > section:has(> .lesson-brand-link) { padding-top: 70px; }
  main > #home:has(> .lesson-brand-link) { padding-top: 66px; }
}

#root #compounds button[aria-expanded] > h3 {
  font-size: 1.5rem !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  margin-top: .75rem;
  margin-bottom: .35rem;
}
#root #compounds button[aria-expanded] > span.border-l-4 {
  background: #e1efeb !important;
  border-left-color: #287568 !important;
}
#root #compounds button[aria-expanded] > span.border-l-4 > span {
  color: #101d32 !important;
}
#root #compounds button[aria-expanded] > span.border-l-4 > span:first-child {
  color: #205d53 !important;
}
#root #compounds button[aria-expanded] > span.border-l-4 > span:last-child {
  color: #4b6262 !important;
}
#root #compounds .everyday-use { padding: 10px 12px; background: #f1eee4; border-radius: 10px; }
#root #compounds .everyday-use::before { content: 'EVERYDAY USE / CONTEXT'; display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #205d53; margin-bottom: 4px; }
.hazard-key { margin: 16px 0; padding: 14px 18px; border: 1px solid #d8d7ce; border-radius: 14px; background: #fffdf8; }
.hazard-key summary { cursor: pointer; font-weight: 700; }
.hazard-symbols { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.hazard-symbol { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; max-width: 110px; text-align: center; font-size: 12px; font-weight: 700; color: #101d32; }
.hazard-symbol img { width: 48px; height: 48px; object-fit: contain; }
.hazard-key p,.hazard-context { display: block; font-size: 12px; color: #52616c; margin: 8px 0; }
.hazard-key a { font-size: 12px; text-decoration: underline; }
/* Beyond-syllabus compounds use a solid grey card, not a coloured fact highlight. */
#root #compounds .syllabus-grey { opacity: 1; filter: grayscale(1) !important; }
#root #compounds .syllabus-grey button[aria-expanded] { background: #e5e5e5 !important; border-color: #bdbdbd !important; color: #555 !important; }
#root #compounds .syllabus-grey button[aria-expanded] > h3 { color: #555 !important; }
#root #compounds .syllabus-grey button[aria-expanded] > span.border-l-4 { background: #e5e5e5 !important; border-left-color: #a3a3a3 !important; }
#root #compounds .syllabus-grey button[aria-expanded] > span.border-l-4 > span { color: #616161 !important; }
#root #compounds .syllabus-grey .everyday-use { background: #dedede !important; }
#root #lab li.apparatus-item { display: flow-root; min-height: 112px; padding: 12px 0; border-bottom: 1px solid #e3e4de; }
#root #lab .apparatus-picture { float: left; width: 76px; height: 100px; margin: 0 14px 6px 0; padding: 5px; border: 1px solid #d6e2e4; border-radius: 10px; background: #f3f8f8; object-fit: contain; }
#root #lab li.apparatus-item:last-child { border-bottom: 0; }
/* Match the order and single-column flow of a student's written report. */
#root #writeup > .grid { grid-template-columns: minmax(0, 1fr) !important; }
#root #writeup > .grid > * { grid-column: 1 / -1 !important; min-width: 0; }
/* Apparatus cards: Holding, Support/Separation, Measuring, Safety. */
#root #lab .grid > div:has(> h3):nth-child(2) { order: 3; }
#root #lab .grid > div:has(> h3):nth-child(3) { order: 2; }
#root #lab .grid > div:has(> h3):nth-child(1) { order: 1; }
#root #lab .grid > div:has(> h3):nth-child(4) { order: 4; }
.industry-hazard-examples { margin-top: 20px; padding-top: 18px; border-top: 1px solid #d8d7ce; }
.industry-hazard-title { font-weight: 800; font-size: 15px; color: #101d32; }
.industry-hazard-examples .hazard-symbols { gap: 18px; }
.industry-hazard-examples .hazard-symbol { width: 100px; }
.industry-hazard-examples .hazard-symbol img { width: 54px; height: 54px; }
.industry-hazard-note { font-size: 12px; color: #52616c; max-width: 900px; }
#root #student-go-pro .plan-message { background: #fffdf8 !important; color: #101d32 !important; border: 1px solid #d8d7ce; }
#root .plan-message > h3 { color: #101d32 !important; }
.plan-message-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.plan-message-grid > div { padding: 22px; border-radius: 16px; }
.free-message { background: #dceee8; border: 1px solid #9fc8bb; }
.pro-message { background: #fbe8c6; border: 1px solid #e6bd72; }
#root .plan-message-grid h4 { font-size: 24px; line-height: 1.25; font-weight: 800; color: #101d32 !important; margin: 10px 0; }
#root .plan-message-grid p { color: #344957 !important; font-size: 16px; }
.plan-message-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.free-message .plan-message-label { color: #205d53; }
.pro-message .plan-message-label { color: #78500b; }
#root .plan-message-note { color: #344957 !important; font-weight: 700; margin-top: 16px; }
@media(max-width:640px) { .plan-message-grid { grid-template-columns: 1fr; } }
#root #home svg.lucide-shield-check { width: 56px !important; height: 56px !important; min-width: 56px; flex-shrink: 0; }
header .lesson-brand-link { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
header .main-site-label { color: #F7F3E8; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
header .lesson-brand-link:hover .main-site-label { color: #F2A93B; }
/* Larger square tiles preserve the existing type sizes and syllabus markers. */
#root .periodic-grid { grid-template-columns: repeat(18, minmax(0, 1fr)) !important; grid-auto-rows: minmax(72px, auto) !important; width: 100%; max-width: 100%; min-width: 0; }
#root .periodic-grid .element-cell { width: 100%; height: 100%; min-width: 0; min-height: 72px; }
#root .periodic-grid .element-cell > .truncate { overflow: visible; text-overflow: clip; }
#root .periodic-grid .element-cell > span.hidden,
#root .periodic-grid .element-cell > span.el-name { width: 100%; text-align: center; white-space: normal; overflow-wrap: break-word; word-break: normal; hyphens: manual; flex-shrink: 0; }

/* Learn-toFly family colours, shared by tiles, legend and category badges. */
#root #elements [style*="background: rgb(255, 138, 61)"] { background-color: #F2A93B !important; color: #101D32; }
#root #elements [style*="background: rgb(255, 209, 102)"] { background-color: #F7CF83 !important; color: #101D32; }
#root #elements [style*="background: rgb(255, 159, 178)"] { background-color: #C2CEDC !important; color: #101D32; }
#root #elements [style*="background: rgb(168, 216, 168)"] { background-color: #CFE3DB !important; color: #101D32; }
#root #elements [style*="background: rgb(127, 200, 188)"] { background-color: #A8CEC5 !important; color: #101D32; }
#root #elements [style*="background: rgb(142, 203, 255)"] { background-color: #E1EFEB !important; color: #101D32; }
#root #elements [style*="background: rgb(201, 166, 255)"] { background-color: #B8CFCE !important; color: #101D32; }
#root #elements [style*="background: rgb(184, 198, 255)"] { background-color: #DCE3EC !important; color: #101D32; }
#root #elements [style*="background: rgb(255, 179, 217)"] { background-color: #E9DFCA !important; color: #101D32; }
#root #elements [style*="background: rgb(255, 138, 138)"] { background-color: #D8C8A6 !important; color: #101D32; }
#root #elements .element-cell.on-syllabus { background-image: none; }

/* Wide, high-contrast grab handles for page and horizontal table scrolling. */
html, body, * { scrollbar-width: auto; }
::-webkit-scrollbar { width: 24px; height: 24px; }
::-webkit-scrollbar-track { background: #dce3ec; border: 1px solid #a4afbd; }
::-webkit-scrollbar-thumb { background: #526073; border: 3px solid #dce3ec; border-radius: 12px; min-height: 64px; min-width: 64px; }
::-webkit-scrollbar-thumb:hover { background: #276d99; }
::-webkit-scrollbar-thumb:active { background: #101d32; }
::-webkit-scrollbar-corner { background: #dce3ec; }
@supports not selector(::-webkit-scrollbar) {
  html, body, * { scrollbar-color: #526073 #dce3ec; scrollbar-width: auto; }
}

/* Raised tile faces: reserve a lower bevel so mass and name stay on the face. */
#root #elements .periodic-grid { box-sizing:border-box; padding:4px 2px 6px; }
#root #elements .periodic-grid button.element-cell {
  position:relative; isolation:isolate; box-sizing:border-box;
  justify-content:flex-start; gap:1px; padding:4px 3px 8px !important;
  border-radius:9px; overflow:hidden;
  background-image:linear-gradient(145deg,rgba(255,255,255,.42),rgba(255,255,255,.05) 45%,rgba(16,29,50,.09)) !important;
  box-shadow:inset 1px 2px 0 rgba(255,255,255,.65),inset -1px -4px 0 rgba(16,29,50,.18),0 3px 0 rgba(16,29,50,.36),0 4px 5px rgba(16,29,50,.13) !important;
  transition:transform .14s ease,box-shadow .14s ease;
  cursor:pointer;
}
#root #elements .periodic-grid button.element-cell > span { flex-shrink:0; }
#root #elements .periodic-grid button.element-cell > .el-sym { margin:1px 0; }
#root #elements .periodic-grid button.element-cell > span.hidden,
#root #elements .periodic-grid button.element-cell > span.el-name {
  display:block !important; text-align:center; width:100%; min-height:10px;
  white-space:normal; overflow-wrap:break-word; word-break:normal; hyphens:manual; line-height:1.2;
}

#root #elements .periodic-grid button.element-cell > span:last-child {
  margin-top:0; line-height:1.15; text-align:center; overflow:visible;
}
#root #elements .periodic-grid button.element-cell:active {
  transform:translateY(2px);
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.45),inset -1px -2px 0 rgba(16,29,50,.18),0 1px 0 rgba(16,29,50,.36) !important;
}
#root #elements .periodic-grid button.element-cell:focus-visible { outline:3px solid #101D32; outline-offset:1px;z-index:2; }
@media(hover:hover) and (pointer:fine) {
  #root #elements .periodic-grid button.element-cell:hover {
    transform:translateY(-2px); z-index:1;
    box-shadow:inset 1px 2px 0 rgba(255,255,255,.75),inset -1px -4px 0 rgba(16,29,50,.18),0 5px 0 rgba(16,29,50,.36),0 6px 7px rgba(16,29,50,.18) !important;
  }
  #root #elements .periodic-grid button.element-cell:hover:active {transform:translateY(2px)}
}
#root #elements .element-details-cue {
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:14px 18px;margin:12px 0;background:#101D32;color:#FFFDF6 !important;
  border:2px solid #F2A93B;border-radius:14px;text-decoration:none;
  min-height:64px;width:100%;box-sizing:border-box;
}
#root #elements .element-details-cue strong {display:block;font-size:1rem;line-height:1.4;font-weight:800}
#root #elements .element-details-cue small {display:block;font-size:.875rem;line-height:1.4;margin-top:3px;color:#E3E8EF}
#root #elements .element-details-cue svg {width:30px;height:30px;flex-shrink:0;color:#F2A93B}
#root #elements .element-details-cue:focus-visible {outline:3px solid #287568;outline-offset:3px}
#root #element-details {scroll-margin-top:24px}
@media(prefers-reduced-motion:reduce){#root #elements .periodic-grid button.element-cell{transition:none}}

#root #elements .element-card-pager{margin:14px 0 12px;width:100%;max-width:100%}
#root #elements .element-pager-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#root #elements .element-pager-buttons button{min-width:0;min-height:48px;padding:10px 12px;border:1px solid #F2A93B;border-radius:10px;background:#F7F3E8;color:#101D32;font-size:.9rem;font-weight:750;line-height:1.4;white-space:normal;overflow-wrap:anywhere;cursor:pointer;text-align:center}
#root #elements .element-pager-buttons button:not(:disabled):hover{background:#F2A93B}
#root #elements .element-pager-buttons button:focus-visible{outline:3px solid #F2A93B;outline-offset:3px}
#root #elements .element-pager-buttons button:disabled{background:#263348;color:#B6C0CC;border-color:#617084;cursor:default}
#root #elements .element-pager-note{color:#D4DCE6;font-size:.875rem;line-height:1.4;margin:8px 0 0}

/* 25 Nov 2026: ink on gold fills must meet WCAG AA 4.5:1.
   White on #f2a93b is about 1.99:1. #101d32 on #f2a93b is about 9:1. */
#root #home button[class*="bg-[#f2a93b]"],
#root .banner-callout-btn,
#root [class~="bg-[#ff5a00]"],
#root [class~="bg-[#f2a93b]"],
#root .bg-amber-400,
#root .bg-amber-300 {
  color: #101d32 !important;
}
#root [class~="bg-[#ff5a00]"] :is(.text-white, [class*="text-white"]),
#root [class~="bg-[#f2a93b]"] :is(.text-white, [class*="text-white"]) {
  color: #101d32 !important;
}
#root .bg-black,
#root .bg-black :is(.text-white, [class*="text-white"]),
#root [class~="bg-[#ff5a00]"] .bg-black,
#root [class~="bg-[#f2a93b]"] .bg-black,
#root [class~="bg-[#ff5a00]"] .bg-black :is(.text-white, [class*="text-white"]),
#root #plans article .bg-black {
  color: #fff !important;
}
