.fraction-hero {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), #ffffff);
}

.fraction-hero h1 {
    letter-spacing: -0.02em;
}

.max-w-760 {
    max-width: 760px;
}

.max-w-820 {
    max-width: 820px;
}

.quick-note {
    background: rgba(13, 110, 253, 0.07);
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.calculator-sticky {
    position: sticky;
    top: 12px;
    z-index: 1;
}

.fraction-input-group {
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.fraction-symbol {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.12);
    color: #084298;
    font-weight: 700;
}

.operation-row {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.fraction-display {
    width: min(15rem, 100%);
    min-height: 9rem;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.08), rgba(255, 255, 255, 0.9));
    color: #0b3d91;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.fraction-rule {
    width: 5.5rem;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.fraction-result-mark {
    padding: 0.65rem 0.8rem;
    border-radius: 0.9rem;
    background: rgba(13, 110, 253, 0.08);
    color: #084298;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 700;
}

.metric-card {
    min-height: 106px;
    padding: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    background: #fff;
}

.metric-card [data-result-key] {
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.formula-box {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.step-number {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.12);
    color: #084298;
    font-weight: 700;
}

.table th,
.table td {
    min-width: 9rem;
}

.table th {
    white-space: nowrap;
}

button,
select,
input {
    touch-action: manipulation;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.35);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .calculator-sticky {
        position: static;
        top: auto;
    }
}

@media (max-width: 575.98px) {
    .fraction-display {
        min-height: 7.5rem;
    }

    .fraction-input-group {
        padding: 0.85rem !important;
    }
}

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