/* Färskalkylatorn — mobile first */
:root {
    --forest: #22302e;
    --moss: #3f4946;
    --yellow: #f8e270;
    --green: #79be79;
    --jade: #c0dca4;
    --spring: #e8f0cb;
    --white: #fffffe;
    --radius: 8px;
    --input-height: 45px;
    --field-font-size: 18px;
    --calculator-offset: 12rem;
    --calculator-footer-h: 10rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.site-body {
    margin: 0;
    font-family: 'MessinaSans', system-ui, -apple-system, sans-serif;
    background: var(--forest);
    color: var(--white);
    line-height: 1.45;
}


.site-wrap {
    max-width: 520px;
    margin: 0 auto;
}

h1, h2, h3, .hero__title, .section__label, .meats-heading, .mix__title, .results-header {
    font-family: 'FKRomanStandard', Georgia, serif;
    font-weight: 600;
}

.hero {
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    padding: 1rem 1rem 1.25rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(34, 48, 46, 0.2) 0%, rgba(34, 48, 46, 0.55) 100%),
        url('../../_resources/images/header-bg.jpg');
    background-size: cover;
    background-position: center;
}

.hero__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    width: 100%;
}

.hero__logo-img {
    display: block;
    flex-shrink: 0;
    height: 58px;
    width: auto;
}

.hero__title {
    margin: 0;
    min-width: 0;
    font-size: 1.875rem;
    line-height: 1.1;
    color: var(--white);
    font-weight: inherit;
}

.hero__title-part--strong {
    font-weight: 600;
}

.hero__title-part--light {
    font-weight: 300;
}

.hero-banner {
    background: var(--moss);
    padding: 1rem;
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
}

.hero-banner__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--white);
}

.section {
    padding: 1rem 1rem 1.25rem;
}

.section--forest {
    background: var(--forest);
}

.intro {
    text-align: center;
    margin-bottom: 1rem;
}

.link-more {
    color: var(--yellow);
    text-decoration: none;
    font-weight: 600;
}

.intro__hint {
    margin: 0;
    opacity: 0.95;
}

.section__label {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--white);
}

.field-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.field-row--amount {
    align-items: center;
}

.field-row--stack {
    flex-direction: column;
    align-items: stretch;
}

.field-row__label {
    flex: 0 0 38%;
    max-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius);
    font-size: var(--field-font-size);
    font-weight: 600;
}

.field-row__label--moss {
    background: var(--moss);
}

.field-row__label--yellow {
    background: var(--yellow);
    color: var(--forest);
}

.field-row__label--green {
    background: var(--green);
    color: var(--forest);
}

.field-pills {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.field-pills .field-pill {
    display: contents;
}

.field-pills > :nth-child(1) {
    border-radius: var(--radius) 0 0 0;
}

.field-pills > :nth-child(2) {
    border-radius: 0 var(--radius) 0 0;
    overflow: hidden;
}

.field-pills > :nth-child(3) {
    border-radius: 0 0 0 var(--radius);
}

.field-pills > :nth-child(4) {
    border-radius: 0 0 var(--radius) 0;
    overflow: hidden;
}

.field-pill {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0.65rem;
}

.field-pill__label {
    flex: 0 1 50%;
    min-width: 0;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius) 0 0 var(--radius);
    font-family: 'FKRomanStandard', Georgia, serif;
    font-size: var(--field-font-size);
    font-weight: 600;
}

.field-pill__label--moss {
    background: var(--moss);
}

.field-pill__control {
    flex: 1 1 50%;
    min-width: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.field-pills .field-pill__label,
.field-pills .field-pill__control {
    flex: none;
    max-width: none;
}

.field-pills .field-pill__label {
    min-height: var(--input-height);
}

.field-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.65rem;
}

.field-stack__label {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: var(--field-font-size);
    font-weight: 600;
}

.field-stack__label--yellow {
    background: var(--yellow);
    color: var(--forest);
}

