:root { --app-store-banner-height: calc(35px + env(safe-area-inset-top, 0px)); }
.app-store-banner[hidden] { display: none; }
.app-store-banner {
  box-sizing: border-box;
  position: relative;
  z-index: 4;
  font-family: system-ui, sans-serif;
  height: var(--app-store-banner-height);
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid #9dbfbc;
  background: #fff;
}

.app-store-banner-inner {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  grid-column-gap: 8px;
  align-items: center;
  box-sizing: border-box;
  height: 100%;
  padding-left: calc(12px + env(safe-area-inset-left, 0px));
  padding-right: calc(12px + env(safe-area-inset-right, 0px));
}

.app-store-banner a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.app-store-banner a:focus-visible { outline: 3px solid #0075ef; outline-offset: -2px; }
.app-store-banner-home {
  justify-self: start;
  min-width: 34px;
  color: #176a5c;
  font-size: 13px;
  font-weight: 700;
}
.app-store-banner-home img { flex: none; }
.app-store-banner-home svg { flex: none; margin-right: 3px; }
.app-store-banner-home span { margin-left: 7px; }
.app-store-banner-nav {
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-store-banner-nav a {
  display: block;
  padding: 0 11px;
  color: #273950;
  font-size: 12px;
  font-weight: 600;
  line-height: 34px;
}
.app-store-banner-home:hover, .app-store-banner-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.banner-link-short { display: none; }
.toolkit-link-short { display: none; }
.app-store-banner { flex-shrink: 0; }
.app-store-banner-link {
  justify-self: end;
  position: relative;
  isolation: isolate;
  padding: 0 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.app-store-banner-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  right: 0;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background: #071a53;
}
.app-store-banner-link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .app-store-banner-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .app-store-banner-nav { justify-content: space-evenly; }
  .app-store-banner-nav a { padding: 0 5px; }
  .banner-link-detail { display: none; }
}

@media (max-width: 540px) {
  .app-store-banner-inner {
    grid-column-gap: 2px;
    padding-left: calc(4px + env(safe-area-inset-left, 0px));
    padding-right: calc(6px + env(safe-area-inset-right, 0px));
  }
  .app-store-banner-home span { display: none; }
  .app-store-banner-nav a { padding: 0 3px; font-size: 11px; }
  .app-store-banner-link { padding: 0 8px; font-size: 11px; }
}

@media (max-width: 350px) {
  .banner-link-full { display: none; }
  .banner-link-short { display: inline; }
  .app-store-banner-nav a { padding-inline: 2px; }
}

@media (max-width: 900px) {
  .toolkit-link-full { display: none; }
  .toolkit-link-short { display: inline; }
}

@media screen {
  .app-store-banner + #classroom-group-designs > .cg-board {
    min-height: calc(100vh - var(--app-store-banner-height));
    min-height: calc(100dvh - var(--app-store-banner-height));
  }
  .app-store-banner + #classroom-group-designs > .cg-board[data-view="board"] {
    height: calc(100vh - var(--app-store-banner-height));
    height: calc(100dvh - var(--app-store-banner-height));
    min-height: 0;
  }
}

@media print {
  .app-store-banner:has(+ #classroom-group-designs) { display: none; }
}

/* Keep the banner and the app within the viewport. The app handles its own scrolling. */
body { overflow: clip; }
.app-store-banner + #sunny-playground {
  height: calc(100% - var(--app-store-banner-height));
  min-height: 0;
  padding-top: 0;
  --mh-phone-top: 0px;
}

@container mh-tablet-app (min-width: 466px) {
  #sunny-playground:not([data-phone]) [data-settings-panel="pupil"] > .mh-settings-columns { align-items: stretch; }
  #sunny-playground:not([data-phone]) [data-settings-panel="pupil"] .mh-profile-settings { flex: 1; grid-auto-rows: 1fr; }
  #sunny-playground:not([data-phone]) .mh-settings .mh-backdrop-settings {
    flex: 1;
    grid-template-rows: 1fr;
  }
  #sunny-playground:not([data-phone]) .mh-settings .mh-backdrop-editor { align-items: stretch; }
  #sunny-playground:not([data-phone]) .mh-settings .mh-backdrop-preview .mh-meadow {
    height: 100%;
    min-height: clamp(118px, 22cqh, 200px);
  }
}
