/*calculations.css*/
/* =========================================================
   MOLE CONVERSION LEARNING PAGE
   ========================================================= */

.calculations-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculation-primary-btn,
.calculation-secondary-btn {
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--color-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        opacity 0.15s ease;
}

.calculation-primary-btn {
    border: 1px solid rgb(238, 172, 96);
    background: rgb(184, 128, 74);
    color: #1d120b;
}

.calculation-primary-btn:hover:not(:disabled) {
    background: rgb(238, 172, 96);
    transform: translateY(-1px);
}

.calculation-secondary-btn {
    border: 1px solid rgba(220, 180, 140, 0.65);
    background: rgba(84, 68, 56, 0.92);
}

.calculation-secondary-btn:hover {
    background: rgb(110, 84, 64);
}

.calculation-primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =========================================================
   CONVERSION MAP
   ========================================================= */

.mole-map-card {
    width: 100%;
    padding: 0;
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.mole-map-scroll {
    overflow-x: auto;
    padding: 10px 0 20px;
    scrollbar-width: thin;
    scrollbar-color:
        rgba(238, 172, 96, 0.75)
        rgba(24, 18, 14, 0.75);
}

.mole-map-scroll::-webkit-scrollbar {
    height: 7px;
}

.mole-map-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(24, 18, 14, 0.75);
}

.mole-map-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(238, 172, 96, 0.75);
}

.mole-conversion-map {
    position: relative;
    display: grid;
    width: 1200px;
    grid-template-columns: 220px 220px 240px 220px 220px;
    grid-template-rows: 220px 170px 220px;
    align-items: center;
    justify-content: center;
    column-gap: 0;
    row-gap: 0;
    min-width: 1200px;
    margin: 0 auto;
}

.conversion-node {
    position: relative;
    display: flex;
    width: 205px;
    min-height: 205px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 18px 16px;
    border: 2px solid rgba(220, 180, 140, 0.45);
    border-radius: 20px;
    color: var(--color-text);
    text-align: center;
    background:
        linear-gradient(
            145deg,
            rgba(84, 68, 56, 0.96),
            rgba(34, 28, 24, 0.96)
        );
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.28),
        inset 0 1px rgba(255, 255, 255, 0.05);
}

button.conversion-node {
    font: inherit;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

button.conversion-node:hover {
    transform: translateY(-4px);
    border-color: rgb(238, 172, 96);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.36),
        0 0 22px rgba(238, 172, 96, 0.16);
}

button.conversion-node.selected {
    border-color: #ffd39a;
    background:
        linear-gradient(
            145deg,
            rgba(184, 128, 74, 0.94),
            rgba(84, 55, 35, 0.96)
        );
    box-shadow:
        0 0 0 3px rgba(238, 172, 96, 0.18),
        0 14px 30px rgba(0, 0, 0, 0.38);
}

.conversion-node strong {
    font-size: 1.08rem;
}

.conversion-node small {
    color: var(--color-text-muted);
    line-height: 1.3;
}

.conversion-node-icon {
    color: #ffd39a;
    font-size: 1.7rem;
    font-weight: 800;
}

.conversion-node-action {
    margin-top: 5px;
    color: #ffca86;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.node-particles {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
}

