/* Chat page — LEADSORBIT Image Studio */

.stage > main.chat-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background: transparent;
}

/* Shared width for scroll area + composer */
.col,
.composer .inner {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

.col {
  padding: 32px var(--page-gutter) 40px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.msg {
  display: flex;
  gap: 13px;
  max-width: 100%;
}

.msg.user { justify-content: flex-end; }

/* Generation / image grid: full column width (no avatar squeeze) */
.msg--wide {
  display: block;
  width: 100%;
}

.msg--wide .avatar { display: none; }

.bubble--wide {
  width: 100%;
  max-width: 100%;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 30px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
}

.avatar.bot {
  background: #fff url("/static/leadsorbit-icon.png") center/74% no-repeat;
  border: 1px solid var(--line);
  font-size: 0;
  box-shadow: 0 2px 8px rgba(13, 48, 86, 0.06);
}

.msg.user .avatar { display: none; }

.bubble {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 1px 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
}

.bubble b { color: var(--navy); font-weight: 600; }
.bubble .list { margin: 11px 0 0; padding-left: 20px; }
.bubble .list li { margin: 4px 0; }

.bubble code {
  background: var(--tint);
  padding: 2.5px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.msg.user .bubble {
  background: var(--tint);
  color: var(--ink);
  border: 1px solid #d6e8f5;
  border-radius: var(--radius-xl);
  padding: 11px 16px;
  max-width: 78%;
  flex: 0 1 auto;
}

.msg.user .bubble b { color: var(--navy); }

/* ---- Generation results card ---- */
.gen-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px clamp(14px, 2.5vw, 22px) 22px;
  box-shadow: var(--shadow-card);
  width: 100%;
}

.composer {
  flex: 0 0 auto;
  background: #fff;
  padding: 14px var(--page-gutter) 24px;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(13, 48, 86, 0.04);
}

.edit-panel {
  position: relative;
  z-index: 2;
  padding: 0 14px 14px;
  background: #fff;
}

.edit-panel .edit-label { padding-top: 10px; }

.edit-form textarea {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.shell {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(72, 137, 255, 0.12);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 6px 16px;
}

.row input[type=text] {
  border: 0;
  outline: none;
  flex: 1;
  padding: 10px 0;
  font-size: 15px;
  min-width: 0;
  background: none;
}

.row input[type=text]:focus { outline: none; box-shadow: none; }

.send {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
  transition: background 0.2s ease, transform 0.2s ease;
}

.send:hover {
  background: var(--pink);
  transform: translateY(-1px);
}

.setup-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--tint);
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.setup-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setup-card > summary::-webkit-details-marker { display: none; }

.setup-card > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.setup-card[open] > summary::after { content: "▴"; }

.setup-body { padding: 4px 16px 16px; }

.setup-card h3 {
  margin: 12px 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setup-card h3:first-child { margin-top: 0; }

.type-pick { display: flex; gap: 8px; flex-wrap: wrap; }

.type-pick label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin: 0;
}

.type-pick label:has(input:checked) {
  border-color: var(--blue);
  background: var(--rail-hover);
  box-shadow: 0 0 0 2px rgba(72, 137, 255, 0.11);
}

.type-pick input { accent-color: var(--blue); width: auto; }

.field {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 12px;
}

.field.attach { border-style: dashed; border-color: var(--blue); background: #fafdff; }

.field input[type=text] {
  border: 0;
  outline: none;
  flex: 1;
  padding: 4px 0;
  font-size: 13.5px;
}

.field input[type=file] {
  border: 0;
  padding: 0;
  flex: 1;
  font-size: 12.5px;
  background: none;
}

.field input:focus { outline: none; box-shadow: none; }

.or-div {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  margin: 7px 0;
}

.hint {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 9px;
  line-height: 1.5;
}

.startrow { display: flex; justify-content: flex-end; margin-top: 11px; }

/* ---- Image grid: roomy cards, full image visible ---- */
.imgwrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .imgwrap { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .imgwrap { grid-template-columns: repeat(3, 1fr); }
}

.imgcell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.img-preview,
.imgcell .ph {
  background: #fff;
  line-height: 0;
  overflow: hidden;
}

.img-preview img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1200 / 704;
}

.imgcell .ph {
  aspect-ratio: 1200 / 704;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  line-height: normal;
}

.imgcell .cap {
  padding: 12px 14px;
  background: #fff;
  font-size: 12px;
  color: var(--navy);
  border-top: 1px solid var(--line);
  line-height: 1.55;
}

.edit-form {
  padding: 0;
  border-top: 0;
  background: transparent;
}

.edit-form textarea {
  min-height: 64px;
  margin-bottom: 10px;
}

.bar {
  height: 6px;
  background: var(--tint-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 4px;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--gradient-brand);
  transition: width 0.4s;
}

.setup {
  background: var(--tint);
  border: 1px solid #CFE4F4;
  border-radius: 11px;
  padding: 12px 14px;
  margin-top: 11px;
  font-size: 13.5px;
  color: var(--navy);
  line-height: 1.6;
}
