.cad-studio-hero { margin-bottom: 4px; }

.cad-studio-layout {
  display: flex;
  align-items: stretch;
  gap: 20px;
  margin-top: 18px;
}

.cad-viewer-panel {
  display: flex;
  flex: 1 1 62%;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line, #d5e0e5);
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow, 0 18px 45px -32px rgba(15, 40, 60, .35));
}

.cad-viewer-panel-header h2 {
  margin: 0;
  color: #12304a;
  font-size: 15px;
}

.cad-panel-viewer-host {
  display: flex;
  flex: 1;
  min-height: 460px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed #d5e0e5;
  border-radius: 12px;
  background: #f5f8f9;
}

.cad-panel-placeholder {
  max-width: 320px;
  margin: 0;
  color: #7c8f99;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

/* The mounted viewer should fill this host instead of the fixed 320px
   height used when it's embedded inline in a chat bubble elsewhere. */
.cad-panel-viewer-host .cad-viewer {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.cad-panel-viewer-host .cad-viewer-canvas {
  flex: 1;
  min-height: 0;
}

.cad-chat-panel {
  display: flex;
  flex: 1 1 36%;
  max-width: 420px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line, #d5e0e5);
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow, 0 18px 45px -32px rgba(15, 40, 60, .35));
}

.cad-chat-panel .conversation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
  max-height: min(64vh, 620px);
  padding: 3px 3px 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.cad-studio-composer .composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cad-studio-suggestions {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .cad-studio-layout { flex-direction: column; }
  .cad-viewer-panel { flex: none; }
  .cad-panel-viewer-host { min-height: 360px; }
  .cad-chat-panel { max-width: none; }
}