.connector-left {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.connector-right {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
}

.connector-mass {
    grid-column: 3;
    grid-row: 2;
    justify-self: center;
    align-self: stretch;
}

.node-moles {
    grid-column: 3;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 240px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.node-moles .conversion-node-icon,
.node-moles strong,
.node-moles small {
    display: block;
    width: 100%;
    text-align: center;
}

.node-moles .conversion-node-icon {
    font-size: 3.2rem;
    line-height: 1;
    color: #ffd39a;
}

.node-moles strong {
    font-size: 1.2rem;
    line-height: 1.2;
}

.node-moles small {
    line-height: 1.3;
    color: var(--color-text-muted);
}

.node-volume {
    grid-column: 5;
    grid-row: 1;
    justify-self: start;
}

.node-mass {
    grid-column: 3;
    grid-row: 3;
    justify-self: center;
    align-self: start;
}


/* Keep the map content above the hollow highlight. */
.conversion-node,
.node-moles,
.map-connector {
    position: relative;
    z-index: 2;
}

.conversion-level-highlight {
    position: absolute;
    inset: 0;
    z-index: 1;

    width: 1200px;
    height: 610px;

    overflow: visible;
    pointer-events: none;
}

.conversion-level-path {
    fill: none;
    stroke: #ffd39a;
    stroke-width: 3;
    stroke-dasharray: 12 9;
    stroke-linejoin: round;

    opacity: 0;
    transition: opacity 0.16s ease;

    vector-effect: non-scaling-stroke;
}


.mole-conversion-map.highlight-gas-to-mass
.route-gas-to-mass,
.mole-conversion-map.highlight-gas-to-particles
.route-gas-to-particles,
.mole-conversion-map.highlight-particles-to-mass
.route-particles-to-mass {
    opacity: 1;
}


/* =========================================
   LEVEL AND ROUTE CHOOSERS
   ========================================= */

.conversion-level-chooser {
    display: grid;
    width: min(920px, calc(100% - 24px));
    grid-template-columns:
        minmax(180px, 1fr)
        repeat(2, minmax(220px, 1fr));
    gap: 12px;
    align-items: stretch;
    margin: 0 auto 8px;
    padding: 12px;
    border: 1px solid rgba(238, 172, 96, 0.34);
    border-radius: 16px;
    background: rgba(34, 28, 24, 0.72);
}

.conversion-level-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
}

.conversion-level-intro strong {
    color: #ffd39a;
    font-size: 1rem;
}

.conversion-level-intro small {
    color: var(--color-text-muted);
    line-height: 1.35;
}

.conversion-level-btn,
.level2-route-btn {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 13px 15px;
    border: 1px solid rgba(220, 180, 140, 0.4);
    border-radius: 12px;
    color: var(--color-text);
    background: rgba(84, 68, 56, 0.78);
    font: inherit;
    text-align: left;
    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.conversion-level-btn:hover,
.conversion-level-btn:focus-visible,
.level2-route-btn:hover,
.level2-route-btn:focus-visible {
    transform: translateY(-2px);
    border-color: #ffd39a;
    background: rgba(126, 86, 52, 0.96);
    outline: none;
}

.conversion-level-btn.selected,
.level2-route-btn.selected {
    border-color: #ffd39a;
    background: rgba(155, 103, 58, 0.94);
    box-shadow:
        0 0 0 3px rgba(238, 172, 96, 0.14);
}

.conversion-level-btn span,
.level2-route-btn strong {
    color: #ffd39a;
    font-size: 0.95rem;
    font-weight: 800;
}

.conversion-level-btn small,
.level2-route-btn span {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.level2-route-chooser {
    position: relative;
    z-index: 3;

    display: grid;
    width: min(920px, calc(100% - 24px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;

    margin: 0 auto 14px;
}

.level2-route-chooser[hidden] {
    display: none;
}

.level2-route-btn {
    min-height: 88px;
}

/* =========================================================
   MAP ARROWS
   ========================================================= */

.map-connector {
    color: #ffd39a;
    font-size: 0.78rem;
    font-weight: 700;
}

.map-connector-horizontal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    width: 100%;
    padding: 0;
    align-self: center;
}

.map-arrow-row {
    position: relative;
    width: 100%;
    height: 28px;
}

.map-arrow-row::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    background: #f0b45c;
}

.map-arrow-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #ffd39a;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.map-connector-horizontal
.map-arrow-row:first-child
.map-arrow-label {
    top: -16px;
}

.map-connector-horizontal
.map-arrow-row:last-child
.map-arrow-label {
    bottom: -20px;
}

.map-arrow-symbol,
.map-arrow-line {
    display: none;
}

.connector-left {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.connector-right {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
}

.connector-left .map-arrow-row:first-child::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 14px solid #f0b45c;
}

.connector-left .map-arrow-row:last-child::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #f0b45c;
}

.connector-right .map-arrow-row:first-child::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #f0b45c;
}

.connector-right .map-arrow-row:last-child::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 14px solid #f0b45c;
}

/* Gap between the left arrows and the particles card */
.connector-left .map-arrow-row::before {
    left: 14px;
}

/* Move the left-facing arrowhead with the shortened line */
.connector-left .map-arrow-row:first-child::after {
    left: 14px;
}

