/* Developer savings calculator. Ledger on black. Not the providers estimator. */

.save-est,
.save-est__result--summary {
    --save-paper: #f3f1ea;
    --save-ink: #0a0a0a;
    --save-mute: rgba(10, 10, 10, 0.82);
    --save-faint: rgba(10, 10, 10, 0.7);
    --save-rule: rgba(17, 17, 17, 0.16);
    --save-fill: rgba(17, 17, 17, 0.05);
}

.save-est {
    scroll-margin-top: 5.5rem;
    position: relative;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--layout-gutter);
    background: var(--color-black);
    color: var(--save-ink);
    color-scheme: light;
}

.save-est__inner {
    max-width: var(--layout-max);
    margin: 0 auto;
}

.save-est__sheet {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vw, 2.25rem);
    padding: clamp(1.35rem, 3.2vw, 2.35rem);
    background: var(--save-paper);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.save-est__intro {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--save-ink);
}

.save-est__intro .eyebrow {
    color: var(--save-ink);
}

.save-est__intro h2 {
    font-family: var(--font-brand);
    font-size: clamp(1.85rem, 3.6vw, 2.85rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: var(--save-ink);
}

.save-est__intro .lede {
    margin-top: 0.45rem;
    max-width: 34rem;
    color: var(--save-mute);
}

.save-est__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 0;
    align-items: stretch;
    border: 1px solid var(--save-rule);
}

.save-est__pane {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding: clamp(1rem, 2.2vw, 1.4rem);
    background: transparent;
    cursor: pointer;
    transition: background 0.25s var(--ease-out-expo);
}

.save-est__pane:first-child {
    border-right: 1px solid var(--save-rule);
}

.save-est__pane:not(.is-active) {
    opacity: 0.72;
}

.save-est__pane.is-active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.35);
    cursor: default;
}

.save-est__pane-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.save-est__radio {
    flex-shrink: 0;
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.2rem;
    border: 1px solid var(--save-ink);
    background: transparent;
}

.save-est__pane.is-active .save-est__radio {
    background: var(--save-ink);
}

.save-est__pane-title {
    display: block;
    font-family: var(--font-meta);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--save-ink);
}

.save-est__pane-desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--save-mute);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-body);
    font-weight: 400;
}

.save-est__controls {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.save-est__scenarios {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.save-est__scenario {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0.8rem 0;
    border: 0;
    border-bottom: 1px solid var(--save-rule);
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.save-est__scenario:first-child {
    border-top: 1px solid var(--save-rule);
}

.save-est__scenario:hover {
    background: var(--save-fill);
}

.save-est__scenario.is-selected {
    background: var(--save-ink);
    color: var(--save-paper);
    border-color: var(--save-ink);
    margin: 0 -0.15rem;
    padding-inline: 0.7rem;
}

.save-est__scenario strong {
    font-size: 0.9375rem;
    font-weight: 500;
    color: inherit;
}

.save-est__scenario span {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: inherit;
    opacity: 0.84;
}

.save-est__scenario.is-selected span {
    opacity: 0.88;
}

.save-est__field {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

#save-est-model-field,
#save-est-provider-field {
    z-index: 5;
}

#save-est-model-field.is-open,
#save-est-provider-field.is-open {
    z-index: 8;
}

.save-est__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-family: var(--font-meta);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--save-ink);
}

.save-est__label b {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-transform: none;
    font-variant-numeric: tabular-nums;
    color: var(--save-ink);
}

.save-est__multi {
    position: relative;
}

.save-est__select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0 2.35rem 0 0;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--save-ink);
    text-align: left;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23111111' stroke-width='1.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.15rem center;
    background-size: 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--save-ink);
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.save-est__select--search {
    padding-right: 3rem;
    cursor: text;
}

.save-est__select--search::placeholder {
    color: rgba(10, 10, 10, 0.55);
}

.save-est__select:focus,
.save-est__select:focus-visible {
    outline: none;
    border-bottom-width: 2px;
}

.save-est__select--multi {
    display: flex;
    align-items: center;
}

#save-est-model-field.is-open .save-est__select,
#save-est-provider-field.is-open .save-est__select {
    border-bottom-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 7.5L6 4l3.5 3.5' stroke='%23111111' stroke-width='1.2'/%3E%3C/svg%3E");
}

.save-est__dropdown {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: -0.7rem;
    right: -0.7rem;
    max-height: min(28rem, 70vh);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem 0;
    border: 1px solid var(--save-ink);
    border-radius: 0;
    background: var(--save-paper);
    box-shadow: 8px 12px 0 rgba(0, 0, 0, 0.08);
}

