.contact-page {
    container: contact-page / inline-size;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    color: var(--text, #000000);
}
.contact-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.contact-intro { max-width: 780px; }
.contact-page .contact-intro h2 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 36px); }
.contact-lead { margin: 0 0 10px; color: var(--text, #000000); font-size: 1.08em; line-height: 1.5; }
.contact-description { color: var(--muted, #666666); line-height: 1.5; }
.contact-description br { display: none; }
.contact-heading-actions { flex: 0 0 auto; }

.contact-notice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--danger-border, #c74b50);
    border-radius: 8px;
    background: var(--danger-bg, #fff0f0);
    color: var(--danger-text, #741d22);
}
.contact-notice.is-success { border-color: var(--success-border, #3e8e58); background: var(--success-bg, #edf8f0); color: var(--success-text, #185d31); }
.contact-notice > svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.contact-notice-title { display: block; margin-bottom: 3px; color: inherit; }
.contact-notice-message { line-height: 1.5; }
.contact-notice-message > :first-child { margin-top: 0; }
.contact-notice-message > :last-child { margin-bottom: 0; }
.contact-notice-message ul { margin: 8px 0 0; padding-left: 20px; }
.contact-notice-message a { color: inherit; }

.contact-main { display: flex; min-width: 0; flex-direction: column; gap: 20px; }
.contact-section,
.contact-optional,
.contact-guidance {
    box-sizing: border-box;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border, #dddddd);
    border-radius: 8px;
    background: var(--surface, #ffffff);
}
.contact-section > h3 { margin: 0 0 18px; color: var(--heading, #1e2751); font-size: 18px; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.contact-field-wide { grid-column: 1 / -1; }
.contact-form textarea { min-height: 190px; resize: vertical; }

.contact-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.contact-optional > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 10px;
    list-style: none;
    color: var(--heading, #1e2751);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.contact-optional > summary::-webkit-details-marker { display: none; }
.contact-optional > summary small { color: var(--muted, #666666); font-size: 11px; font-weight: 400; }
.contact-optional > summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform .15s; }
.contact-optional[open] > summary { margin-bottom: 20px; }
.contact-optional[open] > summary svg { transform: rotate(180deg); }

.contact-verification-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.contact-verification-heading h3 { margin: 0 0 3px; color: var(--heading, #1e2751); font-size: 18px; }
.contact-verification-heading p { margin: 0; color: var(--muted, #666666); line-height: 1.45; }
.contact-verification-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid var(--border, #dddddd); border-radius: 50%; color: var(--heading, #1e2751); }
.contact-verification-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.contact-captcha-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.contact-form img.captcha {
    display: block;
    float: none;
    box-sizing: border-box;
    width: 220px;
    height: 72px;
    margin: 0;
    border: 1px solid var(--border, #dddddd);
    border-radius: 5px;
    object-fit: cover;
}
.contact-captcha-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.contact-game-panel[hidden],
.contact-math-panel[hidden] { display: none !important; }
.contact-game-panel { max-width: 820px; }
.contact-game-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}
.contact-game-toolbar > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.contact-game-toolbar strong { color: var(--heading, #1e2751); font-size: 15px; }
.contact-game-toolbar span { color: var(--muted, #666666); font-size: 12px; }
.contact-icon-action {
    display: grid;
    flex: 0 0 36px;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0 !important;
    place-items: center;
    line-height: 1;
    cursor: pointer;
}
.contact-icon-action svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.contact-game-shell {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    border: 1px solid #4e5e78;
    border-radius: 3px;
    background: #080e18;
}
.contact-game-shell:focus-within { outline: 2px solid var(--link, #708bc4); outline-offset: 2px; }
#contact-game-canvas { display: block; width: 100%; height: auto; aspect-ratio: 640 / 260; max-width: none; touch-action: none; cursor: none; }
#contact-game-canvas:focus { outline: none; }
#contact-game-canvas[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger-border, #c74b50); }
.contact-game-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    background: color-mix(in srgb, #071126 82%, transparent);
    transition: opacity .2s ease;
}
.contact-game-overlay.is-visible { opacity: 1; }
.contact-game-overlay span {
    max-width: 78%;
    padding: 11px 15px;
    border: 1px solid #6f88bd;
    background: #111f3d;
    color: #f7f9ff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}
.contact-game-status { min-height: 19px; margin: 8px 0 0; color: var(--muted, #666666); font-size: 12px; }
.contact-game-status.is-success { color: var(--success, #267540); font-weight: 600; }
.contact-game-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 8px; }
.contact-game-footer p { margin: 0; color: var(--muted, #666666); font-size: 12px; line-height: 1.45; }
.contact-challenge-switch {
    flex: 0 0 auto;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--link, #1e2751);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.contact-math-panel .contact-challenge-switch { margin-top: 16px; }
.contact-secondary-action,
.contact-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--control-border, #8493ac);
    border-radius: 0;
    background: var(--control-bg, #f6f7f9);
    color: var(--text, #000000);
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}
.contact-secondary-action { gap: 7px; }
.contact-secondary-action svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.contact-code-field { max-width: 300px; }
.contact-code-field input { max-width: 180px !important; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.contact-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border, #dddddd); }
.contact-actions > span { color: var(--muted, #666666); font-size: 12px; }
.contact-submit[disabled],
.contact-secondary-action[disabled] { opacity: .58; }
.contact-submit[disabled] { cursor: not-allowed; }
.contact-submit[aria-busy="true"],
.contact-secondary-action[disabled] { cursor: wait; }

.contact-guidance { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(190px, .8fr) minmax(190px, .8fr); align-items: center; gap: 22px; margin-bottom: 20px; color: var(--muted, #666666); line-height: 1.5; }
.contact-guidance-copy h3 { margin: 0 0 8px; color: var(--heading, #1e2751); font-size: 18px; }
.contact-guidance-copy p { margin: 0 0 7px; }
.contact-guidance-copy p:last-child { margin-bottom: 0; }
.contact-guidance-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 58px; padding-left: 22px; border-left: 1px solid var(--border, #dddddd); }
.contact-guidance-step > span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--border, #dddddd); border-radius: 50%; color: var(--heading, #1e2751); font-weight: 700; }
.contact-guidance-step p { margin: 0; }
.contact-guidance-step strong { color: var(--text, #000000); }

@container contact-page (max-width: 800px) {
    .contact-guidance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-guidance-copy { grid-column: 1 / -1; }
    .contact-guidance-step { padding: 16px 0 0; border-top: 1px solid var(--border, #dddddd); border-left: 0; }
}
@container contact-page (max-width: 560px) {
    .contact-heading { flex-wrap: wrap; }
    .contact-heading > div:first-child { flex-basis: 100%; }
    .contact-grid { grid-template-columns: minmax(0, 1fr); }
    .contact-field-wide { grid-column: auto; }
    .contact-guidance { grid-template-columns: minmax(0, 1fr); }
    .contact-guidance-copy { grid-column: auto; }
    .contact-section,
    .contact-optional,
    .contact-guidance { padding: 18px; }
    .contact-actions { align-items: stretch; flex-direction: column; }
    .contact-submit { width: 100%; }
    .contact-game-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .contact-optional > summary svg,
    .contact-game-overlay { transition: none; }
}
@media print {
    .contact-heading-actions,
    .contact-guidance,
    .contact-actions,
    .contact-secondary-action { display: none !important; }
}