/* Gap between the right arrows and the gas-volume card */
.connector-right .map-arrow-row::before {
    right: 14px;
}

/* Move the right-facing arrowhead with the shortened line */
.connector-right .map-arrow-row:first-child::after {
    right: 14px;
}

/* =========================
   VERTICAL ARROWS
   ========================= */

.connector-mass {
    grid-column: 3;
    grid-row: 2;
    justify-self: center;
    align-self: stretch;
}

.map-connector-vertical {
    position: relative;
    width: 180px;

    /* Increase the height while moving it upward.
       The bottom remains in approximately the same position. */
    height: calc(100% + 38px);
    transform: translateY(-38px);

    margin: 0 auto;
}

/* Label beside the downward arrow */
.map-connector-vertical > span:first-child {
    position: absolute;
    top: 50%;
    right: calc(50% + 42px);
    transform: translateY(-50%);
    white-space: nowrap;
    color: #ffd39a;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    text-align: right;
}

/* Label beside the upward arrow */
.map-connector-vertical > span:last-child {
    position: absolute;
    top: 50%;
    left: calc(50% + 42px);
    transform: translateY(-50%);
    white-space: nowrap;
    color: #ffd39a;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    text-align: left;
}

.map-connector-vertical > .vertical-arrow {
    position: absolute;
    display: block;
    top: 10px;
    bottom: 30px;
    width: 2px;
    height: auto;
    font-size: 0;
    background: #f0b45c;
}

/* Downward arrow: mol → mass */
.map-connector-vertical > .vertical-arrow:nth-child(2) {
    left: calc(50% - 26px);
}

.map-connector-vertical > .vertical-arrow:nth-child(2)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 14px solid #f0b45c;
}

/* Upward arrow: mass → mol */
.map-connector-vertical > .vertical-arrow:nth-child(4) {
    left: calc(50% + 26px);
}

.map-connector-vertical > .vertical-arrow:nth-child(4)::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -12px;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 14px solid #f0b45c;
}

/* The old shared middle line is no longer needed */
.map-connector-vertical .vertical-arrow-line {
    display: none;
}

.map-selection-message {
    margin: 8px 0 0;
    padding: 12px 14px;
    border-left: 4px solid var(--color-accent);
    border-radius: 8px;
    color: var(--color-text-muted);
    background: rgba(238, 172, 96, 0.08);
}

/* =========================================================
   GUIDED QUIZ
   ========================================================= */

/* Hide the conversion map while the quiz page is open */
.calculations-layout.quiz-page-open .mole-map-card {
    display: none;
}

/* Make the quiz behave like its own page */
.calculations-layout.quiz-page-open
.conversion-quiz-panel {
    min-height: calc(100vh - 120px);
    border-radius: 18px;
}

/* Header buttons */
.conversion-quiz-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversion-skip-btn {
    white-space: nowrap;
}

/* Buttons displayed after completing the quiz */
.conversion-complete-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.conversion-quiz-panel {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background: rgba(20, 16, 14, 0.94);
    box-shadow: var(--card-shadow);
}

.conversion-quiz-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(220, 180, 140, 0.2);
    background:
        linear-gradient(
            100deg,
            rgba(184, 128, 74, 0.25),
            rgba(20, 16, 14, 0.1)
        );
}

.conversion-quiz-header h2 {
    margin: 4px 0;
    color: var(--color-accent);
}

.conversion-quiz-header p {
    margin: 0;
    color: var(--color-text-muted);
}

.conversion-quiz-topic {
    color: #ffd39a;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.conversion-close-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(220, 180, 140, 0.5);
    border-radius: 50%;
    color: var(--color-text);
    background: rgba(84, 68, 56, 0.9);
    font-size: 1.5rem;
    cursor: pointer;
}

.conversion-question-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

.conversion-question-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.conversion-question-bar h3 {
    margin: 6px 0 0;
    line-height: 1.4;
}

#conversionQuestionNumber {
    color: #ffd39a;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.conversion-score {
    padding: 8px 13px;
    border-radius: 999px;
    color: #ffd39a;
    font-weight: 800;
    background: rgba(238, 172, 96, 0.12);
    white-space: nowrap;
}

/* =========================================================
   GUIDE PROGRESS
   ========================================================= */

