/* =========================================================
   GYOBITE OS — BUILD 175 RESPONSIVE FOUNDATION
   Loaded after styles.css so this layer is the single source
   of truth for viewport, launcher, calendar and music layout.
========================================================= */
:root {
  --gyobite-topbar-height: 56px;
  --gyobite-content-gutter: clamp(10px, 3.2vw, 16px);
  --gyobite-safe-bottom: env(safe-area-inset-bottom, 0px);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
}

#gyoStage,
#gyoStage > .phone,
#gyoStage .screen,
#appWindow,
#appContent {
  min-width: 0;
}

/* Common content rules: allow flex/grid children to shrink instead of
   forcing their siblings outside the phone viewport. */
#appWindow.app-window:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

#appWindow.app-window:not(.hidden) > .app-header {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

#appContent.app-content {
  flex: 1 1 0% !important;
  flex-basis: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

#appContent.app-content :where(.card, section, article, form, fieldset, .row) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#appContent.app-content :where(img, video, canvas, iframe, svg) {
  max-width: 100%;
  box-sizing: border-box;
}

#appContent.app-content :where(input, textarea, select) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#appContent.app-content :where(h1, h2, h3, p, small, strong, label, span) {
  min-width: 0;
  max-inline-size: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}

#appContent.app-content :where(table) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

#appContent.app-content :where(.row) {
  flex-wrap: wrap;
}

#appContent.app-content button {
  min-width: 0;
  max-width: 100%;
  line-height: 1.2;
}

/* One consistent 3-column launcher: four complete rows per page. */
#homeScreen .launcher-pages {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}

#homeScreen .launcher-pages::-webkit-scrollbar {
  display: none !important;
}

#homeScreen .launcher-page {
  display: block !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  scroll-snap-align: start !important;
}

#homeScreen .launcher-page .app-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(66px, auto)) !important;
  grid-auto-rows: minmax(66px, auto) !important;
  align-content: start !important;
  justify-content: stretch !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  gap: clamp(8px, 1.5vh, 13px) clamp(4px, 1.4vw, 8px) !important;
  padding: 5px 2px 10px !important;
  box-sizing: border-box !important;
}

#homeScreen .launcher-page .app-icon {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 66px !important;
  max-height: none !important;
  gap: 6px !important;
  padding: 3px 2px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

#homeScreen .launcher-page .app-glyph {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  width: clamp(36px, 10.5vw, 48px) !important;
  height: clamp(36px, 10.5vw, 48px) !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: clamp(11px, 3.2vw, 16px) !important;
}

#homeScreen .launcher-page .app-icon small {
  display: -webkit-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 2.35em !important;
  max-height: 2.5em !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  white-space: normal !important;
  text-overflow: ellipsis !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-align: center !important;
  font-size: clamp(9px, 2.55vw, 11px) !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

#homeScreen .launcher-page .launcher-empty {
  grid-column: 1 / -1 !important;
  grid-row: 1 / -1 !important;
  min-height: 250px !important;
}

#homeScreen .launcher-page-dots {
  display: flex !important;
  flex: 0 0 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 3px 0 8px !important;
}

/* Calendar: fixed arrow columns and seven equal, non-wrapping weekday cells. */
.calendar-card {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  padding: clamp(12px, 3.4cqi, 18px) !important;
}

.calendar-month-nav {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  align-items: center !important;
  gap: clamp(5px, 2cqi, 9px) !important;
  width: 100%;
  min-width: 0;
}

.calendar-month-nav > button {
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  flex: 0 0 42px !important;
  font-size: 18px !important;
}

.calendar-month-title {
  display: block !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  text-align: center !important;
  font-size: clamp(13px, 4.7cqi, 17px) !important;
  line-height: 1.2 !important;
}

.calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: clamp(3px, 1.35cqi, 6px) !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-top: 14px !important;
}

