/* Responsive workspace geometry. One content axis replaces screenshot offsets.
 * Business views keep their Agent column; these chat rules do not alter routes. */
:root {
  --workspace-header-height: 64px;
  --chat-content-width: 960px;
  --chat-gutter: clamp(16px, 3vw, 40px);
}
.app { width: 100%; height: 100vh; height: 100dvh; }
.main { min-height: 0; container: workspace / inline-size; }
.main::after, .main .edge-marks { display: none; }
.main > .main-header {
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  flex-shrink: 0;
  padding-inline: 24px;
}
.main .hdr-title { min-width: 0; }
#sidebar .sb-titlebar {
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  flex-shrink: 0;
  margin-block: 0 16px;
}
#sidebar .sb-footer { flex-shrink: 0; }
.main:not(.with-ai-side) > .main-body { min-height: 0; }
.main:not(.with-ai-side) .transcript {
  padding: 24px var(--chat-gutter) 16px;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.main:not(.with-ai-side) .transcript > .thread {
  width: 100%;
  max-width: var(--chat-content-width);
  min-width: 0;
  margin-inline: auto;
  overflow-wrap: anywhere;
}
/* In-flow centering: short windows scroll the welcome content instead of clipping it. */
.main:not(.with-ai-side) .transcript:has(> .thread:empty) {
  display: flex;
  flex-direction: column;
  padding-block: 24px;
}
.main:not(.with-ai-side) .transcript:has(> .thread:empty) > .welcome-hero {
  position: static;
  inset: auto;
  transform: none;
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--chat-content-width);
  margin: auto;
  padding: 0;
  gap: 20px;
}
.main:not(.with-ai-side) .welcome-actions { gap: 12px; margin-top: 4px; }
.main:not(.with-ai-side) .welcome-actions a {
  min-height: 40px;
  padding: 9px 16px;
  justify-content: space-between;
  gap: 20px;
}
/* Footer remains a flex sibling of the scrolling transcript, never viewport-positioned. */
.main:not(.with-ai-side) > .composer-wrap {
  left: auto;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  padding: 12px var(--chat-gutter) max(20px, env(safe-area-inset-bottom));
  container: compose / inline-size;
}
.main:not(.with-ai-side) .composer,
.main:not(.with-ai-side) .pending-queue-renderer,
.main:not(.with-ai-side) .composer-note {
  width: 100%;
  max-width: var(--chat-content-width);
  min-width: 0;
  margin-inline: auto;
}
.main:not(.with-ai-side) .composer {
  padding: 16px;
  min-height: 116px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px #30264008;
}
.main:not(.with-ai-side) .composer:focus-within {
  border-color: #b39acb;
  box-shadow: 0 0 0 3px #8050bc0a, 0 4px 20px #30264008;
}
.main:not(.with-ai-side) #input {
  min-height: 44px;
  max-height: min(240px, 25dvh);
  margin-bottom: 16px;
  overflow-y: auto;
}
.main:not(.with-ai-side) #input::placeholder { color: #96909d; }
.main:not(.with-ai-side) .composer-bar {
  height: auto;
  min-height: 32px;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.main:not(.with-ai-side) :is(.bar-left, .bar-right) {
  min-width: 0;
  max-width: 100%;
  gap: 4px;
}
.main:not(.with-ai-side) .bar-left { flex-wrap: wrap; }
.main:not(.with-ai-side) .bar-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.main:not(.with-ai-side) .pill { min-width: 0; white-space: nowrap; }
.main:not(.with-ai-side) .pill.model { flex: 0 1 auto; min-width: 0; }
.main:not(.with-ai-side) .pill.model span {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main:not(.with-ai-side) .composer-bar :is(.icon-btn, .send) { flex-shrink: 0; }
.main:not(.with-ai-side) .composer-note { color: var(--type-muted); text-align: center; margin-top: 8px; }
.main:not(.with-ai-side) .pending-queue-renderer__list { max-height: 20dvh; overflow-y: auto; }
.main > :is(.rp-task, .rp-workspace) { top: var(--workspace-header-height); }
.main > .rp-workspace--fullscreen { top: 0; }
/* Dock wide-screen inspectors without covering the conversation or its composer. */
@container workspace (min-width: 960px) {
  .main:not(.with-ai-side):has(> .rp-task.rp-open:not([hidden])) > :is(.main-body, .composer-wrap) {
    width: calc(100% - 320px);
    flex-shrink: 0;
  }
  .main:not(.with-ai-side):has(> .rp-workspace.rp-open:not([hidden]):not(.rp-workspace--fullscreen)) > :is(.main-body, .composer-wrap) {
    width: calc(100% - 352px);
    flex-shrink: 0;
  }
}
@container compose (max-width: 560px) {
  .main:not(.with-ai-side) .bar-right { width: 100%; justify-content: flex-end; }
  .main:not(.with-ai-side) .pill.model span { max-width: 140px; }
  .main:not(.with-ai-side) .composer { padding: 12px; }
}
@container workspace (max-width: 420px) {
  .main > .main-header { padding-inline: 12px; }
  .main .hdr-actions { gap: 4px; }
  .main .hdr-actions .fm-btn { padding-inline: 8px; }
  .main:not(.with-ai-side) .transcript { padding-inline: 12px; }
  .main:not(.with-ai-side) > .composer-wrap { padding-inline: 12px; }
  .main:not(.with-ai-side) .welcome-hero__illustration { width: min(240px, 100%); }
  .main:not(.with-ai-side) .welcome-actions { gap: 8px; }
  .main:not(.with-ai-side) .welcome-actions a { gap: 10px; padding-inline: 12px; }
  .main > :is(.rp-task, .rp-workspace) { min-width: 0; max-width: 100%; }
}
@media (max-width: 680px) {
  #sidebar .sb-titlebar { height: 96px; min-height: 96px; }
}
@media (max-height: 650px) {
  .main:not(.with-ai-side) .transcript:has(> .thread:empty) { padding-block: 16px; }
  .main:not(.with-ai-side) .welcome-hero__illustration { width: min(200px, 100%); }
  .main:not(.with-ai-side) .transcript:has(> .thread:empty) > .welcome-hero { gap: 12px; }
  .main:not(.with-ai-side) > .composer-wrap { padding-block: 8px max(12px, env(safe-area-inset-bottom)); }
}
