/* =========================================================
   DISTANCE FORMULA PRACTICE
   /interactive-learning-tools/distance-formula/
   ========================================================= */


/* =========================================================
   PAGE VARIABLES
   ========================================================= */

.df-practice-page {
    --df-navy: #16324f;
    --df-navy-dark: #10283f;
    --df-teal: #159a9c;
    --df-teal-dark: #117d7f;
    --df-teal-soft: #e9f7f7;
    --df-green: #198754;
    --df-green-dark: #146c43;
    --df-green-soft: #eaf7ef;
    --df-red: #dc3545;
    --df-red-soft: #fcebec;
    --df-amber: #b7791f;
    --df-amber-soft: #fff8e7;
    --df-blue-soft: #eef6fc;
    --df-text: #263746;
    --df-muted: #667788;
    --df-border: #d9e2e8;
    --df-border-light: #e8eef2;
    --df-bg: #f5f8fa;
    --df-white: #ffffff;
    --df-shadow: 0 12px 34px rgba(22, 50, 79, 0.10);
    --df-shadow-small: 0 5px 18px rgba(22, 50, 79, 0.08);

    color: var(--df-text);
    font-family: "Inter", sans-serif;
}


/* =========================================================
   GENERAL
   ========================================================= */

.df-practice-page *,
.df-practice-page *::before,
.df-practice-page *::after {
    box-sizing: border-box;
}

.df-practice-page button,
.df-practice-page input,
.df-practice-page select {
    font-family: inherit;
}

.df-practice-page button {
    -webkit-tap-highlight-color: transparent;
}

.df-practice-page [hidden] {
    display: none !important;
}


/* =========================================================
   PRACTICE SECTION
   ========================================================= */

.df-section {
    padding: 4.5rem 1.5rem;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f7fafb 55%,
            #ffffff 100%
        );
}

.df-app {
    width: min(1180px, 100%);
    margin: 0 auto;
}


/* =========================================================
   EYEBROW
   ========================================================= */

