/* Pre-platform layout only: never constrain authenticated module workspaces. */
body:has(> #app > .landing-screen),
#app:has(> .landing-screen) {
    min-height: 100svh;
    min-height: 100dvh;
}
#app > .landing-screen {
    width: 100%;
    height: auto;
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: minmax(min-content, 1fr) auto;
    justify-items: center;
    padding: max(.4rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom)) max(.65rem, env(safe-area-inset-left));
    overflow: visible;
}
#app > .landing-screen > .landing-shell {
    width: min(100%, 1200px);
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: .35rem 0;
    display: grid;
    place-items: center;
    align-self: stretch;
}
#app > .landing-screen .landing-orb {
    max-width: 40%;
    max-height: 70%;
    inset-inline: auto 0;
    z-index: -1;
}
#app > .landing-screen .landing-orb--left { inset-inline: 0 auto; }
#app > .landing-screen .auth-panel { padding: 0; justify-self: center; min-width: 0; }
#app > .landing-screen .auth-card { position: relative; padding: .8rem; }
#app > .landing-screen .auth-brand-panel { gap: .4rem; padding: .6rem; margin-bottom: .65rem; }
#app > .landing-screen .auth-brand-panel__logo { height: clamp(52px, 12dvh, 96px); }
#app > .landing-screen .auth-input { font-size: 1rem; min-height: 44px; }
#app > .landing-screen .auth-form { gap: .5rem; }
#app > .landing-screen .access-public-navigation { margin-top: .5rem; gap: .15rem .5rem; }
#app > .landing-screen .landing-card {
    gap: clamp(.4rem, 1.8dvh, 1.15rem);
    padding: clamp(.75rem, 3dvh, 2rem);
}
#app > .landing-screen .landing-logo { max-height: 32dvh; width: min(100%, 450px); }
#app > .landing-screen .landing-kicker { min-height: 36px; padding: .5rem .75rem; }
#app > .landing-screen .landing-btn-primary { min-height: 44px; padding: .7rem 1.25rem; min-width: min(240px, 100%); }
#app > .landing-screen .footer-shell { width: 100%; margin: 0; padding: 0; }
#app > .landing-screen .footer-shell__inner {
    min-height: 0;
    padding: .4rem .5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: .15rem .75rem;
    font-size: .65rem;
    line-height: 1.25;
}
#app > .landing-screen .footer-shell__inner > div { width: auto; font-size: inherit; line-height: inherit; }
/* Keyboard, text zoom and unusually long notices may grow the page safely. */
@media (max-height: 680px) {
    #app > .landing-screen .auth-brand-panel { grid-template-columns: minmax(70px, 100px) minmax(0, 1fr); align-items: center; gap: .55rem; }
    #app > .landing-screen .auth-brand-panel__logo { width: 100%; height: 52px; padding: .25rem; border-radius: 12px; }
    #app > .landing-screen .auth-kicker { min-height: 26px; font-size: .63rem; padding: .25rem .4rem; letter-spacing: .06em; }
    #app > .landing-screen .auth-copy { font-size: .75rem; }
    #app > .landing-screen .auth-title { font-size: 1rem; }
    #app > .landing-screen .auth-check,
    #app > .landing-screen .auth-link { font-size: .75rem; }
    #app > .landing-screen .auth-row { gap: .4rem; }
    #app > .landing-screen .auth-actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
    #app > .landing-screen .auth-btn-primary,
    #app > .landing-screen .auth-btn-secondary { min-height: 44px; padding: .4rem; font-size: .85rem; }
}
@media (min-width: 640px) and (max-height: 500px) {
    #app > .landing-screen .auth-panel { width: min(100%, 780px); }
    #app > .landing-screen .auth-card:has(> .auth-form) { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); grid-template-areas: "brand form" "links form"; gap: .5rem 1rem; align-items: center; }
    #app > .landing-screen .auth-brand-panel { grid-area: brand; grid-template-columns: 1fr; margin: 0; }
    #app > .landing-screen .auth-brand-panel__logo { width: 170px; height: 64px; }
    #app > .landing-screen .auth-form { grid-area: form; }
    #app > .landing-screen .auth-card > .access-public-navigation { grid-area: links; margin: 0; }
    #app > .landing-screen .auth-row { gap: .25rem; }
}
/* Profile choice is still before entering a workspace. Keep its existing pager. */
#app > .landing-screen--context { grid-template-rows: 1fr; }
#app > .landing-screen--context > .landing-shell { grid-template-rows: minmax(min-content, 1fr) auto; gap: .35rem; }
#app > .landing-screen--context .context-selector { width: min(100%, 1040px); padding: .8rem; min-width: 0; }
#app > .landing-screen--context .context-selector__hero { gap: .4rem; margin-bottom: .5rem; }
#app > .landing-screen--context .context-selector__brand { flex-direction: row; align-items: center; gap: .65rem; }
#app > .landing-screen--context .context-selector__logo { width: 48px; height: 48px; padding: .2rem; }
#app > .landing-screen--context .context-selector__title { font-size: 1.05rem; }
#app > .landing-screen--context .context-selector__copy,
#app > .landing-screen--context .context-selector__helper { font-size: .8rem; line-height: 1.3; }
#app > .landing-screen--context .context-selector__helper { padding: .4rem .6rem; }
#app > .landing-screen--context .context-selector__search { gap: .2rem; }
#app > .landing-screen--context .context-selector__search-status { font-size: .75rem; }
#app > .landing-screen--context .context-selector__list { gap: .4rem; padding: 0; }
#app > .landing-screen--context .context-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: .35rem; padding: .5rem; }
#app > .landing-screen--context .context-row__icon { width: 28px; height: 28px; }
#app > .landing-screen--context .context-row__badges { grid-column: 2; }
#app > .landing-screen--context .context-row__arrow { grid-column: 3; grid-row: 1; }
#app > .landing-screen--context .context-card__meta { font-size: .72rem; line-height: 1.3; }
#app > .landing-screen--context .context-selector__pager { margin-top: .5rem; flex-direction: row; justify-content: space-between; gap: .4rem; }
#app > .landing-screen--context .context-selector__pager-status { font-size: .78rem; min-width: 0; }
#app > .landing-screen--context .context-selector__actions { margin-top: .4rem; }
#app > .landing-screen--context .auth-btn-secondary { min-height: 40px; padding: .4rem .7rem; }
@media (min-width: 640px) and (max-height: 650px) {
    #app > .landing-screen--context .context-selector { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .5rem 1rem; align-items: start; }
    #app > .landing-screen--context .context-selector__hero { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
    #app > .landing-screen--context .context-selector__list,
    #app > .landing-screen--context .context-selector__pager { grid-column: 2; }
    #app > .landing-screen--context .context-selector__actions { grid-column: 1; grid-row: 3; }
}

