.ape-contact-dialog {
    padding: 0; border: 1px solid var(--ape-line); border-radius: var(--ape-radius-card);
    width: min(760px, calc(100vw - 48px)); max-width: none;
    height: min(850px, calc(100dvh - 48px)); max-height: none;
    color: var(--ape-ink); background: var(--ape-cream);
    box-shadow: 0 24px 80px rgba(25, 60, 61, .24); overflow: hidden;
    font-family: var(--ape-font-family);
}
.ape-contact-dialog::backdrop { background: rgba(25, 60, 61, .48); }
.ape-contact-dialog[open] { animation: ape-contact-enter .18s ease-out; }
.ape-contact-shell { height: 100%; display: flex; flex-direction: column; }
.ape-contact-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: var(--ape-surface); border-bottom: 1px solid var(--ape-line); flex-shrink: 0; }
.ape-contact-eyebrow { margin: 0 0 4px; color: var(--ape-text-accent); font-size: var(--ape-type-2xs); font-weight: 750; letter-spacing: .1em; }
.ape-contact-heading h2 { margin: 0; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.025em; }
.ape-contact-close { flex: 0 0 44px; height: 44px; display: grid; place-items: center; color: var(--ape-ink); background: var(--ape-peach-soft); border: 1px solid var(--ape-line); border-radius: 50%; cursor: pointer; }
.ape-contact-close:hover { background: var(--ape-peach); }
.ape-contact-close svg { width: 22px; height: 22px; }
.ape-contact-content { position: relative; flex: 1; min-height: 0; }
.ape-contact-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--ape-cream); }
.ape-contact-loading { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; padding: 24px; background: var(--ape-cream); color: var(--ape-muted); pointer-events: none; }
.ape-contact-loading[hidden] { display: none; }
.ape-contact-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 8px 24px; background: var(--ape-surface); border-top: 1px solid var(--ape-line); font-size: var(--ape-type-xs); color: var(--ape-muted); flex-shrink: 0; }
.ape-contact-bottom a { color: var(--ape-text-accent); display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.ape-contact-close:focus-visible, .ape-contact-bottom a:focus-visible { outline: var(--ape-focus-width) solid var(--ape-focus-color); outline-offset: 3px; }
.ape-contact-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes ape-contact-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
    .ape-contact-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .ape-contact-heading { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
    .ape-contact-heading h2 { font-size: var(--ape-type-xl); }
    .ape-contact-bottom { padding: 4px 16px calc(4px + env(safe-area-inset-bottom)); }
    .ape-contact-bottom > span { display: none; }
}
/* Reclaim height on short desktop windows; keep the native form's scrolling. */
@media (min-width: 721px) and (max-height: 720px) {
    .ape-contact-dialog { height: calc(100dvh - 24px); }
    .ape-contact-heading { padding: 8px 24px; }
    .ape-contact-eyebrow { display: none; }
    .ape-contact-heading h2 { font-size: var(--ape-type-xl); }
    .ape-contact-bottom { padding-block: 4px; }
}
@media (prefers-reduced-motion: reduce) { .ape-contact-dialog[open] { animation: none; } }
