:root {
    --heep-paper: var(--paper, #f8f3eb);
    --heep-line: var(--line, #ddd3c7);
    --heep-ink: var(--ink, #1f1b16);
    --heep-mid: var(--mid, #766e65);
    --heep-rose: var(--rose, #b66e5f);
    --heep-blush-mid: var(--blush-mid, #d6a39a);
    --heep-sans: var(--sans, Arial, sans-serif);
    --heep-serif: var(--serif, Georgia, serif);
}

.heep-modal {
    position: fixed;
    inset: 0;
    background: rgba(31, 27, 22, .6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.heep-modal.open {
    display: flex;
}

body.heep-modal-open {
    overflow: hidden;
}

.heep-panel {
    width: min(700px, 100%);
    max-height: 92vh;
    overflow: auto;
    background: var(--heep-paper);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .3);
}

.heep-header {
    padding: 32px 36px 24px;
    border-bottom: 1px solid var(--heep-line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.heep-header h3 {
    font-family: var(--heep-serif);
    font-size: 32px;
    font-weight: 300;
    line-height: 1.1;
    color: var(--heep-ink);
    letter-spacing: -.01em;
    margin: 0;
}

.heep-header h3 em {
    font-style: italic;
    color: var(--heep-rose);
}

.heep-header p {
    font-family: var(--heep-sans);
    font-size: 14px;
    color: var(--heep-mid);
    margin: 8px 0 0;
    line-height: 1.55;
}

.heep-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--heep-paper);
    border: 1px solid var(--heep-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--heep-ink);
    cursor: pointer;
    transition: all .25s;
    font-family: var(--heep-serif);
    font-weight: 300;
    padding: 0;
}

.heep-close:hover {
    background: var(--heep-ink);
    color: #F5EFE5;
    border-color: var(--heep-ink);
}

.heep-body {
    padding: 28px 36px 36px;
}

.heep-field-block {
    margin-bottom: 24px;
}

.heep-field-title {
    display: block;
    font-family: var(--heep-sans);
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--heep-rose);
    font-weight: 600;
    margin-bottom: 12px;
}

.heep-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.heep-choice-card {
    position: relative;
    border: 1.5px solid var(--heep-line);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--heep-paper);
    transition: all .2s;
}

.heep-choice-card:hover {
    border-color: var(--heep-rose);
}

.heep-choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.heep-choice-card strong {
    display: block;
    font-family: var(--heep-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--heep-ink);
    margin-bottom: 4px;
}

.heep-choice-card small {
    display: block;
    font-family: var(--heep-sans);
    font-size: 12px;
    color: var(--heep-mid);
    line-height: 1.45;
}

.heep-choice-card:has(input:checked) {
    border-color: var(--heep-rose);
    background: rgba(182, 110, 95, .04);
}

.heep-choice-card:has(input:checked)::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 14px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--heep-rose);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.heep-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.heep-body input:not([type="radio"]),
.heep-body select,
.heep-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1.5px solid var(--heep-line);
    border-radius: 10px;
    font-family: var(--heep-sans);
    font-size: 14px;
    background: var(--heep-paper);
    color: var(--heep-ink);
    font-weight: 400;
}

.heep-body textarea {
    margin-top: 10px;
    min-height: 90px;
    resize: vertical;
}

.heep-body input:focus,
.heep-body select:focus,
.heep-body textarea:focus {
    outline: none;
    border-color: var(--heep-rose);
}

.heep-result {
    background: var(--heep-ink);
    color: #F5EFE5;
    border-radius: 14px;
    padding: 20px 22px;
    margin: 18px 0;
    position: relative;
}

.heep-result .heep-label {
    display: block;
    font-family: var(--heep-sans);
    font-size: 11px;
    color: var(--heep-blush-mid);
    letter-spacing: .15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
}

.heep-result strong {
    font-family: var(--heep-serif);
    font-size: 30px;
    font-weight: 300;
    display: block;
    margin-bottom: 4px;
    color: #F5EFE5;
}

.heep-result .heep-price-suffix {
    font-family: var(--heep-sans);
    font-size: 14px;
    color: var(--heep-blush-mid);
    font-weight: 500;
    letter-spacing: .02em;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

.heep-result .heep-price-type {
    display: inline-block;
    background: var(--heep-rose);
    color: #fff;
    font-family: var(--heep-sans);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 100px;
    margin-bottom: 10px;
}

.heep-result p {
    font-family: var(--heep-sans);
    font-size: 12px;
    color: rgba(245, 239, 229, .65);
    line-height: 1.55;
    margin: 8px 0 0;
}

.heep-result p b {
    color: #fff;
    font-weight: 600;
}

.heep-submit {
    width: 100%;
    padding: 16px;
    background: var(--heep-rose);
    color: #fff;
    border: 0;
    border-radius: 100px;
    font-family: var(--heep-sans);
    font-size: 13px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 8px;
    transition: background .25s;
    cursor: pointer;
}

.heep-submit:hover {
    background: var(--heep-ink);
}

.heep-submit:disabled {
    opacity: .65;
    cursor: wait;
}

.heep-message {
    display: none;
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    font-family: var(--heep-sans);
    font-size: 13px;
    text-align: center;
}

.heep-message.success {
    display: block;
    background: #e7f4e8;
    color: #256b2d;
}

.heep-message.error {
    display: block;
    background: #fae5e3;
    color: #9a3026;
}

.heep-talk {
    text-align: center;
    margin-top: 18px;
}

.heep-talk a {
    font-family: var(--heep-sans);
    font-size: 13px;
    color: var(--heep-ink);
    text-decoration: none;
}

.heep-talk a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .heep-modal {
        padding: 10px;
    }

    .heep-panel {
        max-height: 96vh;
        border-radius: 18px;
    }

    .heep-header {
        padding: 24px 20px 18px;
    }

    .heep-header h3 {
        font-size: 27px;
    }

    .heep-body {
        padding: 22px 20px 28px;
    }

    .heep-choice-grid,
    .heep-field-grid {
        grid-template-columns: 1fr;
    }

    .heep-choice-grid {
        gap: 8px;
    }
}