.calendar-weekday {
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  width: 100% !important;
  padding: 3px 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  text-align: center !important;
  font-size: clamp(9px, 3.2cqi, 12px) !important;
  line-height: 1.2 !important;
}

.calendar-day,
.calendar-day-empty {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: clamp(32px, 10cqi, 46px) !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.calendar-day {
  font-size: clamp(10px, 3.5cqi, 13px) !important;
  line-height: 1 !important;
  border-radius: 12px !important;
  white-space: nowrap !important;
}

.calendar-day.is-today {
  background: #8b7cff !important;
  color: #11152a !important;
  font-weight: 800 !important;
}

/* Gyo Music: use an explicit five-row grid so the catalogue owns its
   scroll area and the player always occupies its own final row. */
#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 14px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) > .gyomusic-page {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  flex: 1 1 0% !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  gap: clamp(7px, 2vw, 11px) !important;
  padding: 10px 0 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-heading,
#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-search,
#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-section-title {
  min-width: 0 !important;
  margin: 0 !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-heading h2 {
  font-size: clamp(20px, 6vw, 25px) !important;
  line-height: 1.15 !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-library {
  display: flex !important;
  flex: initial !important;
  flex-direction: column !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  gap: 8px !important;
  padding: 2px 2px 10px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-track {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-player {
  position: relative !important;
  inset: auto !important;
  align-self: stretch !important;
  flex: 0 0 auto !important;
  width: calc(100% + 28px) !important;
  min-width: 0 !important;
  margin: 0 -14px !important;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  gap: 8px 10px !important;
  border-radius: 0 !important;
  z-index: 2 !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-cover {
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-meta {
  min-width: 0 !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-progress-wrap {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) 30px !important;
  align-items: center !important;
  min-width: 0 !important;
  gap: 6px !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-progress-wrap span {
  white-space: nowrap !important;
  font-size: 9px !important;
}

#appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-skip-controls {
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: clamp(12px, 4vw, 22px) !important;
}

/* Tablet, laptop and desktop shell. */
@media (min-width: 801px) {
  :root { --gyobite-topbar-height: 58px; }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .gyobite-topbar {
    position: relative !important;
    min-height: 58px !important;
    height: 58px;
    flex: 0 0 58px;
  }

  #gyoStage.stage {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 430px) minmax(280px, 440px);
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 4vw, 72px);
    width: 100%;
    min-height: calc(100dvh - 58px);
    height: auto !important;
    max-height: none !important;
    padding: clamp(14px, 2.4vh, 28px) clamp(16px, 3vw, 48px) !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    box-sizing: border-box;
  }

  #gyoStage > .phone {
    width: min(430px, calc(100vw - 32px), calc(48.86dvh - 45px)) !important;
    height: auto !important;
    aspect-ratio: 430 / 880 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 86px) !important;
    flex: 0 1 auto !important;
    padding: 8px !important;
    border-radius: 42px !important;
  }

  #gyoStage > .phone > .screen {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 34px !important;
  }

  #gyoStage > .side-info {
    display: block !important;
    width: min(440px, 36vw) !important;
    min-width: 0 !important;
    max-width: 440px !important;
  }

  #gyoStage > .side-info h2 {
    font-size: clamp(28px, 2.7vw, 44px);
    line-height: 1.12;
  }
}

@media (min-width: 801px) and (max-width: 1100px) {
  #gyoStage.stage {
    grid-template-columns: minmax(0, 390px) minmax(230px, 320px);
    gap: clamp(12px, 2vw, 24px);
    padding-inline: 16px !important;
  }

  #gyoStage > .phone {
    width: min(390px, calc(100vw - 32px), calc(47.56dvh - 42px)) !important;
    aspect-ratio: 390 / 820 !important;
    max-height: calc(100dvh - 86px) !important;
  }

  #gyoStage > .side-info {
    width: min(320px, 38vw) !important;
    min-width: 0 !important;
  }

  #gyoStage > .side-info h2 {
    font-size: clamp(25px, 3vw, 32px);
  }
}

