/* Student portal. The same illustrated navigation is used in the sidebar and phone drawer. */
#student-app {
  --ink:#0c2852; --aqua:#00898f; --paper:#effcfe;
  min-height:100dvh; display:grid; grid-template-columns:clamp(180px,17.6vw,270px) minmax(0,1fr);
  grid-template-rows:auto 1fr; color:var(--ink); background:var(--paper);
  font-family:Nunito,'Trebuchet MS',system-ui,sans-serif;
}
#student-app[hidden] {display:none!important}
#student-app .student-topbar {
  grid-column:1/-1; position:relative; display:flex; align-items:center; gap:clamp(12px,2vw,30px);
  height:auto; min-height:78px; padding:10px clamp(15px,2.4vw,37px); border:0; color:white;
  background:linear-gradient(100deg,#00bfc1,#00bbc0 62%,#00b1b4);
}
#student-app .header-brand {margin:0 auto 0 0;min-width:0;display:block}
#student-app .header-brand img {display:block;width:clamp(135px,15vw,216px);height:auto;max-height:none;object-fit:contain}
#student-app .student-topbar .menu-toggle {display:none}
#student-app #student-search-open {
  display:flex;align-items:center;justify-content:flex-start;gap:14px;flex:0 1 480px;min-width:0;max-width:none;
  margin:0;height:46px;padding:0 17px;border:0;border-radius:99px;background:#fff;color:#26495a;
}
#student-app #student-search-open span:last-child {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:clamp(13px,1.2vw,17px)}
#student-app .ex-inbox {display:grid;place-items:center;border:0;border-radius:50%;width:44px;height:44px;padding:9px;background:#009fa5;cursor:pointer}
#student-app .ex-inbox img {width:100%;height:100%;object-fit:contain}
#student-app .profile-toggle {display:flex;align-items:center;gap:8px;min-width:0;background:transparent;color:#fff;border:0}
#student-app .profile-toggle .ex-profile-label {display:grid;text-align:left;max-width:18ch;font:800 1rem/1.16 Nunito,system-ui,sans-serif}
#student-app .ex-profile-label strong {overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#student-app .ex-profile-label small {font-size:.78em}
#student-app .ex-sidebar, #student-menu {
  background:#e3f8fc;color:var(--ink);
}
#student-app .ex-sidebar {grid-area:2/1;display:flex;flex-flow:column;min-width:0;padding:24px 0 0;border-right:1px solid #cfe9ed}
#student-menu .workspace-menu-inner {display:flex;flex-direction:column;min-height:100%;box-sizing:border-box;padding:16px 0 0}
#student-menu .drawer-heading {margin:0 15px 8px;padding:0 0 9px;border-bottom:1px solid #c6e9ed}
#student-menu .drawer-heading h2 {color:var(--ink)}
#student-menu [data-drawer-close] {color:#135764;background:#c7edef}
#student-app .ex-links {box-sizing:border-box;display:grid;gap:4px;width:100%;padding:0 10px;margin:0}
#student-app .ex-links :is(a,button),#student-app .menu-entrance {
  display:flex;align-items:center;gap:13px;min-height:46px;width:100%;box-sizing:border-box;margin:0;padding:8px 13px;
  font:800 clamp(14px,1.25vw,18px)/1.22 Nunito,'Trebuchet MS',sans-serif;
  border:0;border-radius:13px;color:var(--ink);background:transparent;text-align:left;text-decoration:none;cursor:pointer;
}
#student-app .menu-entrance {width:calc(100% - 20px);margin:8px 10px;color:#246470;font-size:.94rem}
#student-app .ex-icon {width:27px;height:27px;object-fit:contain;flex:none}
#student-app .ex-links img[src$="/icon-bell.webp"] {filter:brightness(0) saturate(100%) invert(28%) sepia(31%) saturate(1056%) hue-rotate(142deg)}
#student-app .ex-links :is(a,button):hover,#student-app .menu-entrance:hover {background:#cceff3}
#student-app .ex-links [aria-current=page],
#student-app[data-view=world] [data-student-page=world],#student-app[data-view=games] :is(.ex-links,.ex-mobile-nav) [data-student-page=games],
#student-app[data-view=progress] :is(.ex-links,.ex-mobile-nav) [data-student-page=progress],#student-app[data-view=week] .ex-links [data-student-page=week] {background:#00898f;color:white}
#student-app .ex-links [aria-current=page] img,#student-app[data-view=games] [data-student-page=games]>.ex-icon,
#student-app[data-view=progress] [data-student-page=progress]>.ex-icon {filter:brightness(0) invert(1)}
#student-app :is(.ex-links,.ex-mobile-nav) img[src$="/icon-home.webp"] {filter:brightness(0) saturate(100%) invert(24%) sepia(48%) saturate(715%) hue-rotate(147deg)}
#student-app[data-view=world] :is(.ex-links,.ex-mobile-nav) img[src$="/icon-home.webp"] {filter:none}
#student-app .ex-lighthouse {margin-top:auto;width:100%;aspect-ratio:269/237;max-height:260px;min-height:135px;background:bottom left/100% auto no-repeat url('/student-explorers/scenes/lighthouse.webp');pointer-events:none}
#student-app .student-main {grid-area:2/2;width:100%;max-width:none;box-sizing:border-box;min-width:0;margin:0;padding:22px clamp(15px,2vw,32px) 45px;background:linear-gradient(180deg,#dcf8fc,#f8fdff 46%,#e8faff)}
#student-app .ex-hero {position:relative;isolation:isolate;margin:0 0 16px;min-height:82px;display:grid;align-content:start}
#student-app .ex-hero h2,#student-app .ex-hero p {position:relative;max-width:70%;overflow-wrap:anywhere}
#student-app .ex-hero h2 {font:1000 clamp(28px,2.8vw,42px)/1.1 Nunito,'Trebuchet MS',sans-serif;margin:0 0 5px;color:var(--ink);letter-spacing:-.035em}
#student-app .ex-hero p {font-size:clamp(14px,1.35vw,19px);line-height:1.35;font-weight:650;margin:0}
#student-app .ex-scenery {position:absolute;z-index:-1;inset:5px 0 0 auto;width:39%;max-width:540px;background:right bottom/contain no-repeat url('/student-explorers/scenes/compass-trail.webp');mix-blend-mode:multiply}
#student-app .ex-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(10px,1.3vw,20px)}
#student-app .ex-card {--edge:#f36b77;display:flex;flex-direction:column;min-width:0;overflow:hidden;border:2px solid var(--edge);border-radius:clamp(18px,2vw,29px);color:var(--ink);background:white;text-decoration:none;box-shadow:0 3px 7px #214d7312}
#student-app .ex-card.listening {--edge:#16c0be}
#student-app .ex-card.writing {--edge:#f3ac19}
#student-app .ex-card-media {position:relative;flex:none;aspect-ratio:1.6;min-height:0}
#student-app .ex-card-media picture,#student-app .ex-card-media img {position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover}
#student-app .ex-card-copy {position:relative;flex:1 1 auto;min-width:0;border-top:2px solid var(--edge);border-radius:18px 18px 0 0;margin-top:-5px;padding:12px clamp(32px,3.6vw,55px) 14px 13px;background:#fff}
#student-app .ex-card h3 {display:flex;align-items:center;gap:8px;margin:0 0 4px;color:var(--ink);font:1000 clamp(18px,2vw,31px)/1.15 Nunito,'Trebuchet MS',sans-serif}
#student-app .ex-symbol {width:1.3em;height:1.2em;object-fit:contain;flex:none}
#student-app .ex-card p {margin:0 0 0 clamp(27px,3vw,47px);font:650 clamp(13px,1.15vw,17px)/1.35 Nunito,'Trebuchet MS',sans-serif}
#student-app .ex-next,#student-app .ex-feature-arrow {display:grid;place-items:center;flex:none;width:clamp(24px,2.7vw,37px);aspect-ratio:1;border-radius:50%;background:var(--edge);color:#fff;font:900 1.55rem/1 Nunito,sans-serif}
#student-app .ex-next {position:absolute;right:9px;top:50%;transform:translateY(-50%)}
#student-app .ex-features {display:grid;grid-template-columns:1fr 1fr;gap:clamp(12px,1.4vw,22px);margin:22px 0 0}
#student-app .ex-feature {--edge:#af86e9;display:flex;align-items:center;gap:clamp(7px,1.1vw,16px);min-width:0;padding:13px 16px;min-height:108px;text-align:left;color:var(--ink);background:linear-gradient(#fff,#faf7ff);border:2px solid #e5ddf3;border-radius:24px;cursor:pointer;box-shadow:0 3px 7px #16436812}
#student-app .ex-feature.progress {--edge:#48bcc1;border-color:#d2ebee;background:linear-gradient(#fff,#f4fcfd)}
#student-app .ex-feature-icon,#student-app .ex-feature-art {width:clamp(32px,4.7vw,78px);height:clamp(32px,4.8vw,72px);object-fit:contain;flex:none;mix-blend-mode:multiply}
#student-app .ex-feature h3 {font:1000 clamp(18px,1.65vw,25px)/1.15 Nunito,'Trebuchet MS',sans-serif;margin:0 0 6px}
#student-app .ex-feature p {font:650 clamp(13px,1.12vw,17px)/1.3 Nunito,'Trebuchet MS',sans-serif;margin:0}
#student-app .ex-feature-art {margin-left:auto}
#student-app .ex-more {margin-top:20px;display:flex;gap:10px;flex-wrap:wrap}
#student-app .ex-more a {background:#fff;border:1px solid #c9e8eb;border-radius:13px;padding:10px 14px;color:#145565;text-decoration:none;font-weight:800}
#student-app .ex-mobile-nav {display:none}
#student-app :is(.ex-card,.ex-feature,.ex-links a,.ex-links button,.ex-mobile-nav a,.ex-mobile-nav button):focus-visible {outline:3px solid #176679;outline-offset:2px}
#student-app #student-content>.learning-panel:not([hidden]) {margin-top:24px}
@media (min-width:761px) and (max-width:1080px) {
  #student-app .ex-feature-art {display:none}
  #student-app .ex-feature-arrow {margin-left:auto}
}
@media (max-width:760px) {
  #student-app {grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
  #student-app .student-topbar {display:grid;grid-template-columns:34px minmax(0,1fr) 44px auto;grid-template-rows:auto auto;column-gap:8px;row-gap:10px;padding:9px 12px 12px;border-radius:0 0 23px 23px}
  #student-app .student-topbar .menu-toggle {display:grid;width:34px;height:44px;color:white;background:transparent;border:0}
  #student-app .header-brand {margin:0;min-width:0}
  #student-app .header-brand img {height:auto;width:min(100%,142px)}
  #student-app .ex-inbox {width:34px;height:34px;padding:7px}
  #student-app .profile-toggle {max-width:32vw;gap:5px;padding:3px}
  #student-app .profile-toggle .ex-profile-label {display:grid;min-width:0;max-width:13ch;font-size:clamp(11px,3vw,15px)}
  #student-app #student-search-open {grid-column:1/-1;grid-row:2;width:100%;height:43px;min-height:42px}
  #student-app .ex-sidebar {display:none}
  #student-app .student-main {grid-area:2/1;padding:16px 10px 24px}
  #student-app .ex-hero {min-height:clamp(78px,19vw,112px);margin-bottom:10px;padding-inline:8px}
  #student-app .ex-hero h2 {font-size:clamp(25px,6.4vw,37px);max-width:85%}
  #student-app .ex-hero p {font-size:clamp(13px,3.35vw,18px);max-width:63%}
  #student-app .ex-scenery {width:39%;background-image:url('/student-explorers/scenes/compass-trail-phone.webp');background-position:right bottom;background-size:contain}
  #student-app .ex-cards {grid-template-columns:1fr;gap:10px}
  #student-app .ex-card {display:grid;grid-template-columns:49% minmax(0,1fr);min-height:94px;border-radius:19px;background:#fff8f8}
  #student-app .ex-card.listening {background:#f0fcfc}
  #student-app .ex-card.writing {background:#fffaf0}
  #student-app .ex-card-media {min-height:100%;width:100%;min-width:0;aspect-ratio:auto;overflow:hidden;border-radius:0 10px 10px 0}
  #student-app .ex-card-copy {margin:0;border:0;border-radius:0;align-self:center;background:transparent;padding:8px 29px 8px 10px}
  #student-app .ex-card h3 {gap:5px;font-size:clamp(16px,4.25vw,25px)}
  #student-app .ex-card p {margin-left:0;font-size:clamp(12px,3.1vw,17px);line-height:1.27}
  #student-app .ex-next {width:22px;right:5px;font-size:20px}
  #student-app .ex-features {gap:9px;margin-top:12px}
  #student-app .ex-feature {display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr;gap:3px;position:relative;text-align:center;align-items:start;min-height:136px;padding:8px 8px 15px;border-radius:21px}
  #student-app .ex-feature-icon {grid-row:1;grid-column:2;width:51px;height:39px;justify-self:center}
  #student-app .ex-feature>span:not(.ex-feature-arrow) {grid-row:2;grid-column:1/-1;justify-self:center;width:100%}
  #student-app .ex-feature h3 {margin-bottom:3px;font-size:clamp(16px,4.2vw,23px)}
  #student-app .ex-feature p {font-size:clamp(12px,2.9vw,16px);line-height:1.25;padding-inline:8px 17px}
  #student-app .ex-feature-art {display:none}
  #student-app .ex-feature.progress .ex-feature-icon {display:none}
  #student-app .ex-feature.progress .ex-feature-art {display:block;grid-column:2;grid-row:1;justify-self:center;margin:0;width:66px;height:39px}
  #student-app .ex-feature-arrow {position:absolute;right:6px;bottom:9px;width:23px;font-size:20px}
  #student-app .ex-mobile-nav {grid-area:3/1;position:relative;z-index:30;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;padding:5px 4px max(6px,env(safe-area-inset-bottom));background:white;border-radius:18px 18px 0 0;border:1px solid #d5ebef;box-shadow:0 -3px 15px #216b791c}
  #student-app .ex-mobile-nav :is(a,button) {display:grid;align-content:center;justify-items:center;gap:3px;min-height:44px;min-width:0;margin:0;padding:3px 0;border:0;border-radius:11px;background:transparent;color:var(--ink);font:800 clamp(9px,2.4vw,12px)/1.1 Nunito,sans-serif;text-decoration:none}
  #student-app .ex-mobile-nav .ex-icon {width:24px;height:23px}
  #student-menu {width:min(85vw,325px)}
  #student-menu .ex-lighthouse {max-height:210px;flex-shrink:0;background-size:auto 100%;background-color:#dff7fb;background-position:bottom center}
}

