/* Stage 1 owns the frame and navigation; page redesigns follow separately. */
body:has(.client-foundation){background:var(--client-canvas)!important;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--client-ink)}
body:has(.client-foundation)>.nav{display:none!important}
body:has(.client-foundation) #app{padding:0;margin:0;min-height:100dvh}
body .client-shell.client-foundation{box-sizing:border-box;width:100%;max-width:540px;margin:0 auto;padding:18px 20px calc(108px + env(safe-area-inset-bottom));min-height:100dvh;background:var(--client-page)!important;font-family:inherit;box-shadow:none}
.foundation-header{height:44px;display:flex;justify-content:space-between;align-items:center;margin:0 0 20px}
.foundation-header>a{font-size:var(--type-caption);font-weight:800;letter-spacing:.16em;text-decoration:none;color:#647883}
.foundation-header>a b{color:#139b9e}
.foundation-header button{display:grid;place-items:center;width:36px;height:36px;padding:9px;border:1px solid var(--client-line);border-radius:50%;background:var(--client-surface);color:var(--client-ink);box-shadow:none}
.foundation-header svg{width:17px;height:17px}
body .client-foundation .foundation-tabs{position:fixed!important;top:auto!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;left:50%!important;transform:translateX(-50%)!important;z-index:30;box-sizing:border-box;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:0!important;width:calc(100% - 24px)!important;max-width:516px!important;margin:0!important;padding:7px 4px!important;border:1px solid var(--client-line)!important;border-radius:24px!important;background:#ffffffed!important;backdrop-filter:blur(18px);box-shadow:0 5px 24px #1735420d!important}
body .client-foundation .foundation-tabs button{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-width:0;min-height:48px;padding:5px 0!important;gap:5px!important;border:0!important;border-radius:14px!important;background:transparent!important;color:#7b8d97!important;box-shadow:none!important;text-shadow:none!important;font-family:inherit}
body .client-foundation .foundation-tabs button.active{color:#078e98!important;background:transparent!important}
body .client-foundation .foundation-tabs button::before,body .client-foundation .foundation-tabs button::after{display:none!important;content:none!important}
body .client-foundation .foundation-tabs svg{width:20px;height:20px;flex-shrink:0}
body .client-foundation .foundation-tabs button span{font-size:var(--type-caption)!important;line-height:1.2;font-weight:600!important;letter-spacing:0!important}
.client-foundation button:focus-visible,.client-foundation a:focus-visible{outline:2px solid #078e98!important;outline-offset:4px}
.client-foundation #client-content{padding-bottom:0!important}
.client-foundation .client-privacy-footer{padding:24px 0 0;text-align:center}
body:has(.client-foundation) #chat-launcher{bottom:calc(90px + env(safe-area-inset-bottom))!important}
body:has(.client-foundation) #toast{bottom:calc(150px + env(safe-area-inset-bottom))}
.foundation-profile h1{font-size:var(--type-title);letter-spacing:-.04em;margin:5px 0 25px}
.foundation-kicker{font-size:var(--type-caption);letter-spacing:.13em;font-weight:700;color:#71858f}
.foundation-account{display:flex;align-items:center;gap:14px;padding:20px 16px;background:var(--client-surface);border:1px solid var(--client-line);border-radius:20px}
.foundation-avatar{display:grid;place-items:center;width:48px;height:48px;background:var(--client-soft);border-radius:50%;color:#078e98;font-size:20px;font-weight:700}
.foundation-account h2{margin:0;font-size:var(--type-section)}.foundation-account p{font-size:var(--type-body);color:var(--client-muted);margin:5px 0 0}
.foundation-settings{margin-top:18px;border:1px solid var(--client-line);border-radius:20px;overflow:hidden;background:var(--client-surface)}
.foundation-settings button{display:flex;justify-content:space-between;width:100%;padding:19px 16px;border:0;background:var(--client-surface);color:var(--client-ink);text-align:left;font:500 14px inherit;border-radius:0;box-shadow:none}
.foundation-settings button+button{border-top:1px solid var(--client-line)}
@media(max-width:380px){body .client-shell.client-foundation{padding-left:14px;padding-right:14px}.foundation-tabs button span{font-size:var(--type-caption)!important}}
body:has(.client-foundation) .client-foundation .foundation-tabs button.active{background:transparent!important;box-shadow:none!important}
body:has(.client-foundation) .foundation-profile h1,body:has(.client-foundation) .foundation-profile h2{font-family:inherit!important;text-shadow:none!important;color:var(--client-ink)!important}
body:has(.client-foundation) #toast:not(.show){visibility:hidden}
body:has(.client-foundation) #chat-launcher{right:max(18px,calc((100vw - 500px)/2))!important}
/* Hide the client chat launcher while the staged redesign is reviewed. */
body:has(.client-foundation) #chat-launcher{display:none!important}

/* Keep navigation still while only the page content slides between tabs. */
html:has(.client-foundation){scrollbar-gutter:stable}
body .client-foundation .foundation-tabs button,
body .client-foundation .foundation-tabs button:is(.active,:hover,:active){
  animation:none!important;
  transform:none!important;
  transition:background-color .2s ease,color .2s ease,box-shadow .2s ease!important;
}

/* Clip sliding pages without creating a horizontal scrollbar or moving the dock. */
body:has(.client-foundation){overflow-x:clip}
body .client-shell.client-foundation{overflow-x:clip}
body:has(.client-foundation) .client-foundation nav.foundation-tabs{
 left:0!important;right:0!important;bottom:0!important;transform:none!important;
 width:100%!important;max-width:none!important;border-radius:0!important;
 border-width:1px 0 0!important;padding:8px max(8px,calc((100% - 540px)/2)) calc(8px + env(safe-area-inset-bottom))!important;
 box-shadow:0 -4px 20px #1735420a!important;
}
