/* shared textarea behavior */
.search-textarea {
  max-height: 80px;
  overflow-y: auto;
}

.app-shell {
  background: transparent;
  min-width: 0;
}

.app-content {
  min-height: 0;
  min-width: 0;
  contain: layout;
}

/* GPU-accelerated page switch panels */
.app-content > .nicegui-column {
  will-change: opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.manager-body {
  min-height: 0;
  contain: layout style;
}

.manager-grid {
  content-visibility: auto;
  contain-intrinsic-size: auto 980px;
}

.manager-grid .task-card {
  min-height: 148px;
}

/* generator page */
.generator-workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 360px);
  align-items: start;
  min-width: 0;
}

.generator-main-col,
.generator-side-panel {
  min-width: 0;
}

.generator-side-panel {
  width: clamp(320px, 26vw, 360px) !important;
  align-self: start;
}

.generator-form-scroll {
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--pr-border);
  border-top: none;
  border-radius: 0 0 var(--pr-radius-lg) var(--pr-radius-lg);
  padding: 10px;
}

.generator-yaml-editor {
  height: calc(100vh - 264px);
  min-height: 420px;
}

.generator-args-textarea {
  min-height: 320px;
  background: #f8fafc;
}

@media (max-width: 1380px) {
  .generator-workspace {
    grid-template-columns: 1fr !important;
  }

  .generator-side-panel {
    width: 100% !important;
    position: static !important;
  }

  .generator-yaml-editor {
    height: calc(100vh - 236px);
    min-height: 340px;
  }
}

/* monitor page */
.monitor-terminal-col {
  height: 100%;
  min-width: 0;
}

.monitor-terminal-inner {
  min-height: 0;
  min-width: 0;
  contain: layout;
}

.monitor-terminal {
  min-height: 0;
  min-width: 0;
}

.monitor-task-list-scroll {
  min-height: 0;
}

.manager-body,
.generator-form-scroll {
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