.conversion-guide-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 20px;
}

.guide-progress-item {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 auto;
    border: 2px solid rgba(220, 180, 140, 0.25);
    border-radius: 50%;
    color: var(--color-text-muted);
    background: rgba(34, 28, 24, 1);
    font-weight: 800;
}

.guide-progress-item.active {
    border-color: var(--color-accent);
    color: #ffd39a;
}

.guide-progress-item.complete {
    border-color: rgba(90, 220, 130, 0.8);
    color: #102014;
    background: rgba(90, 220, 130, 0.9);
}

.guide-progress-line {
    width: min(110px, 15vw);
    height: 2px;
    background: rgba(220, 180, 140, 0.22);
}

/* =========================================================
   GUIDE STEPS
   ========================================================= */

.conversion-guide-step {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(220, 180, 140, 0.25);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.035);
    transition:
        opacity 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.conversion-guide-step.is-locked {
    opacity: 0.4;
}

.conversion-guide-step.is-complete {
    border-color: rgba(90, 220, 130, 0.55);
    background: rgba(70, 130, 85, 0.12);
}

.guide-step-number {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: #1d120b;
    background: var(--color-accent-dark);
    font-weight: 900;
}

.conversion-guide-step.is-complete .guide-step-number {
    background: rgba(90, 220, 130, 0.95);
}

.guide-step-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
}

.guide-step-content h3,
.guide-step-content p {
    margin: 0;
}

.guide-step-label {
    color: #ffd39a;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* =========================================================
   CHOICES
   ========================================================= */

.quantity-choice-buttons,
.operation-choice-grid {
    display: grid;
    width: 100%;
    grid-template-columns:
        repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.quantity-choice-btn {
    min-height: 58px;
    padding: 10px;
    border: 1px solid rgba(220, 180, 140, 0.35);
    border-radius: 10px;
    color: var(--color-text);
    background: rgba(84, 68, 56, 0.65);
    font: inherit;
    cursor: pointer;
}

.quantity-choice-btn:hover,
.quantity-choice-btn.selected {
    border-color: var(--color-accent);
    background: rgba(184, 128, 74, 0.38);
}

.operation-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operation-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 12px;
    border: 1px solid rgba(220, 180, 140, 0.35);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.035);
}

.operation-choice:has(input:checked) {
    border-color: var(--color-accent);
    background: rgba(184, 128, 74, 0.24);
}

.operation-choice input {
    flex: 0 0 auto;
}

.operation-choice span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.operation-choice small {
    color: var(--color-text-muted);
}

.operation-symbol {
    color: #ffd39a;
    font-size: 1.7rem;
    font-weight: 900;
}

/* =========================================================
   FACTOR AND ANSWER FIELDS
   ========================================================= */

.conversion-factor-working {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 8px;
}

.factor-working-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 13px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
}

.factor-working-row strong {
    color: #ffd39a;
}

.factor-reference-box {
    padding: 16px;
    border: 1px solid rgba(238, 172, 96, 0.35);
    border-radius: 12px;
    color: #ffd39a;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
    background: rgba(238, 172, 96, 0.08);
}

.conversion-answer-label {
    color: var(--color-text);
    font-weight: 800;
}

.conversion-answer-field {
    display: grid;
    width: min(100%, 520px);
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(220, 180, 140, 0.55);
    border-radius: 11px;
    background: rgba(5, 5, 5, 0.35);
}

.conversion-answer-field:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(238, 172, 96, 0.12);
}

.conversion-answer-field input {
    min-width: 0;
    padding: 12px 14px;
    border: none;
    outline: none;
    color: var(--color-text);
    background: transparent;
    font: inherit;
}

.conversion-answer-field span {
    display: flex;
    align-items: center;
    padding: 0 13px;
    color: #ffd39a;
    background: rgba(184, 128, 74, 0.18);
    font-weight: 800;
    white-space: nowrap;
}

.conversion-equation-display {
    padding: 15px;
    border-radius: 12px;
    color: #ffd39a;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
    background: rgba(238, 172, 96, 0.09);
}

.conversion-substitution {
    width: 100%;
    padding: 13px;
    border-left: 4px solid var(--color-accent);
    border-radius: 8px;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.035);
}