/* The viewport holds the navigation. Only the pupil's content pane scrolls. */
@media screen {
  html:has(#student-app:not([hidden])), body:has(#student-app:not([hidden])) {
    overflow:hidden;overscroll-behavior:none;
  }
  #student-app:not([hidden]) {
    position:fixed;inset:0;display:grid;box-sizing:border-box;width:100%;
    height:100%;height:100dvh;min-height:0;overflow:clip;
  }
  #student-app .student-main, #student-app .ex-sidebar {
    min-height:0;overflow-y:auto;overscroll-behavior:contain;
  }
  body:has(dialog[open]) #student-app :is(.student-main,.ex-sidebar) {overflow:hidden}
  #student-menu, #explorer-pass, #student-avatar-dialog, #student-search {
    overscroll-behavior:contain;
  }
  #student-menu .drawer-heading {
    position:sticky;top:0;z-index:1;background:#e3f8fc;
  }
}
@media screen and (min-width:761px) {
  #student-app {grid-template-rows:auto minmax(0,1fr)}
}

/* Phone entrance: the scene can scroll independently on short screens. */
@media screen and (max-width:760px), screen and (max-width:960px) and (max-height:540px) and (orientation:landscape) {
  html:has(#gateway:not([hidden])), body:has(#gateway:not([hidden])) {
    overflow:hidden;overscroll-behavior:none;
  }
  body:has(#gateway:not([hidden])) {
    height:100vh;height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr);
  }
  body:has(#gateway:not([hidden]))>.preview-ribbon {grid-area:1/1}
  #gateway:not([hidden]) {
    grid-area:2/1;min-height:0;height:100%;width:100%;padding:0;overflow:clip;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto auto minmax(0,1fr) auto auto;
    gap:0;align-items:center;
  }
  #gateway .gate-header {grid-area:1/1;padding:6px max(14px,env(safe-area-inset-right)) 5px max(14px,env(safe-area-inset-left))}
  #gateway .gateway-content {display:contents}
  #gateway .gateway-content>* {grid-column:1;position:relative;z-index:3;margin:0;padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
  #gateway .overline {grid-row:2}
  #gateway h1 {grid-row:3;font-size:clamp(27px,min(8vw,6dvh),46px);margin-block:3px}
  #gateway .gateway-content>p {grid-row:4;font-size:clamp(12px,2dvh,15px);max-width:none}
  #gateway .gate-welcome {
    grid-area:5/1;align-self:stretch;min-height:0;overflow:auto;overscroll-behavior:contain;
    padding:4px 12px;scrollbar-width:thin;
  }
  #gateway .welcome-scene {width:min(100%,52dvh);margin-inline:auto}
  #gateway .welcome-bubble-slot {min-height:0;padding-block:3px 10px}
  #gateway .gateway-actions {
    grid-row:6;display:flex;flex-wrap:wrap;gap:6px;
    padding-block:8px max(9px,env(safe-area-inset-bottom));
  }
  #gateway .gateway-actions>.btn {flex:1 1 auto;min-height:44px;padding:6px 8px;line-height:1.2}
  #gateway .gate-footnote {grid-row:7}
  body:has(dialog[open]) #gateway .gate-welcome {overflow:hidden}
}
@media screen and (max-width:960px) and (max-height:540px) and (orientation:landscape) {
  #gateway:not([hidden]) {grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto 1fr auto auto 1fr auto}
  #gateway .gate-header {grid-column:1/-1}
  #gateway .gate-welcome {grid-area:2/1/7/2}
  #gateway .gateway-content>* {grid-column:2}
  #gateway .overline {align-self:end}
  #gateway .gateway-actions {grid-row:6}
  #gateway .gate-footnote {grid-row:5;align-self:start}
}

