/* =====================================================================
   Revise Science — rs-selector.css
   Course selector + topic menu, shared by GCSE and A-level pages.
   Replaces four pasted <style> blocks:
     GCSE: "gcse chemistry filter code" (29 pages) + "GCSE chem menu" (25)
     A-level: "#chemistryfilters" (6) + "A-level Chem Menu" (6)
   The GCSE version is the standard. A-level-only rules follow at the end.
   v1.1 (17 Nov 2026): Community pill coloured outside the menu too (the status key); [data-calculator] in the
   badge-host rule (unused [data-next-until] dropped); packed menu rows, the pill slot and the Calc pill at the end.
   v1.2 (17 Nov 2026): content pages show one topic box + Back to GCSE menu + Next in your course; pills never
   clip (.rs-stack); course-aware pills (hidden attribute) - the rs-topic-menu blocks at the end.
   v1.3 (17 Nov 2026): Next in this topic, the topic box Order toggle; the course selector folded to one line
   (.rs-cs-folded / .rs-cs-open, rs-course-fold blocks at the very end).
   ===================================================================== */

body:not(:has(.alevel-selector-container)) .course-selector-container {
  width: min(100%, 1000px);
  container-type: inline-size;
  container-name: gcse-selector;
  padding: 9px 12px !important;
  margin: 0 auto 16px;
  background: #f5f6fb;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  box-shadow: 3px 3px 0 #d9dde7;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
  margin: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container.rs-selector-ready #cs-controls-row {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div {
  width: auto;
  padding: 0;
  min-width: 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  width: 100%;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-type-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-tier-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-year-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-paper-select {
  min-width: 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  flex: 1 1 auto;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  width: 100%;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  max-width: none;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  width: 100%;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select {
  box-sizing: border-box;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-board-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-type-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-tier-select, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-paper-select {
  text-align: center;
  text-align-last: center;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(1) {
  flex: 34 1 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(2) {
  flex: 28 1 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-tier-wrapper {
  flex: 18 1 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-year-wrapper {
  flex: 20 1 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-paper-wrapper {
  flex: 20 1 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .cs-label {
  display: block;
  text-align: center;
  margin: 0 0 4px;
  color: #5d6680;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .form-select, body:not(:has(.alevel-selector-container)) .course-selector-container .cs-dropdown-btn {
  width: 100%;
  min-height: 36px;
  padding: 6px 34px;
  text-align: center;
  text-align-last: center;
  color: #25242f !important;
  background-color: #ffffff !important;
  border: 1px solid #cfd5e2 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 0.84rem;
  cursor: pointer;
}

body:not(:has(.alevel-selector-container)) .course-selector-container {
  position: relative;
  z-index: 40;
  overflow: visible;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select[hidden] {
  display: none !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 34px;
  border: 1px solid #cfd5e2;
  border-radius: 8px;
  background: #ffffff;
  color: #25242f;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-button:hover {
  border-color: #9aa5bd;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-button:focus-visible {
  border-color: #6f79a0;
  box-shadow: 0 0 0 3px rgba(111, 121, 160, 0.14);
  outline: 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-label {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid #394362;
  border-bottom: 1.7px solid #394362;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 120ms ease;
  pointer-events: none;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select.is-open .rs-custom-select-button::after {
  transform: translateY(-30%) rotate(225deg);
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 2000;
  width: 100%;
  max-height: 260px;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #8d929d;
  border-radius: 0 0 5px 5px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(23, 25, 67, 0.13);
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-menu[hidden] {
  display: none !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #25242f;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option:hover, body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option:focus-visible {
  background: #edf6ff;
  color: #171943;
  outline: 0;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option.is-selected {
  background: #286bcc;
  color: #ffffff;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option.is-selected:hover, body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option.is-selected:focus-visible {
  background: #286bcc;
  color: #ffffff;
}

@container gcse-selector (max-width: 460px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-button, body:not(:has(.alevel-selector-container)) .course-selector-container .rs-custom-select-option {
    font-size: 0.8rem;
  }
}

body:not(:has(.alevel-selector-container)) .course-selector-container .form-select:hover, body:not(:has(.alevel-selector-container)) .course-selector-container .cs-dropdown-btn:hover {
  border-color: #9aa5bd !important;
}

body:not(:has(.alevel-selector-container)) .course-selector-container .form-select:focus, body:not(:has(.alevel-selector-container)) .course-selector-container .cs-dropdown-btn:focus {
  border-color: #6f79a0 !important;
  box-shadow: 0 0 0 3px rgba(111, 121, 160, 0.14) !important;
  outline: 0;
}

body:not(:has(.alevel-selector-container)) .rs-inline-statement-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: help;
  user-select: none;
}

@container gcse-selector (max-width: 700px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(1), body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(2), body:not(:has(.alevel-selector-container)) .course-selector-container #cs-tier-wrapper, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-year-wrapper, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-paper-wrapper {
    flex: 1 1 calc(50% - 5px) !important;
  }
}

@container gcse-selector (max-width: 460px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(1), body:not(:has(.alevel-selector-container)) .course-selector-container #cs-controls-row > div:nth-child(2) {
    flex: 1 1 100% !important;
  }
}

@container gcse-selector (max-width: 460px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container #cs-tier-wrapper, body:not(:has(.alevel-selector-container)) .course-selector-container #cs-paper-wrapper {
    flex: 1 1 calc(50% - 5px) !important;
  }
}

@container gcse-selector (max-width: 460px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container #cs-year-wrapper {
    flex: 1 1 100% !important;
  }
}

.rs-page-unavailable-notice {
  width: min(100%, 1000px);
  margin: -4px auto 18px;
  padding: 14px 16px;
  border: 1px solid #efc2b7;
  border-left: 4px solid #d33e16;
  border-radius: 10px;
  background: #fff6f3;
  color: #394362;
  font-size: 0.9rem;
  line-height: 1.55;
}

.rs-page-unavailable-notice strong {
  color: #25242f;
}

.rs-page-unavailable-notice[hidden] {
  display: none !important;
}

:root {
  --rs-menu-navy: #171943;
  --rs-menu-soft: #4e5365;
  --rs-menu-muted: #696e7f;
  --rs-menu-line: #e0e3e8;
  --rs-menu-chem: #d65329;
  --rs-menu-blue: #3f78a8;
  --rs-menu-blue-dark: #244f7a;
  --rs-menu-blue-light: #edf6ff;
}

.rs-menu, .rs-status-tools {
  font-family: "ABeeZee", sans-serif;
}

.rs-selector-toolbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  margin: 0 auto 0.8rem;
}

body:not(:has(.alevel-selector-container)) .rs-selector-toolbar .course-selector-container {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0 !important;
}

body:not(:has(.alevel-selector-container)) .rs-selector-toolbar .course-selector-container:not(.cs-expanded):not(.cs-hover-open) {
  padding: 7px 14px !important;
}

body:not(:has(.alevel-selector-container)) .rs-selector-toolbar .cs-collapse-toggle {
  padding-top: 2px;
  padding-bottom: 2px;
}

.rs-status-tools {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  min-width: 205px;
  z-index: 20;
}

.rs-roadmap-link {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  width: 100%;
  padding: 0.42rem 0.58rem;
  border: 1px solid #f0a08a;
  border-radius: 8px;
  color: #a63c1b;
  background: #fff4ef;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.rs-roadmap-link:hover, .rs-roadmap-link:focus-visible {
  border-color: var(--rs-menu-chem);
  color: #8d3217;
  background: #ffebe4;
  text-decoration: none;
}

.alevel-selector-container {
  width: min(100%,1000px);
  max-width: none;
  padding: 9px 12px;
  margin: 0 auto 16px;
  background: #f5f6fb;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  box-shadow: 3px 3px 0 #d9dde7;
}

.alevel-selector-container.rs-cs-folded {
  width: min(100%,44rem);
}

.alevel-selector-container #al-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
  margin: 0;
}

.alevel-selector-container #al-controls-row > div {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 0;
}

.alevel-selector-container.rs-cs-folded #al-controls-row {
  display: none;
}

.alevel-selector-container .cs-label {
  display: block;
  margin: 0 0 4px;
  padding-top: 2px;
  color: #5d6680;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .045em;
  text-align: center;
  text-transform: uppercase;
}

.alevel-selector-container .form-select {
  width: 100%;
  min-height: 36px;
  padding: 6px 34px;
  color: #25242f;
  background-color: #fff;
  border: 1px solid #cfd5e2;
  border-radius: 8px;
  box-shadow: none;
  font-size: .84rem;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
}

.alevel-selector-container .form-select:hover {
  border-color: #9aa5bd;
}

.alevel-selector-container .form-select:focus {
  border-color: #6f79a0;
  box-shadow: 0 0 0 3px rgba(111,121,160,.14);
  outline: 0;
}

.alevel-selector-container .rs-cs-sum {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 36px;
}

.alevel-selector-container.rs-cs-open .rs-cs-sum {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dfe3ea;
}

.alevel-selector-container .rs-cs-sum__text {
  margin: 0;
  color: #25242f;
  font-size: .95rem;
  line-height: 1.3;
}

.alevel-selector-container .rs-cs-sum__label {
  color: #4f5872;
}

.alevel-selector-container .rs-cs-sum__name {
  font-weight: 700;
}

.alevel-selector-container .rs-cs-sum__change {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 12px;
  border: 1.5px solid #7d849a;
  border-radius: 8px;
  background: #fff;
  color: #185abc;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .alevel-selector-container .rs-cs-sum__change {
    min-height: 40px;
  }
}

.alevel-selector-container .rs-cs-sum__change:hover {
  border-color: #185abc;
  background: #eef3fc;
}

.alevel-selector-container .rs-cs-sum__change:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

.alevel-selector-container .rs-cs-note {
  margin: 3px 0 0;
  color: #4f5872;
  font-size: .8rem;
  line-height: 1.3;
  text-align: center;
}

.alevel-selector-container.rs-cs-open .rs-cs-note {
  margin: -2px 0 10px;
}

.rs-selector-toolbar .alevel-selector-container {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.rs-selector-toolbar .alevel-selector-container.rs-cs-folded {
  width: auto;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.rs-selector-toolbar .alevel-selector-container.rs-cs-folded .rs-cs-sum {
  justify-content: flex-start;
}

.rs-selector-toolbar .alevel-selector-container.rs-cs-folded .rs-cs-sum__text {
  font-size: 1rem;
}

.rs-roadmap-link__arrow {
  margin-left: auto;
}

.rs-status-key {
  position: relative;
  width: 100%;
  margin: 0;
  color: var(--rs-menu-soft);
  font-size: 0.8rem;
}

.rs-status-key summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  width: 100%;
  padding: 0.34rem 0.55rem;
  border-radius: 8px;
  color: var(--rs-menu-soft);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

@media (max-width: 575.98px) {
  .rs-status-key summary {
    min-height: 40px;
  }
}

.rs-status-key summary::-webkit-details-marker {
  display: none;
}

.rs-status-key summary::before {
  content: "ⓘ";
  color: var(--rs-menu-blue);
}

.rs-status-key summary::after {
  content: "⌄";
  margin-left: 0.08rem;
  color: var(--rs-menu-muted);
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 150ms ease;
}

.rs-status-key[open] summary::after {
  transform: rotate(180deg);
}

.rs-status-key summary:hover {
  color: var(--rs-menu-blue-dark);
  background: var(--rs-menu-blue-light);
}

.rs-selector-toolbar .rs-status-key .rs-badge-key {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  width: 320px;
  max-width: calc(100vw - 2rem);
  padding: 0.45rem;
  border: 1px solid var(--rs-menu-line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 25, 67, 0.12);
}

.rs-badge-key-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.42rem 0.5rem;
  border-radius: 7px;
  background: #f7f8fb;
}

.rs-badge-key-item .rs-badge {
  min-width: 58px;
  justify-self: start;
  white-space: nowrap;
}

.rs-status-tools--hidden {
  display: none !important;
}

.rs-menu.rs-masonryjs {
  position: relative;
  padding-top: 0;
}

.rs-menu .topic {
  overflow: hidden;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--rs-menu-line);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 4px 13px rgba(23, 25, 67, 0.035);
}

.rs-menu .topic-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0.72rem 0.78rem;
  border: 1px solid #e2e5ea;
  border-radius: 11px;
  background: #f8f9fb;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.rs-menu .topic-header:has(.topic-title a) {
  cursor: pointer;
  border-color: #dbe6f0;
  background: #f8fbff;
}

.rs-menu .topic-header:has(.topic-title a):hover {
  border-color: #a9cce8;
  background: var(--rs-menu-blue-light);
  box-shadow: 0 3px 10px rgba(63, 120, 168, 0.08);
}

.rs-menu .topic-title {
  margin: 0;
  color: var(--rs-menu-navy);
  font-size: clamp(1.02rem, 1.35vw, 1.24rem);
  font-weight: 800;
  line-height: 1.28;
}

.rs-menu .topic-title a {
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.rs-menu .topic-title a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.rs-menu .topic-title a::after {
  content: "→";
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-left: 0.38rem;
  color: var(--rs-menu-chem);
  font-size: 0.9em;
  transition: transform 150ms ease;
}

.rs-menu .topic-header:hover .topic-title a::after {
  transform: translateX(3px);
}

.rs-menu .topic-title--disabled {
  color: #858b98;
  font-weight: 800;
  pointer-events: none;
}

.rs-menu .topic:not(:has(.topic-title a, .topic-links a:not(.disabled), .btn-quiz:not(.disabled))) h3.topic-title--disabled::after {
  content: "Not available yet";
  display: inline-flex;
  margin-left: 0.42rem;
  padding: 0.18rem 0.34rem;
  border-radius: 5px;
  color: #747b88;
  background: #e8eaed;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: middle;
}

.rs-menu .btn-quiz {
  position: relative;
  z-index: 2;
  padding: 0.42rem 0.62rem;
  border: 1px solid #d6dee7;
  border-radius: 8px;
  color: #33415c;
  background: #ffffff;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: none;
}

.rs-menu .btn-quiz:hover, .rs-menu .btn-quiz:focus-visible {
  border-color: #a9cce8;
  color: var(--rs-menu-blue-dark);
  background: var(--rs-menu-blue-light);
}

.rs-menu .btn-quiz.disabled {
  display: none !important;
}

.rs-menu .topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  margin: 0;
  padding: 0.65rem 0.1rem 0.05rem;
  list-style: none;
}

.rs-menu .topic-links a, .rs-menu .chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.48rem 0.68rem;
  border: 1px solid #dfe5ec;
  border-radius: 999px;
  color: #31415f;
  background: #ffffff;
  font-size: 0.88rem;
  line-height: 1.25;
  text-decoration: none;
}

.rs-menu .topic-links a:hover, .rs-menu .topic-links a:focus-visible {
  border-color: #b8d8f3;
  color: var(--rs-menu-navy);
  background: var(--rs-menu-blue-light);
  text-decoration: none;
}

.rs-menu .chip.disabled {
  border-color: transparent;
  color: #9aa0ad;
  background: #f1f2f4;
  cursor: default;
  opacity: 0.82;
}

body:not(:has(.alevel-selector-container)) .rs-menu .topic-header.has-topic-filters {
  flex-wrap: wrap;
  align-items: center;
}

body:not(:has(.alevel-selector-container)) .rs-menu .topic-header.has-topic-filters .topic-title {
  flex: 1 1 230px;
  min-width: 0;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
  position: relative;
  z-index: 3;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #394362;
  line-height: 1;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter select {
  border: 2px solid #e6e6e6;
  border-radius: 8px;
  padding: 3px 7px;
  height: 34px;
  font-size: 0.82rem;
  background: #ffffff;
  color: #25242f;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter select.active {
  border-color: #394362;
  box-shadow: 0 0 0 2px rgba(57, 67, 98, 0.12);
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter:nth-child(1) select {
  width: 116px;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter:nth-child(2) select {
  width: 126px;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter:nth-child(3) select {
  width: 96px;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter:nth-child(4) select {
  width: 84px;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-mini-tier-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 34px;
  padding: 3px 7px;
  border: 1px solid #f9cfcc;
  border-radius: 8px;
  background: linear-gradient(135deg, #fdeeed 0%, #e2f1f9 100%);
  color: #e74c3c;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  user-select: none;
}

body:not(:has(.alevel-selector-container)) .rs-menu .rs-int-filter-hidden, .rs-menu .rs-int-topic-hidden, body:not(:has(.alevel-selector-container)) .rs-menu .rs-paper-filter-hidden, .rs-menu .rs-paper-topic-hidden {
  display: none !important;
}

[data-practical], [data-calculator], [data-building], [data-new-until], [data-updated], [data-refresh-until] {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 0.34rem;
}

.rs-auto-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex: 0 0 auto;
}

.rs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.34rem;
  border: 0;
  border-radius: 5px;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 1;
  text-decoration: none !important;
  text-transform: uppercase;
  white-space: nowrap;
}

.rs-badge--practical {
  color: #166b48;
  background: #e8f7ef;
}

.rs-badge--building {
  color: #ffffff;
  background: #b8431f;
}

.rs-badge--new {
  color: #7a5600;
  background: #fff3cc;
}

.rs-badge--updated {
  color: #2e75ad;
  background: #edf6ff;
}

.rs-badge--next {
  color: #a63c1b;
  background: #fff1eb;
}

.rs-badge--refresh {
  color: #5b3e9f;
  background: #f2eef9;
}

@media (max-width: 991.98px) {
  .rs-menu.rs-masonryjs .topic {
    position: static !important;
    transform: none !important;
    width: auto !important;
    margin-bottom: 16px;
  }
}

@media (max-width: 767.98px) {
  .rs-selector-toolbar {
    display: block;
    margin-bottom: 0.65rem;
  }
}

@media (max-width: 767.98px) {
  .rs-status-tools {
    width: min(100%, 260px);
    margin: 0.35rem 0 0 auto;
  }
}

@media (max-width: 767.98px) {
  .rs-menu .topic-header {
    align-items: flex-start;
  }
}

@media (max-width: 767.98px) {
  body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filters {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 767.98px) {
  body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter {
    flex: 1 1 110px;
  }
}

@media (max-width: 767.98px) {
  body:not(:has(.alevel-selector-container)) .rs-menu .rs-topic-header-filter select {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rs-menu .topic-header, .rs-menu .topic-title a::after, .rs-roadmap-link, .rs-status-key summary::after {
    transition: none;
  }
}

/* ---------- A-level only (classes that exist only on A-level pages) ---------- */

@keyframes fadeInPill {
  from {
    opacity: 0;
    transform: translateY(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rs-menu .rs-topic-filter-select {
  width: 150px !important;
  min-width: 150px !important;
  height: 38px;
  min-height: 38px;
  padding: 6px 32px 6px 10px;
  border: 1px solid #cfd5e2 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  box-shadow: none !important;
  color: #25242f !important;
  font-size: 0.82rem;
}

@media (max-width: 767.98px) {
  .rs-menu .topic-header.has-topic-filters {
    flex-wrap: wrap;
  }
}

@media (max-width: 767.98px) {
  .rs-menu .rs-topic-filter-select {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ---------- A-level filter controls keep their own sizing ----------
   Scoped to pages that have the A-level selector, so GCSE pages are untouched. */

body:has(.alevel-selector-container) .rs-selector-toolbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  margin: 0 auto 0.8rem;
}

body:has(.alevel-selector-container) .rs-selector-toolbar .rs-status-key .rs-badge-key {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  width: 320px;
  max-width: calc(100vw - 2rem);
  padding: 0.45rem;
  border: 1px solid var(--rs-menu-line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 25, 67, 0.12);
}

@media (max-width: 767.98px) {
  body:has(.alevel-selector-container) .rs-selector-toolbar {
    display: block;
    margin-bottom: 0.65rem;
  }
}

/* ---------- Topic menu: main-page layout (GCSE and A-level) ----------
   Moved here from the "GCSE chem menu" and "A-level Chem Menu" components (14 Nov 2026).
   Only changes the menu on the main GCSE and A-level pages (rs-gcse-menu.js adds .rs-menu--index there).
   The single-topic menu on lesson pages is unchanged. */

.rs-menu.rs-menu--index .topic {
  padding: 0;
  border: 1px solid #e0e3e8;
  border-top: 4px solid var(--rs-chem, #d33c16);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 36, 47, 0.06);
}

.rs-menu.rs-menu--index .topic.rs-topic--empty {
  border-top-color: #cfd3dc;
  box-shadow: none;
  background: #fbfbfc;
}

.rs-menu.rs-menu--index .topic-header, .rs-menu.rs-menu--index .topic-header:has(.topic-title a), .rs-menu.rs-menu--index .topic-header:has(.topic-title a):hover {
  min-height: 0;
  padding: 14px 16px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rs-menu.rs-menu--index .topic-header:has(.topic-title a):hover .topic-title {
  color: var(--rs-chem-deep, #a42d12);
}

.rs-menu.rs-menu--index .topic-title {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
}

.rs-menu.rs-menu--index .btn-quiz:not(.disabled) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--rs-navy, #394362);
  border-radius: 8px;
  color: #ffffff;
  background: var(--rs-navy, #394362);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(57, 67, 98, 0.2);
}

.rs-menu.rs-menu--index .btn-quiz:not(.disabled)::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--rs-navy, #394362);
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.rs-menu.rs-menu--index .btn-quiz:not(.disabled):hover, .rs-menu.rs-menu--index .btn-quiz:not(.disabled):focus-visible {
  border-color: var(--rs-ink, #25242f);
  color: #ffffff;
  background: var(--rs-ink, #25242f);
}

.rs-menu--index .rs-topic-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 0 16px;
}

.rs-menu--index .rs-topic-progress__track {
  flex: 0 0 110px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef2;
}

.rs-menu--index .rs-topic-progress__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--rs-chem, #d33c16);
}

.rs-menu--index .rs-topic-progress__text {
  color: #696e7f;
  font-size: 0.8rem;
  font-weight: 700;
}

.rs-menu--index .rs-topic-progress__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.rs-menu--index .rs-topic--empty .rs-topic-progress__track, .rs-menu--index .rs-topic--empty .rs-topic-progress__text, .rs-menu--index .rs-topic--complete .rs-topic-progress__track, .rs-menu--index .rs-topic--complete .rs-topic-progress__text {
  display: none;
}

.rs-menu--index .rs-topic-progress:not(:has(.rs-topic-progress__tags > *)) {
  min-height: 0;
}

.rs-menu--index .rs-topic--complete .rs-topic-progress:not(:has(.rs-topic-progress__tags > *)) {
  display: none;
}

.rs-badge--community {
  color: #ffffff;
  background: var(--rs-navy, #394362);
}

.rs-menu.rs-menu--index .topic-links {
  gap: 6px;
  align-items: center;
  padding: 10px 16px 16px;
}

.rs-menu.rs-menu--index .topic-links > li:has( > a[href]:not(.disabled)) {
  display: flex;
  flex: 0 0 calc(50% - 3px);
  min-width: 0;
  align-self: stretch;
}

@media (max-width: 575.98px) {
  .rs-menu.rs-menu--index .topic-links > li:has( > a[href]:not(.disabled)) {
    flex-basis: 100%;
  }
}

.rs-menu.rs-menu--index .topic-links > li > a[href]:not(.disabled) {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #e3e6ec;
  border-radius: 9px;
  color: #25242f;
  background: #f7f8fa;
  font-size: 0.93rem;
  font-weight: 700;
}

.rs-menu.rs-menu--index .topic-links > li > a[href]:not(.disabled):hover, .rs-menu.rs-menu--index .topic-links > li > a[href]:not(.disabled):focus-visible {
  border-color: var(--rs-chem-line, #f2bcb0);
  color: #25242f;
  background: var(--rs-chem-soft, #fff0ec);
}

.rs-menu.rs-menu--index .topic-links > li > a .rs-auto-badge-wrap {
  margin-left: auto;
}

.rs-menu.rs-menu--index .topic-links > li:has( > .chip.disabled) {
  display: flex;
  order: 2;
}

.rs-menu.rs-menu--index .topic-links > li > .chip.disabled {
  min-height: 0;
  padding: 3px 9px;
  border: 1px dashed #d3d7df;
  border-radius: 999px;
  color: #8a909c;
  background: transparent;
  font-size: 0.78rem;
  opacity: 1;
}

.rs-menu.rs-menu--index .topic:has(.btn-quiz.disabled) .topic-links::after {
  content: "Chapter quiz";
  order: 3;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px dashed #d3d7df;
  border-radius: 999px;
  color: #8a909c;
  font-size: 0.78rem;
  line-height: 1.25;
}

.rs-menu.rs-menu--index .topic-links:has( > li:not(.rs-hidden):not(.rs-int-filter-hidden):not(.rs-paper-filter-hidden) > .chip.disabled)::before, .rs-menu.rs-menu--index .topic:has(.btn-quiz.disabled) .topic-links::before {
  content: "Coming later";
  order: 1;
  flex: 0 0 100%;
  margin-top: 4px;
  color: #8a909c;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.rs-menu.rs-menu--index .rs-topic--empty .topic-links::before {
  display: none !important;
}

.rs-menu.rs-menu--index .rs-topic--empty .topic-links {
  padding-top: 8px;
}

/* ---------- Menu: "Order by" (main GCSE page only; built by rs-gcse-menu.js) ----------
   The button padding rule is limited to pages with the topic menu (.rs-masonryjs),
   as it was when it sat in the "GCSE chem menu" component. */

body:not(:has(.alevel-selector-container)) .course-selector-container #cs-order-wrapper {
  flex: 22 1 0;
}

body:not(:has(.alevel-selector-container)):has(.rs-masonryjs) .course-selector-container .rs-custom-select-button {
  padding-left: 12px;
  padding-right: 30px;
}

@container gcse-selector (max-width: 940px) {
  body:not(:has(.alevel-selector-container)) .course-selector-container #cs-order-wrapper {
    flex: 1 0 100%;
  }
}

.rs-menu--index .rs-order-topic .topic-title {
  cursor: default;
}

.rs-menu.rs-menu--index .rs-order-topic .topic-header:hover .topic-title {
  color: inherit;
}

.rs-order-anchor {
  display: none !important;
}

.rs-badge.rs-badge--also {
  color: #4a5163;
  background: #eceef2;
}

.rs-menu.rs-menu--index .topic-links > li > .chip.disabled .rs-badge--also {
  margin-left: 5px;
  padding: 0 5px;
  font-size: 0.62rem;
}

/* ---------- Topic menu: packed rows and the pill slot (main GCSE page; v1.1, 17 Nov 2026) ----------
   rs-gcse-menu.js (RSMenuPack) adds .rs-menu--packed to the menu, sets --rs-pill-slot (the widest pill) and
   gives each shown, published <li> its flex-basis. Without the script the menu stays two links per row.
   Not-ready chips (.chip.disabled), "Coming later" and the disabled "Chapter quiz" chip are not touched. */

/* Every chip: name on the left (wraps), pills in one slot on the right: same width everywhere, stacked,
   vertically centred. Chips without pills keep their name in the same place. */

.rs-menu.rs-menu--packed .topic-links > li > a[href]:not(.disabled) {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
}

.rs-menu.rs-menu--packed .rs-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: normal;
  hyphens: manual;
}

.rs-menu.rs-menu--packed .topic-links > li > a .rs-auto-badge-wrap {
  display: flex;
  flex: 0 0 var(--rs-pill-slot, 66px);
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  width: var(--rs-pill-slot, 66px);
  margin-left: auto;
}

.rs-menu.rs-menu--packed .topic-links > li > a .rs-auto-badge-wrap > .rs-badge {
  width: 100%;
}

/* The theme gives every link "transition: all .2s": sizes must not animate here, or the measuring passes read
   half-way values (and the menu would keep re-packing). Colour transitions on hover stay. */

.rs-menu.rs-menu--packed .topic-links > li, .rs-menu.rs-menu--packed .topic-links > li > a, .rs-menu.rs-menu--packed .rs-chip-name, .rs-menu.rs-menu--packed .topic-links .rs-auto-badge-wrap, .rs-menu.rs-menu--packed .topic-links .rs-badge {
  transition-property: color, background-color, border-color, box-shadow !important;
}

/* Rows: the script's flex-basis is exact; grow fills the last fraction of a pixel. */

.rs-menu.rs-menu--packed .topic-links > li.rs-packed {
  flex-grow: 1;
  flex-shrink: 0;
  max-width: 100%;
}

/* Phones: never one link per row (the live rule below 576px made it 100%); slightly tighter chips. */

@media (max-width: 575.98px) {
  .rs-menu.rs-menu--packed .topic-links > li:has( > a[href]:not(.disabled)) {
    flex-basis: calc(50% - 3px);
  }
}

@media (max-width: 575.98px) {
  .rs-menu.rs-menu--packed .topic-links > li > a[href]:not(.disabled) {
    gap: 5px;
    padding: 7px 8px;
    font-size: 0.84rem;
    line-height: 1.22;
  }
}

@media (max-width: 575.98px) {
  .rs-menu.rs-menu--packed .topic-links > li > a .rs-badge {
    padding-right: 0.16rem;
    padding-left: 0.16rem;
    font-size: 0.5rem;
    letter-spacing: 0;
  }
}

/* Compact chip: only where a long word would not fit otherwise (narrow phones). Same layout, smaller. */

.rs-menu.rs-menu--packed .topic-links > li.rs-tight > a[href]:not(.disabled), .rs-menu.rs-menu--packed .topic-links.rs-measure-tight > li.rs-pub > a {
  gap: 4px !important;
  padding: 5px 6px !important;
  font-size: 0.74rem !important;
}

.rs-menu.rs-menu--packed .topic-links > li.rs-tight > a .rs-auto-badge-wrap, .rs-menu.rs-menu--packed .topic-links.rs-measure-tight > li.rs-pub > a .rs-auto-badge-wrap {
  flex-basis: calc(var(--rs-pill-slot, 66px) * 0.84);
  width: calc(var(--rs-pill-slot, 66px) * 0.84);
}

.rs-menu.rs-menu--packed .topic-links > li.rs-tight > a .rs-badge, .rs-menu.rs-menu--packed .topic-links.rs-measure-tight > li.rs-pub > a .rs-badge {
  padding: 0.14rem 0.12rem;
  font-size: 0.42rem;
  letter-spacing: 0;
}

/* Measuring passes (one frame each, never painted). */

.rs-menu.rs-menu--packed .topic-links.rs-measure > li.rs-pub {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
}

.rs-menu.rs-menu--packed .topic-links.rs-measure > li.rs-pub .rs-chip-name {
  flex: 0 0 auto;
  white-space: nowrap;
}

.rs-menu.rs-menu--packed .topic-links.rs-measure.rs-measure-min > li.rs-pub .rs-chip-name {
  width: min-content;
  white-space: normal;
}

.rs-menu.rs-measure-pills .topic-links > li > a .rs-auto-badge-wrap > .rs-badge {
  width: auto;
  align-self: flex-start;
}

/* One box per row below 1200px (the cards are too narrow for chips and the pill slot in two columns there). */

@media (max-width: 1199.98px) {
  .rs-menu.rs-masonryjs.rs-menu--packed .topic {
    position: static !important;
    width: auto !important;
    margin-bottom: 16px;
    transform: none !important;
  }
}

/* Phones: pills become small icons (full name in the title and aria-label, set by the script). The status key on
   the GCSE page shows the same icons. Practical = flask, Calc = calculator, Community pick = star, Coming next =
   arrow; New, Updated, Refresh, Building and "+N topics" = a dot in the pill's colour. */

@media (max-width: 575.98px) {
  .rs-menu.rs-menu--packed .topic-links > li.rs-tight > a .rs-auto-badge-wrap {
    flex-basis: var(--rs-pill-slot, 14px);
    width: var(--rs-pill-slot, 14px);
  }
}

@media (max-width: 575.98px) {
  body:not(:has(.alevel-selector-container)) .rs-badge-key-item {
    grid-template-columns: 22px minmax(0, 1fr);
  }
}

/* Calculator pill: same shape as Practical; teal (6.0:1); calculator icon in currentColor. */

.rs-badge--calc {
  gap: 0.22rem;
  color: #0b6375;
  background: #e2f3f6;
}

.rs-badge--calc::before {
  content: "";
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.7rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath fill-rule='evenodd' d='M3 0h8a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3Zm0 1.8A1.2 1.2 0 0 0 1.8 3v10A1.2 1.2 0 0 0 3 14.2h8a1.2 1.2 0 0 0 1.2-1.2V3A1.2 1.2 0 0 0 11 1.8Zm.6 1.4h6.8v3H3.6ZM3.6 8h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Zm-5 3h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath fill-rule='evenodd' d='M3 0h8a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3Zm0 1.8A1.2 1.2 0 0 0 1.8 3v10A1.2 1.2 0 0 0 3 14.2h8a1.2 1.2 0 0 0 1.2-1.2V3A1.2 1.2 0 0 0 11 1.8Zm.6 1.4h6.8v3H3.6ZM3.6 8h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Zm-5 3h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Shared with the GCSE page: generated by tools/gen_shared_css.py from rs-home.css (md5 0e09f35adce04a46e8e806889be9dfb5), scoped to
   .rs-topicbox / .rs-topicnav on content pages. Do not edit by hand: change rs-home.css and run the script again. */

.rs-topicbox, .rs-topicnav {
  --hm-ink: var(--rs-ink, #25242f);
  --hm-navy: var(--rs-navy, #394362);
  --hm-chem: var(--rs-chem, #d33c16);
  --hm-chem-deep: #a42d12;
  --hm-chem-soft: #fff0ec;
  --hm-chem-tint: #ffd6c8;
  --hm-chem-line: #f2bcb0;
  --hm-muted: #5d6273;
  --hm-line: #e0e3e8;
  --hm-soft: #f5f6fb;
  --hm-skill: #eef0f7;
  --hm-skill-line: #c9cee0;
  --hm-r: 12px;
  --hm-bg: #f6f5f3;
  --hm-navy-soft: #eef0f7;
  --hm-navy-line: #c9cee0;
}

.rs-topicbox.hm-tint-start, .rs-topicnav .hm-tint-start {
  --hm-t: #fff0ec;
  --hm-t-line: #f2bcb0;
  --hm-t-acc: #d33c16;
  --hm-t-ink: #a42d12;
}

.rs-topicbox.hm-tint-0, .rs-topicnav .hm-tint-0 {
  --hm-t: #faeaf0;
  --hm-t-line: #eac2cf;
  --hm-t-acc: #ca547b;
  --hm-t-ink: #68122f;
}

.rs-topicbox.hm-tint-1, .rs-topicnav .hm-tint-1 {
  --hm-t: #eafaf5;
  --hm-t-line: #c2eadd;
  --hm-t-acc: #54caa3;
  --hm-t-ink: #12684b;
}

.rs-topicbox.hm-tint-2, .rs-topicnav .hm-tint-2 {
  --hm-t: #f4eafa;
  --hm-t-line: #dac2ea;
  --hm-t-acc: #9954ca;
  --hm-t-ink: #441268;
}

.rs-topicbox.hm-tint-3, .rs-topicnav .hm-tint-3 {
  --hm-t: #f2faea;
  --hm-t-line: #d6eac2;
  --hm-t-acc: #8fca54;
  --hm-t-ink: #3d6812;
}

.rs-topicbox.hm-tint-4, .rs-topicnav .hm-tint-4 {
  --hm-t: #eaeefa;
  --hm-t-line: #c2ccea;
  --hm-t-acc: #5471ca;
  --hm-t-ink: #122868;
}

.rs-topicbox.hm-tint-5, .rs-topicnav .hm-tint-5 {
  --hm-t: #faf6ea;
  --hm-t-line: #eae0c2;
  --hm-t-acc: #caac54;
  --hm-t-ink: #685312;
}

.rs-topicbox.hm-tint-6, .rs-topicnav .hm-tint-6 {
  --hm-t: #eaf9fa;
  --hm-t-line: #c2e7ea;
  --hm-t-acc: #54c0ca;
  --hm-t-ink: #126168;
}

.rs-topicbox.hm-tint-7, .rs-topicnav .hm-tint-7 {
  --hm-t: #faeafa;
  --hm-t-line: #eac2ea;
  --hm-t-acc: #ca54ca;
  --hm-t-ink: #681268;
}

.rs-topicbox.hm-tint-8, .rs-topicnav .hm-tint-8 {
  --hm-t: #eafaed;
  --hm-t-line: #c2eac9;
  --hm-t-acc: #54ca67;
  --hm-t-ink: #126821;
}

.rs-topicbox.hm-tint-9, .rs-topicnav .hm-tint-9 {
  --hm-t: #edeafa;
  --hm-t-line: #c9c2ea;
  --hm-t-acc: #6754ca;
  --hm-t-ink: #211268;
}

.rs-topicbox.hm-tint-10, .rs-topicnav .hm-tint-10 {
  --hm-t: #fafaea;
  --hm-t-line: #eaeac2;
  --hm-t-acc: #caca54;
  --hm-t-ink: #686812;
}

.rs-topicbox.hm-tint-11, .rs-topicnav .hm-tint-11 {
  --hm-t: #eaf4fa;
  --hm-t-line: #c2daea;
  --hm-t-acc: #5499ca;
  --hm-t-ink: #124468;
}

:is(.rs-topicbox, .rs-topicnav) .hm-num {
  font-family: "Lexend", "ABeeZee", sans-serif;
  font-variant-numeric: tabular-nums;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route:focus-visible, :is(.rs-topicbox, .rs-topicnav) .hm-quiz:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--new {
  background: #fff1c2;
  color: #6b4800;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--upd {
  background: #e3efff;
  color: #0b4a8f;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--prac {
  background: #e2f4e5;
  color: #1a6a2a;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--calc {
  background: #e2f3f6;
  color: #0b6375;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--calc::before {
  content: "";
  display: inline-block;
  width: 0.62rem;
  height: 0.7rem;
  margin-right: 4px;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath fill-rule='evenodd' d='M3 0h8a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3Zm0 1.8A1.2 1.2 0 0 0 1.8 3v10A1.2 1.2 0 0 0 3 14.2h8a1.2 1.2 0 0 0 1.2-1.2V3A1.2 1.2 0 0 0 11 1.8Zm.6 1.4h6.8v3H3.6ZM3.6 8h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Zm-5 3h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath fill-rule='evenodd' d='M3 0h8a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3Zm0 1.8A1.2 1.2 0 0 0 1.8 3v10A1.2 1.2 0 0 0 3 14.2h8a1.2 1.2 0 0 0 1.2-1.2V3A1.2 1.2 0 0 0 11 1.8Zm.6 1.4h6.8v3H3.6ZM3.6 8h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Zm-5 3h1.8v1.8H3.6Zm2.5 0h1.8v1.8H6.1Zm2.5 0h1.8v1.8H8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--refresh {
  background: #f0e8fb;
  color: #5a2d91;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--comm {
  background: var(--hm-navy);
  color: #fff;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--next {
  background: #fde6df;
  color: #9a2c10;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--build {
  background: var(--hm-chem-deep);
  color: #fff;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--start {
  background: #c2381a;
  color: #fff;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pill--off {
  background: #eceef2;
  color: #4e5365;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route {
  --r-acc: var(--hm-navy);
  --r-soft: var(--hm-navy-soft);
  --r-line: var(--hm-navy-line);
  --r-ink: var(--hm-navy);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px;
  border: 1.5px solid #cfd3dc;
  border-radius: 10px;
  background: #fff;
  color: var(--hm-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background-color .12s, border-color .12s;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--r-soft);
  color: var(--r-acc);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-sub {
  color: var(--hm-muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route:active {
  transform: translateY(1px);
}

:is(.rs-topicbox, .rs-topicnav) .hm-route:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route {
  border-color: var(--r-line);
  background: var(--r-soft);
  color: var(--r-ink);
  box-shadow: 0 1px 0 var(--r-line);
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-icon {
  background: #fff;
}

:is(.rs-topicbox, .rs-topicnav) .hm-route-sub {
  color: var(--r-ink);
}

:is(.rs-topicbox, .rs-topicnav) .hm-route:hover {
  border-color: var(--r-acc);
  filter: brightness(0.97);
}

@media (prefers-reduced-motion: reduce) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route:hover, :is(.rs-topicbox, .rs-topicnav) .hm-route:active {
    transform: none !important;
  }
}

:is(.rs-topicbox, .rs-topicnav) .hm-route:focus-visible, :is(.rs-topicbox, .rs-topicnav) .hm-pg:focus-visible, :is(.rs-topicbox, .rs-topicnav) .hm-sheet:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-tile {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 2px solid var(--hm-t-line, var(--hm-line));
  border-radius: 10px;
  background: var(--hm-t, var(--hm-soft));
  font-size: 1.7rem;
  line-height: 1;
}

:is(.rs-topicbox, .rs-topicnav) .hm-tile-n {
  position: absolute;
  top: 3px;
  left: 5px;
  color: var(--hm-t-ink, var(--hm-navy));
  font-family: "Lexend", sans-serif;
  font-size: 0.66rem;
  font-weight: 400;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz, :is(.rs-topicbox, .rs-topicnav) .hm-quiz-later {
  box-sizing: border-box;
  height: 36px;
  white-space: nowrap;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1.5px solid #4a5577;
  border-radius: 8px;
  background: #4a5577;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 0 rgb(23 25 67 / 18%);
  transition: background-color .12s, transform .06s;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz-ico {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  color: #4a5577;
  font-size: 0.68rem;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz:hover {
  border-color: var(--hm-navy);
  background: var(--hm-navy);
  color: #fff;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz:hover .hm-quiz-ico {
  color: var(--hm-navy);
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz:active {
  transform: translateY(1px);
  box-shadow: none;
  background: #252c45;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz-tag {
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff;
  color: var(--hm-navy);
  font-size: 0.62rem;
  line-height: 1.1;
}

:is(.rs-topicbox, .rs-topicnav) .hm-quiz-later {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1.5px dashed #c4c8d2;
  border-radius: 8px;
  color: #6f7484;
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
  :is(.rs-topicbox, .rs-topicnav) .hm-quiz {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.rs-topicbox, .rs-topicnav) .hm-quiz:active {
    transform: none;
  }
}

:is(.rs-topicbox, .rs-topicnav) .hm-sheet {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid #767c90;
  border-radius: 999px;
  background: #fff;
  color: var(--hm-ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

:is(.rs-topicbox, .rs-topicnav) .hm-sheet:hover {
  border-color: var(--hm-navy);
  background: var(--hm-soft);
  color: var(--hm-ink);
}

:is(.rs-topicbox, .rs-topicnav) .hm-list {
  display: grid;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@container (min-width: 600px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows), auto);
    grid-auto-flow: column;
  }
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto 0.8rem;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  height: 100%;
  padding: 8px 12px;
  border: 1.5px solid #767c90;
  border-radius: 10px;
  background: #fff;
  color: var(--hm-ink);
  text-decoration: none;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg:hover {
  border-color: var(--hm-t-acc, var(--hm-navy));
  background: var(--hm-t, var(--hm-navy-soft));
  color: var(--hm-ink);
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg:hover .hm-pg-name {
  text-decoration-color: currentColor;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg-n {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--hm-navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 400;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg-name {
  font-weight: 700;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-color: rgb(37 36 47 / 30%);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg-topic {
  display: block;
  margin-top: 2px;
  color: var(--hm-muted);
  font-size: 0.82rem;
  font-weight: 400;
  text-decoration: none;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-pg-go {
  color: var(--hm-t-ink, var(--hm-navy));
  font-size: 1.4rem;
  line-height: 1;
}

:is(.rs-topicbox, .rs-topicnav) .hm-later {
  margin-top: 10px;
}

:is(.rs-topicbox, .rs-topicnav) .hm-later.rs-menu .topic {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: none !important;
}

:is(.rs-topicbox, .rs-topicnav) .hm-later.rs-menu .topic::before {
  display: none !important;
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route {
    min-height: 48px;
    max-height: 64px;
    padding: 5px 8px;
    gap: 7px;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route-name {
    font-size: 0.92rem;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route-sub {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-tile {
    width: 50px;
    height: 50px;
    font-size: 1.45rem;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-pg {
    grid-template-columns: 1.7rem minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-pg-n {
    width: 1.7rem;
    height: 1.7rem;
  }
}

@media (max-width: 575.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-pg-go {
    display: none;
  }
}

@media (max-width: 389.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route {
    gap: 6px;
    padding: 5px 7px;
  }
}

@media (max-width: 389.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 389.98px) {
  :is(.rs-topicbox, .rs-topicnav) .hm-route-name {
    font-size: 0.88rem;
  }
}

/* ---------- Topic menu on content pages (v1.4, 17 Nov 2026) ----------
   v1.4: Next in this topic + Next in your course (or one Next), the Order toggle in the filter row.
   rs-gcse-menu.js (RSTopicMenu) adds .rs-menu--topic to the menu on a content page: the menu stays in the page as the
   data and is hidden, and the page's own topic is drawn after it as .rs-topicbox in the GCSE page's card look, with
   .rs-topicnav (Back to GCSE menu, Next) as its quick-route buttons. The shared look (tints, tile, quiz button, page
   rows, pills, routes) is rs-topic-home-shared.css, generated from rs-home.css. Without the script the full menu shows. */

.rs-menu.rs-menu--topic {
  display: none !important;
}

.rs-topicbox {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--hm-line);
  border-top: 4px solid var(--hm-t-acc, var(--hm-navy));
  border-radius: var(--hm-r);
  background: #fff;
  color: var(--hm-ink);
  font-size: 1rem;
  container-type: inline-size;
}

/* an exam board spec topic (exam board order): neutral navy, as the GCSE page's plain quick routes */

.rs-topicbox.rs-topicbox--spec {
  --hm-t: #eef0f7;
  --hm-t-line: #c9cee0;
  --hm-t-acc: #394362;
  --hm-t-ink: #394362;
}

.rs-topicbox[hidden] {
  display: none;
}

.rs-topicbox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.rs-topicbox__title {
  flex: 1 1 10rem;
  min-width: 0;
}

.rs-topicbox__title h3 {
  margin: 0;
  color: var(--hm-ink);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.25;
}

.rs-topicbox__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 3px 0 0;
  color: var(--hm-t-ink, var(--hm-muted));
  font-size: 0.85rem;
}

.rs-topicbox__flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rs-topicbox__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rs-topicbox .hm-pg {
  text-decoration: none;
}

.rs-topicbox .hm-pg-name {
  min-width: 0;
  overflow-wrap: normal;
}

.rs-topicbox__id {
  display: flex;
  flex: 1 1 14rem;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Board / Course / Tier: rs-gcse-menu.js's mini course filters (they set the page's own course selector), in a row
   under the head, in the box's look */

.rs-topicbox__filters:empty {
  display: none;
}

.rs-topicbox .rs-topic-header-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 8px 10px;
  border: 1px solid var(--hm-t-line, var(--hm-line));
  border-radius: 10px;
  background: var(--hm-t, var(--hm-soft));
}

.rs-topicbox .rs-topic-header-filter {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rs-topicbox .rs-topic-header-filter label {
  color: var(--hm-t-ink, var(--hm-navy));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.rs-topicbox .rs-topic-header-filter select {
  box-sizing: border-box;
  max-width: 100%;
  height: 36px;
  padding: 4px 8px;
  border: 1.5px solid #767c90;
  border-radius: 8px;
  background-color: #fff;
  color: var(--hm-ink);
  font: inherit;
  font-size: 0.86rem;
}

.rs-topicbox .rs-topic-header-filter select:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

.rs-topicbox .rs-mini-tier-pill {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border: 1.5px dashed #c4c8d2;
  border-radius: 8px;
  background: #fff;
  color: #4e5365;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topic-header-filter {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topic-header-filter select {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topic-header-filter:first-child {
    flex-basis: 100%;
  }
}

/* Back to GCSE menu and Next, above the box: the GCSE page's quick-route buttons (style B); Next in the next page's
   topic tint */

.rs-topicnav {
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 12px;
  margin: 28px 0 20px;
}

.rs-topicnav__next-slot {
  display: contents;
}

/* v1.4: the next buttons (Next in this topic, Next in your course, or one Next) sit together on the right; they wrap
   under Back when the row is too narrow, and stack full width on phones */

.rs-topicnav__nexts {
  display: flex;
  flex: 1 1 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  margin-left: auto;
}

.rs-topicnav .rs-topicnav__back {
  align-self: flex-start;
}

.rs-topicnav__nexts:empty {
  display: none;
}

.rs-topicnav .rs-topicnav__nexts .hm-route.rs-topicnav__next {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 22rem;
  margin-left: 0;
}

/* Next in your course: a neutral slate, the same everywhere (Next in this topic and the single Next use the topic's tint) */

.rs-topicnav .hm-route.rs-topicnav__next.rs-topicnav__course {
  --r-acc: #3f4f66;
  --r-soft: #eef1f5;
  --r-line: #c3cad6;
  --r-ink: #2f3b4f;
}

/* one row (Back left, the next buttons right) while the row is at least 620px wide; narrower: Back on its own, the
   next buttons side by side under it (the row's own width, so it does not depend on the page's columns) */

.rs-topicnav {
  container: rs-topicnav / inline-size;
}

@container rs-topicnav (max-width: 619.98px) {
  .rs-topicnav__nexts {
    flex: 1 1 100%;
  }
}

@container rs-topicnav (max-width: 619.98px) {
  .rs-topicnav .rs-topicnav__nexts .hm-route.rs-topicnav__next {
    flex: 1 1 0;
    max-width: none;
  }
}

@container rs-topicnav (max-width: 619.98px) {
  .rs-topicnav .rs-topicnav__nexts > .hm-route.rs-topicnav__next:only-child {
    flex: 0 1 auto;
    max-width: 100%;
  }
}

.rs-topicnav .rs-topicnav__nexts .rs-topicnav__end {
  margin-left: 0;
}

.rs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rs-topicnav .hm-route {
  flex: 0 1 auto;
  min-width: 0;
  max-height: none;
  text-decoration: none;
}

.rs-topicnav .hm-route.rs-topicnav__next {
  --r-acc: var(--hm-t-acc, var(--hm-chem));
  --r-soft: var(--hm-t, var(--hm-chem-soft));
  --r-line: var(--hm-t-line, var(--hm-chem-line));
  --r-ink: var(--hm-t-ink, var(--hm-chem-deep));
  margin-left: auto;
}

.rs-topicnav .hm-route .hm-route-sub {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.rs-topicnav .hm-route .hm-route-name {
  overflow-wrap: normal;
}

.rs-topicnav__end {
  align-self: center;
  margin-left: auto;
  color: #5d6273;
  font-size: 0.88rem;
}

.rs-topicnav__pick {
  flex: 1 1 100%;
  margin: 0;
  color: #5d6273;
  font-size: 0.85rem;
  text-align: right;
}

.rs-topicnav__pick[hidden] {
  display: none;
}

.rs-topicnav__pick-btn {
  padding: 0;
  border: 0;
  color: var(--rs-navy, #394362);
  background: none;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.rs-topicnav__pick-btn:hover {
  color: var(--rs-chem-deep, #a42d12);
}

.rs-topicnav__pick-btn:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .rs-topicnav .hm-route, .rs-topicnav .hm-route.rs-topicnav__next {
    flex: 1 1 100%;
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .rs-topicnav__nexts {
    flex: 1 1 100%;
    flex-direction: column;
    gap: 8px;
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .rs-topicnav .rs-topicnav__nexts .hm-route.rs-topicnav__next {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 575.98px) {
  .rs-topicnav__pick, .rs-topicnav__end {
    flex: 1 1 100%;
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox {
    padding: 12px;
  }
}

/* where "Pick your course" takes the student: a brief outline round the course selector */

.course-selector-container.rs-course-pick-flash {
  border-radius: 10px;
  outline: 3px solid var(--rs-chem-line, #f2bcb0);
  outline-offset: 4px;
}

/* Pills never clip: a chip whose name or pills would not fit (rs-gcse-menu.js adds .rs-stack) sets its pills under the
   name, in a row, instead of in the slot on the right. */

.rs-menu.rs-menu--packed .topic-links > li.rs-stack > a[href]:not(.disabled) {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.rs-menu.rs-menu--packed .topic-links > li.rs-stack > a .rs-chip-name {
  flex: 0 0 auto;
  width: 100%;
}

.rs-menu.rs-menu--packed .topic-links > li.rs-stack > a .rs-auto-badge-wrap {
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  width: auto;
  max-width: 100%;
  margin-left: 0;
}

.rs-menu.rs-menu--packed .topic-links > li.rs-stack > a .rs-auto-badge-wrap > .rs-badge {
  width: auto;
}

/* Course-aware pills (data-calculator="<courses>"): a pill that is not on the chosen course is hidden */

.rs-badge[hidden], .rs-auto-badge-wrap:not(:has( > .rs-badge:not([hidden]))) {
  display: none !important;
}

/* v1.4: Order (Suggested | Exam board) at the end of the filter row, in the GCSE page's segmented look */

.rs-topicbox .rs-topicbox__order {
  margin-left: auto;
}

.rs-topicbox .rs-topicbox__order-label {
  color: var(--hm-t-ink, var(--hm-navy));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.rs-topicbox .rs-topicbox__seg {
  display: inline-flex;
  overflow: hidden;
  border: 1.5px solid #767c90;
  border-radius: 8px;
  background: #fff;
}

.rs-topicbox .rs-topicbox__seg button {
  flex: 1 1 auto;
  height: 33px;
  padding: 4px 12px;
  border: 0;
  border-right: 1px solid #767c90;
  background: #fff;
  color: var(--hm-ink);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topicbox__seg button {
    min-height: 40px;
  }
}

.rs-topicbox .rs-topicbox__seg button:last-child {
  border-right: 0;
}

.rs-topicbox .rs-topicbox__seg button[aria-pressed="true"] {
  background: var(--hm-navy, #394362);
  color: #fff;
}

.rs-topicbox .rs-topicbox__seg button:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: -3px;
}

.rs-topicbox .rs-topicbox__order-hint {
  flex: 1 1 100%;
  margin: 0;
  color: var(--hm-ink);
  font-size: 0.85rem;
  text-align: right;
}

.rs-topicbox .rs-topicbox__order-hint[hidden] {
  display: none;
}

.rs-topicbox .rs-topicbox__keep {
  padding: 0;
  border: 0;
  background: none;
  color: #185abc;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.rs-topicbox .rs-topicbox__keep:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topic-header-filter.rs-topicbox__order {
    flex: 1 1 100%;
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topicbox__seg {
    display: flex;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-topicbox__order-hint {
    text-align: left;
  }
}

/* v1.4: a spec topic drawn from several topics: "Revision sheet ▾" and "Chapter quiz ▾" open a small list of each
   topic's sheet or quiz (tile in the topic's tint, name, pages here, New/Updated) */

.rs-topicbox .rs-dd {
  position: relative;
  display: inline-flex;
}

.rs-topicbox .rs-dd-btn {
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.rs-topicbox .rs-dd-caret {
  margin-left: 6px;
  font-size: 0.8em;
}

.rs-topicbox .rs-dd-btn[aria-expanded="true"] .rs-dd-caret {
  display: inline-block;
  transform: rotate(180deg);
}

.rs-topicbox .rs-dd-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  min-width: 15rem;
  max-width: min(22rem, calc(100vw - 24px));
  margin: 0;
  padding: 6px;
  border: 1px solid #c9cee0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(23 25 67 / 18%);
  list-style: none;
}

.rs-topicbox .rs-dd-menu[hidden] {
  display: none;
}

.rs-topicbox .rs-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--hm-ink, #25242f);
  text-decoration: none;
}

.rs-topicbox .rs-dd-item:hover {
  background: var(--hm-t, #eef0f7);
}

.rs-topicbox .rs-dd-item:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: -1px;
}

.rs-topicbox .rs-dd-tile {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--hm-t-line, #c9cee0);
  border-radius: 8px;
  background: var(--hm-t, #eef0f7);
  font-size: 1rem;
}

.rs-topicbox .rs-dd-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.rs-topicbox .rs-dd-name {
  font-weight: 700;
  line-height: 1.2;
}

.rs-topicbox .rs-dd-sub {
  color: var(--hm-muted, #5d6273);
  font-size: 0.8rem;
  line-height: 1.2;
}

.rs-topicbox .rs-dd-tag {
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .rs-topicbox .rs-dd-btn[aria-expanded="true"] .rs-dd-caret {
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-dd {
    display: contents;
  }
}

@media (max-width: 575.98px) {
  .rs-topicbox .rs-dd-menu {
    position: static;
    order: 9;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
    box-shadow: none;
  }
}

/* the topic tints on the menu items (the same values as the box's own tints, rs-topic-home-shared.css) */

.rs-topicbox .rs-dd-item.hm-tint-start {
  --hm-t: #fff0ec;
  --hm-t-line: #f2bcb0;
  --hm-t-acc: #d33c16;
  --hm-t-ink: #a42d12;
}

.rs-topicbox .rs-dd-item.hm-tint-0 {
  --hm-t: #faeaf0;
  --hm-t-line: #eac2cf;
  --hm-t-acc: #ca547b;
  --hm-t-ink: #68122f;
}

.rs-topicbox .rs-dd-item.hm-tint-1 {
  --hm-t: #eafaf5;
  --hm-t-line: #c2eadd;
  --hm-t-acc: #54caa3;
  --hm-t-ink: #12684b;
}

.rs-topicbox .rs-dd-item.hm-tint-2 {
  --hm-t: #f4eafa;
  --hm-t-line: #dac2ea;
  --hm-t-acc: #9954ca;
  --hm-t-ink: #441268;
}

.rs-topicbox .rs-dd-item.hm-tint-3 {
  --hm-t: #f2faea;
  --hm-t-line: #d6eac2;
  --hm-t-acc: #8fca54;
  --hm-t-ink: #3d6812;
}

.rs-topicbox .rs-dd-item.hm-tint-4 {
  --hm-t: #eaeefa;
  --hm-t-line: #c2ccea;
  --hm-t-acc: #5471ca;
  --hm-t-ink: #122868;
}

.rs-topicbox .rs-dd-item.hm-tint-5 {
  --hm-t: #faf6ea;
  --hm-t-line: #eae0c2;
  --hm-t-acc: #caac54;
  --hm-t-ink: #685312;
}

.rs-topicbox .rs-dd-item.hm-tint-6 {
  --hm-t: #eaf9fa;
  --hm-t-line: #c2e7ea;
  --hm-t-acc: #54c0ca;
  --hm-t-ink: #126168;
}

.rs-topicbox .rs-dd-item.hm-tint-7 {
  --hm-t: #faeafa;
  --hm-t-line: #eac2ea;
  --hm-t-acc: #ca54ca;
  --hm-t-ink: #681268;
}

.rs-topicbox .rs-dd-item.hm-tint-8 {
  --hm-t: #eafaed;
  --hm-t-line: #c2eac9;
  --hm-t-acc: #54ca67;
  --hm-t-ink: #126821;
}

.rs-topicbox .rs-dd-item.hm-tint-9 {
  --hm-t: #edeafa;
  --hm-t-line: #c9c2ea;
  --hm-t-acc: #6754ca;
  --hm-t-ink: #211268;
}

.rs-topicbox .rs-dd-item.hm-tint-10 {
  --hm-t: #fafaea;
  --hm-t-line: #eaeac2;
  --hm-t-acc: #caca54;
  --hm-t-ink: #686812;
}

.rs-topicbox .rs-dd-item.hm-tint-11 {
  --hm-t: #eaf4fa;
  --hm-t-line: #c2daea;
  --hm-t-acc: #5499ca;
  --hm-t-ink: #124468;
}

/* phones: stacked full width (after the container rules above, so these win) */

@media (max-width: 575.98px) {
  .rs-topicnav .rs-topicnav__nexts .hm-route.rs-topicnav__next, .rs-topicnav .rs-topicnav__nexts > .hm-route.rs-topicnav__next:only-child {
    flex: 0 0 auto;
    max-width: none;
  }
}

/* ---------- v1.3 (17 Nov 2026): the course selector folded to one line ("Your course: … ✎ Change") ----------
   rs-course-filter.js adds .rs-cs-folded (one line) or .rs-cs-open (the line, then the full selector) to the
   container once a course has been picked. With neither class the selector is as before. */

.course-selector-container .rs-cs-sum {
  display: none;
}

.course-selector-container.rs-cs-has-sum .rs-cs-sum {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 36px;
  text-align: left;
}

/* folded: a fixed width (44rem, or the full width on small screens), centred, so late text never resizes it */

.course-selector-container.rs-cs-folded {
  flex: 0 1 auto !important;
  width: min(100%, 44rem) !important;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

/* before rs-course-filter.js has run (the early flag from the selector's own code): folded already, with the line's
   room kept. Not on the GCSE page, which folds its own course step. */

html.rs-cs-picked body:not(:has(#hmPage)) .course-selector-container:not(.rs-cs-has-sum) {
  flex: 0 1 auto !important;
  width: min(100%, 44rem) !important;
  margin-right: auto;
  margin-left: auto;
}

html.rs-cs-picked body:not(:has(#hmPage)) .course-selector-container:not(.rs-cs-has-sum) #cs-controls-row {
  display: none !important;
}

html.rs-cs-picked body:not(:has(#hmPage)) .course-selector-container:not(.rs-cs-has-sum)::before {
  content: "";
  display: block;
  height: 36px;
}

.course-selector-container.rs-cs-folded #cs-controls-row {
  display: none !important;
}

.course-selector-container.rs-cs-open .rs-cs-sum {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dfe3ea;
}

.course-selector-container .rs-cs-sum__text {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: #25242f;
  font-size: 0.95rem;
  line-height: 1.3;
}

.course-selector-container .rs-cs-sum__label {
  color: #4f5872;
}

.course-selector-container .rs-cs-sum__name {
  font-weight: 700;
}

.course-selector-container .rs-cs-sum__change {
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 12px;
  border: 1.5px solid #9aa3bb;
  border-radius: 8px;
  background: #fff;
  color: #185abc;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .course-selector-container .rs-cs-sum__change {
    min-height: 40px;
  }
}

.course-selector-container .rs-cs-sum__change:hover {
  border-color: #185abc;
  background: #eef3fc;
}

.course-selector-container .rs-cs-sum__change:focus-visible {
  outline: 3px solid #185abc;
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .course-selector-container.rs-cs-folded {
    width: 100% !important;
  }
}

@media (max-width: 575.98px) {
  html.rs-cs-picked body:not(:has(#hmPage)) .course-selector-container:not(.rs-cs-has-sum)::before {
    height: 40px;
  }
}

@media (max-width: 575.98px) {
  .course-selector-container .rs-cs-sum__text {
    flex: 0 1 auto;
  }
}

/* v1.4: what this page is the same for, on its own small line (kept from the start, so nothing moves) */

.course-selector-container .rs-cs-note {
  contain: inline-size;
  margin: 3px 0 0;
  color: #4f5872;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 575.98px) {
  .course-selector-container .rs-cs-note {
    text-align: left;
  }
}

/* v1.4.1 (Matthew, 17 Nov 21:02): no empty line. The note shows only when it has something to say; before the
   selector is ready, its line is kept only on a Higher or Foundation only page (not for International, untiered),
   so the box has its final height from the start. A tighter box: 6px above and below the line. */

.course-selector-container .rs-cs-note:empty {
  display: none;
}

html:not(.rs-cs-int) body:has(.rs-ht-page, .rs-ft-page) .course-selector-container:not(.rs-selector-ready) .rs-cs-note:empty {
  display: block;
  min-height: 1.04rem;
}

body:not(:has(.alevel-selector-container)) .course-selector-container.rs-cs-folded, body:not(:has(.alevel-selector-container)) .rs-selector-toolbar .course-selector-container.rs-cs-folded:not(.cs-expanded):not(.cs-hover-open), html.rs-cs-picked body:not(:has(#hmPage)) .course-selector-container:not(.rs-cs-has-sum) {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

