/* Product assistant: one scrolling history between a stable header and composer. */
.studio-page .chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: var(--space-5) 18px 14px;
}
.studio-page .chat-panel[hidden] { display: none; }
.studio-page .chat-top {
  position: relative;
  flex: none;
  padding: 0 var(--space-12) 14px 0;
  border-bottom: 1px solid var(--border-ui);
}
.studio-page .assistant-close {
  position: absolute;
  top: 0;
  right: 0;
  float: none;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: var(--radius-12);
  background: var(--surface-workspace);
}
.studio-page .assistant-close:hover { background: var(--brand-tint); }
.studio-page .chat-top .eyebrow {
  margin: 0 0 6px;
  color: var(--brand-ink);
  font-size: var(--text-11);
  font-weight: 600;
  letter-spacing: .07em;
}
.studio-page .chat-top h2 {
  margin: 0 0 5px;
  font-size: var(--text-20);
  line-height: 1.2;
  font-weight: 600;
}
.studio-page .chat-top > p:last-child {
  margin: 0;
  line-height: 1.45;
}
.studio-page .conversation {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) 6px var(--space-1) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-mist) transparent;
}
.studio-page .message {
  margin-bottom: var(--space-4);
  font-size: var(--text-small);
  line-height: 1.55;
}
.studio-page .message p { margin: 0; }
.studio-page .message-author {
  display: block;
  margin-bottom: 5px;
  font-size: var(--text-10);
  font-weight: 600;
  letter-spacing: .06em;
}
.studio-page .message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 10px;
}
.studio-page .message-actions button { min-height: 36px; }
.studio-page .message.user {
  margin-left: 18px;
  padding: var(--space-3) 14px;
  border-color: var(--brand-line);
  background: var(--brand-tint);
  color: var(--color-slate);
}
.studio-page .examples {
  flex: none;
  flex-wrap: nowrap;
  gap: var(--space-2);
  overflow-x: auto;
  min-height: 0;
  margin: 0;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-mist) transparent;
}
.studio-page .examples button {
  flex: none;
  min-height: 36px;
  padding: var(--space-2) 11px;
  font-size: var(--text-caption);
  white-space: nowrap;
}
.studio-page .examples button:hover {
  border-color: var(--brand-line);
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.studio-page .composer {
  flex: none;
  min-width: 0;
  padding: 10px var(--space-3);
  border-radius: var(--radius-16);
  background: var(--color-snow);
}
.studio-page .composer:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.studio-page .composer textarea {
  display: block;
  min-height: 70px;
  max-height: 112px;
  resize: none;
  font-size: var(--text-16);
  line-height: 1.5;
}
.studio-page .composer textarea:focus-visible { outline: none; }
.studio-page .composer-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: var(--space-2);
}
.studio-page .composer-bottom > span { line-height: 1.45; }
.studio-page .send {
  min-height: 40px;
  padding: 9px 13px;
  border-color: var(--brand-primary);
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
  color: var(--color-snow);
  font-size: var(--text-caption);
  font-weight: 600;
}
.studio-page .send:hover:enabled { border-color: var(--brand-ink); background: var(--brand-ink); }
.studio-page .privacy-note { flex: none; margin: 9px 2px 0; line-height: 1.4; }

/* In the side panel there is room to show every example; phones keep the compact scroller. */
@media (min-width: 761px) {
  .studio-page .examples { flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 760px) {
  .studio-page.assistant-mobile-open { overflow: hidden; }
  .studio-page .chat-panel {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    z-index: 30;
    width: auto;
    height: auto;
    max-height: none;
    padding: var(--space-4) var(--space-4) var(--space-3);
    border-radius: var(--radius-20);
    box-shadow: 0 0 0 200vmax #17191c66, 0 20px 60px #17191c26;
  }
  .studio-page .chat-top { padding-right: var(--space-12); }
  .studio-page .assistant-close { width: 44px; height: 44px; }
  .studio-page .conversation { padding-top: 14px; }
  .studio-page .examples { margin-inline: -16px; padding-inline: var(--space-4); }
  .studio-page .send { min-height: 44px; }
}

@media (max-width: 380px) {
  .studio-page .chat-panel { padding-inline: var(--space-3); }
  .studio-page .examples { margin-inline: -12px; padding-inline: var(--space-3); }
  .studio-page .chat-top h2 { font-size: var(--text-18); }
}

@media (max-width: 760px) and (max-height: 580px) {
  .studio-page .chat-top > p:last-child, .studio-page .privacy-note { display: none; }
  .studio-page .composer textarea { min-height: 48px; max-height: 76px; }
}
