body.auth-gated{display:flex!important;flex-direction:column;overflow:auto!important;background:linear-gradient(150deg,#f3f8fa,#faf8f3,#f3faf8)!important;height:auto!important;min-height:100dvh;padding:24px 16px}
.auth-gated>aside,.auth-gated>main,.auth-gated>dialog{display:none!important}
body.auth-gated.auth-particles-on{isolation:isolate;background:#fbfcfe!important}
.auth-particle-background{position:fixed;inset:0;overflow:hidden;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 15% 15%,#eef0fc66 0,transparent 50%),radial-gradient(ellipse at 83% 55%,#ecf2fd77 0,transparent 52%),#fafcff}
.auth-particle{position:absolute;left:var(--x);top:var(--y);width:var(--size);height:var(--size);will-change:transform}
.auth-particle i{display:block;width:100%;height:100%;border-radius:50%;opacity:var(--opacity);filter:blur(var(--blur));background:var(--color)}
body.auth-particles-on #auth-root{position:relative;z-index:1;background:#fff;box-shadow:0 20px 70px #4c5c8b09;border-color:#e4e8f0}
@media(max-width:650px){.auth-particle:nth-child(n+85){display:none}}
@media(prefers-reduced-motion:reduce){.auth-particle{will-change:auto}}
#auth-root{box-sizing:border-box;width:100%;max-width:500px;flex-shrink:0;margin:auto;padding:36px;border:1px solid #e6e9eb;border-radius:24px;background:#fff;color:#30363b;box-shadow:0 16px 60px #24363b0a;font-family:system-ui,sans-serif}
#auth-root[hidden]{display:none!important}#auth-root.admin-wide{max-width:1000px;margin:6px auto}
#auth-root h1{font-size:27px;margin:22px 0 10px}#auth-root h2{font-size:18px;margin:8px 0}#auth-root p{line-height:1.7;font-size:14px;overflow-wrap:anywhere}
.auth-brand{font-size:20px;font-weight:600}.auth-badge{display:inline-block;font-size:12px;color:#6e7d83;background:#eff4f5;border-radius:30px;padding:4px 10px;margin-top:10px}
#auth-root label{display:block;font-size:14px;margin:16px 0}#auth-root input:not([type=checkbox]){box-sizing:border-box;display:block;width:100%;padding:12px 14px;margin-top:8px;border:1px solid #d9dfe3;border-radius:10px;font:inherit;background:#fff;color:#30363b}
#auth-root button,.auth-actions button{border:1px solid #dce2e5;border-radius:12px;background:#f5f7f8;color:#30363b;padding:10px 16px;cursor:pointer;margin:4px 8px 4px 0;font:inherit;font-size:14px}
#auth-root button[type=submit]{background:#347bf6;color:#fff;border-color:transparent;width:100%;margin-top:8px}#auth-root button:disabled{opacity:.5;cursor:wait}.auth-message{color:#9c512e;min-height:20px}
#auth-root .auth-login-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
#auth-root .auth-login-links button{margin:0;padding:10px 8px;text-align:center;background:transparent;border:0;box-shadow:none}
#auth-root .auth-login-links button:hover{text-decoration:underline;text-underline-offset:4px}
.auth-qr{width:200px;height:200px;display:block;margin:16px auto}.auth-secret{user-select:all}.admin-users{display:grid;gap:18px;margin-top:24px}.admin-user{padding:20px;background:#fafbfc;border:1px solid #e5e8eb;border-radius:16px}
#auth-root details{background:#fff;border:1px solid #e5e8eb;border-radius:12px;margin:12px 0;padding:12px}#auth-root summary{cursor:pointer;font-weight:600}#auth-root details label{display:inline-flex;align-items:center;gap:8px;width:calc(50% - 16px);margin:8px;font-size:13px}#auth-root input[type=checkbox]{width:16px;height:16px;accent-color:#347bf6}
.auth-actions{display:flex;align-items:center;gap:8px}.auth-actions span{font-size:12px;color:#7d888f}.auth-actions button{padding:5px 10px;margin:0}
.header-right .auth-actions button{background:transparent;border-color:transparent;transition:background-color .15s ease,border-color .15s ease}
.header-right .auth-actions button:hover,.header-right .auth-actions button:focus-visible{background:#f5f7f8;border-color:#dce2e5}
body:not(.home-screen) .header-right #status,body:not(.home-screen) .header-right .auth-actions{display:none}
.account-identity{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #edf0f1;margin-bottom:16px}
#account-email{min-width:0;overflow-wrap:anywhere;color:#596169;font-size:13px}
#account-settings-actions{flex-shrink:0}
#account-logout{padding:8px 12px;border:1px solid #e4e8eb;border-radius:10px;background:transparent;color:#596169}
#account-logout:hover,#account-logout:focus-visible{background:#f5f7f8}
.header-right #status[role=button]{cursor:pointer;max-width:40vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px;border-radius:10px}
.header-right #status[role=button]:hover,.header-right #status[role=button]:focus-visible{background:#f5f7f8;color:#30363b;outline-offset:2px}
dialog.personal-center{width:min(1120px,calc(100% - 32px));max-height:90dvh;padding:28px;background:#fff;color:#303b43;overflow:auto;overscroll-behavior:contain}
.personal-center .dialog-top h2{margin:0;font-size:24px}
.personal-center .dialog-top .icon-button{display:grid;place-items:center;width:36px;height:36px;padding:0;border-radius:50%}
.personal-center .account-identity{margin:16px 0 24px}
.history-section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.history-section-heading h3{font-size:18px;font-weight:500;margin:0}
.history-retention,#history-notice{font-size:13px;line-height:1.8;color:#84929b}
#history-notice:empty{display:none}
#result-history-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:20px 0}
.history-result-card{min-width:0;border:1px solid #e8ecef;border-radius:16px;padding:10px;background:#fff}
.history-result-preview{display:flex;justify-content:center;align-items:center;width:100%;aspect-ratio:3/4;border:0;border-radius:10px;background:#f5f7f8;padding:10px;color:#84929b;font-size:13px;overflow:hidden}
.history-result-preview:disabled{opacity:1}
.history-result-preview img{width:100%;height:100%;object-fit:contain}
.history-result-card p{font-size:12px;margin:12px 0 0;line-height:1.6}
.history-result-card .history-expiry{color:#84929b;margin-top:4px}
.history-result-card a{display:inline-block;margin:12px 0 2px;font-size:13px;color:#42698c;text-decoration:underline;text-underline-offset:3px}
#history-more{display:block;margin:20px auto;background:#fff;border:1px solid #e3e8eb;border-radius:20px;padding:10px 24px}
#account-preferences{border-top:1px solid #edf0f1;margin-top:24px;padding-top:20px}
#account-preferences summary{cursor:pointer;color:#73818b;font-size:13px}
#account-preferences>p{font-size:13px;color:#84929b}
dialog.history-viewer{width:min(1200px,calc(100vw - 32px));height:90dvh;max-height:90dvh;padding:36px 24px 48px;overflow:hidden;background:#f5f7f8;color:#596169}
.history-viewer>button{position:absolute;right:12px;top:12px;z-index:2;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:50%;padding:0;background:#fff}
.history-viewer .image-zoom-viewport{width:100%;height:100%}
.history-viewer .image-zoom-viewport img{width:100%;height:100%;object-fit:contain;user-select:none}
.history-viewer-status{position:absolute;bottom:8px;left:20px;right:20px;margin:0;text-align:center;font-size:12px;line-height:1.6;pointer-events:none}
@media(max-width:900px){#result-history-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){dialog.personal-center{padding:20px 16px}#result-history-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.history-result-card{padding:8px}.history-result-card p{font-size:11px}.personal-center .account-identity{align-items:flex-start}.history-retention{font-size:12px}}
@media(max-width:650px){body.auth-gated{padding:20px 12px}#auth-root{padding:24px}#auth-root details label{width:100%;margin:7px 0}.auth-actions span{display:none}.auth-actions{gap:3px}}
/* Turnstile flexible widgets need at least 300px, including on narrow phones. */
@media(max-width:374px){body.auth-gated{padding-inline:4px}#auth-root{padding-inline:clamp(5px,calc((100vw - 310px)/2),24px)}}
.auth-captcha{width:100%}
.admin-user-name{display:block;font-size:18px;margin-bottom:6px}.admin-user-meta{display:block;font-size:13px;font-weight:400;color:#6e7d83;overflow-wrap:anywhere}
#auth-root .admin-usage{background:transparent;border:0;margin:0 0 16px;padding:0}#auth-root .admin-usage summary{list-style:disclosure-closed;padding:4px 0}#auth-root .admin-usage[open] summary{list-style:disclosure-open}
.admin-usage-content{padding:12px 0;font-size:14px}.admin-usage-content h3{font-size:15px;margin:20px 0 12px}.admin-usage-scroll{overflow:auto;background:#fff;border:1px solid #e5e8eb;border-radius:12px}.admin-usage-scroll table{border-collapse:collapse;width:100%;font-size:13px}.admin-usage-scroll th,.admin-usage-scroll td{padding:12px;text-align:right;white-space:nowrap;border-bottom:1px solid #edf0f2}.admin-usage-scroll th:first-child,.admin-usage-scroll td:first-child{text-align:left}.admin-usage-scroll th{background:#f3f6f8;font-weight:500}.admin-usage-scroll tr:last-child td{border-bottom:0}#auth-root .admin-usage-note{font-size:12px;color:#7d888f}
.auth-captcha{margin:16px 0;min-height:65px}#auth-root input[type=hidden]{display:none}.workspace-backup{border-top:1px solid #e5e8eb;margin-top:20px;padding-top:16px}.workspace-backup h3{font-size:15px;margin:0 0 10px}.workspace-backup p{font-size:13px;line-height:1.6}.workspace-backup label{display:flex;align-items:center;gap:8px;font-size:13px;margin:14px 0}.workspace-backup input[type=checkbox]{width:16px;height:16px}.workspace-backup button{border:1px solid #dce2e5;border-radius:10px;background:#f5f7f8;padding:8px 12px;cursor:pointer;font:inherit;font-size:13px;margin-right:8px}
#auth-root .admin-prompts{margin-top:26px}#auth-root .admin-prompt-card{padding:18px;background:#fafbfc}
#auth-root .admin-prompt-card label{display:block;width:auto;margin:16px 0}#auth-root .admin-prompt-card textarea{box-sizing:border-box;width:100%;display:block;margin-top:10px;padding:14px;border:1px solid #d9dfe3;border-radius:12px;min-height:140px;resize:vertical;font:inherit;line-height:1.7;background:#fff;color:#30363b}
#auth-root .admin-prompt-meta{font-size:12px;color:#72818a}.admin-prompt-preview{white-space:pre-wrap;overflow-wrap:anywhere;background:#f0f3f5;border-radius:10px;padding:16px;font:inherit;font-size:14px;line-height:1.7}.admin-prompt-actions{display:flex;flex-wrap:wrap}.admin-prompt-history{border-top:1px solid #dce2e5;margin-top:16px;padding-top:16px}