#student-app .ex-card.speaking {--edge:#008c94}
#student-app .ex-themes>summary {padding:12px 13px;cursor:pointer;font-weight:800}
#student-app .ex-themes>button {padding-inline-start:26px}
#student-app .ex-mobile-nav [aria-current=page] {background:#00898f;color:white}
@media(min-width:761px){#student-app .ex-cards {grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1360px){#student-app .ex-cards {grid-template-columns:repeat(4,minmax(0,1fr))}}

:is(#gateway,#student-app) .home-music-toggle {
 display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;
 border:1px solid #aae4e3;border-radius:50%;background:#e8fbfa;color:#12555c;
 font:700 21px/1 system-ui;cursor:pointer;
}
:is(#gateway,#student-app) .home-music-toggle[data-playing="true"] {background:#07585e;color:white}
:is(#gateway,#student-app) .home-music-toggle:focus-visible {outline:3px solid #ffd978;outline-offset:2px}
#gateway .gate-header .home-music-toggle {margin-left:auto;margin-right:8px}
#student-app:not([data-view="world"]) .home-music-toggle {visibility:hidden}

.home-track-picker {width:min(20rem,calc(100% - 2rem));padding:1.25rem;border:1px solid #97cac8;border-radius:1rem;background:#fffdf7;color:#17474a}
.home-track-picker h2 {margin:0 0 .75rem}
.home-track-picker button {display:block;width:100%;min-height:44px;margin-top:.5rem;background:#dff5ef;color:#07585e;border:1px solid #97cac8;border-radius:.75rem;font:inherit;font-weight:700;cursor:pointer}
.home-track-picker h2 {padding-inline-end:2.75rem}
.home-track-picker [data-music-action="close"] {position:absolute;top:.45rem;inset-inline-end:.55rem;width:44px;height:44px;margin:0;background:transparent;border:0}
.home-track-picker button[aria-pressed="true"] {background:#07676b;color:#fff}
.home-track-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem;margin-top:.5rem}
.home-track-actions button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.3rem;padding:.45rem .2rem;font-size:.78rem;line-height:1.15}
.home-track-actions [data-music-action="stop"] {background:#fae5dd;color:#7c3829}
.home-track-picker button:focus-visible {outline:3px solid #087779;outline-offset:2px}