.field-stack__label--green {
    background: var(--green);
    color: var(--forest);
}

.field-stack__control {
    width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.field-stack .field-stack__control.input {
    border-radius: 0 0 var(--radius) var(--radius);
}

.field-stack .field-stack__control.stepper--infield {
    width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
}

.input {
    box-sizing: border-box;
    border: none;
    border-radius: var(--radius);
    height: var(--input-height);
    min-height: var(--input-height);
    padding: 0 0.65rem;
    font-size: var(--field-font-size);
    line-height: var(--input-height);
    color: var(--forest);
    background: var(--white);
    width: 100%;
}

.input--center,
select.input {
    text-align: center;
    text-align-last: center;
}

.input--white {
    background: var(--white);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
}

.stepper__btn {
    border: none;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    line-height: 1;
    background: rgba(255, 255, 254, 0.15);
    color: var(--white);
    cursor: pointer;
}

.stepper__btn:active {
    transform: scale(0.96);
}

.stepper--infield {
    gap: 0;
    box-sizing: border-box;
    height: var(--input-height);
    min-height: var(--input-height);
    max-height: var(--input-height);
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0 0.5rem;
}

.field-stack .stepper--infield {
    border-radius: 0 0 var(--radius) var(--radius);
}

.field-pills > .stepper--infield {
    border-radius: 0 0 var(--radius) 0;
}

.stepper--infield .input {
    flex: 1;
    align-self: stretch;
    min-width: 0;
    height: auto;
    min-height: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 0.25rem;
    line-height: var(--input-height);
}

.stepper--infield .stepper__btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
    background: var(--white);
    color: var(--forest);
    border: 1px solid var(--forest);
    border-radius: 50%;
}

.meats-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.65rem;
    background: var(--moss);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.meats-grid .meats-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
    text-align: center;
    color: var(--white);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.meats-grid .field-stack {
    margin-bottom: 0;
    min-width: 0;
    min-height: 100%;
    align-self: stretch;
}

.meats-grid .field-stack__label {
    flex: 0 0 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.meats-grid .field-stack__control,
.meats-grid .field-stack > .modal-select {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--input-height);
    margin-top: 0;
}

.meats-grid .field-stack .stepper--infield {
    height: auto;
    max-height: none;
    align-self: stretch;
    width: 100%;
}

.mix {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.65rem;
    row-gap: 0.25rem;
    align-items: center;
    padding: 0.5rem 0 0.25rem;
}

.mix--compact {
    padding-top: 0.35rem;
}

.mix__title {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.mix__icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    justify-self: center;
}

.mix__icon--animal {
    grid-column: 1;
    grid-row: 1;
}

.mix__icon--plant {
    grid-column: 3;
    grid-row: 1;
}

.mix__pct {
    font-weight: 700;
    font-size: 26px;
    line-height: 1;
    text-align: center;
    justify-self: center;
}

.mix__pct--animal {
    grid-column: 1;
    grid-row: 2;
    color: var(--yellow);
}

.mix__pct--plant {
    grid-column: 3;
    grid-row: 2;
    color: var(--green);
}

.mix__range {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 0;
    align-self: center;
    height: 30px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.mix__range::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 254, 0.25);
}

.mix__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -12.5px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

.mix__range:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.mix__range::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 254, 0.25);
}

.mix__range::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

.mix__range:active::-moz-range-thumb {
    cursor: grabbing;
}

.section--cta {
    text-align: center;
    padding-top: 0.5rem;
}

.site-wrap .btn {
    border: none;
    cursor: pointer;
    font: inherit;
}

.site-wrap .btn--pill {
    border-radius: 999px;
    padding: 0.85rem 1.75rem;
    font-weight: 700;
    width: 100%;
    max-width: 320px;
}

.site-wrap .btn--primary {
    background: var(--white);
    color: var(--forest);
}

.site-wrap .btn--ghost {
    background: var(--white);
    color: var(--forest);
    margin-top: 0.5rem;
}