/* Phone and narrow tablet. Use the available dynamic viewport rather than
   fixed 100vh dimensions so browser chrome and safe areas are respected. */
@media (max-width: 800px) {
  :root {
    --gyobite-topbar-height: calc(56px + env(safe-area-inset-top, 0px));
  }

  html,
  body {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .gyobite-topbar {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    z-index: 2200 !important;
    display: grid !important;
    flex: 0 0 var(--gyobite-topbar-height) !important;
    width: 100% !important;
    height: var(--gyobite-topbar-height) !important;
    min-height: var(--gyobite-topbar-height) !important;
    max-height: none !important;
    box-sizing: border-box !important;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px !important;
  }

  #gyoStage.stage {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex: 1 1 0% !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #gyoStage > .phone {
    position: relative !important;
    display: block !important;
    flex: 0 1 auto !important;
    width: min(390px, calc(100vw - 16px), calc(47.56dvh - 33px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
    height: auto !important;
    aspect-ratio: 390 / 820 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: calc(100dvh - var(--gyobite-topbar-height) - env(safe-area-inset-bottom, 0px) - 12px) !important;
    padding: 7px !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    border-radius: clamp(25px, 8vw, 42px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #gyoStage > .phone:before {
    display: block !important;
    top: 10px !important;
    width: clamp(68px, 22vw, 88px) !important;
    height: 19px !important;
  }

  #gyoStage .screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: clamp(19px, 6vw, 33px) !important;
    overflow: hidden !important;
  }

  #gyoStage > .side-info {
    display: none !important;
  }

  #gyoStage .status-bar {
    height: 42px !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) clamp(12px, 4vw, 18px) 0 !important;
    box-sizing: border-box !important;
  }

  #homeScreen.home-screen {
    position: absolute !important;
    inset: 42px 0 28px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: clamp(18px, 3vh, 28px) clamp(12px, 3.5vw, 17px) 8px !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    box-sizing: border-box !important;
  }

  #homeScreen .home-heading,
  #homeScreen .search-pill,
  #homeScreen .widget-row,
  #homeScreen .section-heading {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #homeScreen .home-heading {
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 5px !important;
  }

  #homeScreen .home-heading h1 {
    font-size: clamp(20px, 5.8vw, 26px) !important;
    line-height: 1.12 !important;
  }

  #homeScreen .home-heading p {
    font-size: clamp(10px, 2.8vw, 12px) !important;
    line-height: 1.35 !important;
  }

  #homeScreen .search-pill {
    min-height: 42px !important;
    padding: 9px 12px !important;
    font-size: clamp(10px, 2.8vw, 12px) !important;
  }

  #homeScreen .widget-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin: 6px 0 6px !important;
  }

  #homeScreen .mini-widget {
    min-width: 0 !important;
    min-height: 60px !important;
    gap: 6px !important;
    padding: 8px !important;
  }

  #homeScreen .mini-widget > i {
    flex: 0 0 auto !important;
    font-size: clamp(15px, 4.5vw, 19px) !important;
  }

  #homeScreen .mini-widget strong {
    font-size: clamp(14px, 4.4vw, 17px) !important;
  }

  #homeScreen .mini-widget small,
  #homeScreen .mini-widget > span {
    font-size: clamp(8px, 2.3vw, 10px) !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  #homeScreen .section-heading {
    margin: 0 0 2px !important;
    font-size: clamp(11px, 3vw, 13px) !important;
  }

  #homeScreen .launcher-pages {
    flex: 1 1 0% !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: pan-x pan-y !important;
  }

  #homeScreen .launcher-page {
    height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  #homeScreen .launcher-page .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(66px, auto)) !important;
    grid-auto-rows: minmax(66px, auto) !important;
    height: auto !important;
    min-height: 264px !important;
    max-height: none !important;
    gap: clamp(6px, 1vh, 9px) clamp(4px, 1.3vw, 7px) !important;
    padding: 5px 2px 9px !important;
    align-content: start !important;
  }

  #homeScreen .launcher-page .app-icon {
    height: auto !important;
    min-height: 66px !important;
    max-height: none !important;
    overflow: visible !important;
    gap: 5px !important;
    padding: 3px 1px !important;
  }

  #homeScreen .launcher-page .app-glyph {
    width: clamp(34px, 10vw, 46px) !important;
    height: clamp(34px, 10vw, 46px) !important;
  }

  #homeScreen .launcher-page .app-icon small {
    min-height: 2.35em !important;
    font-size: clamp(8px, 2.5vw, 10px) !important;
    line-height: 1.2 !important;
  }

  #homeScreen .launcher-page-dots {
    flex: 0 0 18px !important;
    height: 18px !important;
    margin: 2px 0 7px !important;
  }

  #homeScreen .dock {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 72px !important;
    margin: 6px 0 0 !important;
    padding: 8px 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 2px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  #homeScreen .dock .app-icon {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 3px !important;
    overflow: visible !important;
  }

  #homeScreen .dock .app-glyph {
    width: clamp(32px, 9vw, 42px) !important;
    height: clamp(32px, 9vw, 42px) !important;
  }

  #homeScreen .dock .app-icon small {
    display: block !important;
    max-width: 100% !important;
    min-height: 0 !important;
    font-size: clamp(8px, 2.3vw, 9px) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #appWindow.app-window:not(.hidden) {
    position: absolute !important;
    inset: 42px 0 28px !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content {
    flex: 1 1 0% !important;
    flex-basis: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: clamp(10px, 3vw, 14px) clamp(10px, 3vw, 14px) calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .nav-bar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 28px !important;
  }

  .quick-handle {
    bottom: 3px !important;
  }
}

