.hpc-calculator,
.hpc-calculator * {
    box-sizing: border-box;
}

.hpc-calculator {
    --hpc-bg: #ffffff;
    --hpc-soft: #f7f3ee;
    --hpc-soft-2: #fffaf4;
    --hpc-text: #2b2520;
    --hpc-muted: #74675d;
    --hpc-border: #e8ded3;
    --hpc-accent: #9a623a;
    --hpc-accent-dark: #754628;
    --hpc-shadow: 0 18px 45px rgba(69, 48, 31, .12);
    width: 100%;
    max-width: 1120px;
    margin: 24px auto;
    padding: 24px;
    border: 1px solid var(--hpc-border);
    border-radius: 26px;
    background: linear-gradient(180deg, var(--hpc-soft-2), var(--hpc-bg));
    color: var(--hpc-text);
    box-shadow: var(--hpc-shadow);
    font-family: inherit;
}

.hpc-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

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

.hpc-header h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.15;
    color: var(--hpc-text);
}

.hpc-header p:last-child {
    max-width: 760px;
    margin: 0;
    color: var(--hpc-muted);
    font-size: 16px;
    line-height: 1.55;
}

.hpc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 18px;
    align-items: start;
}

.hpc-panel {
    border: 1px solid var(--hpc-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 28px rgba(69, 48, 31, .07);
}

.hpc-inputs {
    padding: 18px;
}

.hpc-section {
    padding: 16px;
    border-radius: 18px;
    background: var(--hpc-soft);
}

.hpc-section + .hpc-section {
    margin-top: 14px;
}

.hpc-section h3 {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.25;
    color: var(--hpc-text);
}

.hpc-grid {
    display: grid;
    gap: 12px;
}

.hpc-form-rows {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.hpc-field-full {
    width: 100%;
}

.hpc-time-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.hpc-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.hpc-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.hpc-field span {
    font-size: 13px;
    font-weight: 700;
    color: var(--hpc-muted);
}

.hpc-field-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(104px, 28%, 146px);
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.hpc-field-inline span {
    min-width: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.hpc-field-inline input,
.hpc-field-inline select {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hpc-field input,
.hpc-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--hpc-border);
    border-radius: 14px;
    background: #fff;
    color: var(--hpc-text);
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.hpc-field input:focus,
.hpc-field select:focus {
    border-color: var(--hpc-accent);
    box-shadow: 0 0 0 4px rgba(154, 98, 58, .14);
}

.hpc-result {
    position: sticky;
    top: 18px;
    padding: 20px;
}

.hpc-result-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--hpc-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.hpc-price {
    margin: 0;
    color: var(--hpc-accent-dark);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 900;
    line-height: 1.05;
    word-break: break-word;
}

.hpc-result-note {
    margin: 8px 0 18px;
    color: var(--hpc-muted);
    font-size: 15px;
}

.hpc-summary {
    display: grid;
    gap: 9px;
    margin: 0 0 16px;
}

.hpc-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--hpc-border);
    color: var(--hpc-muted);
    font-size: 15px;
}

.hpc-summary-row strong {
    flex: 0 0 auto;
    color: var(--hpc-text);
    font-weight: 800;
    text-align: right;
}

.hpc-summary-total {
    margin-top: 3px;
    padding: 13px 12px;
    border: 0;
    border-radius: 14px;
    background: var(--hpc-soft);
    color: var(--hpc-text);
    font-weight: 800;
}

.hpc-formula {
    margin: 14px 0;
    padding: 13px 14px;
    border-radius: 16px;
    background: #fff7ed;
    color: var(--hpc-muted);
    font-size: 14px;
    line-height: 1.45;
}

.hpc-formula strong {
    display: block;
    margin-bottom: 4px;
    color: var(--hpc-text);
}

.hpc-copy {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 15px;
    background: var(--hpc-accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
    box-shadow: 0 9px 18px rgba(154, 98, 58, .22);
}

.hpc-copy:hover {
    background: var(--hpc-accent-dark);
    transform: translateY(-1px);
}

.hpc-copy:active {
    transform: translateY(0);
}

.hpc-copy-status {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--hpc-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .hpc-calculator {
        padding: 18px;
        border-radius: 22px;
    }

    .hpc-layout {
        grid-template-columns: 1fr;
    }

    .hpc-result {
        position: static;
    }
}

@media (max-width: 640px) {
    .hpc-calculator {
        margin: 18px auto;
        padding: 14px;
        border-radius: 20px;
    }

    .hpc-inputs,
    .hpc-result {
        padding: 14px;
    }

    .hpc-section {
        padding: 13px;
    }

    .hpc-grid-2,
    .hpc-grid-3 {
        grid-template-columns: 1fr;
    }

    .hpc-form-rows {
        gap: 11px;
    }

    .hpc-time-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .hpc-field span {
        font-size: 12px;
    }

    .hpc-field input,
    .hpc-field select {
        min-height: 42px;
        padding: 9px 10px;
        font-size: 14px;
    }

    .hpc-field-inline {
        grid-template-columns: minmax(0, 1fr) clamp(86px, 34%, 112px);
        gap: 8px;
    }

    .hpc-field-inline input,
    .hpc-field-inline select {
        max-width: none;
        width: 100%;
    }

    .hpc-summary-row {
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .hpc-time-row {
        gap: 8px;
    }

    .hpc-time-row .hpc-field input {
        padding-left: 8px;
        padding-right: 8px;
    }

    .hpc-field-inline {
        grid-template-columns: minmax(0, 1fr) clamp(76px, 34%, 92px);
    }

    .hpc-field-inline input,
    .hpc-field-inline select {
        padding-left: 8px;
        padding-right: 8px;
    }
}
