/* Full-page scroll for the chat surface (not a nested thread scroller) */
.ws-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /* Clears sticky .ws-composer + iOS home / visualViewport inset */
  scroll-padding-bottom: calc(168px + env(safe-area-inset-bottom) + var(--vv-bottom-inset, 0px));
}

.ws-center {
  /* Must equal .ws-ask padding-inline + textarea padding-inline (14px + 4px) */
  --ws-text-inset: 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  /* Wide panel column — closer to Cursor chat width */
  max-width: min(960px, 100%);
  width: 100%;
  margin: 0 auto;
  min-height: 100%;
  box-sizing: border-box;
  padding-inline: clamp(16px, 2.5vw, 28px);
}

.ws-main.is-canvas-open .ws-center {
  max-width: none;
}

/* Empty chat — same column width as conversation ask bar */
.ws-stage.is-empty .ws-center {
  justify-content: flex-end;
  padding-top: 16px;
  padding-bottom: 48px;
  min-height: 100%;
}
.ws-stage.is-empty .ws-thread {
  display: none;
}
.ws-stage.is-empty .ws-composer {
  position: relative;
  background: transparent;
  padding: 0;
  width: 100%;
}
.ws-stage.is-empty .cmore {
  display: none !important;
}
.ws-stage.is-empty .ws-ask {
  min-height: 128px;
  border-radius: 16px;
}
.ws-stage.is-empty .ws-ctx {
  display: none;
}

/* Active chat — thread top → bottom; follow-up ask sticky at bottom */
.ws-stage:not(.is-empty) .ws-thread {
  flex: 1 0 auto;
  padding-top: 16px;
  /* Clear sticky tall ask (~128px) + composer pad + safe-area / visualViewport inset */
  padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom-inset, 0px));
  padding-inline: 0;
}
.ws-stage:not(.is-empty) .ws-composer {
  position: sticky;
  bottom: 0;
  padding-inline: 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom) + var(--vv-bottom-inset, 0px));
}
.ws-stage:not(.is-empty) .ws-ask {
  border-radius: 16px;
  min-height: 128px;
}

