html,
body {
  height: 100%;
}

body.nx-layout-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.nx-layout-shell {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.nx-layout-shell .nx-frame-regular-main,
.nx-layout-shell .nx-frame-project-main,
.nx-layout-shell .nx-frame-toolkit-page,
.nx-layout-shell .nx-project-header-shell {
  min-height: 0;
  height: 100%;
}

.nx-layout-shell .nx-frame-regular-content,
.nx-layout-shell .nx-project-header__body,
.nx-layout-shell .nx-frame-toolkit-page__body,
.nx-layout-shell .nx-frame-toolkit-page__workspace,
.nx-layout-shell .nx-frame-toolkit-page__split,
.nx-layout-shell .nx-frame-toolkit-doc-panel .nx-toolkit-doc__scroll,
.nx-layout-shell .nx-frame-toolkit-helper-panel .nx-pip-helper__scroll {
  overflow: auto;
}

.nx-layout-shell .nx-frame-regular-content {
  overflow-x: hidden;
  overflow-y: auto;
}

.nx-layout-shell .nx-frame-regular-topbar {
  padding: 0 16px;
}

.nx-pip-chat-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.nx-pip-chat-panel__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  transition: opacity 220ms ease, background-color 220ms ease;
  cursor: pointer;
}

.nx-pip-chat-panel__drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  transform: translateX(102%);
  transition: transform 220ms ease;
  will-change: transform;
  display: flex;
}

.nx-pip-chat-panel .nx-pip-chat-shell {
  width: min(420px, 92vw);
  height: 100%;
  border-radius: 0;
  border: 0;
  border-left: 1px solid rgb(152 152 152);
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.2);
}

.nx-pip-chat-panel[data-state="open"] {
  pointer-events: auto;
}

.nx-pip-chat-panel[data-state="open"] .nx-pip-chat-panel__backdrop {
  opacity: 1;
  background: rgba(15, 23, 42, 0.28);
}

.nx-pip-chat-panel[data-state="open"] .nx-pip-chat-panel__drawer {
  transform: translateX(0);
}