/* =========================================================
   FEEDBACK AND COMPLETION
   ========================================================= */

.conversion-feedback {
    width: 100%;
    padding: 11px 13px;
    border-radius: 9px;
    line-height: 1.45;
}

.conversion-feedback.correct {
    border: 1px solid rgba(90, 220, 130, 0.55);
    background: rgba(70, 150, 90, 0.15);
}

.conversion-feedback.incorrect {
    border: 1px solid rgba(255, 100, 100, 0.55);
    background: rgba(180, 60, 60, 0.14);
}

.conversion-feedback.hint {
    border: 1px solid rgba(255, 190, 80, 0.55);
    background: rgba(190, 120, 40, 0.14);
}

.conversion-question-actions {
    display: flex;
    justify-content: flex-end;
}

.conversion-complete-card {
    display: flex;
    min-height: 430px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
    text-align: center;
}

.conversion-complete-card p {
    max-width: 620px;
    margin: 0;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.conversion-complete-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 50%;
    color: #102014;
    background: rgba(90, 220, 130, 0.95);
    font-size: 2.3rem;
    font-weight: 900;
}

.conversion-final-score {
    color: #ffd39a;
    font-size: 2.8rem;
    font-weight: 900;
}

.conversion-question-content.mass-flow-active
.conversion-guide-progress,
.conversion-question-content.mass-flow-active
.conversion-guide-step {
    display: none;
}

