/* =========================
   Slope converter
   ========================= */

.slope-card,
.slope-card * {
    box-sizing: border-box;
}

.slope-card {
    width: min(100%, 760px);
    margin: 1.5rem auto;
    padding: 1.25rem;
    border: 1px solid #d7dbe0;
    border-radius: 16px;
    background: #f8f9fb;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.slope-card__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.2;
}

.slope-card__intro {
    margin: 0 0 1.25rem;
    color: #4b5563;
    line-height: 1.55;
}

.slope-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.slope-form__equal {
    align-self: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b7280;
    padding-bottom: 0.15rem;
}

.slope-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.slope-field__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.slope-field__control {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.85rem;
    border: 1px solid #cfd6de;
    border-radius: 12px;
    background: #fff;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.slope-field__control:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.slope-field input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: #111827;
    padding: 0.7rem 0;
}

.slope-field input::placeholder {
    color: #9ca3af;
}

.slope-field__unit {
    flex: 0 0 auto;
    margin-left: 0.6rem;
    font-weight: 700;
    color: #4b5563;
}

.slope-canvas-wrap {
    overflow: auto;
    padding: 0.5rem;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    background: #fff;
}

.slope-canvas-wrap canvas {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 0 auto;
    border: 1px solid #d9e0e7;
    border-radius: 10px;
    background: #fff;
}

/* Mobile */
@media (max-width: 640px) {
    .slope-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .slope-form {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .slope-form__equal {
        justify-self: center;
        padding-bottom: 0;
    }

    .slope-canvas-wrap {
        padding: 0.35rem;
    }
}