/* Captcha overlay: neutral backdrop, inherited site colors, compact form. */
html.captcha-open { overflow:hidden; scrollbar-gutter:auto; padding-inline-end:var(--captcha-scrollbar-gap,0px); }
.captcha-dialog {
    box-sizing:border-box; margin:auto; padding:0; border:1px solid var(--line,rgba(255,255,255,.1)); border-radius:16px;
    background:var(--surface,#191a1f); color:var(--text,#f4f2ef); font-family:inherit;
    width:min(380px,calc(100vw - 40px)); max-width:none; max-height:calc(100dvh - 32px);
    overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
    box-shadow:0 16px 48px rgba(0,0,0,.22),0 2px 8px rgba(0,0,0,.08);
}
.captcha-dialog::backdrop { background:rgba(0,0,0,.52); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
html.theme-light .captcha-dialog::backdrop { background:rgba(24,24,24,.3); }
html.theme-light .captcha-dialog { box-shadow:0 16px 48px rgba(0,0,0,.14),0 2px 8px rgba(0,0,0,.05); }
.captcha-panel { position:relative; margin:0; padding:26px; box-sizing:border-box; text-align:left; }
.captcha-panel h1,.captcha-panel h2 { color:inherit; font-size:20px; font-weight:650; margin:0; padding:0; letter-spacing:0; line-height:1.5; }
.captcha-panel h1::before,.captcha-panel h2::before { content:none; }
.captcha-panel p { color:var(--text-muted,#a3a2a5); font-size:13px; font-weight:400; line-height:1.7; }
.captcha-panel .captcha-heading { display:flex; align-items:center; gap:10px; padding-right:28px; }
.captcha-heading svg { width:22px; height:22px; flex:0 0 22px; color:var(--text-muted,#a3a2a5); }
.captcha-panel .captcha-description { margin:10px 0 20px; text-align:left; }
.captcha-eyebrow { display:block; margin-bottom:10px; color:var(--text-muted,#a3a2a5); font-size:12px; font-weight:500; letter-spacing:0; }
.captcha-dialog .captcha-panel label,.captcha-gate-wrap .captcha-panel label { display:block; color:inherit; font-size:13px; font-weight:550; margin:18px 0 0; }
.captcha-dialog .captcha-panel input:not([type=hidden]),.captcha-gate-wrap .captcha-panel input:not([type=hidden]) {
    display:block; box-sizing:border-box; width:100%; min-width:0; height:48px; min-height:48px;
    border:1px solid var(--line,rgba(255,255,255,.1)); border-radius:8px;
    background:var(--page,#101114); color:inherit; padding:10px 14px;
    font:inherit; font-size:20px; font-weight:500; line-height:1.3; letter-spacing:8px; text-align:center;
    font-variant-numeric:tabular-nums; margin:8px 0 0; box-shadow:none;
}
.captcha-panel input::placeholder { color:var(--text-dim,#777980); font-size:14px; font-weight:400; letter-spacing:2px; }
.captcha-dialog .captcha-panel input:focus,.captcha-gate-wrap .captcha-panel input:focus { outline:2px solid var(--accent,#d5fa6b); outline-offset:-1px; }
.captcha-dialog .captcha-panel input[aria-invalid=true],.captcha-gate-wrap .captcha-panel input[aria-invalid=true] { border-color:#efaaa3; outline-color:#efaaa3; }
html.theme-light .captcha-panel input[aria-invalid=true] { border-color:#ad3b32; outline-color:#ad3b32; }
.captcha-panel button { box-sizing:border-box; font:inherit; cursor:pointer; transition:background-color .15s,color .15s; }
.captcha-panel button:disabled { opacity:.5; cursor:not-allowed; }
.captcha-panel button:focus-visible,.captcha-gate-wrap form>a:focus-visible { outline:2px solid var(--accent,#d5fa6b); outline-offset:3px; }
.captcha-panel button:active:not(:disabled) { transform:translateY(1px); }
.captcha-panel .captcha-close {
    display:grid; place-items:center; position:absolute; top:14px; right:12px;
    width:44px; height:44px; min-height:44px; padding:0; border:0; border-radius:8px;
    background:transparent; color:var(--text-muted,#a3a2a5); font-size:22px; font-weight:400; line-height:1;
}
.captcha-close svg { width:20px; height:20px; }
.captcha-panel .captcha-image {
    display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:84px;
    padding:8px 12px; border:1px solid var(--line,rgba(255,255,255,.1)); border-radius:10px;
    background:var(--surface-soft,#24262d); color:var(--text-muted,#a3a2a5); font-weight:400;
}
html.theme-light .captcha-panel .captcha-image { background:var(--surface-soft,#f4f4f4); }
.captcha-image img { display:block; width:190px; max-width:calc(100% - 52px); height:auto; aspect-ratio:190/66; object-fit:contain; border-radius:5px; }
.captcha-image span { display:grid; justify-items:center; gap:6px; flex:0 0 auto; font-size:12px; line-height:1.4; white-space:nowrap; }
.captcha-image svg { width:17px; height:17px; }
.captcha-panel .captcha-submit,.captcha-gate-wrap [type=submit] {
    display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:44px; height:44px;
    background:var(--accent,#d5fa6b); color:var(--accent-ink,#16190d);
    border:0; padding:10px 14px; border-radius:8px; font-size:14px; font-weight:650; line-height:1.4; white-space:nowrap;
}
.captcha-panel .captcha-submit:hover { opacity:1; }
.captcha-panel .captcha-submit:disabled { opacity:.5; }
.captcha-panel[data-busy=verify] .captcha-submit::before {
    content:''; width:13px; height:13px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:captcha-spin .7s linear infinite;
}
.captcha-panel .captcha-status { min-height:20px; margin:9px 0 12px; font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
.captcha-panel .captcha-status[data-state=error] { color:#efaaa3; }
html.theme-light .captcha-panel .captcha-status[data-state=error] { color:#ad3b32; }
.captcha-gate-wrap { width:min(480px,calc(100% - 32px)); margin:64px auto; }
.captcha-gate-wrap .captcha-panel { border:1px solid var(--line,rgba(255,255,255,.1)); border-radius:16px; background:var(--surface,#191a1f); }
.captcha-gate-wrap .captcha-panel h1 { margin-bottom:10px; }
.captcha-gate-wrap form>a { display:block; text-align:center; margin-top:14px; color:var(--accent,#d5fa6b); font-size:13px; line-height:1.8; }
@media(hover:hover) {
    .captcha-panel .captcha-close:hover { opacity:1; color:var(--text,#f4f2ef); background:var(--surface-soft,#24262d); }
    .captcha-panel .captcha-image:hover:not(:disabled) { opacity:1; color:var(--text,#f4f2ef); border-color:var(--text-dim,#777980); }
    .captcha-panel .captcha-submit:hover:not(:disabled) { filter:brightness(.95); }
}
@media(max-width:480px) {
    .captcha-panel { padding:22px 20px; }
    .captcha-dialog { width:calc(100vw - 40px); }
    .captcha-panel .captcha-close { top:10px; right:8px; }
    .captcha-gate-wrap { margin:32px auto; }
}
@media(max-height:500px) {
    .captcha-dialog { max-height:calc(100dvh - 16px); }
    .captcha-dialog .captcha-panel { padding-block:18px; }
    .captcha-dialog .captcha-description { margin-bottom:12px; }
}
@keyframes captcha-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) {
    .captcha-panel button { transition:none; }
    .captcha-panel[data-busy=verify] .captcha-submit::before { animation:none; }
}