/* Calculator layout */
.calculator {
    display: flex;
    flex-direction: column;
}

.calculator--fill-available {
    min-height: calc(100dvh - var(--calculator-offset));
}

.calculator--fill-available .calculator__footer {
    margin-top: auto;
}

.calculator__stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.calculator__main {
    display: grid;
    grid-template: 1fr / 1fr;
}

.calculator__inputs,
.calculator__results {
    grid-area: 1 / 1;
    min-width: 0;
}

.calculator__inputs .section:last-child {
    padding-bottom: 0.5rem;
}

.calculator__results {
    background: var(--forest);
}

@media (max-width: 899px) {
    .calculator__results {
        display: none;
    }

    .calculator--results-open .calculator__inputs {
        display: none;
    }

    .calculator--results-open .calculator__results {
        display: block;
    }
}

.calculator__footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--forest);
}

.calculator__mix {
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
    border-top: 1px solid rgba(255, 255, 254, 0.12);
}

.calculator__cta {
    padding-top: 0;
}

.calculator__disclaimer {
    margin: 0;
    padding: 0.5rem 1rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
    opacity: 0.75;
}

.calculator__brand {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1rem;
}

.calculator__brand--results {
    padding-top: 0.5rem;
}

.calculator__brand--footer {
    display: none;
    margin-top: 20px;
}

.calculator__brand-logo {
    display: block;
    max-width: 8.8rem;
    width: 100%;
    height: auto;
}

.disclaimer-mark {
    color: inherit;
    text-decoration: none;
    margin-left: 0.15em;
}

.disclaimer-mark:hover,
.disclaimer-mark:focus-visible {
    text-decoration: underline;
}

@media (max-width: 399px) {
    .calculator__disclaimer {
        font-size: 0.7rem;
    }
}

@media (max-width: 899px) {
    #estimation-disclaimer {
        margin-bottom: 10px;
    }
}

.section--results {
    background: var(--forest);
}

.results-header {
    text-align: center;
    padding: 1rem;
    font-weight: 600;
}

.results-header p {
    margin: 0;
}

.carousel {
    padding: 0 0 0.5rem;
}

.carousel__viewport {
    position: relative;
    padding: 0 0.25rem;
}

.carousel__stage {
    position: relative;
    min-height: 200px;
    padding-bottom: 0.25rem;
    perspective: 1000px;
    transform-style: preserve-3d;
    touch-action: pan-y;
    isolation: isolate;
}

.carousel__nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 254, 0.45);
    border-radius: 50%;
    background: rgba(34, 48, 46, 0.55);
    color: var(--white);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.carousel__nav--prev {
    left: 20px;
}

.carousel__nav--next {
    right: 20px;
}

.carousel__nav:hover {
    background: rgba(34, 48, 46, 0.75);
    border-color: var(--white);
}

.carousel__nav:active {
    background: rgba(34, 48, 46, 0.9);
}

.carousel__nav-icon {
    display: block;
}

.carousel__nav[hidden] {
    display: none;
}

.result-card {
    width: min(100%, 300px);
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.carousel__stage .result-card {
    position: absolute;
    left: 50%;
    top: 0;
    min-height: var(--carousel-card-min-height, auto);
    display: flex;
    flex-direction: column;
    transform-origin: center center;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease,
        visibility 0.3s ease;
    will-change: transform;
}

.carousel__stage .result-card.is-active {
    z-index: 3;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) scale(1) rotateY(0deg) translateZ(0);
}

.carousel__stage .result-card.is-prev {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: pointer;
    transform: translateX(calc(-50% - 17%)) scale(0.9) rotateY(8deg) translateZ(-30px);
}

.carousel__stage .result-card.is-next {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: pointer;
    transform: translateX(calc(-50% + 17%)) scale(0.9) rotateY(-8deg) translateZ(-30px);
}

.carousel__stage .result-card.is-hidden {
    z-index: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) scale(0.85) rotateY(0deg) translateZ(-60px);
}

