/* =========================================================
   PEMDAS PRACTICE PAGE
   ========================================================= */

:root
{
    --pd-navy: #102a43;
    --pd-navy-dark: #081c2f;
    --pd-blue: #1f6f8b;
    --pd-teal: #159a9c;
    --pd-teal-dark: #117b7d;
    --pd-green: #198754;
    --pd-red: #c0392b;
    --pd-orange: #d97706;
    --pd-purple: #6f42c1;
    --pd-light: #f5f8fb;
    --pd-lighter: #fbfcfe;
    --pd-border: #dbe5ee;
    --pd-text: #243b53;
    --pd-muted: #627d98;
    --pd-white: #ffffff;
    --pd-shadow: 0 18px 45px rgba(16, 42, 67, 0.12);
    --pd-shadow-small: 0 8px 24px rgba(16, 42, 67, 0.09);
}


/* =========================================================
   GENERAL PAGE STYLING
   ========================================================= */

.pemdas-practice-page
{
    background: var(--pd-white);
    color: var(--pd-text);
    font-family: "Inter", sans-serif;
}

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

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

.pemdas-practice-page button
{
    cursor: pointer;
}


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

.pd-section
{
    position: relative;
    padding: 5rem 1.5rem;
    background:
        radial-gradient(
            circle at top left,
            rgba(21, 154, 156, 0.08),
            transparent 32rem
        ),
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f5f8fb 100%
        );
}

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


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

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

.pd-toolbar-heading
{
    max-width: 650px;
}

.pd-toolbar-heading h2
{
    margin: 0 0 0.75rem;
    color: var(--pd-navy);
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    font-weight: 800;
    line-height: 1.15;
}

.pd-toolbar-heading p:last-child
{
    max-width: 620px;
    margin: 0;
    color: var(--pd-muted);
    font-size: 1rem;
    line-height: 1.7;
}

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

.pd-difficulty-control
{
    flex: 0 0 auto;
    min-width: 190px;
}

.pd-difficulty-control label
{
    display: block;
    margin-bottom: 0.45rem;
    color: var(--pd-navy);
    font-size: 0.85rem;
    font-weight: 700;
}

.pd-difficulty-select
{
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 2.5rem 0.7rem 0.95rem;
    border: 1px solid var(--pd-border);
    border-radius: 0.75rem;
    background-color: var(--pd-white);
    color: var(--pd-navy);
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    box-shadow: var(--pd-shadow-small);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.pd-difficulty-select:hover
{
    border-color: rgba(21, 154, 156, 0.6);
}

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


/* =========================================================
   PROGRESS BAR
   ========================================================= */

.pd-progress-area
{
    margin-bottom: 1.25rem;
}

.pd-progress-text
{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
    color: var(--pd-navy);
    font-size: 0.88rem;
    font-weight: 700;
}

.pd-progress-track
{
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe9f1;
}

.pd-progress-bar
{
    width: 10%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--pd-teal),
        var(--pd-blue)
    );
    transition: width 0.35s ease;
}


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

.pd-card
{
    padding: clamp(1.4rem, 4vw, 2.5rem);
    border: 1px solid rgba(219, 229, 238, 0.9);
    border-radius: 1.35rem;
    background: var(--pd-white);
    box-shadow: var(--pd-shadow);
}

.pd-card-top
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.pd-card-label
{
    margin: 0 0 0.3rem;
    color: var(--pd-navy);
    font-size: 0.95rem;
    font-weight: 800;
}

.pd-step-instruction
{
    margin: 0;
    color: var(--pd-muted);
    font-size: 0.92rem;
}

.pd-difficulty-badge
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(21, 154, 156, 0.11);
    color: var(--pd-teal-dark);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}


/* =========================================================
   EXPRESSION AREAS
   ========================================================= */

.pd-original-problem-area,
.pd-current-expression-area
{
    padding: 1.3rem;
    border-radius: 1rem;
}

.pd-original-problem-area
{
    margin-bottom: 1.25rem;
    border: 1px solid var(--pd-border);
    background: var(--pd-lighter);
}

.pd-current-expression-area
{
    margin: 1.25rem 0;
    border: 2px solid rgba(21, 154, 156, 0.25);
    background:
        linear-gradient(
            135deg,
            rgba(21, 154, 156, 0.08),
            rgba(31, 111, 139, 0.05)
        );
}