.df-eyebrow {
    margin: 0 0 0.45rem;
    color: var(--df-teal-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.df-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.df-toolbar-heading {
    max-width: 760px;
}

.df-toolbar-heading h2 {
    margin: 0 0 0.65rem;
    color: var(--df-navy);
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    font-weight: 800;
    line-height: 1.15;
}

.df-toolbar-heading > p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--df-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

.df-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.df-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.df-control-group label {
    color: var(--df-navy);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.df-select {
    min-width: 180px;
    padding: 0.75rem 2.6rem 0.75rem 0.9rem;
    border: 1px solid var(--df-border);
    border-radius: 0.65rem;
    background-color: var(--df-white);
    color: var(--df-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.df-select:focus {
    border-color: var(--df-teal);
    box-shadow: 0 0 0 3px rgba(21, 154, 156, 0.14);
}


/* =========================================================
   PRACTICE MODE SELECTOR
   ========================================================= */

.df-mode-selector {
    margin-bottom: 1.6rem;
    padding: 1.15rem;
    border: 1px solid var(--df-border-light);
    border-radius: 1rem;
    background: var(--df-white);
    box-shadow: var(--df-shadow-small);
}

.df-mode-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.df-mode-label {
    color: var(--df-navy);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.df-mode-help {
    color: var(--df-muted);
    font-size: 0.86rem;
    line-height: 1.5;
    text-align: right;
}

.df-mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.df-mode-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 50px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--df-border);
    border-radius: 0.7rem;
    background: #f8fafb;
    color: var(--df-navy);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.df-mode-button:hover {
    border-color: var(--df-teal);
    background: var(--df-teal-soft);
}

.df-mode-button.is-active {
    border-color: var(--df-teal);
    background: var(--df-teal);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(21, 154, 156, 0.22);
}

.df-mode-button:active {
    transform: translateY(1px);
}


/* =========================================================
   ROUND PROGRESS
   ========================================================= */

.df-progress-area {
    margin-bottom: 1.1rem;
}

.df-progress-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    color: var(--df-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.df-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf1;
}

.df-progress-bar {
    width: 10%;
    height: 100%;
    border-radius: inherit;
    background: var(--df-teal);
    transition: width 0.35s ease;
}


/* =========================================================
   MAIN PRACTICE CARD
   ========================================================= */

.df-card {
    overflow: hidden;
    border: 1px solid var(--df-border);
    border-radius: 1.25rem;
    background: var(--df-white);
    box-shadow: var(--df-shadow);
}

.df-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.35rem 1.6rem;
    border-bottom: 1px solid var(--df-border-light);
    background: #fbfcfd;
}

.df-card-label {
    margin: 0 0 0.3rem;
    color: var(--df-teal-dark);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.df-step-instruction {
    margin: 0;
    color: var(--df-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.df-card-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.df-mode-badge,
.df-difficulty-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.df-mode-badge {
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
}

.df-difficulty-badge {
    background: #edf2f6;
    color: var(--df-navy);
}


/* =========================================================
   CURRENT PROBLEM
   ========================================================= */

.df-current-problem-area {
    padding: 2rem 1.6rem 1.75rem;
    text-align: center;
}

.df-problem-label {
    display: block;
    margin-bottom: 1rem;
    color: var(--df-muted);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.df-point-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.15rem;
}

.df-point-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    padding: 1.15rem 1.6rem;
    border: 2px solid var(--df-border);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--df-shadow-small);
}

.df-point-name {
    margin-bottom: 0.35rem;
    color: var(--df-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.df-point-value {
    color: var(--df-navy);
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
}

.df-point-label {
    margin-top: 0.35rem;
    color: var(--df-teal-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.df-point-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
    font-size: 1rem;
}


/* =========================================================
   COORDINATE MAPPING
   ========================================================= */

.df-coordinate-map {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 110px));
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.df-coordinate-map-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--df-border-light);
    border-radius: 0.65rem;
    background: #f8fafb;
}

.df-coordinate-map-item span {
    color: var(--df-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.df-coordinate-map-item strong {
    color: var(--df-navy);
    font-size: 1rem;
    font-weight: 800;
}


/* =========================================================
   FORMULA PANEL
   ========================================================= */

.df-formula-panel {
    margin: 0 1.6rem 1.6rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid #cfe5e5;
    border-radius: 1rem;
    background:
        linear-gradient(
            135deg,
            #f4fbfb 0%,
            #edf8f8 100%
        );
    text-align: center;
}

.df-formula-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--df-teal-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.df-formula,
.df-working-formula,
.df-reference-main-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--df-navy);
    font-weight: 700;
    white-space: nowrap;
}

.df-formula {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.df-formula-d {
    margin-right: 0.25em;
}


/* =========================================================
   CUSTOM RADICAL
   Keeps the radical bar attached to the full expression
   ========================================================= */

.df-radical {
    display: inline-flex;
    align-items: flex-start;
    position: relative;
}

.df-radical-symbol {
    display: inline-block;
    margin-right: -0.02em;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25em;
    font-weight: 400;
    line-height: 0.95;
    transform: translateY(0.05em);
}

.df-radicand {
    display: inline-flex;
    align-items: center;
    gap: 0.22em;
    min-height: 1.12em;
    padding: 0.08em 0.08em 0 0.08em;
    border-top: 0.075em solid currentColor;
    line-height: 1.1;
}

.df-formula-group {
    display: inline-flex;
    align-items: center;
}

.df-formula-group sup,
.df-radicand sup {
    position: relative;
    top: -0.25em;
    margin-left: 0.03em;
    font-size: 0.55em;
    line-height: 1;
}

.df-formula-plus {
    margin: 0 0.12em;
}

.df-formula-note {
    max-width: 680px;
    margin: 0.8rem auto 0;
    color: var(--df-muted);
    font-size: 0.83rem;
    line-height: 1.55;
}


/* =========================================================
   FIVE-STEP PROGRESS
   ========================================================= */

.df-step-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem 1.75rem;
}

.df-step-marker {
    display: flex;
    flex: 0 0 82px;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #8b99a5;
    text-align: center;
}

.df-step-marker > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid #d8e0e5;
    border-radius: 50%;
    background: #ffffff;
    color: #84929e;
    font-size: 0.82rem;
    font-weight: 800;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease;
}

.df-step-marker small {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
}

.df-step-marker.is-active > span {
    border-color: var(--df-teal);
    background: var(--df-teal);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(21, 154, 156, 0.11);
}

.df-step-marker.is-active small {
    color: var(--df-teal-dark);
}

.df-step-marker.is-complete > span {
    border-color: var(--df-green);
    background: var(--df-green);
    color: #ffffff;
}

.df-step-marker.is-complete small {
    color: var(--df-green-dark);
}

.df-step-connector {
    flex: 1 1 70px;
    max-width: 110px;
    height: 2px;
    margin-top: 16px;
    background: #dfe6ea;
}


/* =========================================================
   WORK AREA
   ========================================================= */

.df-work-area {
    padding: 2rem 1.6rem;
    border-top: 1px solid var(--df-border-light);
    background: #fbfcfd;
}

.df-work-step-number {
    margin: 0 0 0.35rem;
    color: var(--df-teal-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.df-work-area > h3 {
    margin: 0 0 0.45rem;
    color: var(--df-navy);
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 800;
}

.df-work-description {
    max-width: 780px;
    margin: 0 0 1.2rem;
    color: var(--df-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}


/* =========================================================
   CURRENT PROBLEM REMINDER
   ========================================================= */

.df-problem-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d5e8e8;
    border-left: 4px solid var(--df-teal);
    border-radius: 0.7rem;
    background: var(--df-teal-soft);
}

.df-reminder-label {
    color: var(--df-teal-dark);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.df-reminder-points {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    color: var(--df-text);
    font-size: 0.9rem;
}

.df-reminder-points strong {
    color: var(--df-navy);
}


/* =========================================================
   WORKBENCH
   ========================================================= */

.df-workbench {
    overflow: hidden;
    margin-bottom: 1.3rem;
    border: 1px solid var(--df-border);
    border-radius: 1rem;
    background: var(--df-white);
    box-shadow: var(--df-shadow-small);
}

.df-workbench-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--df-border-light);
    background: #f7f9fa;
}

.df-workbench-heading > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.df-workbench-label {
    color: var(--df-teal-dark);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-workbench-heading strong {
    color: var(--df-navy);
    font-size: 0.88rem;
    font-weight: 700;
}

.df-workbench-status {
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #eaf0f4;
    color: var(--df-muted);
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}


/* =========================================================
   LIVE WORKING FORMULA
   ========================================================= */

.df-working-formula {
    min-height: 118px;
    padding: 1.5rem 1rem;
    overflow-x: auto;
    font-size: clamp(1.4rem, 4vw, 2.15rem);
}

.df-formula-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25em;
    min-height: 1.25em;
    margin: 0 0.05em;
    padding: 0 0.12em;
    border-radius: 0.18em;
    color: var(--df-muted);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.df-formula-slot.is-active {
    background: #fff4cf;
    color: #8b6514;
    box-shadow: inset 0 0 0 1px #ecd588;
}

.df-formula-slot.is-complete {
    background: var(--df-green-soft);
    color: var(--df-green-dark);
}


/* =========================================================
   FORMULA EXPLANATION
   ========================================================= */

.df-formula-explanation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--df-border-light);
    background: #fbfcfd;
    color: var(--df-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

.df-formula-explanation svg,
.df-formula-explanation i {
    color: var(--df-teal);
}


/* =========================================================
   ANSWER FORMS
   ========================================================= */

.df-answer-form {
    max-width: 700px;
    margin: 1.3rem auto;
}

.df-input-label {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--df-navy);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
}

.df-two-value-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 0.8rem;
}

.df-value-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.df-value-input-group > span {
    color: var(--df-muted);
    font-size: 0.73rem;
    font-weight: 800;
    text-align: center;
}

.df-value-operator {
    padding-bottom: 0.72rem;
    color: var(--df-navy);
    font-size: 1.55rem;
    font-weight: 700;
}

.df-step-input {
    width: 100%;
    min-height: 50px;
    padding: 0.7rem 0.85rem;
    border: 2px solid var(--df-border);
    border-radius: 0.7rem;
    background: #ffffff;
    color: var(--df-navy);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.df-step-input:focus {
    border-color: var(--df-teal);
    box-shadow: 0 0 0 3px rgba(21, 154, 156, 0.12);
}

.df-step-input.is-correct {
    border-color: var(--df-green);
    background: var(--df-green-soft);
}

.df-step-input.is-incorrect {
    border-color: var(--df-red);
    background: var(--df-red-soft);
}

.df-input-row {
    display: flex;
    gap: 0.65rem;
}

.df-input-row .df-step-input {
    flex: 1;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.df-submit-button,
.df-next-button,
.df-secondary-button {
    border: 0;
    border-radius: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.df-submit-button {
    min-height: 50px;
    padding: 0.7rem 1.35rem;
    background: var(--df-teal);
    color: #ffffff;
    font-size: 0.9rem;
    box-shadow: 0 5px 14px rgba(21, 154, 156, 0.20);
}

.df-submit-button:hover {
    background: var(--df-teal-dark);
    transform: translateY(-1px);
}

.df-wide-submit {
    display: block;
    width: 100%;
    margin-top: 0.8rem;
}

.df-next-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 50px;
    padding: 0.7rem 1.4rem;
    background: var(--df-green);
    color: #ffffff;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.22);
}

.df-next-button:hover {
    background: var(--df-green-dark);
    transform: translateY(-1px);
}

.df-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--df-border);
    background: #ffffff;
    color: var(--df-navy);
    font-size: 0.8rem;
}

.df-secondary-button:hover {
    border-color: var(--df-teal);
    background: var(--df-teal-soft);
}

.df-submit-button:active,
.df-next-button:active,
.df-secondary-button:active {
    transform: translateY(1px);
}


/* =========================================================
   GRAPH
   ========================================================= */

.df-graph-shell {
    margin-top: 1.75rem;
    overflow: hidden;
    border: 1px solid var(--df-border);
    border-radius: 1rem;
    background: var(--df-white);
}

.df-graph-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--df-border-light);
    background: #f7f9fa;
}

.df-graph-heading > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.df-graph-label {
    color: var(--df-teal-dark);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-graph-heading strong {
    color: var(--df-navy);
    font-size: 0.86rem;
}

.df-distance-readout {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.df-graph-wrapper {
    padding: 1rem;
}

.df-graph {
    width: 100%;
    height: 460px;
    border: 1px solid var(--df-border-light) !important;
    border-radius: 0.75rem;
    background: #ffffff;
}

.df-graph-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 0.85rem;
}

.df-graph-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--df-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.df-legend-point {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.df-legend-point-one {
    background: var(--df-teal);
}

.df-legend-point-two {
    background: var(--df-navy);
}

.df-legend-line {
    display: inline-block;
    width: 22px;
    height: 3px;
    border-radius: 999px;
}

.df-legend-triangle {
    background: #8b99a5;
}

.df-graph-status-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--df-border-light);
}

.df-graph-status-card {
    padding: 0.9rem 1rem;
    text-align: center;
}

.df-graph-status-card + .df-graph-status-card {
    border-left: 1px solid var(--df-border-light);
}

.df-graph-status-card span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--df-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.df-graph-status-card strong {
    color: var(--df-navy);
    font-size: 1rem;
    font-weight: 800;
}


/* =========================================================
   FEEDBACK
   ========================================================= */

.df-feedback {
    margin: 0 1.6rem 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--df-border);
    border-radius: 0.7rem;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.55;
    text-align: center;
}

.df-feedback-neutral {
    background: #f7f9fa;
    color: var(--df-muted);
}

.df-feedback-correct {
    border-color: #b8ddc7;
    background: var(--df-green-soft);
    color: var(--df-green-dark);
}

.df-feedback-incorrect {
    border-color: #efc1c6;
    background: var(--df-red-soft);
    color: #a52834;
}


/* =========================================================
   ACTION ROW
   ========================================================= */

.df-action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 0 1.6rem 1.5rem;
}


