/* Livelytics Food Cost Calculator - isolated styles */
.lvfc,
.lvfc * {
    box-sizing: border-box;
}

.lvfc {
    --lvfc-orange: #f15a24;
    --lvfc-orange-dark: #d94712;
    --lvfc-teal: #238f9e;
    --lvfc-green: #16855d;
    --lvfc-amber: #b97508;
    --lvfc-red: #c84040;
    --lvfc-ink: #182f3a;
    --lvfc-text: #405c68;
    --lvfc-muted: #7a8d95;
    --lvfc-border: #e7e4df;
    --lvfc-soft: #fff5ef;
    width: 100%;
    margin: 34px 0;
    color: var(--lvfc-ink);
    font-family: inherit;
}

.lvfc svg {
    display: block;
    max-width: 100%;
}

.lvfc__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.lvfc__header-icon {
    display: grid;
    flex: 0 0 46px;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, var(--lvfc-orange), var(--lvfc-orange-dark));
    box-shadow: 0 8px 20px rgba(241, 90, 36, 0.24);
}

.lvfc__header-icon svg {
    width: 24px !important;
    height: 24px !important;
}

.lvfc__eyebrow {
    display: block;
    margin: 0 0 4px;
    color: var(--lvfc-orange-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.lvfc__header h2 {
    margin: 0 !important;
    color: var(--lvfc-ink) !important;
    font-size: clamp(24px, 3vw, 31px) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
}

.lvfc__header p {
    margin: 7px 0 0 !important;
    color: var(--lvfc-text) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.lvfc__panel {
    overflow: hidden;
    border: 1px solid var(--lvfc-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(24, 47, 58, 0.09);
}

.lvfc__panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    color: #fff;
    background: #171717;
}

.lvfc__panel-heading strong,
.lvfc__panel-kicker {
    display: block;
}

.lvfc__panel-kicker {
    margin-bottom: 2px;
    color: #a9a9ad;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lvfc__panel-heading strong {
    color: #fff;
    font-size: 14px;
    line-height: 1.25;
}

.lvfc__badge {
    flex: 0 0 auto;
    padding: 6px 8px;
    border-radius: 6px;
    color: #fff;
    background: var(--lvfc-orange);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.lvfc__form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    background: linear-gradient(180deg, #fff 0%, #fffdfb 100%);
}

.lvfc__field--wide {
    grid-column: 1 / -1;
}

.lvfc__field label {
    display: block;
    margin: 0 0 6px;
    color: #304b57;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.lvfc__field small {
    display: block;
    margin-top: 5px;
    color: var(--lvfc-muted);
    font-size: 10px;
    line-height: 1.4;
}

.lvfc input,
.lvfc select,
.lvfc button {
    font: inherit;
}

.lvfc input[type="text"],
.lvfc input[type="number"],
.lvfc select {
    width: 100% !important;
    min-width: 0;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid #d8dde0 !important;
    border-radius: 8px !important;
    outline: none;
    color: #213944 !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 44px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lvfc select {
    appearance: auto;
    line-height: normal !important;
}

.lvfc input:focus,
.lvfc select:focus {
    border-color: var(--lvfc-teal) !important;
    box-shadow: 0 0 0 3px rgba(35, 143, 158, 0.12) !important;
}

.lvfc input[readonly] {
    color: #697b83 !important;
    background: #f5f5f3 !important;
    cursor: not-allowed;
}

.lvfc__input-addon {
    position: relative;
}

.lvfc__input-addon > span {
    position: absolute;
    top: 50%;
    left: 10px;
    z-index: 2;
    transform: translateY(-50%);
    color: #6f7f86;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.lvfc__input-addon input {
    padding-left: 34px !important;
}

.lvfc__input-addon--right > span {
    right: 12px;
    left: auto;
}

.lvfc__input-addon--right input {
    padding-right: 34px !important;
    padding-left: 12px !important;
}

.lvfc__breakdown {
    margin: 0 18px 18px;
    overflow: hidden;
    border: 1px solid var(--lvfc-border);
    border-radius: 10px;
    background: #fff;
}

.lvfc__breakdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.lvfc__breakdown summary::-webkit-details-marker {
    display: none;
}

.lvfc__breakdown summary strong,
.lvfc__breakdown summary small {
    display: block;
}

.lvfc__breakdown summary strong {
    color: #243e49;
    font-size: 12px;
    line-height: 1.35;
}

.lvfc__breakdown summary small {
    margin-top: 2px;
    color: var(--lvfc-muted);
    font-size: 10px;
}

.lvfc__breakdown summary svg {
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    color: var(--lvfc-orange);
    transition: transform 0.2s ease;
}

.lvfc__breakdown[open] summary svg {
    transform: rotate(180deg);
}

.lvfc__breakdown-body {
    padding: 14px;
    border-top: 1px solid #eeeae6;
}

.lvfc__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #425c67;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.lvfc__toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lvfc__toggle-ui {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: #d5d9da;
    transition: background 0.2s ease;
}

.lvfc__toggle-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.lvfc__toggle input:checked + .lvfc__toggle-ui {
    background: var(--lvfc-teal);
}

.lvfc__toggle input:checked + .lvfc__toggle-ui::after {
    transform: translateX(14px);
}

.lvfc__ingredient-list {
    display: grid;
    gap: 8px;
}

.lvfc__ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 36px;
    gap: 8px;
    align-items: center;
}

.lvfc__ingredient-row input {
    height: 40px !important;
    font-size: 12px !important;
    line-height: 40px !important;
}

.lvfc__ingredient-cost {
    position: relative;
}

.lvfc__ingredient-cost span {
    position: absolute;
    top: 50%;
    left: 10px;
    z-index: 2;
    transform: translateY(-50%);
    color: #6f7f86;
    font-size: 11px;
    pointer-events: none;
}

.lvfc__ingredient-cost input {
    padding-left: 30px !important;
}

.lvfc__remove {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #efd9ce;
    border-radius: 8px;
    color: #b44a20;
    background: #fff5ef;
    cursor: pointer;
}

.lvfc__remove svg {
    width: 15px !important;
    height: 15px !important;
}

.lvfc__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px dashed rgba(241, 90, 36, 0.55);
    border-radius: 8px;
    color: var(--lvfc-orange-dark);
    background: var(--lvfc-soft);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.lvfc__add > span {
    font-size: 18px;
    line-height: 1;
}

.lvfc__breakdown-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eeeae6;
    color: #61737b;
    font-size: 11px;
}

.lvfc__breakdown-total strong {
    color: #213944;
    font-size: 14px;
}

.lvfc__results {
    margin: 0 18px 18px;
    padding: 16px;
    border-radius: 12px;
    color: #fff;
    background: #171717;
}

.lvfc__results-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lvfc__results-top > div > span,
.lvfc__results-top > div > strong {
    display: block;
}

.lvfc__results-top > div > span {
    margin-bottom: 2px;
    color: #a8a8ad;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.lvfc__results-top > div > strong {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lvfc__status {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.lvfc__status--good {
    color: #6ce1aa;
    background: rgba(49, 199, 137, 0.15);
}

.lvfc__status--watch {
    color: #ffc768;
    background: rgba(255, 181, 71, 0.15);
}

.lvfc__status--high {
    color: #ff9090;
    background: rgba(255, 97, 97, 0.15);
}

.lvfc__result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.lvfc__result-card {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.055);
}

