/* Windows-style quick launcher in sidebar footer (Fizzy-inspired collapsible sections) */

.launcher {
  position: static;
  z-index: 30;
}

.sidebar__launcher {
  margin-block-end: 0.35rem;
}

.launcher__trigger {
  align-items: center;
  background: linear-gradient(145deg, oklch(var(--lch-blue)), oklch(var(--lch-blue) / 0.82));
  block-size: 2.75rem;
  border-radius: 0.55rem;
  border: 1px solid oklch(var(--lch-blue) / 0.45);
  box-shadow: 0 4px 14px oklch(var(--lch-black) / 0.12);
  color: white;
  cursor: pointer;
  display: flex;
  gap: 0.55rem;
  inline-size: 100%;
  justify-content: flex-start;
  padding: 0 0.75rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.launcher__trigger-label {
  font-size: 0.8125rem;
  font-weight: 700;
}

.launcher__trigger:hover {
  box-shadow: 0 10px 28px oklch(var(--lch-black) / 0.24);
  transform: translateY(-1px);
}

.launcher__trigger-grid {
  display: grid;
  gap: 0.22rem;
  grid-template-columns: repeat(2, 0.55rem);
}

.launcher__trigger-grid span {
  background-color: currentColor;
  block-size: 0.55rem;
  border-radius: 0.12rem;
  inline-size: 0.55rem;
}

.launcher__panel {
  animation: launcher-panel-in 150ms ease;
  background: none;
  border: none;
  inset: auto;
  margin: 0;
  max-block-size: min(78dvh, 36rem);
  max-inline-size: min(22rem, calc(100vw - 2rem));
  overflow: visible;
  padding: 0;
  position: fixed;
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  inset-inline-start: max(1rem, env(safe-area-inset-left));
}

@media (min-width: 100ch) {
  .launcher__panel {
    inset-inline-start: calc(var(--panel-sidebar-width) + 0.75rem);
  }
}

.launcher__panel::backdrop {
  animation: launcher-backdrop-in 150ms ease;
  background-color: oklch(var(--lch-black) / 0.35);
}

.launcher__panel-inner {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  background-color: oklch(var(--lch-gray) / 0.96);
  border-radius: 0.85rem;
  border: 1px solid var(--color-border-dark);
  box-shadow: 0 16px 48px oklch(var(--lch-black) / 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-block-size: inherit;
  overflow: auto;
  padding: 1rem;
}

.launcher__header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.launcher__header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-inline-size: 0;
}

.launcher__logo {
  font-size: 1rem;
}

.launcher__account {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
}

.launcher__close {
  align-items: center;
  aspect-ratio: 1;
  background-color: var(--color-bg);
  block-size: 2rem;
  border-radius: 50%;
  border: 1px solid var(--color-border-dark);
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  inline-size: 2rem;
  justify-content: center;
  padding: 0;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.launcher__close:hover {
  background-color: oklch(var(--lch-gray-dark) / 0.35);
  border-color: var(--color-border-darker);
  color: var(--color-text);
}

.launcher__close .icon {
  block-size: 1rem;
  inline-size: 1rem;
}

.launcher__tiles {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  outline: none;
}

.launcher__tile {
  align-items: center;
  aspect-ratio: 1;
  background-color: var(--color-bg);
  border-radius: 0.55rem;
  border: 1px solid var(--color-border-dark);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-size: 0.6875rem;
  font-weight: 700;
  gap: 0.35rem;
  justify-content: center;
  line-height: 1.2;
  padding: 0.45rem;
  text-align: center;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.launcher__tile .icon {
  color: var(--color-text-muted);
}

.launcher__tile:hover {
  border-color: var(--color-border-darker);
  box-shadow: 0 0 0 var(--hover-size) var(--hover-color);
  text-decoration: none;
}

.launcher__tile--current {
  background-color: oklch(var(--lch-blue-light) / 0.55);
  border-color: oklch(var(--lch-blue) / 0.35);
  box-shadow: none;
  color: oklch(var(--lch-blue));
}

.launcher__tile--current .icon {
  color: inherit;
}

.launcher__section {
  border-block-start: 1px solid var(--color-border-dark);
  padding-block-start: 0.65rem;
}

.launcher__section-meta {
  margin: 0.15rem 0 0;
}

.launcher__section-link {
  color: var(--color-link);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.launcher__section-link:hover {
  text-decoration: underline;
}

.launcher__app-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  list-style: none;
  margin: 0.45rem 0 0;
  max-block-size: 10rem;
  overflow: auto;
  padding: 0;
}

.launcher__app-link {
  align-items: center;
  border-radius: 0.35rem;
  color: var(--color-text);
  display: flex;
  font-size: 0.8125rem;
  gap: 0.55rem;
  padding: 0.25rem 0.45rem;
  text-decoration: none;
}

.launcher__app-link:hover {
  background-color: oklch(var(--lch-gray-dark) / 0.35);
  text-decoration: none;
}

.launcher__app-link--current {
  background-color: oklch(var(--lch-blue-light) / 0.45);
  font-weight: 600;
}

.launcher__app-link--deploying .launcher__app-dot {
  animation: launcher-dot-pulse 1.2s ease-in-out infinite;
}

.launcher__app-link--error .launcher__app-dot {
  box-shadow: 0 0 0 2px oklch(var(--lch-red) / 0.35);
}

.launcher__app-dot {
  block-size: 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
  inline-size: 0.65rem;
}

.launcher__app-dot--red { background-color: #ff3b30; }
.launcher__app-dot--orange { background-color: #ff9500; }
.launcher__app-dot--yellow { background-color: #ffcc00; }
.launcher__app-dot--green { background-color: #34c759; }
.launcher__app-dot--blue { background-color: #007aff; }
.launcher__app-dot--purple { background-color: #af52de; }
.launcher__app-dot--gray { background-color: #8e8e93; }

.launcher__app-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher__account-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-block-start: 0.45rem;
}

.launcher__trial {
  color: var(--color-link);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.launcher__user {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher__sign-out {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0;
  text-align: start;
}

.launcher__sign-out:hover {
  color: var(--color-link);
}

.panel-shell--launcher-open .panel-main {
  pointer-events: none;
}

@keyframes launcher-panel-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes launcher-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes launcher-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.88); }
}