@media (max-width: 560px) {
    #app > .landing-screen .footer-shell__inner { font-size: .6rem; gap: .1rem .5rem; }
    #app > .landing-screen .footer-shell__inner > div { font-size: inherit; line-height: inherit; }
    #app > .landing-screen .footer-shell__copy { order: 3; }
    #app > .landing-screen .auth-card:has(#passwordChangeForm) { padding: .6rem; }
    #app > .landing-screen .auth-card:has(#passwordChangeForm) .auth-brand-panel { grid-template-columns: 1fr; padding: .4rem; }
    #app > .landing-screen .auth-card:has(#passwordChangeForm) .auth-brand-panel__logo { width: 130px; height: 36px; }
    #app > .landing-screen--context .context-selector { padding: .5rem; }
    #app > .landing-screen--context .context-selector__eyebrow,
    #app > .landing-screen--context .context-card__eyebrow { font-size: .62rem; letter-spacing: .07em; line-height: 1.25; }
    #app > .landing-screen--context .context-selector__copy,
    #app > .landing-screen--context .context-selector__helper { font-size: .75rem; line-height: 1.25; }
    #app > .landing-screen--context .context-selector__search-label,
    #app > .landing-screen--context .context-selector__search-status { font-size: .72rem; line-height: 1.25; }
    #app > .landing-screen--context .context-row__headline { gap: .15rem .5rem; }
    #app > .landing-screen--context .context-card__role { font-size: .8rem; line-height: 1.2; margin: 0; }
    #app > .landing-screen--context .context-row__badges { margin: 0; }
    #app > .landing-screen--context .context-selector__pager { flex-direction: row; }
    #app > .landing-screen--context .context-selector__pager > button { width: auto; min-width: 0; font-size: .75rem; }
}

@media (min-width: 640px) and (max-height: 500px) {
    #app > .landing-screen .landing-logo { max-height: 24dvh; }
    #app > .landing-screen .landing-card { padding: .65rem; gap: .4rem; }
    #app > .landing-screen .auth-copy-block { gap: .2rem; }
    #app > .landing-screen--context .context-selector { padding: .6rem; }
    #app > .landing-screen--context .context-selector__hero { gap: .3rem; }
    #app > .landing-screen--context .context-selector__eyebrow { font-size: .62rem; letter-spacing: .07em; }
    #app > .landing-screen--context .context-selector__copy,
    #app > .landing-screen--context .context-selector__helper { font-size: .75rem; }
    #app > .landing-screen--context .context-selector__search-label { font-size: .72rem; }
}