/* =========================================================
   HINT PANEL
   ========================================================= */

.df-help-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 0 1.6rem 1.5rem;
    padding: 1rem;
    border: 1px solid #ead59b;
    border-radius: 0.8rem;
    background: var(--df-amber-soft);
}

.df-help-panel-icon {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff0c1;
    color: var(--df-amber);
}

.df-help-panel strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #76520f;
    font-size: 0.82rem;
}

.df-help-panel p {
    margin: 0;
    color: #735c2b;
    font-size: 0.83rem;
    line-height: 1.55;
}


/* =========================================================
   REFERENCE PANEL
   ========================================================= */

.df-reference-panel {
    margin: 0 1.6rem 1.6rem;
    overflow: hidden;
    border: 1px solid var(--df-border);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--df-shadow-small);
}

.df-reference-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--df-border-light);
    background: var(--df-navy);
}

.df-reference-panel-heading h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}

.df-close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
}

.df-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.df-reference-hero {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--df-border-light);
    background: var(--df-teal-soft);
    text-align: center;
}

.df-reference-label {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--df-teal-dark);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-reference-main-formula {
    font-size: clamp(1.35rem, 4vw, 2rem);
}

.df-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.df-reference-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--df-border-light);
}

.df-reference-item:nth-child(odd) {
    border-right: 1px solid var(--df-border-light);
}