.lvfc__result-card--primary {
    border-color: rgba(241, 90, 36, 0.48);
    background: rgba(241, 90, 36, 0.14);
}

.lvfc__result-card span,
.lvfc__result-card strong,
.lvfc__result-card small {
    display: block;
}

.lvfc__result-card span {
    color: #b9b9bd;
    font-size: 9px;
    font-weight: 700;
}

.lvfc__result-card strong {
    margin: 5px 0 4px;
    color: #fff;
    font-size: 19px;
    line-height: 1;
}

.lvfc__result-card small {
    color: #96969b;
    font-size: 8px;
    line-height: 1.35;
}

.lvfc__meter-block {
    margin-top: 14px;
}

.lvfc__meter-heading,
.lvfc__meter-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lvfc__meter-heading {
    margin-bottom: 7px;
    color: #d5d5d8;
    font-size: 10px;
    font-weight: 700;
}

.lvfc__meter-heading strong {
    color: #fff;
    font-size: 11px;
}

.lvfc__meter {
    position: relative;
    height: 9px;
    border-radius: 999px;
    background: #39393d;
}

.lvfc__meter-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2aa879, #61d5a8);
    transition: width 0.3s ease, background 0.2s ease;
}

.lvfc__meter.lvfc__meter--watch .lvfc__meter-fill {
    background: linear-gradient(90deg, #d78c18, #ffc45f);
}

.lvfc__meter.lvfc__meter--high .lvfc__meter-fill {
    background: linear-gradient(90deg, #d54a4a, #ff7b70);
}

.lvfc__meter--margin .lvfc__meter-fill {
    background: linear-gradient(90deg, var(--lvfc-teal), #63c7d2);
}

.lvfc__meter-target {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 2px;
    height: 17px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28);
    transform: translateX(-1px);
    transition: left 0.3s ease;
}

.lvfc__meter-scale {
    margin-top: 5px;
    color: #808086;
    font-size: 8px;
}

.lvfc__formula {
    margin-top: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.lvfc__formula span,
.lvfc__formula code {
    display: block;
}

.lvfc__formula span {
    margin-bottom: 5px;
    color: var(--lvfc-orange);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.lvfc__formula code {
    color: #d9d9dc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    line-height: 1.55;
    white-space: normal;
}

.lvfc__note {
    margin: 10px 0 0 !important;
    color: #ababaf !important;
    font-size: 10px !important;
    line-height: 1.55 !important;
}

.lvfc__reset {
    display: block;
    margin: 0 18px 18px auto;
    padding: 0;
    border: 0;
    color: #6d7f87;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.lvfc__reset:hover {
    color: var(--lvfc-orange-dark);
}

@media (max-width: 640px) {
    .lvfc {
        margin: 28px 0;
    }

    .lvfc__header {
        gap: 11px;
    }

    .lvfc__header-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .lvfc__header h2 {
        font-size: 24px !important;
    }

    .lvfc__form,
    .lvfc__result-grid {
        grid-template-columns: 1fr;
    }

    .lvfc__field--wide {
        grid-column: auto;
    }

    .lvfc__ingredient-row {
        grid-template-columns: minmax(0, 1fr) 105px 36px;
    }
}

@media (max-width: 420px) {
    .lvfc__panel-heading,
    .lvfc__form,
    .lvfc__results {
        padding-right: 14px;
        padding-left: 14px;
    }

    .lvfc__breakdown,
    .lvfc__results {
        margin-right: 14px;
        margin-left: 14px;
    }

    .lvfc__reset {
        margin-right: 14px;
    }

    .lvfc__ingredient-row {
        grid-template-columns: 1fr 36px;
    }

    .lvfc__ingredient-cost {
        grid-column: 1 / 2;
    }

    .lvfc__remove {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: stretch;
        height: auto;
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lvfc *,
    .lvfc *::before,
    .lvfc *::after {
        transition: none !important;
    }
}
