/* Salary to Hourly — layout + CLS reserves (visual tokens from salary-calculator.css) */

@media (max-width: 1023px) {
    /* Inputs → results → actions (natural mobile flow) */
    .sth-inputs { order: 1; }
    .sth-hero { order: 2; }
    .sth-breakdown { order: 3; }
    .sth-actions { order: 4; }
    .sth-calc { order: 5; }
    .sth-comp { order: 6; }

    .sth-page-pad {
        padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
    }

    .sth-overtime-label {
        padding-right: 0;
    }

    .sth-hero,
    .sth-breakdown {
        min-height: 0;
    }
}

.sth-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sth-hero { order: 1; }
.sth-inputs { order: 2; }
.sth-breakdown { order: 3; }
.sth-calc { order: 4; }
.sth-comp { order: 5; }
.sth-actions { order: 6; }

.sth-days-switch.sal-mode-switch {
    display: flex;
    width: 100%;
}

.sth-days-switch .sal-mode-btn {
    flex: 1 1 0;
    min-width: 0;
}

.sal-hero-value,
.sth-breakdown-val,
.sth-comp-val,
.sth-mobile-bar-value {
    font-variant-numeric: tabular-nums;
}

.sth-hero-summary {
    min-height: 2.5rem;
}

@media (min-width: 1024px) {
    .sth-hero {
        min-height: 9.5rem;
    }

    .sth-breakdown {
        min-height: 12.5rem;
    }
}

.sth-inputs #panel-hourly.hidden,
.sth-inputs #panel-freelancer.hidden,
.sth-inputs #panel-salary.hidden {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

.sth-breakdown-row td {
    min-height: 2.25rem;
    vertical-align: middle;
}

.sth-breakdown-val {
    min-width: 5.5rem;
}

.sth-comp-tile {
    min-height: 4.5rem;
}

.sth-comp-val {
    min-height: 1.25rem;
}

@media (min-width: 1024px) {
    .sth-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "inputs hero"
            "inputs breakdown"
            "inputs actions"
            "calc comp";
        gap: 1.5rem;
        align-items: start;
    }

    .sth-inputs {
        grid-area: inputs;
        align-self: start;
    }

    @media (min-height: 769px) {
        .sth-inputs {
            position: sticky;
            top: 6rem;
            max-height: calc(100vh - 7rem);
            overflow-y: auto;
            overscroll-behavior: contain;
        }
    }

    .sth-hero { grid-area: hero; order: unset; }
    .sth-breakdown { grid-area: breakdown; order: unset; }
    .sth-actions { grid-area: actions; order: unset; }
    .sth-calc { grid-area: calc; order: unset; align-self: start; }
    .sth-comp { grid-area: comp; order: unset; align-self: start; }

    .sth-calc.sth-calc--solo {
        grid-column: 1 / -1;
        max-width: 42rem;
    }
}

.sth-mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fin-text-muted, #64748b);
}

html.dark .sth-mobile-bar {
    background: rgba(18, 18, 20, 0.94);
    border-top-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.sth-mobile-bar.is-visible {
    visibility: visible;
    opacity: 1;
}

.sth-mobile-bar-value {
    font-size: 1.125rem;
    font-weight: 800;
    min-width: 6.5rem;
    text-align: right;
    color: var(--fin-text, #0f172a);
}

html.dark .sth-mobile-bar-value {
    color: #f8fafc;
}

@media (min-width: 1024px) {
    .sth-mobile-bar {
        display: none !important;
    }
}

.sth-actions .fin-action-btn i {
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.sth-quick-stat p {
    margin: 0;
}
