html,
body {
  height: 100%;
}

.app-body,
.app-main {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.42);
}

.auth-card {
  width: min(100%, 28rem);
}

.app-locked nav,
.app-locked main {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.app-grid {
  align-items: stretch;
  min-height: 0;
}

.content-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 90%;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-light-bg-subtle);
}

.chat-bubble.user {
  margin-left: auto;
  background: var(--bs-primary-bg-subtle);
}

.chat-bubble.assistant {
  margin-right: auto;
}

.chat-role {
  margin-bottom: 0.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.chat-textarea {
  min-height: 7rem;
  resize: vertical;
}

.dsl-card .card-body {
  min-height: 0;
}

.dsl-box {
  flex: 1 1 auto;
  height: 100%;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.workspace-content,
.workspace-pane {
  height: 100%;
  min-height: 0;
}

.media-panel {
  height: 24rem;
  min-height: 24rem;
  overflow: hidden;
}

.form-control-color {
  padding: 0.2rem;
}

.media-panel-padded {
  padding: 0.75rem;
}

.media-panel img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

#viewer3d {
  width: 100%;
  height: 24rem;
  display: block;
}

.frame-strip {
  min-height: 0;
  max-height: 24rem;
  overflow-y: auto;
}

.status-detail {
  overflow-y: auto;
}

.terminal-window {
  height: 12rem;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
}

@media (max-width: 1199.98px) {
  .app-body,
  .app-main {
    overflow: auto;
  }

  .chat-scroll,
  .media-panel,
  #viewer3d,
  .frame-strip {
    min-height: 18rem;
    max-height: none;
    height: 18rem;
  }

  .dsl-box {
    min-height: 18rem;
  }
}