.pd-expression-label
{
    display: block;
    margin-bottom: 0.55rem;
    color: var(--pd-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pd-original-expression
{
    color: var(--pd-navy);
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
}

.pd-current-expression
{
    color: var(--pd-navy-dark);
    font-size: clamp(1.65rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.025em;
    overflow-wrap: anywhere;
}


/* =========================================================
   STEP HISTORY
   ========================================================= */

.pd-step-history-area
{
    padding: 1.25rem;
    border: 1px solid var(--pd-border);
    border-radius: 1rem;
    background: #ffffff;
}

.pd-step-history-heading
{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--pd-border);
    color: var(--pd-navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.pd-step-history-heading span:last-child
{
    color: var(--pd-muted);
    font-weight: 600;
}

.pd-step-history
{
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.pd-history-item
{
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    background: var(--pd-light);
}

.pd-history-number
{
    color: var(--pd-teal-dark);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pd-history-expression
{
    color: var(--pd-navy);
    font-size: 1rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pd-history-correct
{
    border-left: 4px solid var(--pd-green);
    background: rgba(25, 135, 84, 0.07);
}


/* =========================================================
   INPUT FORM
   ========================================================= */

.pd-step-form
{
    margin-top: 1.5rem;
}

.pd-input-label
{
    display: block;
    margin-bottom: 0.6rem;
    color: var(--pd-navy);
    font-size: 0.9rem;
    font-weight: 800;
}

.pd-input-row
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
}

.pd-step-input
{
    width: 100%;
    min-height: 56px;
    padding: 0.85rem 1rem;
    border: 2px solid var(--pd-border);
    border-radius: 0.85rem;
    background: var(--pd-white);
    color: var(--pd-navy-dark);
    font-size: 1.05rem;
    font-weight: 650;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.pd-step-input::placeholder
{
    color: #9aabba;
    font-weight: 500;
}

.pd-step-input:hover
{
    border-color: #b9cad8;
}

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

.pd-step-input.is-correct
{
    border-color: var(--pd-green);
    background: rgba(25, 135, 84, 0.045);
}

.pd-step-input.is-incorrect
{
    border-color: var(--pd-red);
    background: rgba(192, 57, 43, 0.045);
}

.pd-input-help
{
    margin: 0.6rem 0 0;
    color: var(--pd-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}


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

.pd-submit-button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0.85rem 1.4rem;
    border: 0;
    border-radius: 0.85rem;
    background: linear-gradient(
        135deg,
        var(--pd-teal),
        var(--pd-blue)
    );
    color: var(--pd-white);
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(21, 154, 156, 0.22);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.pd-submit-button:hover
{
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 12px 24px rgba(21, 154, 156, 0.28);
}

.pd-submit-button:active
{
    transform: translateY(0);
}

.pd-submit-button:focus-visible,
.pd-secondary-button:focus-visible,
.pd-close-button:focus-visible
{
    outline: 3px solid rgba(21, 154, 156, 0.25);
    outline-offset: 3px;
}

.pd-submit-button:disabled
{
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

.pd-action-row
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

.pd-secondary-button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--pd-border);
    border-radius: 0.7rem;
    background: var(--pd-white);
    color: var(--pd-navy);
    font-size: 0.82rem;
    font-weight: 750;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.pd-secondary-button svg
{
    width: 17px;
    height: 17px;
}

.pd-secondary-button:hover
{
    border-color: rgba(21, 154, 156, 0.55);
    background: rgba(21, 154, 156, 0.06);
    color: var(--pd-teal-dark);
    transform: translateY(-1px);
}

.pd-close-button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 42, 67, 0.07);
    color: var(--pd-navy);
}

.pd-close-button:hover
{
    background: rgba(16, 42, 67, 0.13);
}

.pd-close-button svg
{
    width: 18px;
    height: 18px;
}


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

.pd-feedback
{
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.55;
}

.pd-feedback-neutral
{
    border-color: var(--pd-border);
    background: var(--pd-light);
    color: var(--pd-muted);
}

.pd-feedback-correct
{
    border-color: rgba(25, 135, 84, 0.26);
    background: rgba(25, 135, 84, 0.08);
    color: #12633e;
}

.pd-feedback-incorrect
{
    border-color: rgba(192, 57, 43, 0.25);
    background: rgba(192, 57, 43, 0.07);
    color: #922b21;
}

.pd-feedback-warning
{
    border-color: rgba(217, 119, 6, 0.28);
    background: rgba(217, 119, 6, 0.08);
    color: #9a5204;
}


/* =========================================================
   HELP AND RULE PANELS
   ========================================================= */

.pd-help-panel,
.pd-rule-panel
{
    margin-top: 1rem;
    border-radius: 0.9rem;
}

.pd-help-panel
{
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(217, 119, 6, 0.22);
    background: rgba(217, 119, 6, 0.07);
}

.pd-help-panel[hidden],
.pd-rule-panel[hidden],
.pd-results[hidden]
{
    display: none !important;
}

.pd-help-panel-icon
{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(217, 119, 6, 0.14);
    color: var(--pd-orange);
}

.pd-help-panel-icon svg
{
    width: 19px;
    height: 19px;
}

.pd-help-panel strong
{
    display: block;
    margin-bottom: 0.2rem;
    color: #804000;
    font-size: 0.86rem;
}

.pd-help-panel p
{
    margin: 0;
    color: #855008;
    font-size: 0.85rem;
    line-height: 1.55;
}

.pd-rule-panel
{
    padding: 1.15rem;
    border: 1px solid rgba(111, 66, 193, 0.2);
    background: rgba(111, 66, 193, 0.055);
}

.pd-rule-panel-heading
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pd-rule-panel-heading h3
{
    margin: 0;
    color: var(--pd-navy);
    font-size: 1rem;
    font-weight: 800;
}

.pd-rule-list
{
    display: grid;
    gap: 0.55rem;
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    color: var(--pd-text);
    font-size: 0.86rem;
    line-height: 1.55;
}

.pd-rule-list strong
{
    color: var(--pd-purple);
}


/* =========================================================
   STATISTICS
   ========================================================= */

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

.pd-stat
{
    padding: 1.1rem;
    border: 1px solid var(--pd-border);
    border-radius: 0.95rem;
    background: var(--pd-white);
    text-align: center;
    box-shadow: var(--pd-shadow-small);
}

.pd-stat span
{
    display: block;
    min-height: 2.5em;
    margin-bottom: 0.45rem;
    color: var(--pd-muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
}

.pd-stat strong
{
    display: block;
    color: var(--pd-navy);
    font-size: 1.65rem;
    font-weight: 800;
}


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

.pd-results
{
    margin-top: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(21, 154, 156, 0.22);
    border-radius: 1.2rem;
    background:
        radial-gradient(
            circle at top right,
            rgba(21, 154, 156, 0.12),
            transparent 22rem
        ),
        var(--pd-white);
    text-align: center;
    box-shadow: var(--pd-shadow);
}

.pd-results-label
{
    margin: 0 0 0.5rem;
    color: var(--pd-teal-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pd-results h2
{
    margin: 0 0 0.65rem;
    color: var(--pd-navy);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
}

.pd-results > p:not(.pd-results-label)
{
    margin: 0 auto;
    max-width: 600px;
    color: var(--pd-muted);
    line-height: 1.65;
}

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

.pd-result-item
{
    padding: 1.1rem;
    border: 1px solid var(--pd-border);
    border-radius: 0.85rem;
    background: var(--pd-light);
}

.pd-result-item span
{
    display: block;
    min-height: 2.5em;
    margin-bottom: 0.4rem;
    color: var(--pd-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

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

.pd-result-accuracy
{
    border-color: rgba(21, 154, 156, 0.3);
    background: rgba(21, 154, 156, 0.08);
}


/* =========================================================
   INFORMATION CARDS
   ========================================================= */

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

.pd-info article
{
    padding: 1.7rem;
    border: 1px solid var(--pd-border);
    border-radius: 1rem;
    background: var(--pd-white);
    box-shadow: var(--pd-shadow-small);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.pd-info article:hover
{
    transform: translateY(-4px);
    border-color: rgba(21, 154, 156, 0.35);
    box-shadow: var(--pd-shadow);
}

.pd-info-icon
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    border-radius: 0.8rem;
    background: rgba(21, 154, 156, 0.1);
    color: var(--pd-teal-dark);
}

.pd-info-icon svg
{
    width: 21px;
    height: 21px;
}

.pd-info h2
{
    margin: 0 0 0.75rem;
    color: var(--pd-navy);
    font-size: 1.12rem;
    font-weight: 800;
}

.pd-info p
{
    margin: 0;
    color: var(--pd-muted);
    font-size: 0.91rem;
    line-height: 1.7;
}


/* =========================================================
   EXAMPLE SECTION
   ========================================================= */

.pd-example-section
{
    padding: 5rem 0;
    background: var(--pd-navy);
    color: var(--pd-white);
}

.pd-example-content
{
    width: min(100%, 840px);
    margin: 0 auto;
}

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

.pd-example-heading .pd-eyebrow
{
    color: #6dd8d9;
}

.pd-example-heading h2
{
    margin: 0 0 0.85rem;
    color: var(--pd-white);
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    font-weight: 800;
}

.pd-example-heading p
{
    margin: 0;
    color: #c8d8e5;
}

.pd-example-expression
{
    margin: 2rem auto;
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.07);
    color: var(--pd-white);
    font-size: clamp(1.65rem, 5vw, 2.35rem);
    font-weight: 800;
    text-align: center;
}

.pd-example-steps
{
    display: grid;
    gap: 0.9rem;
}

.pd-example-step
{
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.055);
}

.pd-example-step-number
{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--pd-teal);
    color: var(--pd-white);
    font-weight: 800;
}

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

.pd-example-step-label
{
    color: #a9bfd0;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pd-example-step strong
{
    color: var(--pd-white);
    font-size: 1.15rem;
}

.pd-example-note
{
    margin: 1.5rem 0 0;
    color: #c8d8e5;
    font-size: 0.9rem;
    line-height: 1.7;
    text-align: center;
}


/* =========================================================
   SEO SECTION
   ========================================================= */

.pd-seo-section
{
    padding: 5rem 0;
    background: var(--pd-white);
}

.pd-seo-content
{
    width: min(100%, 860px);
    margin: 0 auto;
}

.pd-seo-content h2
{
    margin: 0 0 1rem;
    color: var(--pd-navy);
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    font-weight: 800;
    line-height: 1.2;
}

.pd-seo-content h3
{
    margin: 2.2rem 0 0.75rem;
    color: var(--pd-navy);
    font-size: 1.3rem;
    font-weight: 800;
}

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

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

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

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


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes pdShake
{
    0%,
    100%
    {
        transform: translateX(0);
    }

    25%
    {
        transform: translateX(-5px);
    }

    50%
    {
        transform: translateX(5px);
    }

    75%
    {
        transform: translateX(-3px);
    }
}

@keyframes pdPop
{
    0%
    {
        transform: scale(0.97);
        opacity: 0.5;
    }

    100%
    {
        transform: scale(1);
        opacity: 1;
    }
}

.pd-shake
{
    animation: pdShake 0.3s ease;
}

.pd-pop
{
    animation: pdPop 0.25s ease;
}


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

@media (max-width: 900px)
{
    .pd-toolbar
    {
        align-items: stretch;
        flex-direction: column;
        gap: 1.25rem;
    }

    .pd-difficulty-control
    {
        width: 100%;
        max-width: 320px;
    }

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

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


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

@media (max-width: 600px)
{
    .pd-section
    {
        padding: 3.5rem 1rem;
    }

    .pd-card
    {
        padding: 1.15rem;
        border-radius: 1rem;
    }

    .pd-card-top
    {
        flex-direction: column;
    }

    .pd-input-row
    {
        grid-template-columns: 1fr;
    }

    .pd-submit-button
    {
        width: 100%;
    }

    .pd-action-row
    {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pd-secondary-button
    {
        width: 100%;
    }

    .pd-history-item
    {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .pd-step-history-heading
    {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .pd-stats,
    .pd-results-grid
    {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .pd-stat,
    .pd-result-item
    {
        padding: 0.9rem 0.65rem;
    }

    .pd-stat strong,
    .pd-result-item strong
    {
        font-size: 1.35rem;
    }

    .pd-info
    {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .pd-example-section,
    .pd-seo-section
    {
        padding: 4rem 0;
    }

    .pd-example-step
    {
        align-items: flex-start;
    }

    .pd-seo-links
    {
        align-items: stretch;
        flex-direction: column;
    }

    .pd-seo-links .btn
    {
        width: 100%;
    }

    .pd-resource-link
    {
        text-align: center;
    }
}


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

@media (max-width: 390px)
{
    .pd-stats,
    .pd-results-grid
    {
        grid-template-columns: 1fr;
    }

    .pd-original-problem-area,
    .pd-current-expression-area,
    .pd-step-history-area
    {
        padding: 1rem;
    }

    .pd-current-expression
    {
        font-size: 1.5rem;
    }
}


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

@media (prefers-reduced-motion: reduce)
{
    .pemdas-practice-page *,
    .pemdas-practice-page *::before,
    .pemdas-practice-page *::after
    {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}