.mass-guided-flow {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(238, 172, 96, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

#conversionQuestionText {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;

    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 800;
    line-height: 1.35;
}

.conversion-question-main {
    display: inline;
}

.question-atomic-reference {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    color: #ffd39a;
    background: rgba(238, 172, 96, 0.12);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.mass-guided-stage {
    padding: 5px 0;
    animation: mass-stage-appear 0.25s ease;
}

.mass-guided-line {
    display: flex;
    min-height: 55px;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 1.15rem;
}

.mass-guided-input {
    width: 88px;
    min-height: 46px;
    padding: 7px 9px;
    border: 2px solid rgba(220, 180, 140, 0.3);
    border-radius: 10px;
    outline: none;
    color: white;
    text-align: center;
    background: rgba(5, 5, 5, 0.5);
    font: inherit;
    font-weight: 900;
}

.mass-guided-input:disabled:not(.is-correct) {
    opacity: 0.35;
}

.mass-guided-input.is-active {
    opacity: 1;
    border-color: #ffd39a;
    background: rgba(184, 128, 74, 0.22);
    animation: mass-input-glow 1.2s infinite;
}

.mass-guided-input.is-correct {
    opacity: 1;
    border-color: rgba(90, 220, 130, 0.9);
    color: #baffcf;
    background: rgba(70, 150, 90, 0.18);
}

.mass-guided-input.is-incorrect {
    border-color: #ff7474;
    background: rgba(180, 60, 60, 0.2);
}

.mass-guided-check {
    align-self: flex-end;
}

.mass-guided-lead {
    min-width: 0;
    color: var(--color-text);
    font-weight: 800;
}

.mass-guided-symbol {
    width: auto;
    min-width: 0;
    color: #ffd39a;
    text-align: center;
    font-weight: 900;
}

.mass-guided-expression {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mass-guided-times,
.mass-guided-inline-plus {
    color: #ffd39a;
    font-weight: 900;
}

.mass-guided-inline-plus {
    font-size: 1.2rem;
}

.mass-guided-unit {
    display: inline-block;
    flex: 0 0 auto;
    color: var(--color-text);
    font-weight: 700;
    white-space: nowrap;
}

.question-moles-underline {
    text-decoration: underline;
    text-decoration-color: #ffd39a;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.mass-guided-eq-line {
    display: grid;
    min-height: 64px;
    grid-template-columns:
        240px
        32px
        minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
}

.mass-guided-terms-row,
.mass-guided-result-row {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-self: start;
    gap: 12px;
    flex-wrap: nowrap;
}

.mass-guided-term-step {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   GUIDED OPERATION CHOICE
   ========================================================= */

.guided-operation-picker {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px solid rgba(238, 172, 96, 0.34);
    border-radius: 13px;
    background: rgba(238, 172, 96, 0.07);
}

.guided-operation-picker[hidden] {
    display: none;
}

.guided-operation-picker > strong {
    margin-right: 4px;
    color: var(--color-text);
}

.guided-operation-buttons {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.guided-operation-btn {
    display: inline-flex;
    min-width: 130px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 15px;
    border: 2px solid rgba(220, 180, 140, 0.35);
    border-radius: 11px;
    color: var(--color-text);
    background: rgba(5, 5, 5, 0.38);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.guided-operation-btn span {
    color: #ffd39a;
    font-size: 1.45rem;
    font-weight: 900;
}

.guided-operation-btn:hover:not(:disabled),
.guided-operation-btn:focus-visible {
    border-color: #ffd39a;
    outline: none;
    background: rgba(184, 128, 74, 0.22);
}

.guided-operation-btn.is-correct {
    border-color: rgba(90, 220, 130, 0.9);
    color: #baffcf;
    background: rgba(70, 150, 90, 0.18);
}

.guided-operation-btn.is-incorrect {
    border-color: #ff7474;
    background: rgba(180, 60, 60, 0.2);
}

.guided-operation-btn:disabled {
    cursor: default;
}

.guided-operation-feedback {
    width: 100%;
    min-height: 1.4em;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.guided-operation-feedback.correct {
    color: #baffcf;
}

.guided-operation-feedback.incorrect {
    color: #ff9b9b;
}

/* =========================================================
   VERTICAL DIVISION / FRACTION
   ========================================================= */

.guided-fraction {
    display: inline-grid;
    min-width: 190px;
    grid-template-rows: auto auto;
    align-items: stretch;
    justify-items: stretch;
    vertical-align: middle;
}

.guided-fraction-top,
.guided-fraction-bottom {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    white-space: nowrap;
}

.guided-fraction-top {
    border-bottom: 3px solid currentColor;
}

.guided-fraction .mass-guided-input {
    width: 125px;
}

@media (max-width: 600px) {
    .guided-operation-picker {
        align-items: stretch;
        flex-direction: column;
    }

    .guided-operation-buttons {
        width: 100%;
        flex-direction: column;
    }

    .guided-operation-btn {
        width: 100%;
    }

    .guided-fraction {
        min-width: 160px;
    }

    .guided-fraction .mass-guided-input {
        width: 105px;
    }
}

@keyframes mass-input-glow {
    0%,
    100% {
        box-shadow:
            0 0 0 3px rgba(238, 172, 96, 0.12),
            0 0 13px rgba(238, 172, 96, 0.25);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(238, 172, 96, 0.08),
            0 0 23px rgba(238, 172, 96, 0.48);
    }
}

@keyframes mass-stage-appear {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 760px) {
    .calculations-header,
    .mole-map-heading,
    .conversion-question-bar {
        flex-direction: column;
    }

    .quantity-choice-buttons,
    .operation-choice-grid {
        grid-template-columns: 1fr;
    }

    .conversion-guide-step {
        grid-template-columns: 1fr;
    }

    .guide-step-number {
        width: 32px;
        height: 32px;
    }

    .conversion-question-actions {
        justify-content: stretch;
    }

    .conversion-question-actions button {
        width: 100%;
    }

    .conversion-complete-actions {
        width: 100%;
        flex-direction: column;
    }

    .conversion-complete-actions button,
    .conversion-quiz-header-actions button {
        width: 100%;
    }

    .conversion-level-chooser {
        grid-template-columns: 1fr;
    }

    .level2-route-chooser {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CLICKABLE MOLE GLOSSARY TERM
   ========================================================= */

.question-mol-link {
    display: inline;
    margin: 0;
    padding: 0;

    border: 0;
    border-bottom: 1px dashed rgba(255, 173, 92, 0.9);

    background: transparent;
    color: #ffad5c;

    font: inherit;
    font-weight: inherit;
    line-height: inherit;

    cursor: pointer;
    vertical-align: baseline;
}

.question-mol-link:hover {
    color: #ffd39a;
    border-bottom-style: solid;
}

.question-mol-link.question-moles-underline {
    text-decoration: underline;
    text-decoration-color: #ffd39a;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.mole-glossary-link {
    width: auto;
    min-height: 0;
    margin: 0 auto 6px;
    padding: 0 4px;
}