@media (prefers-reduced-motion: reduce) {
    .carousel__stage .result-card {
        transition: none;
    }
}

.carousel__stage .result-card .card-surface {
    flex: 1 1 auto;
    min-height: 0;
}

.card-surface {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: var(--jade);
    border-radius: var(--radius);
    padding: 0;
    color: var(--forest);
    box-sizing: border-box;
    backface-visibility: hidden;
    transition: box-shadow 0.3s ease, filter 0.3s ease;
}

.card-surface--measuring {
    height: auto;
    min-height: 0;
}

.card-surface--measuring .card-surface__top,
.card-surface--measuring .result-body {
    flex: none;
}

.card-surface__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 0;
    padding: 1rem 1rem 0.5rem;
    box-sizing: border-box;
}

.carousel__stage .result-card.is-active .card-surface {
    box-shadow: 0 10px 24px rgba(34, 48, 46, 0.35);
}

.carousel__stage .result-card.is-prev .card-surface,
.carousel__stage .result-card.is-next .card-surface {
    box-shadow: 0 4px 14px rgba(34, 48, 46, 0.22);
    filter: brightness(0.97);
}

.carousel__stage .result-card.is-hidden .card-surface {
    box-shadow: none;
    filter: none;
}

.chart-wrap {
    position: relative;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 0.35rem;
    flex-shrink: 0;
    aspect-ratio: 284 / 132.6146;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-badge {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chart-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    font-weight: 800;
    pointer-events: none;
    color: var(--white);
    text-align: center;
    line-height: 1.1;
    padding: 0 0.35rem;
    box-sizing: border-box;
}

.chart-center--stacked .chart-center__value {
    font-size: 1.9rem;
    line-height: 1.05;
}

.chart-center--stacked .chart-center__unit {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: 95%;
    margin-top: 0.15em;
}

@keyframes chartCenterPulse {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

.chart-center--pulse {
    animation: chartCenterPulse 0.45s ease;
}

@keyframes resultBodyPulse {
    0% {
        background-color: var(--spring);
    }
    40% {
        background-color: #d8e8b0;
    }
    100% {
        background-color: var(--spring);
    }
}

.result-body--pulse {
    animation: resultBodyPulse 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
    .chart-center--pulse,
    .result-body--pulse {
        animation: none;
    }
}

.result-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    margin: 0;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.25;
    min-height: calc(2 * 1.25 * 1.05rem);
}

.result-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    background: var(--spring);
    border-radius: 0;
    padding: 1rem 1.25rem 1.25rem;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.75rem;
    padding: 1.75rem 0 1.5rem;
}

.carousel__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 254, 0.45);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.carousel__dot[aria-selected="true"] {
    background: var(--white);
    border-color: var(--white);
}

@media (min-width: 640px) {
    .site-wrap {
        max-width: 640px;
    }

    .hero {
        min-height: 220px;
    }

    .hero__inner {
        gap: 1.2rem;
    }

    .hero__logo-img {
        height: 83px;
    }

    .hero__title {
        font-size: 2.8rem;
    }
}

@media (min-width: 900px) {
    .site-wrap {
        max-width: min(1200px, 100% - 2rem);
    }

    .calculator__stage {
        flex: 0 0 auto;
        overflow: visible;
    }

    .calculator__main {
        display: flex;
        align-items: stretch;
        gap: 1rem;
    }

    .calculator__inputs,
    .calculator__results {
        flex: 1 1 0;
        min-width: 0;
    }

    .calculator__inputs {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .calculator__footer {
        position: static;
        bottom: auto;
        z-index: auto;
    }

    .calculator--fill-available {
        min-height: 0;
    }

    .calculator--fill-available .calculator__footer {
        margin-top: 0;
    }

    .calculator__cta {
        display: none;
    }

    .calculator__brand--footer {
        display: flex;
    }

    .calculator__brand--results {
        display: none;
    }
}