.nx-layout-shell .nx-dashboard-top-prompt {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.nx-layout-shell .nx-dashboard-top-prompt .nx-pip-input-wrap {
  width: 100%;
}

.nx-layout-shell .nx-dashboard-project-header {
  padding-top: 28px;
}

.nx-layout-shell .nx-dashboard-shell {
  width: min(100%, 64rem);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.nx-layout-shell .nx-frame-regular-content {
  padding: 2rem;
}

.nx-layout-shell .nx-dashboard-project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nx-layout-shell .nx-dashboard-project-grid > * {
  min-width: 0;
}

.nx-layout-shell .nx-dashboard-project-grid > .nx-stack {
  width: 100% !important;
}

.nx-app-sidebar-nav__account-avatar-trigger {
  border: 0;
  padding: 0;
  cursor: pointer;
}

.nx-profile-modal__feedback {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.nx-profile-modal__feedback.is-error {
  color: #b42318;
}

.nx-profile-modal__feedback.is-success {
  color: #157347;
}

@media (max-width: 1024px) {
  .nx-layout-shell.nx-frame-demo--regular .nx-app-sidebar-nav {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 3.5rem;
    max-width: 100%;
    flex: 0 0 3.5rem;
    z-index: auto;
    transform: none !important;
    transition: width 180ms ease, flex-basis 180ms ease;
    box-shadow: none;
  }

  .nx-layout-shell.nx-frame-demo--regular[data-frame-sidebar="expanded"] .nx-app-sidebar-nav {
    width: min(20rem, 84vw);
    flex-basis: min(20rem, 84vw);
  }

  .nx-layout-shell.nx-frame-demo--regular .nx-frame-regular-main {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .nx-layout-shell.nx-frame-demo--project .nx-frame-project-rail {
    display: flex;
    width: 3.5rem;
    flex: 0 0 3.5rem;
  }

  .nx-layout-shell .nx-frame-regular-topbar {
    height: 60px;
    padding: 0 12px;
  }

  .nx-layout-shell .nx-frame-regular-topbar__title {
    font-size: 19px;
  }

  .nx-layout-shell .nx-frame-regular-topbar__right {
    gap: 8px;
  }

  .nx-layout-shell .nx-frame-regular-content {
    padding: 2rem;
    gap: 12px;
  }

  .nx-layout-shell .nx-dashboard-shell {
    gap: 12px;
  }

  .nx-layout-shell.nx-frame-demo--project {
    gap: 0;
    padding: 0;
  }

  .nx-layout-shell .nx-frame-project-main .nx-project-header__body {
    padding: 0;
    gap: 12px;
  }

  .nx-layout-shell .nx-frame-toolkit-page__header {
    padding: 8px 12px;
  }

  .nx-layout-shell .nx-frame-toolkit-page__title {
    font-size: 18px;
  }

  .nx-layout-shell .nx-frame-toolkit-page__runs {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 768px) {
  .nx-pip-chat-panel .nx-pip-chat-shell {
    border-left: 1px solid rgb(152 152 152);
  }

  .nx-layout-shell .nx-frame-regular-topbar__pip {
    padding: 0 10px;
    gap: 6px;
  }

  .nx-layout-shell .nx-frame-regular-topbar__pip span {
    display: none;
  }

  .nx-layout-shell .nx-frame-project-main__placeholder--grid,
  .nx-layout-shell .nx-frame-regular-content__grid {
    grid-template-columns: 1fr;
  }

  /* Match alpha behavior: keep dashboard cards at 2 columns until 720px */
  .nx-layout-shell .nx-dashboard-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nx-layout-shell .nx-dashboard-project-grid {
    grid-template-columns: 1fr;
  }
}

/* Project Pipeline page */
.nx-project-header__body:has(> .nx-project-pipeline-shell) {
  padding: 0 !important;
  gap: 0 !important;
  height: 100% !important;
  position: relative;
  margin: 0 !important;
  border: 0 !important;
  background: #ece8dd !important;
}

.nx-project-pipeline-shell {
  height: 100%;
  position: relative;
  display: flex;
  gap: 8px;
  background: transparent;
}

.nx-project-pipeline-mobile-toggle {
  display: none;
  margin-right: 8px;
  min-width: 28px;
  padding: 0 8px;
}

.nx-project-pipeline-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.4);
  border: 0;
  cursor: pointer;
}

.nx-project-pipeline-panel {
  height: 100%;
  position: relative;
  width: 20rem;
  flex: 0 0 20rem;
  z-index: 2;
}

.nx-project-pipeline-mobile-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 55;
  margin-left: auto;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  transition: background-color 140ms ease;
  cursor: pointer;
}

.nx-project-pipeline-mobile-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.nx-project-pipeline-mobile-close [data-lucide] {
  width: 20px;
  height: 20px;
}

.nx-project-pipeline-panel .nx-stack,
.nx-project-pipeline-panel .nx-pp-nav-shell,
.nx-project-pipeline-panel .nx-pp-nav-shell__frame {
  min-height: 100%;
  height: 100%;
  width: 100% !important;
  max-width: none !important;
}

.nx-project-pipeline-panel .nx-pp-nav {
  margin-right: 0;
  border-radius: 0;
  border-left: 0;
  border-bottom: 0;
  border-top: 0;
}

.nx-project-toolkit-page .nx-project-pipeline-panel .nx-row {
  display: none;
}

.nx-project-toolkit-page .nx-project-pipeline-panel .nx-stack > div[style*="height:520px"] {
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.nx-project-toolkit-page .nx-project-pipeline-panel .nx-stack > div[style*="height:520px"] > div:last-child {
  display: none !important;
}

.nx-project-toolkit-page .nx-project-pipeline-panel .nx-rt-nav {
  width: 100%;
  height: 100%;
  border-radius: 0;
  margin-right: 0;
}

.nx-project-pipeline-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
  border-top-right-radius: 12px;
}

.nx-project-pipeline-main-inner {
  max-width: 80rem;
  padding: 16px 16px 16px 10px;
}

.nx-project-pipeline-checklist {
  padding-left: 8px;
  min-width: 0;
}

.nx-project-pipeline-checklist .nx-pipeline-stages {
  width: 100% !important;
  max-width: 100% !important;
}

.nx-project-pipeline-checklist .nx-toolkit-library-shell {
  width: 100% !important;
  max-width: 100% !important;
}

.nx-project-toolkit-page .nx-project-pipeline-main-inner {
  padding: 8px 8px 8px 5px;
}

.nx-project-toolkit-page .nx-project-pipeline-checklist {
  padding-left: 4px;
}

.nx-project-toolkit-page .nx-toolkit-library__inner {
  padding: 12px;
}

.nx-project-toolkit-page .nx-toolkit-library__content {
  padding-top: 0;
  padding-bottom: 0;
}

.nx-toolkit-analysis-page .nx-project-pipeline-main {
  display: flex;
  overflow: hidden;
}

.nx-toolkit-analysis-page--no-nav {
  gap: 0;
}

.nx-toolkit-analysis-page--no-nav .nx-project-pipeline-main {
  border-top-left-radius: 12px;
}

.nx-toolkit-analysis-question-page .nx-project-pipeline-main {
  background: transparent;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-split {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-helper {
  min-width: 0;
  display: flex;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-helper > .nx-toolkit-q-shell,
.nx-toolkit-analysis-page .nx-toolkit-analysis-helper > .nx-pip-helper-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-doc {
  display: flex;
  min-width: 0;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-doc > .nx-stack {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  display: flex;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-doc .nx-toolkit-doc-shell {
  width: 100%;
  height: 100%;
  display: flex;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-doc .nx-toolkit-doc {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.nx-toolkit-analysis-page .nx-toolkit-analysis-doc .nx-toolkit-doc__scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.nx-project-pipeline-stage-head {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 22px;
  border-bottom: 1px solid rgba(220, 227, 238, 0.9);
  background: #f6f6f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nx-project-pipeline-stage-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.nx-project-pipeline-stage-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--nx-color-text, #111827);
  font-family: var(--nx-font-serif, "Lora", Georgia, "Times New Roman", serif);
}

.nx-project-toolkit-page .nx-project-pipeline-stage-head {
  background: linear-gradient(90deg, #2aaac1 0%, #3498db 100%);
  border-bottom: 0;
}

.nx-project-toolkit-page .nx-project-pipeline-stage-title {
  color: #ffffff;
}

.nx-project-toolkit-page .nx-project-pipeline-mobile-toggle {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
  background: transparent;
}

.nx-project-toolkit-page .nx-project-pipeline-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1024px) {
  .nx-project-pipeline-mobile-toggle {
    display: inline-flex;
    position: static;
  }

  .nx-project-pipeline-shell[data-nav-state="open"] .nx-project-pipeline-backdrop {
    display: block;
  }

  .nx-project-pipeline-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: min(20rem, 86vw);
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .nx-project-pipeline-main {
    border-top-right-radius: 0;
  }

  .nx-project-pipeline-shell[data-nav-state="open"] .nx-project-pipeline-mobile-close {
    display: inline-flex;
  }

  .nx-project-pipeline-shell[data-nav-state="open"] .nx-project-pipeline-panel {
    transform: translateX(0);
  }
}

@media (min-width: 1025px) {
  .nx-toolkit-analysis-page[data-nav-state="closed"] {
    gap: 0;
  }

  .nx-toolkit-analysis-page[data-nav-state="closed"] .nx-project-pipeline-panel {
    width: 0;
    flex-basis: 0;
    overflow: hidden;
  }

  .nx-project-pipeline-main-inner {
    padding: 24px 24px 24px 10px;
  }

  .nx-project-pipeline-checklist {
    padding-left: 10px;
  }

  .nx-project-toolkit-page .nx-project-pipeline-main-inner {
    padding: 12px 12px 12px 5px;
  }

  .nx-project-toolkit-page .nx-project-pipeline-checklist {
    padding-left: 5px;
  }

  .nx-project-toolkit-page .nx-toolkit-library__inner {
    padding: 16px;
  }
}
