/* MaxIn generation composer layout; standalone static compatibility patch. */
.creative-thread { container-type: inline-size; min-width: 0; }
.creative-thread .composer-dock {
  width: min(1280px, 100cqw);
}

.creative-thread .composer-card {
  container: generation-composer / inline-size;
}

.creative-thread .composer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  overflow: visible;
}

.creative-thread .composer-toolbar .creation-controls {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: visible;
}

.creative-thread .composer-toolbar .creation-control {
  flex-shrink: 0;
}

.creative-thread .composer-toolbar .model-trigger {
  min-width: 0;
  max-width: 240px;
  flex-shrink: 1;
}

.creative-thread .model-trigger > span:not(.model-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-thread .composer-toolbar .composer-submit-actions {
  min-width: 0;
  margin-left: 0;
}

.creative-thread .composer-toolbar .composer-submit-actions .send-button {
  margin-left: 0;
}

.creative-thread .composer-submit-actions .cost-hint-toolbar {
  white-space: nowrap;
}

/* Follow the actual resized card width, including beside the desktop sidebar. */
@container generation-composer (max-width: 1020px) {
  .creative-thread .composer-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .creative-thread .composer-toolbar .creation-controls {
    flex-wrap: wrap;
  }

  .creative-thread .composer-toolbar .composer-submit-actions {
    width: 100%;
  }

  .creative-thread .composer-submit-actions .cost-hint-toolbar {
    margin-right: auto;
  }
}


.creative-thread .composer-dock { box-sizing: border-box; max-width: 100%; }
/* Existing site bundles render the estimate beside the submit group. Keep
   their JavaScript intact and place both in the same responsive grid row. */
.creative-thread .composer-toolbar:has(> .cost-hint-toolbar) {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "controls cost actions";
}
.creative-thread .composer-toolbar:has(> .cost-hint-toolbar) > .creation-controls { grid-area: controls; }
.creative-thread .composer-toolbar > .cost-hint-toolbar {
  grid-area: cost; align-self: center; justify-self: start; white-space: nowrap;
}
.creative-thread .composer-toolbar:has(> .cost-hint-toolbar) > .composer-submit-actions { grid-area: actions; }
@container generation-composer (max-width: 1020px) {
  .creative-thread .composer-toolbar:has(> .cost-hint-toolbar) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "controls controls" "cost actions";
  }
  .creative-thread .composer-toolbar:has(> .cost-hint-toolbar) > .composer-submit-actions { width: auto; }
}
/* Small-screen themes hide the duplicate estimate. Retain two grid columns
   even then so the automatic image switch stays beside the send button. */
@media (max-width: 420px) {
  .creative-thread .composer-toolbar:not(:has(> .cost-hint-toolbar)) .composer-submit-actions { justify-content: flex-end; }
}