.df-reference-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 0.65rem;
    border-radius: 0.6rem;
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
}

.df-reference-item > strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--df-navy);
    font-size: 0.9rem;
}

.df-reference-equation {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--df-teal-dark);
    font-size: 1rem;
    font-weight: 800;
}

.df-reference-item p {
    margin: 0;
    color: var(--df-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.df-reference-memory {
    padding: 1.15rem;
    background: #f8fafb;
}

.df-reference-memory > strong {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--df-navy);
    font-size: 0.84rem;
}

.df-memory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.df-memory-grid span {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--df-border-light);
    border-radius: 0.55rem;
    background: #ffffff;
    color: var(--df-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.df-reference-note {
    margin: 0;
    padding: 1rem 1.15rem;
    border-top: 1px solid var(--df-border-light);
    background: var(--df-amber-soft);
    color: #6f5a2b;
    font-size: 0.8rem;
    line-height: 1.6;
}


/* =========================================================
   PROBLEM COMPLETE
   ========================================================= */

.df-problem-complete {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 0 1.6rem 1.6rem;
    padding: 1.15rem;
    border: 1px solid #b7ddc6;
    border-radius: 1rem;
    background: var(--df-green-soft);
}

.df-problem-complete-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--df-green);
    font-size: 1.35rem;
}

