/* =========================================================
   SKYSUITE STAGE 89.3 — NATIVE MOBILE APP SHELL
   - Phone/tablet: no side drawer or sidebar navigation
   - Bottom app dock + native More sheet
   - Installed mobile PWA: no dashboard/login media
   - Desktop rendering is intentionally unchanged
   ========================================================= */

:root{
  --sky89-teal:#7A1F3D;
  --sky89-aqua:#9F3157;
  --sky89-violet:#7A1F3D;
  --sky89-blue:#7A1F3D;
  --sky89-green:#7A1F3D;
  --sky89-coral:#F16065;
  --sky89-amber:#F2C45E;
  --sky89-bg:#F7F8FA;
  --sky89-ink:#201519;
  --sky89-muted:#897C80;
  --sky89-line:#EAE1E4;
  --sky89-soft:#F8EAEF;
  --sky89-accent:var(--sky89-teal);
  --sky89-safe-bottom:env(safe-area-inset-bottom,0px);
  --sky89-safe-top:env(safe-area-inset-top,0px);
  --sky89-dock-height:66px;
}

html[data-sky-pwa-portal="student"],body[data-sky-mobile-portal="student"]{--sky89-accent:var(--sky89-blue);--sky89-soft:#F8EDEF}
html[data-sky-pwa-portal="family"],body[data-sky-mobile-portal="family"]{--sky89-accent:var(--sky89-green);--sky89-soft:#F8EDEF}
html[data-sky-pwa-portal="learning"],body[data-sky-mobile-portal="learning"]{--sky89-accent:var(--sky89-violet);--sky89-soft:#F8EDEF}
html[data-sky-pwa-portal="community"],body[data-sky-mobile-portal="community"],html[data-sky-pwa-portal="staff"],body[data-sky-mobile-portal="staff"],html[data-sky-pwa-portal="operations"],body[data-sky-mobile-portal="operations"]{--sky89-accent:var(--sky89-teal);--sky89-soft:#F8EAEF}

/* Stage 89.1 — login screens stay clean.
   Routine redirect/logout notices are intentionally not displayed above the form.
   A genuine authentication failure is moved into one compact inline message. */
.portal-messages,.sg-messages,.sl-messages{display:none!important}
.sky89-login-error{
  display:flex;align-items:flex-start;gap:9px;
  margin:2px 0 13px;padding:10px 12px;
  border:1px solid #F3C7CA;border-radius:13px;
  background:#FFF5F5;color:#9E343B;
  font-size:12px;line-height:1.4;font-weight:650;
}
.sky89-login-error>span{
  flex:0 0 22px;width:22px;height:22px;display:grid;place-items:center;
  border-radius:50%;background:#FDE1E3;color:#C2444C;font-size:12px;font-weight:900;
}
.sky89-login-error p{margin:1px 0 0;min-width:0}

/* Old generated mobile shells are disabled when Stage 89 is present. */
.sky-mobile-bottom-nav,.sky87-mobile-dock,.sky87-more-backdrop,.sky87-more-sheet,.sky-mobile-nav-overlay{display:none!important}

.sky89-dock,.sky89-more-backdrop,.sky89-more-sheet,.sky89-network{display:none}

@media(max-width:980px){
  html:not(.sky-pwa-desktop) body.sky89-mobile{
    min-height:100dvh;
    padding-bottom:calc(var(--sky89-dock-height) + var(--sky89-safe-bottom) + 12px)!important;
    background:var(--sky89-bg);
    -webkit-tap-highlight-color:transparent;
    overscroll-behavior-y:none;
  }

  /* -------------------------------------------------------
     NO MOBILE SIDEBAR / NO HAMBURGER
     The authorized links remain in the DOM only as the secure
     source for the bottom dock + More sheet.
     ------------------------------------------------------- */
  html:not(.sky-pwa-desktop) body.sky89-mobile .sidebar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-sidebar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-sidebar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-side{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:none!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile #sidebar-collapse,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-mobile,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-mobile-toggle,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-mobile{
    display:none!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile.sky-mobile-nav-open,
  html:not(.sky-pwa-desktop) body.sky89-mobile.sky-portal-drawer-open{overflow:auto!important}

  html:not(.sky-pwa-desktop) body.sky89-mobile .main-content{
    width:100%!important;
    max-width:100%!important;
    margin-left:0!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-shell,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-shell,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-shell{
    display:block!important;
    grid-template-columns:1fr!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-main,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-main,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-main,
  html:not(.sky-pwa-desktop) body.sky89-mobile .learn-main,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-main{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
  }

  /* Community becomes a true mobile app surface too. */
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-main-nav{display:none!important}
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-topbar{
    min-height:58px!important;
    height:auto!important;
    padding:calc(8px + var(--sky89-safe-top)) 14px 8px!important;
    flex-wrap:nowrap!important;
    gap:10px!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-top-actions{max-width:54%;min-width:0}
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-persona{display:none!important}
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-back{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Compact sticky app bars. */
  html:not(.sky-pwa-desktop) body.sky89-mobile .sky-global-topbar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-topbar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-topbar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-top,
  html:not(.sky-pwa-desktop) body.sky89-mobile .learn-nav{
    min-height:58px!important;
    height:auto!important;
    padding-top:var(--sky89-safe-top)!important;
    backdrop-filter:blur(22px) saturate(1.2)!important;
    -webkit-backdrop-filter:blur(22px) saturate(1.2)!important;
  }
  html:not(.sky-pwa-desktop) body.sky89-mobile .sky-global-topbar{padding-left:14px!important;padding-right:14px!important}
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-topbar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-topbar,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-top{padding-left:14px!important;padding-right:14px!important}
  html:not(.sky-pwa-desktop) body.sky89-mobile .learn-nav{padding-left:13px!important;padding-right:13px!important}

  html:not(.sky-pwa-desktop) body.sky89-mobile .main-content,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-content,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-content,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-content,
  html:not(.sky-pwa-desktop) body.sky89-mobile .learn-main,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-main{
    padding-bottom:calc(92px + var(--sky89-safe-bottom))!important;
  }

  /* -------------------------------------------------------
     BOTTOM APP NAVIGATION
     ------------------------------------------------------- */
  .sky89-dock{
    position:fixed;
    z-index:1900;
    left:0;right:0;bottom:0;
    min-height:calc(var(--sky89-dock-height) + var(--sky89-safe-bottom));
    display:grid;
    align-items:start;
    gap:0;
    padding:6px 7px calc(6px + var(--sky89-safe-bottom));
    border-top:1px solid rgba(226,215,219,.94);
    background:rgba(255,255,255,.94);
    box-shadow:0 -10px 35px rgba(58,26,37,.075);
    backdrop-filter:blur(28px) saturate(1.28);
    -webkit-backdrop-filter:blur(28px) saturate(1.28);
  }
  .sky89-dock-item{
    position:relative;
    min-width:0;
    min-height:54px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:3px 1px 2px;
    border:0;
    background:transparent;
    color:#958A8E;
    text-decoration:none;
    font:inherit;
    cursor:pointer;
    touch-action:manipulation;
  }
  .sky89-dock-icon{
    width:31px;height:31px;
    display:grid;place-items:center;
    border-radius:11px;
    transition:background .16s ease,color .16s ease,transform .16s ease;
  }
  .sky89-dock-icon svg{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round}
  .sky89-dock-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;font-weight:800;letter-spacing:-.015em}
  .sky89-dock-item.active{color:var(--sky89-accent)}
  .sky89-dock-item.active .sky89-dock-icon{background:var(--sky89-soft);transform:translateY(-1px)}
  .sky89-dock-item:active .sky89-dock-icon{transform:scale(.92)}
  .sky89-dock-item.sky89-ai .sky89-dock-icon{color:#fff;background:linear-gradient(145deg,var(--sky89-accent),#D65983);box-shadow:0 7px 18px rgba(122,31,61,.25)}
  .sky89-dock-item.sky89-ai .sky89-dock-label{color:var(--sky89-accent)}
  .sky89-dock-badge{
    position:absolute;top:1px;left:calc(50% + 8px);
    min-width:16px;height:16px;padding:0 4px;
    display:grid;place-items:center;
    border:2px solid #fff;border-radius:999px;
    background:var(--sky89-coral);color:#fff;
    font-size:7px;font-weight:900;
  }

  /* -------------------------------------------------------
     APP-STYLE MORE SHEET — Stage 89.3
     Full-width bottom sheet with a 3-column launcher grid,
     modelled after a modern native app workspace.
     ------------------------------------------------------- */
  .sky89-more-backdrop{
    position:fixed;inset:0;z-index:2000;display:block;
    opacity:0;visibility:hidden;pointer-events:none;
    background:rgba(18,25,31,.42);
    backdrop-filter:blur(5px);
    -webkit-backdrop-filter:blur(5px);
    transition:opacity .18s ease,visibility .18s ease;
  }
  .sky89-more-sheet{
    position:fixed;z-index:2010;left:0;right:0;bottom:0;
    display:block;
    max-height:min(76dvh,760px);
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding:7px 16px calc(24px + var(--sky89-safe-bottom));
    border:0;
    border-radius:28px 28px 0 0;
    background:#fff;
    box-shadow:0 -24px 80px rgba(31,13,19,.25);
    transform:translateY(calc(100% + 24px));
    visibility:hidden;
    transition:transform .22s cubic-bezier(.2,.8,.2,1),visibility .22s ease;
  }
  .sky89-more-sheet::-webkit-scrollbar{display:none}
  body.sky89-more-open{overflow:hidden!important}
  body.sky89-more-open .sky89-more-backdrop{opacity:1;visibility:visible;pointer-events:auto}
  body.sky89-more-open .sky89-more-sheet{transform:translateY(0);visibility:visible}
  .sky89-more-grabber{
    position:sticky;top:0;z-index:3;
    width:44px;height:5px;margin:1px auto 16px;
    border-radius:999px;background:#D8D2D5;
  }
  .sky89-more-head{
    display:flex;align-items:center;justify-content:space-between;gap:14px;
    padding:0 2px 17px;margin-bottom:14px;
    border-bottom:1px solid #ECE5E8;
  }
  .sky89-more-head>div{min-width:0;display:flex;flex-direction:column;align-items:flex-start}
  .sky89-more-eyebrow{
    display:block;order:0;margin:0 0 5px!important;
    color:var(--sky89-accent)!important;
    font-size:10px!important;font-weight:950!important;
    line-height:1.1;text-transform:uppercase;letter-spacing:.10em;
  }
  .sky89-more-head strong{
    order:1;display:block;color:var(--sky89-ink);
    font-size:27px;line-height:1;letter-spacing:-.045em;
  }
  .sky89-more-close{
    width:48px;height:48px;flex:0 0 48px;
    display:grid;place-items:center;
    border:1px solid #E5DCDF;border-radius:50%;
    background:#fff;color:#51494C;
    font-size:22px;font-weight:700;line-height:1;
    box-shadow:0 4px 14px rgba(33,27,29,.03);
    cursor:pointer;touch-action:manipulation;
  }
  .sky89-more-links{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
  }
  .sky89-more-link{
    min-width:0;min-height:116px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;
    padding:11px 6px;
    border:1px solid #E9E1E4;border-radius:20px;
    background:#fff;color:#312E30;
    text-decoration:none;text-align:center;
    font-size:10px;line-height:1.2;font-weight:850;
    box-shadow:0 2px 8px rgba(44,29,35,.015);
    touch-action:manipulation;
  }
  .sky89-more-link:active{transform:scale(.975);background:#FAF8F9}
  .sky89-more-link.active{
    border-color:color-mix(in srgb,var(--sky89-accent) 30%,#E9E1E4);
    background:color-mix(in srgb,var(--sky89-soft) 58%,#fff);
    color:var(--sky89-accent);
  }
  .sky89-more-link-icon{
    width:48px;height:48px;flex:0 0 48px;
    display:grid;place-items:center;
    border-radius:16px;
    background:color-mix(in srgb,var(--sky89-soft) 72%,#F5F1F3);
    color:var(--sky89-accent);
  }
  .sky89-more-link.active .sky89-more-link-icon{background:#fff;color:var(--sky89-accent)}
  .sky89-more-link-icon svg{
    width:23px;height:23px;
    fill:none;stroke:currentColor;stroke-width:1.75;
    stroke-linecap:round;stroke-linejoin:round;
  }
  .sky89-more-link>span:last-child{
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    overflow:hidden;max-width:100%;
  }
  .sky89-more-signout{
    border-color:rgba(241,96,101,.24);
    background:#FFF7F7;color:#D94D53;
  }
  .sky89-more-signout .sky89-more-link-icon{background:#FFF0F0;color:#D94D53}

  /* Keep large tables inside the phone viewport. */
  .sky89-table-wrap{width:100%;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:16px}
  .sky89-table-hint{display:none;color:#94888C;font-size:9px;margin:0 0 6px}
  .sky89-table-wrap table{max-width:none}

  /* Network status floats above the dock. */
  .sky89-network{
    position:fixed;z-index:2100;left:12px;right:12px;
    bottom:calc(var(--sky89-dock-height) + var(--sky89-safe-bottom) + 11px);
    display:block;padding:10px 12px;border-radius:13px;
    background:#3F1724;color:#fff;font-size:10px;font-weight:760;text-align:center;
    box-shadow:0 12px 34px rgba(52,15,27,.22);
    opacity:0;transform:translateY(8px);pointer-events:none;transition:.18s ease;
  }
  .sky89-network.show{opacity:1;transform:translateY(0)}

  /* -------------------------------------------------------
     INSTALLED PHONE APP: NO MEDIA
     Browser/desktop experience is untouched.
     ------------------------------------------------------- */
  html.sky-pwa-mobile .hz-hero-media,
  html.sky-pwa-mobile .hz-campus-media-section{display:none!important}
  html.sky-pwa-mobile .hz-hero{grid-template-columns:1fr!important;min-height:0!important}
  html.sky-pwa-mobile .hz-hero-copy{padding-right:0!important}

  html.sky-pwa-mobile body.sg-body .sg-experience-column{display:none!important}
  html.sky-pwa-mobile body.sg-body .sg-enterprise-shell{display:block!important;width:100%!important;max-width:560px!important;padding:0!important}
  html.sky-pwa-mobile body.sg-body .sg-login-card{min-height:100dvh!important;border-radius:0!important;border:0!important;box-shadow:none!important;padding-top:calc(28px + var(--sky89-safe-top))!important}
  html.sky-pwa-mobile body.sg-body{background:var(--sky89-bg)!important}

  html.sky-pwa-mobile body.portal-auth .portal-bg,
  html.sky-pwa-mobile body.portal-auth .portal-overlay{display:none!important}
  html.sky-pwa-mobile body.portal-auth{background:var(--sky89-bg)!important}
  html.sky-pwa-mobile body.portal-auth .portal-frame{background:#fff!important;box-shadow:none!important}
  html.sky-pwa-mobile body.portal-auth .portal-form-side{background:#fff!important}

  html.sky-pwa-mobile body:has(.sl-login-stage) .sl-login-stage,
  html.sky-pwa-mobile body:has(.sl-login-stage) .sl-login-stage:before{background:none!important;background-image:none!important}
  html.sky-pwa-mobile body:has(.sl-login-stage) .sl-login-overlay,
  html.sky-pwa-mobile body:has(.sl-login-stage) .sl-story{display:none!important}
  html.sky-pwa-mobile body:has(.sl-login-stage){background:var(--sky89-bg)!important}
  html.sky-pwa-mobile body:has(.sl-login-stage) .sl-login-shell{background:#fff!important;box-shadow:none!important;border:0!important}

  /* Give the mobile app a cleaner card rhythm. */
  html:not(.sky-pwa-desktop) body.sky89-mobile .hz-panel,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sf-card,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sp-card,
  html:not(.sky-pwa-desktop) body.sky89-mobile .fp-card,
  html:not(.sky-pwa-desktop) body.sky89-mobile .sc-post-card{
    box-shadow:0 8px 26px rgba(58,24,35,.055)!important;
  }
}

@media(max-width:430px){
  .sky89-dock{padding-left:4px;padding-right:4px}
  .sky89-dock-label{font-size:8.3px}
  .sky89-more-sheet{left:0;right:0;border-radius:27px 27px 0 0;padding-left:12px;padding-right:12px}
  .sky89-more-links{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .sky89-more-link{min-height:106px;border-radius:18px;padding:9px 4px;font-size:9px}
  .sky89-more-link-icon{width:44px;height:44px;flex-basis:44px;border-radius:14px}
  .sky89-more-link-icon svg{width:21px;height:21px}
  .sky89-more-signout{grid-column:auto}
}

@media(max-width:350px){
  .sky89-more-links{gap:6px}
  .sky89-more-link{min-height:100px;font-size:8.3px}
  .sky89-more-link-icon{width:40px;height:40px;flex-basis:40px}
}

@media(prefers-reduced-motion:reduce){
  .sky89-dock-item,.sky89-dock-icon,.sky89-more-backdrop,.sky89-more-sheet,.sky89-network{transition:none!important;animation:none!important}
}

@media print{
  .sky89-dock,.sky89-more-backdrop,.sky89-more-sheet,.sky89-network{display:none!important}
  body.sky89-mobile{padding-bottom:0!important}
}

/* Stage 89 login notices: preserve Django severity and avoid every notice
   looking like an error. Duplicate identical messages are removed by
   skysuite-login-v3.js before the page is shown. */
.portal-message.info,
.sg-message.info,
.sl-message.info{
  border-color:rgba(122,31,61,.20)!important;
  background:#FCF0F4!important;
  color:#7A2743!important;
}
.portal-message.success,
.sg-message.success,
.sl-message.success{
  border-color:rgba(87,201,154,.25)!important;
  background:#F1FBF6!important;
  color:#257352!important;
}
.portal-message.warning,
.sg-message.warning,
.sl-message.warning{
  border-color:rgba(242,196,94,.30)!important;
  background:#FFF9E9!important;
  color:#7C6428!important;
}
.portal-message.error,
.sg-message.error,
.sl-message.error{
  border-color:rgba(241,96,101,.24)!important;
  background:#FFF4F4!important;
  color:#F16065!important;
}


/* ==========================================================
   STAGE 89.4 — INSTALLED MOBILE LOGIN: QUICK PORTAL SWITCHER
   The desktop media/portal column stays untouched. In the installed
   phone app the media remains hidden, while the four alternate portals
   are shown as light icon shortcuts — deliberately not cards.
   ========================================================== */
.sky89-mobile-login-portals{display:none}

@media(max-width:980px){
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals{
    display:block;
    margin:22px 0 2px;
    padding-top:18px;
    border-top:1px solid #ECE7E9;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-head{
    display:flex;align-items:end;justify-content:space-between;gap:12px;
    margin-bottom:13px;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-head>div{min-width:0}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-kicker{
    display:block;margin:0 0 3px;
    color:#897C80;font-size:8.5px;font-weight:900;
    line-height:1.1;letter-spacing:.13em;text-transform:uppercase;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-title{
    display:block;color:#201519;font-size:17px;font-weight:900;
    line-height:1.15;letter-spacing:-.025em;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-note{
    color:#968B8F;font-size:8px;font-weight:650;line-height:1.3;text-align:right;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-grid{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal{
    min-width:0;display:flex;flex-direction:column;align-items:center;gap:7px;
    padding:3px 1px 4px;border:0!important;border-radius:0!important;
    background:transparent!important;box-shadow:none!important;
    color:#594C50;text-decoration:none;text-align:center;
    font-size:8.5px;font-weight:800;line-height:1.15;
    touch-action:manipulation;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-icon{
    width:46px;height:46px;display:grid;place-items:center;
    border-radius:15px;background:#F8EEF1;color:#7A1F3D;
    box-shadow:0 4px 12px rgba(61,26,38,.055);
    transition:transform .15s ease,background .15s ease;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal:active .sky89-mobile-login-portal-icon{transform:scale(.95)}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-icon svg{
    width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.75;
    stroke-linecap:round;stroke-linejoin:round;
  }
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-learning .sky89-mobile-login-portal-icon{background:#F8EDEF;color:#7A1F3D}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-staff .sky89-mobile-login-portal-icon{background:#F8EAEF;color:#7A1F3D}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-student .sky89-mobile-login-portal-icon{background:#F8EDEF;color:#7A1F3D}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-family .sky89-mobile-login-portal-icon{background:#F8EDEF;color:#7A1F3D}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal span:last-child{
    display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  }
  html.sky-pwa-mobile body.sg-body .sg-login-card{min-height:100dvh!important;padding-bottom:calc(24px + var(--sky89-safe-bottom))!important}
}

@media(max-width:350px){
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portals-grid{gap:5px}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal-icon{width:42px;height:42px;border-radius:14px}
  html.sky-pwa-mobile body.sg-body .sky89-mobile-login-portal{font-size:8px}
}

/* ==========================================================
   STAGE 89.7 — CLEAN MOBILE LOGIN + COMPACT COLLAPSIBLE MORE
   ========================================================== */
@media(max-width:980px){
  /* Mobile login is intentionally media-free. The sign-in form and portal
     shortcuts are the experience; desktop keeps the richer media treatment. */
  body.sg-body .sg-experience-column{display:none!important}
  body.sg-body .sg-enterprise-shell{display:block!important;width:100%!important;max-width:560px!important;padding:0!important}
  body.sg-body .sg-login-card{min-height:100dvh!important;border-radius:0!important;border:0!important;box-shadow:none!important;padding-top:calc(24px + var(--sky89-safe-top))!important;padding-bottom:calc(22px + var(--sky89-safe-bottom))!important}
  body.sg-body{background:var(--sky89-bg)!important}
  body.sg-body .sky89-mobile-login-portals{display:block!important;margin:18px 0 0!important;padding-top:16px!important}

  body.portal-auth .portal-bg,
  body.portal-auth .portal-overlay{display:none!important}
  body.portal-auth{background:var(--sky89-bg)!important}
  body.portal-auth .portal-frame{background:#fff!important;box-shadow:none!important}
  body.portal-auth .portal-form-side{background:#fff!important}

  body:has(.sl-login-stage) .sl-login-stage,
  body:has(.sl-login-stage) .sl-login-stage:before{background:none!important;background-image:none!important}
  body:has(.sl-login-stage) .sl-login-overlay,
  body:has(.sl-login-stage) .sl-story{display:none!important}
  body:has(.sl-login-stage){background:var(--sky89-bg)!important}
  body:has(.sl-login-stage) .sl-login-shell{background:#fff!important;box-shadow:none!important;border:0!important}

  /* Smaller portal launcher: simple icons, no cards and no decorative media. */
  body.sg-body .sky89-mobile-login-portals-head{margin-bottom:10px!important}
  body.sg-body .sky89-mobile-login-portals-title{font-size:15px!important}
  body.sg-body .sky89-mobile-login-portals-note{display:none!important}
  body.sg-body .sky89-mobile-login-portals-grid{gap:4px!important}
  body.sg-body .sky89-mobile-login-portal{gap:5px!important;padding:2px 0 3px!important;font-size:8.2px!important}
  body.sg-body .sky89-mobile-login-portal-icon{width:40px!important;height:40px!important;border-radius:13px!important;box-shadow:none!important}
  body.sg-body .sky89-mobile-login-portal-icon svg{width:19px!important;height:19px!important;stroke-width:1.8!important}

  /* More sheet is compact. It shows only category headers until a category is
     expanded, so a long Work Portal menu does not become an endless icon wall. */
  .sky897-more-sheet{max-height:min(72dvh,690px)!important;padding:7px 12px calc(18px + var(--sky89-safe-bottom))!important}
  .sky897-more-sheet .sky89-more-head{padding-bottom:12px!important;margin-bottom:8px!important}
  .sky897-more-sheet .sky89-more-head strong{font-size:24px!important}
  .sky897-more-sheet .sky89-more-close{width:42px!important;height:42px!important;flex-basis:42px!important;font-size:20px!important}
  .sky897-more-groups{display:flex;flex-direction:column;gap:7px}
  .sky897-more-group{border:1px solid #ECE7E9;border-radius:15px;background:#fff;overflow:hidden}
  .sky897-more-group-toggle{
    width:100%;min-height:49px;display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:7px 9px;border:0;background:#fff;color:#37262C;text-align:left;font:inherit;cursor:pointer;touch-action:manipulation;
  }
  .sky897-more-group-title{min-width:0;display:flex;align-items:center;gap:8px;font-size:10.5px;font-weight:880;line-height:1.15}
  .sky897-more-group-title small{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#F5F1F2;color:#887A7F;font-size:8px;font-weight:900}
  .sky897-more-group-icon{width:31px;height:31px;flex:0 0 31px;display:grid;place-items:center;border-radius:10px;background:var(--sky89-soft);color:var(--sky89-accent)}
  .sky897-more-group-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .sky897-more-chevron{width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:9px;background:#F9F7F8;color:#85787C;transition:transform .16s ease}
  .sky897-more-chevron svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .sky897-more-group-toggle[aria-expanded="true"] .sky897-more-chevron{transform:rotate(180deg);background:var(--sky89-soft);color:var(--sky89-accent)}
  .sky897-more-group-body{padding:1px 7px 8px;border-top:1px solid #F2EEEF}
  .sky897-more-group-body[hidden]{display:none!important}
  .sky897-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding-top:7px}
  .sky897-more-item{
    min-width:0;min-height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
    padding:7px 3px;border:0;border-radius:12px;background:#FAFCFB;color:#46343A;text-decoration:none;text-align:center;
    font-size:8.4px;line-height:1.12;font-weight:820;touch-action:manipulation;
  }
  .sky897-more-item:active{transform:scale(.97);background:#F8F3F5}
  .sky897-more-item.active{background:var(--sky89-soft);color:var(--sky89-accent)}
  .sky897-more-item-icon{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:10px;background:#fff;color:var(--sky89-accent);box-shadow:0 1px 4px rgba(58,24,35,.05)}
  .sky897-more-item-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .sky897-more-item-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%}
  .sky897-more-signout{color:#C94C52;background:#FFF8F8}
  .sky897-more-signout .sky897-more-item-icon{color:#D94D53;background:#FFF0F0}

  /* Retire the older large More tile layout when the 89.7 grouped sheet is used. */
  .sky897-more-sheet .sky89-more-links{display:none!important}
}

@media(max-width:350px){
  .sky897-more-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  .sky897-more-item{min-height:67px;font-size:7.8px;padding:6px 2px}
  .sky897-more-item-icon{width:29px;height:29px;flex-basis:29px;border-radius:9px}
  .sky897-more-item-icon svg{width:16px;height:16px}
}

@media(prefers-reduced-motion:reduce){
  .sky897-more-chevron,.sky897-more-item{transition:none!important}
}
