:root{font-family:system-ui,sans-serif;color:#202336;background:#f5f5fb}body{margin:0;display:grid;min-height:100vh;place-items:center}main{box-sizing:border-box;width:min(92vw,30rem);padding:2rem;border-radius:1rem;background:white;box-shadow:0 12px 40px #24325b18}h1{font-size:1.7rem;margin:0 0 .5rem}p{line-height:1.5}label{display:block;font-weight:600}input,button{box-sizing:border-box;width:100%;font:inherit;padding:.8rem;margin-top:.7rem;border-radius:.5rem}input{border:1px solid #a8adbe}button{border:0;color:white;background:#5146cf;cursor:pointer}button:focus-visible,input:focus-visible{outline:3px solid #9f99ff;outline-offset:2px}#status{min-height:1.5rem;color:#6d3050}
.contact{padding:.8rem;border-radius:.5rem;line-height:1.4}.unknown .contact{background:#eeedf9;color:#30297b;font-weight:600;border:1px solid #d1ccf5}.known .contact{background:#f4f3fb;color:#333}

button.secondary{background:#eeedf9;color:#3a329a}

.identity-card{border:1px solid #e9e6f5}
.identity-wordmark{display:flex;align-items:center;gap:.65rem;color:#27244d;font-size:clamp(1.9rem,7vw,2.55rem);font-weight:750;letter-spacing:-.05em;line-height:1.15}
.identity-mark{display:block;flex:none;width:2.625rem;height:2.625rem}
.identity-enrollment p{color:#52526b}
.login-context{font-size:1.2rem;margin:1.25rem 0 .25rem;color:#27244d}
.identity-enrollment{border-top:1px solid #e9e6f5;margin-top:1.25rem;padding-top:1.25rem}
.identity-enrollment h2{font-size:1.2rem;margin:0}
.identity-card #status:empty{margin:0;min-height:0}
.identity-card .contact{font-size:.9rem}
.known .contact{padding:.35rem 0;background:transparent;color:#52526b}
.enroll-title{font-size:1.45rem;margin:1rem 0 .35rem}
.app-kicker{font-size:.7rem;letter-spacing:.14em;font-weight:700;color:#5247b2}
button:disabled{opacity:.75;cursor:wait}
.owner-code{font:700 1.7rem ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;color:#27244d}
.apps-header{display:flex;align-items:center;justify-content:space-between;gap:1rem}

/* Keep the selector at the top without changing the shared centered auth cards. */
body.apps-page{display:block;place-items:normal;min-height:100vh;min-height:100svh;--apps-gutter:max(clamp(1rem,4vw,2.5rem),env(safe-area-inset-left),env(safe-area-inset-right))}
.apps-bar{background:white;border-bottom:1px solid #e9e6f5}
.apps-bar-inner,main.apps-main{box-sizing:border-box;width:100%;max-width:72rem;margin-inline:auto;padding-inline:var(--apps-gutter)}
.apps-bar-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:4.25rem}
.apps-heading{margin:0;color:#27244d;font-size:clamp(1.25rem,4vw,1.5rem);line-height:1.2;overflow-wrap:anywhere}
.apps-bar .account-trigger{width:2.75rem;height:2.75rem}
.apps-bar .account-popover{box-sizing:border-box;width:min(18rem,calc(100vw - var(--apps-gutter) - var(--apps-gutter)))}
main.apps-main{padding-block:1rem 2rem;border-radius:0;background:none;box-shadow:none}
.apps-main #apps-status{margin:0;color:#52526b}
.apps-main #apps-status:empty,.apps-main .app-list[hidden]{display:none}
.apps-main .app-list{display:grid;gap:.7rem;max-width:40rem}
.apps-main .app-link{display:block;padding:1rem;border:1px solid #d1ccf5;border-radius:.65rem;color:#30297b;background:#fff;font-weight:750;text-decoration:none;overflow-wrap:anywhere}
.apps-main .app-link:hover{background:#eeedf9;text-decoration:underline}
.apps-main .app-link:focus-visible{outline:3px solid #9f99ff;outline-offset:2px}

/* The app handoff is quiet until it needs a progress indicator or recovery. */
.handoff-shell{width:min(92vw,30rem);padding:0;background:none;box-shadow:none;text-align:center}
#status.handoff-status{display:inline-flex;align-items:center;gap:.65rem;min-height:0;color:#27244d;font-weight:600}
.transition-progress{display:inline-flex;align-items:center}
.transition-spinner,.handoff-status:not(:empty)::before{content:"";box-sizing:border-box;flex:none;width:1.25rem;height:1.25rem;border:2px solid #d1ccf5;border-top-color:#5146cf;border-radius:50%;animation:handoff-spin .8s linear infinite}
@keyframes handoff-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.transition-spinner,.handoff-status:not(:empty)::before{animation:none}}
.handoff-error{padding:clamp(1.25rem,6vw,2rem);border-radius:1rem;background:white;box-shadow:0 12px 40px #24325b18;text-align:start}
#signout-progress[hidden]{display:none}

/* Only the authenticated Hello World page uses this full-height app shell. */
body.hello-page{display:grid;grid-template-rows:auto 1fr;place-items:stretch;min-height:100vh;min-height:100svh}
.hello-banner{background:#fff;border-bottom:1px solid #e9e6f5;padding-inline:max(clamp(1rem,4vw,2.5rem),env(safe-area-inset-left),env(safe-area-inset-right))}
.hello-banner-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;max-width:72rem;margin-inline:auto;min-height:4.25rem}
.hello-brand{color:#27244d;font-size:1.05rem;font-weight:750}
main.hello-main{display:grid;place-items:center;width:100%;padding:clamp(1.25rem,5vw,3rem);border-radius:0;background:none;box-shadow:none;text-align:center}
.hello-message{max-width:38rem}
.hello-gesture{display:block;margin-bottom:.65rem;font-size:clamp(2rem,8vw,3.25rem);line-height:1.35}
.hello-title{margin:0;color:#27244d;font-size:clamp(2.4rem,9vw,5rem);line-height:1.1;letter-spacing:-.05em;text-wrap:balance}
.hello-copy{max-width:32ch;margin:1rem auto 0;color:#52526b;font-size:clamp(1rem,3.5vw,1.25rem);text-wrap:balance}
@media (prefers-reduced-motion:no-preference){.hello-title{animation:hello-reveal 1.4s cubic-bezier(.22,.65,.3,1) both}}
@keyframes hello-reveal{from{opacity:.72;transform:translateY(.35rem) scale(.975)}to{opacity:1;transform:none}}

/* Keep the sign-in label centered and announce only noticeable preparation. */
.passkey-signin{display:grid;grid-template-columns:.875rem minmax(0,max-content) .875rem;justify-content:center;align-items:center;column-gap:.45rem}
.passkey-signin>span:first-child{grid-area:1/2}
.passkey-signin #passkey-spinner{grid-area:1/3;width:.875rem;height:.875rem;border-color:#ffffff70;border-top-color:white}
#passkey-progress{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