.df-problem-complete-label {
    margin: 0 0 0.15rem;
    color: var(--df-green-dark);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-problem-complete h3 {
    margin: 0 0 0.2rem;
    color: var(--df-navy);
    font-size: 1.35rem;
    font-weight: 800;
}

.df-problem-complete p:last-child {
    margin: 0;
    color: #526b5c;
    font-size: 0.82rem;
    line-height: 1.5;
}


/* =========================================================
   STATS
   ========================================================= */

.df-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.df-stat {
    padding: 0.95rem;
    border: 1px solid var(--df-border-light);
    border-radius: 0.8rem;
    background: #ffffff;
    box-shadow: var(--df-shadow-small);
    text-align: center;
}

.df-stat span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--df-muted);
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
}

.df-stat strong {
    color: var(--df-navy);
    font-size: 1.3rem;
    font-weight: 800;
}


/* =========================================================
   RESULTS
   ========================================================= */

.df-results {
    margin-top: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--df-border);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--df-shadow);
    text-align: center;
}

.df-results-label {
    margin: 0 0 0.35rem;
    color: var(--df-teal-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-results h2 {
    margin: 0 0 0.5rem;
    color: var(--df-navy);
    font-weight: 800;
}

.df-results > p:not(.df-results-label) {
    color: var(--df-muted);
}

.df-results-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.4rem 0;
}

.df-result-item {
    padding: 1rem;
    border: 1px solid var(--df-border-light);
    border-radius: 0.7rem;
    background: #f8fafb;
}

.df-result-item span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--df-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.df-result-item strong {
    color: var(--df-navy);
    font-size: 1.25rem;
    font-weight: 800;
}


/* =========================================================
   INFO CARDS
   ========================================================= */

.df-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.df-info article {
    padding: 1.5rem;
    border: 1px solid var(--df-border-light);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--df-shadow-small);
}

