/* Home screen and independent app windows. App icons themselves belong to each app. */
#launcher {
  position: fixed;
  inset: 42px 0 0;
  padding: 68px 8vw 120px;
  overflow: auto;
}
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 112px);
  gap: 38px 42px;
  justify-content: start;
}
.launcher-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: none;
  color: #203d54;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}
.app-tile {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  filter: drop-shadow(0 9px 10px #183b5026);
  transition: transform 0.18s;
}
.app-tile svg {
  width: 82px;
  height: 82px;
}
.launcher-icon:hover .app-tile {
  transform: translateY(-4px);
}
.launcher-icon:active .app-tile {
  transform: scale(0.93);
}
.menu-logout {
  padding: 4px 8px;
  background: none;
  color: inherit;
  font-size: 11px;
}
.desktop-session .app-window.window {
  position: fixed;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #ffffff96;
  box-shadow: 0 18px 54px #17314933;
}
.desktop-session .app-window.frontmost {
  box-shadow:
    0 30px 85px #10294155,
    0 3px 12px #17314926;
}
.desktop-session .app-window.maximized {
  border-radius: 0;
}
.window-titlebar {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  background: #eaf1f4b8;
  border-bottom: 1px solid #829fb52a;
  touch-action: none;
  user-select: none;
  cursor: default;
}
.window-titlebar strong {
  font-size: 12px;
  font-weight: 600;
}
.window-app-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.window-controls {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}
.window-controls button {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #0007;
  line-height: 1;
  background: #ff6058;
}
.window-controls button:nth-child(2) {
  background: #ffbd2e;
}
.window-controls button:nth-child(3) {
  background: #28c840;
}
.window-reset {
  margin-left: auto;
  background: none;
  padding: 5px;
  color: #4c677b;
}
.app-window iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: #edf3f8;
}
.window-gesture iframe,
.window-animating iframe {
  pointer-events: none;
}
body.app-frame {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: auto;
  background: #edf3f8;
  color: var(--text);
}
.app-frame::before,
.app-frame::after {
  display: none;
}
.app-frame .content {
  padding: 16px 22px 30px;
  margin: 0;
  max-height: none;
  height: auto;
  overflow: visible;
}
.app-search {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.app-frame dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}
#dock button svg {
  width: 46px;
  height: 46px;
}
#dock [data-nav] {
  background: transparent;
  border: none;
  box-shadow: none;
}
#dock .running-dot {
  display: none;
  position: absolute;
  bottom: -4px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  background: #416079;
  border-radius: 50%;
}
#dock .running .running-dot {
  display: block;
}
.menubar {
  z-index: 10000;
}
.dock {
  z-index: 10000;
}
#spaces-dialog {
  z-index: 10002;
}
@media (max-width: 720px) {
  #launcher {
    padding: 42px 26px 110px;
  }
  .launcher-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 30px 18px;
  }
  .app-tile,
  .app-tile svg {
    width: 70px;
    height: 70px;
  }
  .launcher-icon {
    font-size: 12px;
  }
  .desktop-session .app-window.window {
    border-radius: 0;
  }
  .app-frame .content {
    padding: 12px 12px 90px;
  }
  .window-titlebar {
    height: 42px;
    flex-basis: 42px;
  }
  .window-controls button {
    width: 18px;
    height: 18px;
  }
  .window-controls [data-command="maximize"] {
    display: none;
  }
}
#dock button.active::after {display:none;}

/* Keep a growing app catalog inside the viewport, including mobile safe areas. */
#dock {
  width: max-content;
  max-width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 15px;
}
#dock::-webkit-scrollbar { display: none; }
#dock button { flex: 0 0 auto; }
#dock button svg { width: 100%; height: 100%; }
@media (max-width: 720px) {
  #dock {
    gap: 8px;
    padding: 10px 10px 14px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
  }
  #dock button { width: 44px; height: 44px; }
  #dock button:hover { transform: none; }
}