/* Very narrow phones and compact landscape screens. The launcher can scroll
   vertically rather than compressing its rows into overlapping labels. */
@media (max-width: 360px) {
  #homeScreen .home-screen,
  #homeScreen.home-screen {
    padding-inline: 10px !important;
  }

  #homeScreen .launcher-page .app-grid {
    gap: 7px 3px !important;
  }

  #homeScreen .launcher-page .app-glyph {
    width: 34px !important;
    height: 34px !important;
  }

  #homeScreen .launcher-page .app-icon small {
    font-size: 8px !important;
  }
}

@media (max-height: 620px) and (max-width: 800px) {
  #homeScreen.home-screen {
    padding-top: 12px !important;
  }

  #homeScreen .home-heading {
    margin-bottom: 5px !important;
  }

  #homeScreen .widget-row {
    margin-block: 6px !important;
  }

  #homeScreen .launcher-page .app-grid {
    grid-template-rows: repeat(4, minmax(58px, auto)) !important;
    grid-auto-rows: minmax(58px, auto) !important;
    gap: 6px 3px !important;
  }

  #homeScreen .launcher-page .app-icon {
    min-height: 58px !important;
  }

  #homeScreen .dock {
    min-height: 64px !important;
    padding-block: 5px !important;
  }
}

@media (max-height: 560px) and (max-width: 800px) and (orientation: landscape) {
  .gyobite-topbar {
    --gyobite-topbar-height: 48px;
    flex-basis: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding-block: 4px !important;
  }

  #gyoStage > .phone {
    width: min(300px, calc(47.56dvh - 30px)) !important;
    border-radius: 24px !important;
  }
}

@media (pointer: coarse) {
  #appContent.app-content button,
  #appContent.app-content input,
  #appContent.app-content select,
  #appContent.app-content textarea {
    touch-action: manipulation;
  }
}

