.lfc,
.lfc * {
    box-sizing: border-box;
}

.lfc {
    --lfc-bg: #ffffff;
    --lfc-soft: #f6f3ef;
    --lfc-soft-2: #fbfaf8;
    --lfc-border: #e5ded6;
    --lfc-text: #211b17;
    --lfc-muted: #776d64;
    --lfc-strong: #6d4d34;
    --lfc-accent: #9b6a45;
    --lfc-accent-soft: #ead8c9;
    --lfc-warning-bg: #fff6de;
    --lfc-warning-border: #f0c56c;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    color: var(--lfc-text);
    font-family: inherit;
}

.lfc__head {
    padding: 28px;
    margin-bottom: 18px;
    border: 1px solid var(--lfc-border);
    border-radius: 24px;
    background: linear-gradient(135deg, var(--lfc-soft), var(--lfc-bg));
}

.lfc__eyebrow {
    margin: 0 0 8px;
    color: var(--lfc-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lfc__title {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.12;
}

.lfc__lead {
    max-width: 760px;
    margin: 0;
    color: var(--lfc-muted);
    font-size: 17px;
    line-height: 1.55;
}

.lfc__form,
.lfc__result {
    display: grid;
    gap: 18px;
}

.lfc__panel,
.lfc__summary-card,
.lfc__layout-wrap,
.lfc__details {
    border: 1px solid var(--lfc-border);
    border-radius: 22px;
    background: var(--lfc-bg);
    box-shadow: 0 10px 30px rgba(72, 52, 35, .06);
}

.lfc__panel {
    padding: 20px;
}

.lfc__panel--main {
    background: var(--lfc-soft-2);
}

.lfc__panel-title,
.lfc__layout-head h3,
.lfc__details h3 {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.25;
}

.lfc__grid {
    display: grid;
    gap: 14px;
}

.lfc__grid--settings {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.lfc__items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.lfc__item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.lfc__check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.lfc__check input {
    width: 18px;
    height: 18px;
    accent-color: var(--lfc-accent);
}

.lfc__hint {
    color: var(--lfc-muted);
    font-size: 13px;
    line-height: 1.35;
    text-align: right;
}

.lfc__grid--item {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lfc__field {
    display: grid;
    gap: 7px;
}

.lfc__field span {
    color: var(--lfc-muted);
    font-size: 13px;
    line-height: 1.25;
}

.lfc__field input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--lfc-border);
    border-radius: 14px;
    background: #fff;
    color: var(--lfc-text);
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lfc__field input:focus {
    border-color: var(--lfc-accent);
    box-shadow: 0 0 0 4px rgba(155, 106, 69, .13);
}

.lfc__summary {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.lfc__summary-card {
    display: grid;
    gap: 5px;
    padding: 18px;
}

.lfc__summary-card--primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #7a5033, #b9835b);
}

.lfc__summary-card span {
    color: inherit;
    opacity: .78;
    font-size: 14px;
}

.lfc__summary-card strong {
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1;
}

.lfc__summary-card small {
    color: inherit;
    opacity: .72;
    font-size: 13px;
}

.lfc__warnings {
    padding: 14px 16px;
    border: 1px solid var(--lfc-warning-border);
    border-radius: 18px;
    background: var(--lfc-warning-bg);
    color: #6e4a0a;
    line-height: 1.5;
}

.lfc__warnings p {
    margin: 0;
}

.lfc__warnings p + p {
    margin-top: 7px;
}

.lfc__layout-wrap,
.lfc__details {
    padding: 20px;
}

.lfc__layout-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.lfc__layout-head h3,
.lfc__details h3 {
    margin-bottom: 0;
}

.lfc__layout-head p {
    max-width: 520px;
    margin: 0;
    color: var(--lfc-muted);
    font-size: 14px;
    line-height: 1.45;
}

.lfc__layout {
    display: grid;
    gap: 12px;
}

.lfc__row {
    position: relative;
    overflow: hidden;
    min-height: 92px;
    border: 1px solid var(--lfc-border);
    border-radius: 18px;
    background:
        repeating-linear-gradient(90deg, rgba(109, 77, 52, .055) 0, rgba(109, 77, 52, .055) 1px, transparent 1px, transparent 34px),
        #fffdfb;
}

.lfc__row-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(229, 222, 214, .82);
    color: var(--lfc-muted);
    font-size: 12px;
}

.lfc__row-pieces {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    min-height: 74px;
}

.lfc__piece {
    display: flex;
    min-width: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border: 1px solid rgba(109, 77, 52, .3);
    border-radius: 12px;
    background: var(--lfc-accent-soft);
    color: #402a1b;
    text-align: center;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
}

.lfc__piece:nth-child(2n) {
    background: #e4ead7;
}

.lfc__piece:nth-child(3n) {
    background: #dfe8ee;
}

.lfc__empty {
    padding: 18px;
    border: 1px dashed var(--lfc-border);
    border-radius: 18px;
    color: var(--lfc-muted);
    background: var(--lfc-soft-2);
}

.lfc__details-list {
    display: grid;
    gap: 10px;
}

.lfc__detail {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--lfc-border);
}

.lfc__detail:last-child {
    border-bottom: 0;
}

.lfc__detail strong {
    display: block;
    margin-bottom: 3px;
}

.lfc__detail span {
    color: var(--lfc-muted);
    font-size: 14px;
}

.lfc__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--lfc-soft);
    color: var(--lfc-strong);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .lfc__grid--settings {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }

    .lfc__summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .lfc__head,
    .lfc__panel,
    .lfc__layout-wrap,
    .lfc__details {
        border-radius: 18px;
        padding: 16px;
    }

    .lfc__lead {
        font-size: 15px;
    }

    .lfc__grid--settings {
        grid-template-columns: 1fr 1fr;
    }

    .lfc__grid--item {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .lfc__grid--settings .lfc__field:first-child {
        grid-column: 1 / -1;
    }

    .lfc__grid--item .lfc__field {
        min-width: 0;
        gap: 5px;
    }

    .lfc__grid--item .lfc__field span {
        font-size: 11px;
        line-height: 1.15;
        white-space: nowrap;
    }

    .lfc__grid--item .lfc__field input {
        min-height: 40px;
        padding: 7px 6px;
        text-align: center;
        font-size: 14px;
    }

    .lfc__item-head,
    .lfc__layout-head {
        display: grid;
        justify-content: stretch;
    }

    .lfc__hint {
        text-align: left;
    }

    .lfc__row {
        min-height: 82px;
    }

    .lfc__row-pieces {
        min-height: 64px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lfc__piece {
        min-width: 86px;
        flex: 0 0 auto;
    }

    .lfc__detail {
        grid-template-columns: 1fr;
    }

    .lfc__badge {
        justify-self: start;
    }
}

@media (max-width: 380px) {
    .lfc__grid--item {
        gap: 6px;
    }

    .lfc__grid--item .lfc__field span {
        font-size: 10px;
    }

    .lfc__grid--item .lfc__field input {
        min-height: 38px;
        padding: 6px 4px;
        font-size: 13px;
    }
}