.save-est__dropdown-bar {
    display: flex;
    gap: 0.85rem;
    padding: 0.25rem 0.85rem 0.55rem;
    border-bottom: 1px solid var(--save-rule);
    margin-bottom: 0.2rem;
}

.save-est__dropdown-action {
    appearance: none;
    border: 0;
    padding: 0;
    background: none;
    font-family: var(--font-meta);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--save-ink);
    cursor: pointer;
}

.save-est__dropdown-action:hover {
    text-decoration: underline;
}

.save-est__option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
}

.save-est__option:hover,
.save-est__option:has(input:checked),
.save-est__option--btn.is-picked {
    background: var(--save-fill);
}

.save-est__option input {
    margin-top: 0.15rem;
    accent-color: var(--save-ink);
}

.save-est__option strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--save-ink);
}

.save-est__option em {
    display: block;
    margin-top: 0.15rem;
    font-style: normal;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--save-mute);
}

.save-est__option--btn {
    display: block;
    width: 100%;
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
}

.save-est__option--static {
    cursor: default;
}

.save-est__option--static:hover {
    background: transparent;
}

.save-est__clear {
    position: absolute;
    top: 50%;
    right: 1.55rem;
    z-index: 2;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--save-mute);
    font-size: 1.05rem;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.save-est__clear:hover {
    color: var(--save-ink);
}

.save-est__hint {
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--save-faint);
}

.save-est__gate {
    margin: 0;
    padding: 0.65rem 0 0.15rem;
    border-top: 1px dashed var(--save-rule);
    color: var(--save-ink);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.save-est__range {
    width: 100%;
    height: 1.5rem;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.save-est__range::-webkit-slider-runnable-track {
    height: 1px;
    background: var(--save-ink);
}

.save-est__range::-moz-range-track {
    height: 1px;
    background: var(--save-ink);
}

.save-est__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -5.5px;
    border-radius: 0;
    background: var(--save-ink);
    border: none;
    cursor: pointer;
}

.save-est__range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 0;
    background: var(--save-ink);
    border: none;
    cursor: pointer;
}

.save-est__disclaimer {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.55;
    color: var(--save-faint);
}

.save-est__summary-slot {
    display: none;
}

.save-est__result--summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: var(--save-ink);
    color: var(--save-paper);
    border: 0;
    border-radius: 0;
}

.save-est__result--summary.is-docked {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    width: min(calc(100% - (2 * var(--layout-gutter))), var(--layout-max));
    margin: 0;
    transform: translateX(-50%) translateY(110%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
    transition:
        transform 0.4s var(--ease-out-expo),
        opacity 0.3s ease,
        visibility 0.3s;
}

.save-est__result--summary.is-docked.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.save-est__summary-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.65rem 1.15rem;
    min-width: 0;
    flex: 1;
    overflow: visible;
}

.save-est__summary-figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    flex-shrink: 0;
}

.save-est__result-label {
    font-family: var(--font-meta);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(243, 241, 234, 0.55);
}

.save-est__result-value {
    display: inline-block;
    font-family: var(--font-brand);
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--save-paper);
    font-variant-numeric: tabular-nums;
}

.save-est__result-value.is-updating {
    animation: save-est-value-tick 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes save-est-value-tick {
    0% {
        opacity: 0.25;
        transform: translateY(-0.25em);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.save-est__result-sub {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: rgba(243, 241, 234, 0.62);
}

.save-est__summary-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.65rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: rgba(243, 241, 234, 0.58);
}

.save-est__summary-meta span:not(:last-child)::after {
    content: "/";
    margin-left: 0.65rem;
    color: rgba(243, 241, 234, 0.28);
}

.save-est__cta {
    flex-shrink: 0;
    align-self: center;
    margin-top: 0;
}

@media screen and (max-width: 860px) {
    .save-est__grid {
        grid-template-columns: 1fr;
    }

    .save-est__pane:first-child {
        border-right: 0;
        border-bottom: 1px solid var(--save-rule);
    }
}

@media screen and (max-width: 768px) {
    .save-est__result--summary {
        flex-wrap: wrap;
        padding: 0.9rem 1rem;
    }

    .save-est__summary-main {
        flex-wrap: wrap;
        width: 100%;
    }

    .save-est__result-sub {
        flex-basis: 100%;
        white-space: normal;
    }

    .save-est__summary-meta {
        flex-wrap: wrap;
    }

    .save-est__cta,
    .save-est__result--summary .save-est__cta {
        align-self: stretch;
        width: 100%;
        justify-content: center;
    }
}
