.algebra-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;

    animation: pageEnter 500ms ease both;
}

.algebra-header {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-bottom: 24px;
}

.algebra-header .logo {
    color: var(--blue);

    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.6px;

    text-decoration: none;
}

.algebra-header > div {
    border-left: 1px solid var(--border);
    padding-left: 18px;
}

.algebra-header h1 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.algebra-header p {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 13px;
}

.algebra-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 14px;
}

.algebra-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 20px;

    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 22px;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-header p {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 13px;
}

.algebra-card > label {
    display: block;

    margin-bottom: 7px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 500;
}

.equation-input-wrapper {
    display: flex;
    gap: 8px;
}

#equationInput {
    min-width: 0;
    flex: 1;

    height: 46px;

    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 0 12px;

    background: var(--background);
    color: var(--text);

    font-family: inherit;
    font-size: 15px;

    outline: none;

    transition:
        border-color var(--transition),
        background-color var(--transition);
}

#equationInput::placeholder {
    color: var(--text-muted);
}

#equationInput:focus {
    border-color: var(--blue);
}

#solveButton {
    height: 46px;

    border: 1px solid var(--blue);
    border-radius: 8px;

    padding: 0 18px;

    background: var(--blue);
    color: white;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color var(--transition),
        border-color var(--transition);
}

#solveButton:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
}

.equation-result {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 18px;
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--background);
}

.result-label {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#solution {
    color: var(--text);

    font-size: 18px;
    font-weight: 500;
}

.examples {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.example {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 7px;

    padding: 11px 12px;

    background: transparent;
    color: var(--text-secondary);

    font-family: inherit;
    font-size: 13px;

    text-align: left;

    cursor: pointer;

    transition:
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.example:hover {
    background: var(--surface-hover);
    border-color: var(--blue);
    color: var(--text);
}

@media (max-width: 700px) {
    .algebra-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    body {
        padding: 24px 12px;
    }

    .algebra-header {
        gap: 12px;
    }

    .algebra-header .logo {
        font-size: 21px;
    }

    .algebra-header > div {
        padding-left: 12px;
    }

    .algebra-header h1 {
        font-size: 18px;
    }

    .equation-input-wrapper {
        flex-direction: column;
    }

    #solveButton {
        width: 100%;
    }
}
