/* Existing Additional Maths question layout, V127. */

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      html,
      body {
        height: 100%;
      }

      html {
        scroll-behavior: smooth;
      }

      body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        font-family: Arial, Helvetica, sans-serif;
        background: #f5f7fb;
        color: #1f2937;
        line-height: 1.6;
      }

      main {
        flex: 1;
      }

      a {
        text-decoration: none;
        color: inherit;
      }

      .container {
        width: min(1100px, 92%);
        margin: 0 auto;
      }

      header {
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 1000;
      }

      .navbar {
        padding: 18px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
        position: relative;
      }

      .brand {
        text-decoration: none;
        color: #0f172a;
        font-family: "Brush Script MT", "Comic Sans MS", cursive;
        font-size: 2.2rem;
        font-weight: bold;
        white-space: nowrap;
      }

      .nav-links {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        align-items: center;
        flex-wrap: wrap;
      }

      .nav-links > a,
      .dropbtn {
        text-decoration: none;
        color: #374151;
        font-size: 0.98rem;
        font-weight: 500;
        padding: 10px 14px;
        border-radius: 10px;
        transition:
          background-color 0.2s ease,
          color 0.2s ease;
      }

      .nav-links > a:hover,
      .dropbtn:hover {
        background-color: #eff6ff;
        color: #2563eb;
      }

      .dropdown {
        position: relative;
      }

      .dropbtn {
        display: inline-block;
      }

      .dropdown-content {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 230px;
        background-color: #ffffff;
        border-radius: 14px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
        z-index: 1000;
        overflow: hidden;
      }

      .dropdown-content a {
        display: block;
        padding: 12px 16px;
        text-decoration: none;
        color: #1f2937;
        text-align: left;
        border-radius: 0;
        transition:
          background-color 0.2s ease,
          color 0.2s ease;
      }

      .dropdown-content a:hover {
        background-color: #eff6ff;
        color: #1d4ed8;
      }

      .dropdown:hover .dropdown-content {
        display: block;
      }

      .menu-toggle {
        display: none;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
      }

      .menu-toggle span {
        display: block;
        width: 28px;
        height: 3px;
        background-color: #0f172a;
        margin: 5px 0;
        border-radius: 2px;
      }

      .hero {
        padding: 62px 0 20px;
      }

      .hero-card {
        background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
        border: 1px solid #dbeafe;
        border-radius: 28px;
        padding: 38px;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
      }

      .breadcrumb {
        display: inline-block;
        margin-bottom: 14px;
        color: #2563eb;
        font-weight: 600;
        font-size: 0.95rem;
      }

      .breadcrumb:hover {
        text-decoration: underline;
      }

      .hero h1 {
        font-size: clamp(2rem, 4vw, 3rem);
        color: #0f172a;
        margin-bottom: 14px;
      }

      .hero-stats {
        display: flex;
        gap: 14px;
        flex-wrap: wrap;
        align-items: center;
        padding-top: 18px;
        border-top: 1px solid #dbeafe;
      }

      .hero-stat {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #374151;
        font-size: 0.98rem;
        font-weight: 600;
      }

      .pill {
        padding: 9px 15px;
        border-radius: 999px;
        font-size: 0.92rem;
        font-weight: 700;
      }

      .mode-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 9px 15px;
        border-radius: 999px;
        font-size: 0.92rem;
        font-weight: 700;
        background: #f3f4f6;
        color: #374151;
      }

      .pill.easy {
        background: #dcfce7;
        color: #166534;
      }

      .pill.medium {
        background: #fef3c7;
        color: #92400e;
      }

      .pill.hard {
        background: #fee2e2;
        color: #b91c1c;
      }

      section {
        padding: 18px 0 8px;
      }

      .control-label {
        font-size: 0.95rem;
        font-weight: 700;
        color: #0f172a;
      }

      .toggle-wrap {
        display: inline-flex;
        align-items: center;
        gap: 10px;
      }

      .toggle-pill {
        width: 72px;
        height: 38px;
        border-radius: 999px;
        background: #cbd5e1;
        position: relative;
        cursor: pointer;
        transition: background-color 0.2s ease;
        border: none;
      }

      .toggle-pill.on {
        background: #2563eb;
      }

      .toggle-knob {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #ffffff;
        position: absolute;
        top: 4px;
        left: 4px;
        transition: transform 0.2s ease;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
      }

      .toggle-pill.on .toggle-knob {
        transform: translateX(34px);
      }

      .toggle-state {
        font-size: 0.95rem;
        font-weight: 700;
        color: #374151;
        min-width: 24px;
      }

      .control-btn {
        background: #ffffff;
        border: 1.5px solid #2563eb;
        color: #2563eb;
        border-radius: 999px;
        padding: 12px 20px;
        font-size: 0.95rem;
        font-weight: 700;
        cursor: pointer;
        transition:
          background-color 0.2s ease,
          color 0.2s ease;
      }

      .control-btn:hover:not(:disabled) {
        background: #eff6ff;
      }

      .control-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
      }

      .solution-section {
        padding: 0 0 8px;
      }

      .solution-shell {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 56px;
        gap: 18px;
        align-items: stretch;
      }

      .solution-nav-col {
        display: flex;
      }

      .carousel-btn {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #2563eb;
        font-size: 1.7rem;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
        transition:
          background-color 0.2s ease,
          color 0.2s ease,
          border-color 0.2s ease,
          opacity 0.2s ease;
        margin: auto;
      }

      .carousel-btn:hover:not(:disabled) {
        background: #eff6ff;
        border-color: #93c5fd;
      }

      .carousel-btn:disabled {
        color: #94a3b8;
        background: #f8fafc;
        border-color: #e2e8f0;
        cursor: not-allowed;
        opacity: 0.8;
      }

      .solution-card {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 28px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
        overflow: hidden;
      }

      .solution-top {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 16px;
        padding: 24px 28px;
        border-bottom: 1px solid #e5e7eb;
      }

      .solution-number {
        min-width: 100px;
        height: 52px;
        border-radius: 999px;
        background: #f3f4f6;
        color: #374151;
        display: flex;
        align-items: center;
        justify-content: center;
        justify-self: start;
        padding: 0 18px;
        font-size: 1rem;
        font-weight: 700;
        flex-shrink: 0;
      }

      .solution-meta {
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .solution-jump {
        display: flex;
        justify-content: center;
        align-items: center;
        justify-self: center;
      }

      .jump-wrap {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .jump-label {
        font-size: 0.92rem;
        font-weight: 700;
        color: #374151;
      }

      .jump-input {
        width: 78px;
        height: 42px;
        border: 1.5px solid #cbd5e1;
        border-radius: 999px;
        padding: 0 14px;
        font-size: 0.92rem;
        font-weight: 700;
        color: #2563eb;
        background: #ffffff;
        text-align: center;
        transition: all 0.2s ease;
      }

      .jump-input:hover {
        background: #eff6ff;
        border-color: #93c5fd;
      }

      .jump-input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
      }

      .jump-input::-webkit-outer-spin-button,
      .jump-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }

      .jump-input[type="number"] {
        appearance: textfield;
        -moz-appearance: textfield;
      }

      .jump-btn {
        background: #ffffff;
        border: 1.5px solid #2563eb;
        color: #2563eb;
        border-radius: 999px;
        padding: 10px 16px;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
      }

      .jump-btn:hover {
        background: #eff6ff;
      }

      .jump-input.error {
        border-color: #dc2626;
        background: #fef2f2;
        color: #b91c1c;
      }

      .jump-input.shake {
        animation: shake 0.35s ease;
      }

      @keyframes shake {
        0% {
          transform: translateX(0);
        }
        20% {
          transform: translateX(-6px);
        }
        40% {
          transform: translateX(6px);
        }
        60% {
          transform: translateX(-4px);
        }
        80% {
          transform: translateX(4px);
        }
        100% {
          transform: translateX(0);
        }
      }

      .solution-question {
        padding: 30px 28px;
        border-bottom: 1px solid #e5e7eb;
        background: #ffffff;
        min-height: 185px;
      }

      .solution-question h3 {
        font-size: 1rem;
        color: #2563eb;
        margin-bottom: 8px;
      }

      .solution-question-text {
        font-size: 1.45rem;
        line-height: 1.5;
        color: #0f172a;
      }

      .solution-body {
        padding: 28px;
        min-height: 50px;
      }

      .solution-body.full-reveal {
        animation: fullReveal 1s ease;
      }

      @keyframes fullReveal {
        0% {
          opacity: 0;
          transform: translateY(-8px);
        }
        100% {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .solution-step {
        margin-bottom: 18px;
        padding-bottom: 18px;
        border-bottom: 1px dashed #e5e7eb;
        overflow: hidden;
      }

      .solution-step:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
      }

      .solution-step.shown {
        opacity: 1;
        transform: translateY(0);
        max-height: 1200px;
      }

      .solution-step.revealed {
        opacity: 0;
        transform: translateY(-4px);
        max-height: 0;
        animation: nextStep 0.65s ease forwards;
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
      }

      .solution-step.revealed::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 14px;
        box-shadow: 0 0 18px rgba(37, 99, 235, 0.18);
        opacity: 0;
        animation: glowFade 0.6s ease forwards;
      }

      @keyframes glowFade {
        0% {
          opacity: 0.8;
        }
        100% {
          opacity: 0;
        }
      }

      @keyframes nextStep {
        0% {
          opacity: 0;
          transform: translateY(-10px);
          max-height: 0;
        }
        100% {
          opacity: 1;
          transform: translateY(0);
          max-height: 1200px;
        }
      }

      .comm {
        color: #1e3a8a;
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 6px;
      }

      .comm.be-careful {
        color: #b45309;
        font-weight: 700;
      }

      .maths {
        color: #16a34a;
        font-weight: 700;
        font-size: 1.1rem;
        line-height: 1.5;
      }

      .solution-footer {
        padding: 22px 28px;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 18px;
        border-top: 1px solid #e5e7eb;
      }

      .solution-footer-progress {
        justify-self: start;
      }

      .solution-footer-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
        justify-self: center;
      }

      .solution-footer-toggle {
        justify-self: end;
      }

      .footer-toggle-wrap {
        gap: 10px;
      }

      .solution-progress {
        color: #6b7280;
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
      }

      footer {
        margin-top: 60px;
        background: #0f172a;
        color: #e5e7eb;
        padding: 32px 0;
      }

      footer p {
        color: #cbd5e1;
        font-size: 0.95rem;
      }

      @media (max-width: 950px) {
        .navbar {
          flex-wrap: wrap;
        }

        .menu-toggle {
          display: block;
          margin-left: auto;
        }

        .nav-links {
          display: none;
          width: 100%;
          flex-direction: column;
          align-items: stretch;
          gap: 8px;
          padding-top: 12px;
        }

        .nav-links.active {
          display: flex;
        }

        .nav-links > a,
        .dropbtn {
          width: 100%;
          box-sizing: border-box;
        }

        .dropdown {
          width: 100%;
        }

        .dropdown-content {
          display: none;
          position: static;
          min-width: 100%;
          margin-top: 6px;
          box-shadow: none;
          border-radius: 10px;
          border: 1px solid #e5e7eb;
        }

        .dropdown:hover .dropdown-content {
          display: none;
        }

        .dropdown.mobile-open .dropdown-content {
          display: block;
        }

        .solution-shell {
          grid-template-columns: 48px minmax(0, 1fr) 48px;
          gap: 12px;
        }

        .carousel-btn {
          width: 44px;
          height: 44px;
          font-size: 1.45rem;
        }
        .solution-top {
          grid-template-columns: 1fr;
          justify-items: center;
          text-align: center;
        }

        .solution-meta {
          justify-content: center;
        }

        .solution-footer {
          grid-template-columns: 1fr;
          justify-items: center;
          text-align: center;
        }

        .solution-footer-progress,
        .solution-footer-actions,
        .solution-footer-toggle {
          justify-self: center;
        }

        .solution-footer-actions {
          justify-content: center;
        }
      }

      @media (max-width: 680px) {
        .hero-card {
          padding: 22px 18px;
        }

        .solution-shell {
          grid-template-columns: 40px minmax(0, 1fr) 40px;
          gap: 8px;
        }

        .carousel-btn {
          width: 36px;
          height: 36px;
          font-size: 1.2rem;
        }

        .solution-top,
        .solution-question,
        .solution-body,
        .solution-footer {
          padding-left: 16px;
          padding-right: 16px;
        }

        .solution-question-text {
          font-size: 1.18rem;
        }

        .maths {
          font-size: 1rem;
        }

        .solution-body {
          min-height: 170px;
        }

        .solution-number {
          min-width: 90px;
          font-size: 0.92rem;
          padding: 0 14px;
        }

        .jump-label {
          display: none;
        }

        .jump-input {
          width: 70px;
          height: 38px;
          font-size: 0.88rem;
        }

        .jump-btn {
          padding: 9px 14px;
          font-size: 0.86rem;
        }
      }
    
      .answer-path {
        padding: 22px 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        flex-wrap: wrap;
        border-bottom: 1px solid #e5e7eb;
        background: #ffffff;
      }

      .answer-path-copy {
        color: #475569;
        font-size: 0.98rem;
        font-weight: 600;
      }

      .answer-path-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
      }

      .answer-path-btn {
        min-height: 44px;
        background: #ffffff;
        border: 1.5px solid #2563eb;
        color: #2563eb;
        border-radius: 999px;
        padding: 12px 22px;
        font-size: 0.98rem;
        font-weight: 700;
        cursor: pointer;
        transition:
          background-color 0.2s ease,
          color 0.2s ease,
          border-color 0.2s ease,
          transform 0.2s ease;
      }

      .answer-path-btn:hover:not(:disabled) {
        background: #eff6ff;
        transform: translateY(-1px);
      }

      .answer-path-btn.active {
        background: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
      }

      .answer-path-btn:disabled {
        cursor: not-allowed;
        color: #94a3b8;
        border-color: #cbd5e1;
        background: #f8fafc;
        opacity: 0.85;
      }

      .answer-path-status {
        flex-basis: 100%;
        min-height: 0;
        color: #92400e;
        font-size: 0.9rem;
        font-weight: 600;
      }

      .answer-path-status:empty {
        display: none;
      }

      .quick-answer-panel {
        padding: 28px;
        border-bottom: 1px solid #bbf7d0;
        background: #f0fdf4;
        animation: answerReveal 0.35s ease;
      }

      .quick-answer-panel h3 {
        color: #15803d;
        font-size: 1rem;
        margin-bottom: 10px;
      }

      .quick-answer-body {
        color: #15803d;
        font-size: 1.2rem;
        line-height: 1.6;
        overflow-x: auto;
      }

      .quick-answer-body .part {
        margin-top: 14px;
      }

      .quick-answer-body .part:first-child {
        margin-top: 0;
      }

      .quick-answer-panel[hidden],
      .solution-body[hidden],
      .solution-footer[hidden] {
        display: none !important;
      }

      .solution-step {
        position: relative;
        scroll-margin-top: 140px;
      }

      .maths {
        overflow-x: auto;
      }

      .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }

      .answer-path-btn:focus-visible,
      .control-btn:focus-visible,
      .carousel-btn:focus-visible,
      .jump-btn:focus-visible,
      .jump-input:focus-visible,
      .toggle-pill:focus-visible,
      .menu-toggle:focus-visible,
      a:focus-visible {
        outline: 3px solid #f59e0b;
        outline-offset: 3px;
      }

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

      @media (max-width: 680px) {
        .answer-path {
          padding-left: 16px;
          padding-right: 16px;
          align-items: stretch;
        }

        .answer-path-copy {
          width: 100%;
          text-align: center;
        }

        .answer-path-actions {
          width: 100%;
          display: grid;
          grid-template-columns: 1fr;
        }

        .answer-path-btn,
        .solution-footer-actions .control-btn {
          width: 100%;
          min-height: 44px;
        }

        .quick-answer-panel {
          padding-left: 16px;
          padding-right: 16px;
        }

        .carousel-btn {
          width: 44px;
          height: 44px;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        html {
          scroll-behavior: auto;
        }

        *,
        *::before,
        *::after {
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: 0.01ms !important;
        }
      }


      /* COURSE NAVIGATION STATUS */
      #a-level-dropdown .dropdown-content,
      #ap-dropdown .dropdown-content {
        min-width: 300px;
      }

      #a-level-dropdown .dropdown-content a,
      #ap-dropdown .dropdown-content a,
      #a-level-dropdown .dropdown-content .dropdown-item,
      #ap-dropdown .dropdown-content .dropdown-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 12px 16px;
        text-align: left;
      }

      #a-level-dropdown .dropdown-content .dropdown-item.is-disabled,
      #ap-dropdown .dropdown-content .dropdown-item.is-disabled {
        background: #f8fafc;
        color: #9ca3af;
        cursor: default;
      }

      .nav-coming-soon {
        flex: 0 0 auto;
        padding: 3px 7px;
        border-radius: 999px;
        background: #e5e7eb;
        color: #6b7280;
        font-size: 0.65rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
      }

      @media (max-width: 950px) {
        #a-level-dropdown .dropdown-content,
        #ap-dropdown .dropdown-content {
          min-width: 100%;
        }
      }
    

    