.df-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    border-radius: 0.8rem;
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
    font-size: 1.1rem;
}

.df-info h2 {
    margin: 0 0 0.5rem;
    color: var(--df-navy);
    font-size: 1.05rem;
    font-weight: 800;
}

.df-info p {
    margin: 0;
    color: var(--df-muted);
    font-size: 0.87rem;
    line-height: 1.65;
}


/* =========================================================
   COMPLETE EXAMPLE
   ========================================================= */

.df-example-section {
    padding: 4rem 0;
    background: #f5f8fa;
}

.df-example-content {
    max-width: 940px;
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid var(--df-border);
    border-radius: 1.2rem;
    background: #ffffff;
    box-shadow: var(--df-shadow);
}

.df-example-heading {
    text-align: center;
}

.df-example-heading h2 {
    margin: 0 0 0.6rem;
    color: var(--df-navy);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
}

.df-example-heading > p:last-child {
    max-width: 680px;
    margin: 0 auto;
    color: var(--df-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.df-example-points {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.4rem 0 1rem;
}

.df-example-points span {
    padding: 0.6rem 0.85rem;
    border-radius: 0.65rem;
    background: var(--df-teal-soft);
    color: var(--df-navy);
    font-size: 0.9rem;
    font-weight: 800;
}

.df-example-formula {
    margin: 1rem 0 1.5rem;
    color: var(--df-navy);
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    font-weight: 700;
    text-align: center;
}

.df-example-steps {
    display: grid;
    gap: 0.65rem;
}

.df-example-step {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--df-border-light);
    border-radius: 0.75rem;
    background: #fbfcfd;
}

.df-example-step-number {
    display: flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--df-teal);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
}