@media (prefers-reduced-motion: reduce) {
  #homeScreen .launcher-pages {
    scroll-behavior: auto !important;
  }

  #appContent.app-content *,
  #homeScreen * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 800px) {
    body { height: 100vh !important; }
    #gyoStage > .phone {
      width: min(390px, calc(100vw - 16px), calc(47.56vh - 33px)) !important;
    }
  }

  @media (min-width: 801px) {
    #gyoStage > .phone {
      width: min(430px, calc(100vw - 32px), calc(48.86vh - 45px)) !important;
    }
  }
}

/* Landscape touch devices receive a landscape phone canvas. This avoids a
   postage-stamp portrait simulator on wide, short phone viewports. */
@media (max-height: 560px) and (pointer: coarse) and (orientation: landscape) {
  :root { --gyobite-topbar-height: 48px; }

  html,
  body {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  .gyobite-topbar {
    flex: 0 0 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding-block: 4px !important;
  }

  #gyoStage.stage {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex: 1 1 0% !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 2px 8px !important;
    overflow: hidden !important;
  }

  #gyoStage > .phone {
    width: min(820px, calc(100vw - 16px), calc(210.26dvh - 109px)) !important;
    height: auto !important;
    aspect-ratio: 820 / 390 !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 52px) !important;
    flex: 0 1 auto !important;
    border-radius: 30px !important;
  }

  #gyoStage > .phone:before {
    top: 8px !important;
    width: 82px !important;
    height: 14px !important;
  }

  #gyoStage .screen {
    border-radius: 23px !important;
  }

  #gyoStage .status-bar {
    height: 32px !important;
    padding: 5px 18px 0 !important;
  }

  #gyoStage > .side-info {
    display: none !important;
  }

  #homeScreen.home-screen {
    position: absolute !important;
    inset: 32px 0 26px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 6px 16px 60px !important;
    overflow: hidden !important;
  }

  #homeScreen .home-heading {
    margin: 0 0 4px !important;
  }

  #homeScreen .home-heading h1 {
    font-size: 18px !important;
    margin: 1px 0 !important;
  }

  #homeScreen .home-heading p {
    font-size: 8px !important;
  }

  #homeScreen .search-pill {
    min-height: 28px !important;
    height: 28px !important;
    padding: 4px 9px !important;
  }

  #homeScreen .widget-row {
    display: none !important;
  }

  #homeScreen .section-heading {
    margin: 2px 0 3px !important;
  }

  #homeScreen .launcher-pages {
    flex: 1 1 0% !important;
    height: 0 !important;
    min-height: 58px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: pan-x pan-y !important;
  }

  #homeScreen .launcher-page {
    height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
  }

  #homeScreen .launcher-page .app-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(3, minmax(58px, auto)) !important;
    grid-auto-rows: minmax(58px, auto) !important;
    min-height: 174px !important;
    height: auto !important;
    gap: 6px 8px !important;
  }

  #homeScreen .launcher-page .app-icon {
    min-height: 58px !important;
    gap: 3px !important;
  }

  #homeScreen .launcher-page .app-glyph {
    width: 34px !important;
    height: 34px !important;
  }

  #homeScreen .launcher-page .app-icon small {
    font-size: 8px !important;
  }

  #homeScreen .launcher-page-dots {
    display: none !important;
  }

  #homeScreen .dock {
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 4px !important;
    inset-inline: 12px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 3px 4px !important;
    margin: 0 !important;
    z-index: 12 !important;
  }

  #homeScreen .dock .app-icon {
    min-height: 0 !important;
    gap: 2px !important;
  }

  #homeScreen .dock .app-glyph {
    width: 26px !important;
    height: 26px !important;
  }

  #homeScreen .dock .app-icon small {
    min-height: 0 !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
  }

  #appWindow.app-window:not(.hidden) {
    inset: 32px 0 26px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) {
    padding: 0 10px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) > .gyomusic-page {
    grid-template-rows: minmax(18px, auto) minmax(26px, auto) minmax(22px, auto) minmax(48px, 1fr) 64px !important;
    gap: 3px !important;
    padding-top: 3px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-kicker,
  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-heading p,
  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-mark {
    display: none !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-heading h2 {
    margin: 0 !important;
    font-size: 16px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-search {
    min-height: 26px !important;
    height: 26px !important;
    padding: 3px 8px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-section-title h3 {
    font-size: 11px !important;
    line-height: 1.05 !important;
    margin: 0 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-section-title p {
    font-size: 6px !important;
    margin: 0 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-section-title > button {
    min-width: 22px !important;
    min-height: 22px !important;
    padding: 2px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-player {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    gap: 1px 5px !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 3px 8px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-cover {
    width: 28px !important;
    height: 28px !important;
    flex-basis: 28px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-meta {
    gap: 1px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-meta strong {
    font-size: 8px !important;
    line-height: 1 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-now-meta small {
    font-size: 6px !important;
    line-height: 1 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-progress-wrap {
    grid-template-columns: 25px minmax(0, 1fr) 25px !important;
    gap: 4px !important;
    margin: 0 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-progress-wrap span {
    font-size: 5px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-progress-wrap input {
    height: 2px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-skip-controls {
    gap: 8px !important;
    margin: 0 !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-skip-controls button {
    width: 18px !important;
    height: 18px !important;
    font-size: 8px !important;
  }

  #appWindow.app-window:not(.hidden) > #appContent.app-content:has(.gyomusic-page) .gyomusic-skip-controls #musicPlayPause {
    width: 22px !important;
    height: 22px !important;
  }

  .nav-bar {
    height: 26px !important;
  }
}

/* Desktop launcher: the app grid scrolls inside its own region and the dock
   remains in normal layout flow, preventing the last icon row from sitting
   underneath the dock on short laptop screens. */
@media (min-width: 801px) and (min-height: 561px) {
  #homeScreen.home-screen {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 58px 19px 8px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #homeScreen .home-heading,
  #homeScreen .search-pill,
  #homeScreen .widget-row,
  #homeScreen .section-heading {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #homeScreen .launcher-pages {
    flex: 1 1 0% !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  #homeScreen .launcher-page {
    height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
  }

  #homeScreen .launcher-page .app-grid {
    height: auto !important;
    min-height: 264px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(66px, auto)) !important;
  }

  #homeScreen .launcher-page-dots {
    flex: 0 0 18px !important;
    height: 18px !important;
    margin: 3px 0 6px !important;
  }

  #homeScreen .dock {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 72px !important;
    margin: auto 0 0 !important;
    padding: 8px 5px !important;
  }
}

/* Build198 desktop Game Center profile sizing */
@media(min-width:900px){.gc-profile-scroll{width:100%;max-width:1120px;margin-inline:auto;padding:28px 34px 42px;box-sizing:border-box}.gc-profile-card.gc-profile-moba-card{grid-template-columns:minmax(150px,190px) minmax(0,1fr) minmax(150px,190px);grid-template-areas:"avatar identity trophy" "season season season";align-items:center;gap:20px;min-height:300px;padding:34px 40px}.gc-profile-avatar{grid-area:avatar;justify-self:center}.gc-profile-identity{grid-area:identity;min-width:0;align-items:flex-start}.gc-profile-identity h3{max-width:100%;overflow-wrap:anywhere;word-break:normal}.gc-profile-idline{max-width:100%;white-space:normal;overflow-wrap:anywhere}.gc-profile-trophy-box{grid-area:trophy;justify-self:end;width:100%;max-width:180px;min-width:0}.gc-profile-season-tag{grid-area:season;position:static;width:100%;box-sizing:border-box;margin-top:6px}.gc-stat-grid{max-width:1120px;margin-inline:auto;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.gc-stat-grid article{min-width:0;overflow:hidden}.gc-stat-grid article strong{font-size:clamp(28px,3.2vw,46px);white-space:nowrap;overflow:hidden;font-variant-numeric:tabular-nums}}
