html.hml-preview-off #hml-preview { display: none !important; }
html.hml-preview-open { overflow: hidden; }
html:has(#main:target) #hml-preview,
html:has(#contact-form:target) #hml-preview { display: none; }

.hml-preview {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(6, 8, 7, 0.72);
}

.hml-preview-dialog {
    position: relative;
    width: min(40rem, 100%);
    max-height: min(92vh, 52rem);
    overflow: auto;
    padding: 1.35rem 1.35rem 1.15rem;
    border: 1px solid var(--color-border-hover, rgba(255, 255, 255, 0.16));
    border-radius: 14px;
    background: rgba(12, 16, 13, 0.96);
    color: #f4f1ea;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.hml-preview-kicker {
    margin: 0 0 0.35rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.75;
}

.hml-preview-dialog h2 {
    margin: 0 0 0.65rem;
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.7rem;
    line-height: 1.15;
}

.hml-preview-dialog p { margin: 0 0 0.75rem; line-height: 1.5; }

.hml-preview-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.hml-preview-links a { color: #e6c98a; }
.hml-preview-offer { font-weight: 600; }

.hml-preview-alert {
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
}
.hml-preview-alert--ok { background: rgba(46, 125, 80, 0.28); }
.hml-preview-alert--err { background: rgba(153, 27, 27, 0.35); }
.hml-preview-alert p { margin: 0.25rem 0 0; }

.hml-preview-form { display: grid; gap: 0.35rem; }
.hml-preview-form .form-control,
.hml-preview-form select,
.hml-preview-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
}
.hml-preview-form .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.hml-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.8rem;
}
.hml-preview-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
}