.df-example-step > div {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.df-example-step-label {
    color: var(--df-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.df-example-step strong {
    color: var(--df-navy);
    font-size: 0.94rem;
}

.df-example-note {
    margin: 1rem 0 0;
    padding: 0.85rem;
    border-radius: 0.7rem;
    background: var(--df-green-soft);
    color: var(--df-green-dark);
    font-size: 0.88rem;
    text-align: center;
}


/* =========================================================
   SEO CONTENT
   ========================================================= */

.df-seo-section {
    padding: 4.5rem 0;
    background: #ffffff;
}

.df-seo-content {
    max-width: 940px;
    margin: 0 auto;
}

.df-seo-content h2 {
    margin: 0 0 1rem;
    color: var(--df-navy);
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
}

.df-seo-content h3 {
    margin: 2rem 0 0.55rem;
    color: var(--df-navy);
    font-size: 1.2rem;
    font-weight: 800;
}

.df-seo-content p {
    margin: 0 0 1rem;
    color: var(--df-muted);
    font-size: 0.94rem;
    line-height: 1.8;
}

.df-seo-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.2rem;
    margin-top: 2rem;
}

.df-resource-link {
    color: var(--df-teal-dark);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.df-resource-link:hover {
    color: var(--df-navy);
    text-decoration: underline;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991.98px) {

    .df-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .df-mode-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .df-mode-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .df-mode-help {
        text-align: left;
    }

    .df-stats,
    .df-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .df-info {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .df-section {
        padding: 3rem 1rem;
    }

    .df-toolbar {
        margin-bottom: 1.25rem;
    }

    .df-controls,
    .df-control-group,
    .df-select {
        width: 100%;
    }

    .df-mode-selector {
        padding: 0.9rem;
    }

    .df-mode-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .df-mode-button {
        min-height: 54px;
        padding: 0.55rem;
        font-size: 0.76rem;
    }

    .df-mode-button {
        flex-direction: column;
        gap: 0.25rem;
    }

    .df-card-top {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.1rem;
    }

    .df-card-badges {
        justify-content: flex-start;
    }

    .df-current-problem-area {
        padding: 1.5rem 1rem;
    }

    .df-point-pair {
        gap: 0.55rem;
    }

    .df-point-card {
        flex: 1;
        min-width: 0;
        padding: 0.9rem 0.6rem;
    }

    .df-point-separator {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }

    .df-point-value {
        font-size: 1.45rem;
    }

    .df-coordinate-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .df-formula-panel {
        margin: 0 1rem 1.4rem;
        padding: 1.15rem 0.65rem;
        overflow-x: auto;
    }

    .df-formula {
        min-width: max-content;
        padding: 0 0.4rem;
        font-size: 1.45rem;
    }

    .df-step-progress {
        padding: 0 0.6rem 1.4rem;
    }

    .df-step-marker {
        flex: 0 0 52px;
    }

    .df-step-marker > span {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }

    .df-step-marker small {
        font-size: 0.58rem;
    }

    .df-step-connector {
        min-width: 8px;
        margin-top: 14px;
    }

    .df-work-area {
        padding: 1.5rem 1rem;
    }

    .df-problem-reminder {
        align-items: flex-start;
        flex-direction: column;
    }

    .df-reminder-points {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .df-workbench-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .df-working-formula {
        justify-content: flex-start;
        min-height: 100px;
        padding: 1.35rem 0.9rem;
        font-size: 1.45rem;
    }

    .df-two-value-grid {
        gap: 0.4rem;
    }

    .df-step-input {
        min-width: 0;
        padding: 0.65rem 0.4rem;
    }

    .df-value-operator {
        padding-bottom: 0.65rem;
    }

    .df-input-row {
        flex-direction: column;
    }

    .df-input-row .df-submit-button {
        width: 100%;
    }

    .df-graph-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .df-graph-wrapper {
        padding: 0.65rem;
    }

    .df-graph {
	    width: 100%;
	    height: auto;
	    aspect-ratio: 1 / 1;
	}

    .df-graph-status-row {
        grid-template-columns: 1fr;
    }

    .df-graph-status-card + .df-graph-status-card {
        border-top: 1px solid var(--df-border-light);
        border-left: 0;
    }

    .df-feedback,
    .df-help-panel,
    .df-reference-panel,
    .df-problem-complete {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .df-action-row {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .df-action-row .df-secondary-button {
        flex: 1 1 calc(50% - 0.6rem);
    }

    .df-reference-grid {
        grid-template-columns: 1fr;
    }

    .df-reference-item:nth-child(odd) {
        border-right: 0;
    }

    .df-memory-grid {
        grid-template-columns: 1fr;
    }

    .df-problem-complete {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .df-problem-complete .df-next-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .df-example-content {
        padding: 1.4rem 1rem;
    }

    .df-example-points {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 479.98px) {

    .df-mode-tabs {
        grid-template-columns: 1fr;
    }

    .df-mode-button {
        flex-direction: row;
    }

    .df-point-pair {
        align-items: stretch;
        flex-direction: column;
    }

    .df-point-separator {
        align-self: center;
        transform: rotate(90deg);
    }

    .df-coordinate-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .df-step-progress {
        justify-content: space-between;
    }

    .df-step-marker {
        flex-basis: 44px;
    }

    .df-step-marker small {
        display: none;
    }

    .df-step-connector {
        flex-basis: auto;
    }

    .df-two-value-grid {
        grid-template-columns: 1fr;
    }

    .df-value-operator {
        padding: 0;
        text-align: center;
    }

    .df-action-row {
        flex-direction: column;
    }

    .df-action-row .df-secondary-button {
        width: 100%;
    }

    .df-stats,
    .df-results-grid {
        grid-template-columns: 1fr 1fr;
    }

}


/* =========================================================
   ACCESSIBILITY / REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .df-practice-page *,
    .df-practice-page *::before,
    .df-practice-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

}

.df-answer-input {
    line-height: 1.4;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.df-answer-input::placeholder {
    line-height: 1.4;
}

/* =========================================================
   INPUT SUBSCRIPT CLIPPING FIX
   ========================================================= */

.df-step-input {
    height: 54px;
    padding: 0 0.85rem;
    line-height: 54px;
}

.df-step-input::placeholder {
    line-height: 54px;
}

/* =========================================================
   INLINE DISTANCE FORMULA
   ========================================================= */

.df-inline-formula {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
    vertical-align: baseline;
}

.df-inline-formula .df-radical {
    font-size: 1em;
}