body {
  font-family:
    'Montserrat',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
  background: radial-gradient(circle farthest-side at 50% 100%, #303030 0%, #000 100%);
  margin: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Styles added to the chatContainer will center the solution in the middle of the page */
#chatContainer {
  flex: 1 1 auto;
  min-height: 0;
  height: 100% !important;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  position: relative;
  z-index: 10;
}

.header img {
  max-height: 48px;
}

.header__left {
  flex: 0 0 auto;
}

.header__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Auth Button */
.auth-btn {
  height: 56px;
  padding: 16px 24px;
  gap: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 24px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Apps (Waffle) Dropdown */
.apps-dropdown {
  position: relative;
  margin-right: 12px;
}

.apps-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.apps-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.apps-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: linear-gradient(to bottom left, #1B1B1B, #242424);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  min-width: 340px;
  max-width: 400px;
  display: none;
  overflow: hidden;
  z-index: 100;
}

.apps-menu.open {
  display: block;
}

.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
}

.app-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  transition: background 0.15s ease;
}

.app-tile:hover {
  background: rgba(255, 255, 255, 0.08);
}

.app-tile__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.app-tile__content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.app-tile__title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tile__description {
  font-size: 12px;
  color: #a9a9a9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.apps-menu__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #333;
}

.apps-menu__view-all {
  display: block;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.apps-menu__view-all:hover {
  background: rgba(255, 255, 255, 0.1);
}

.apps-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #6F6F6F;
  font-size: 14px;
}

/* App tile loading skeleton */
.app-tile--loading {
  pointer-events: none;
}

.app-tile--loading .skeleton {
  background: #333;
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.app-tile--loading .app-tile__icon.skeleton {
  width: 40px;
  height: 40px;
}

.app-tile--loading .app-tile__title.skeleton {
  width: 100px;
  height: 14px;
}

.app-tile--loading .app-tile__description.skeleton {
  width: 180px;
  height: 28px;
}

/* Profile Dropdown */
.profile-dropdown {
  position: relative;
}

.profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #515151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
}

.profile-btn:hover,
.profile-btn.active {
  background: #6a6a6a;
}

.profile-initials {
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.profile-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}

.profile-btn:hover .profile-image,
.profile-btn.active .profile-image {
  filter: brightness(0.8);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1B1B1B;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  min-width: 220px;
  display: none;
  overflow: hidden;
}

.profile-menu.open {
  display: block;
}

.profile-menu__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #6F6F6F;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-menu__close:hover {
  color: #d0cece;
}

.profile-menu__header {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.menu-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #515151;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.menu-initials {
  color: white;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
}

.menu-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.profile-email {
  color: #a9a9a9;
  font-size: 12px;
  text-align: center;
}

.profile-menu__divider {
  height: 1px;
  background: #323232;
}

.profile-menu__item {
  display: block;
  width: 100%;
  padding: 1rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #a9a9a9;
  transition: background 0.15s ease;
  text-decoration: none;
}

.profile-menu__item:hover {
  background: #323232;
}

/* Login Modal */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.login-modal__content {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 320px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: white;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  z-index: 50;
  border-radius: 4px;
}

.login-modal__close:hover {
  color: #333;
}

/* Okta widget overrides for modal */
.login-modal #okta-sign-in {
  margin: 0;
  border: none;
  box-shadow: none;
}

.login-modal .clearfix::before,
.login-modal .clearfix::after {
  display: none;
}

/* Login Skeleton */
.login-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
}

.login-skeleton.hidden {
  display: none;
}

/* Login Error */
.login-error {
  text-align: center;
  padding: 2rem 1rem;
}

.login-error.hidden {
  display: none;
}

.login-error p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.skeleton-logo {
  width: 180px;
  height: 40px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.skeleton-title {
  width: 80px;
  height: 24px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.skeleton-label {
  width: 70px;
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 0.5rem;
}

.skeleton-input {
  width: 100%;
  height: 40px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.skeleton-button {
  width: 100%;
  height: 44px;
  background: #e0e0e0;
  border-radius: 4px;
}

.skeleton-logo,
.skeleton-title,
.skeleton-label,
.skeleton-input,
.skeleton-button {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fine-print,
.fine-print a {
  color: white;
  font-size: 10px;
  text-align: center;
  font-weight: 400;
  margin-inline: .25rem;
}

.fine-print a {
  text-decoration: none;
}

footer {
  padding: 1rem;
  text-align: center;
}


#teconsent,
#teconsent > * {
  display: inline !important;
}

#teconsent a {
  color: white !important;
  font-size: 10px;
  text-transform: uppercase;
}

@media (max-width: 812px) and (min-width: 481px) {
  .header img {
    max-height: 40px;
  }
}

@media (max-width: 480px) {
  .header {
    flex-shrink: 0;
    align-items: center;
    min-height: 50px;
    padding: 0.75rem 1rem;
  }

  .header img {
    max-height: 36px;
  }

  footer {
    padding: 0.5rem;
  }

  .fine-print p,
  .fine-print a {
    margin-block-start: 0;
    font-size: 10px;
  }

  #pypestream-wrapper.ps-pypestream-wrapper.showing {
    position: relative !important;
  }
}
