/* Prompt Ola public chat composer v4.
   One quiet surface for both the landing and conversation states. */

.ola-composer {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 10px;
  border: 1px solid var(--ola-line);
  border-radius: 18px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  box-shadow: 0 10px 28px rgb(31 24 12 / .08);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ola-composer:focus-within {
  border-color: var(--ola-orange);
  box-shadow: 0 0 0 3px rgb(242 106 46 / .12), 0 10px 28px rgb(31 24 12 / .08);
}

.ola-composer-input-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
}

.ola-composer #promptText {
  display: block;
  width: 100%;
  height: 30px;
  min-height: 30px;
  max-height: 168px;
  margin: 0;
  padding: 3px 2px 4px;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  color: var(--ola-ink);
  font-size: 16px;
  line-height: 1.45;
}

.ola-composer #promptText:focus {
  outline: 0;
}

.ola-composer #promptText::placeholder {
  color: var(--ola-muted);
  opacity: .78;
}

.ola-composer-toolbar {
  min-width: 0;
  margin-top: 8px;
}

.ola-composer-write-host {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.ola-composer .writing-popover {
  display: none;
}

.ola-composer .composer-footer {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.ola-composer .tools {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.ola-composer .tools::-webkit-scrollbar {
  display: none;
}

.ola-composer .tools > * {
  flex: 0 0 auto;
}

.ola-composer .tool,
.ola-composer .mode-pill,
.ola-composer .attachment-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ola-line);
  border-radius: 999px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.ola-composer .attachment-button {
  width: 36px;
  padding: 0;
  font-size: 20px;
  font-weight: 400;
}

.ola-composer .tool:hover,
.ola-composer .mode-pill:hover,
.ola-composer .attachment-button:hover {
  border-color: var(--ola-orange);
  background: rgb(242 106 46 / .08);
}

.ola-composer .tool:active,
.ola-composer .mode-pill:active,
.ola-composer .attachment-button:active,
.ola-composer .send:active {
  transform: translateY(1px) scale(.98);
}

.ola-composer .tool:focus-visible,
.ola-composer .mode-pill:focus-visible,
.ola-composer .attachment-button:focus-visible,
.ola-composer .send:focus-visible {
  outline: 2px solid var(--ola-orange);
  outline-offset: 2px;
}

.ola-composer .mode-pill.active,
.ola-composer[data-active-control="write"] #moreButton,
.ola-composer[data-active-control="image"] #btnImage,
.ola-composer[data-active-control="advanced"] #tuneButton,
.ola-composer[data-active-control="ad"] #tuneButton,
.ola-composer[data-active-control="video"] .video-pill,
.ola-composer[data-active-control="clean"] #cleanButton {
  border-color: var(--ola-green);
  background: var(--ola-green);
  color: #fff;
}

.ola-composer .send {
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ola-green);
  color: #fff;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease, opacity .16s ease;
}

.ola-composer .send:hover {
  background: var(--ola-green-deep);
}

.ola-composer .send:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.ola-composer .send svg {
  width: 18px;
  height: 18px;
}

.ola-composer .attachment-preview {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 2px 0 0;
  background: transparent;
}

.ola-composer .attachment-preview[hidden] {
  display: none;
}

.ola-composer .attachment-preview img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 9px;
  background: var(--ola-soft);
}

.ola-composer .attachment-preview-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.ola-composer .attachment-preview-name {
  overflow: hidden;
  color: var(--ola-ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ola-composer .attachment-preview-size {
  color: var(--ola-muted);
  font-size: 11px;
}

.ola-composer .attachment-preview-remove {
  margin-left: auto;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ola-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ola-composer .attachment-preview-remove:hover {
  background: var(--ola-soft);
  color: var(--ola-ink);
}

.ola-composer .writing-picker {
  display: none;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ola-line);
}

.ola-composer .writing-picker.open {
  display: block;
}

.ola-composer .writing-picker[hidden] {
  display: none;
}

.ola-composer .writing-picker .writing-popover {
  position: static;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 0 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ola-composer .writing-picker .popover-label {
  margin: 0 0 3px;
  color: var(--ola-ink);
  font-size: 13px;
  font-weight: 650;
}

.ola-composer .writing-picker .popover-note {
  margin: 0 0 8px;
  color: var(--ola-muted);
  font-size: 12px;
  line-height: 1.35;
}

.ola-composer .writing-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ola-composer .writing-card {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 52px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--ola-line);
  border-radius: 12px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}

.ola-composer .writing-card:hover {
  border-color: var(--ola-orange);
  background: rgb(242 106 46 / .08);
}

.ola-composer .writing-card.is-selected {
  border-color: var(--ola-green);
  background: rgb(47 125 74 / .10);
  color: var(--ola-green-deep);
}

.ola-composer .writing-card-title {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.ola-composer .writing-card-copy {
  color: var(--ola-muted);
  font-size: 11px;
  line-height: 1.25;
}

.ola-composer .writing-card-group {
  padding-right: 30px;
}

.ola-composer .writing-card-arrow {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--ola-muted);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
}

.ola-composer .writing-card-group[aria-expanded="true"] .writing-card-arrow {
  color: var(--ola-green);
  transform: translateY(-50%) rotate(45deg);
}

.ola-composer .writing-subgrid {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--ola-line);
  border-radius: 12px;
  background: var(--ola-soft);
}

.ola-composer .writing-subgrid[hidden] {
  display: none;
}

.ola-composer .writing-subgrid-label {
  margin: 0 2px 7px;
  color: var(--ola-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ola-composer .clean-panel {
  display: grid;
  gap: 9px;
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--ola-line);
}

.ola-composer .clean-panel[hidden],
.ola-composer .clean-report[hidden],
.ola-composer .clean-output[hidden],
.ola-composer .clean-download[hidden],
.ola-composer .clean-copy[hidden] {
  display: none;
}

.ola-composer .clean-panel-label {
  margin: 0;
  color: var(--ola-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ola-composer .clean-capability-note,
.ola-composer .clean-status {
  margin: 0;
  color: var(--ola-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ola-composer .clean-actions,
.ola-composer .clean-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ola-composer .clean-action,
.ola-composer .clean-copy,
.ola-composer .clean-download {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--ola-line);
  border-radius: 999px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.ola-composer .clean-action:hover,
.ola-composer .clean-copy:hover,
.ola-composer .clean-download:hover {
  border-color: var(--ola-orange);
  background: rgb(242 106 46 / .08);
}

.ola-composer .clean-action[aria-pressed="true"] {
  border-color: var(--ola-green);
  background: rgb(47 125 74 / .10);
  color: var(--ola-green-deep);
}

.ola-composer .clean-report {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--ola-soft);
}

.ola-composer .clean-report-title,
.ola-composer .clean-report-body {
  margin: 0;
}

.ola-composer .clean-report-title {
  color: var(--ola-ink);
  font-size: 13px;
  font-weight: 700;
}

.ola-composer .clean-report-body {
  color: var(--ola-ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ola-composer .clean-output {
  width: 100%;
  min-height: 100px;
  max-height: 220px;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--ola-line);
  border-radius: 10px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.conversation-section {
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0 0 18px;
  text-align: left;
}

.conversation-section.visible {
  display: block;
}

.conversation-thread {
  display: flex;
  width: min(100%, 780px);
  min-height: 0;
  flex-direction: column;
  gap: 22px;
  margin: 0 auto;
  padding: 16px 0 24px;
  border-top: 1px solid var(--ola-line);
}

.conversation-message {
  display: grid;
  max-width: 78%;
  gap: 6px;
}

.conversation-message.user {
  align-self: flex-end;
  justify-items: end;
}

.conversation-message.ola {
  align-self: flex-start;
  max-width: 100%;
}

.conversation-meta {
  color: var(--ola-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.conversation-bubble {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ola-ink);
  font-size: 16px;
  line-height: 1.65;
  white-space: normal;
}

.conversation-message.user .conversation-bubble {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--ola-soft);
  line-height: 1.5;
}

.conversation-message.ola .conversation-bubble p {
  margin: 0 0 12px;
}

.conversation-message.ola .conversation-bubble p:last-child {
  margin-bottom: 0;
}

.conversation-message.ola .conversation-bubble h2,
.conversation-message.ola .conversation-bubble h3 {
  margin: 18px 0 8px;
  font-size: 1.06em;
  line-height: 1.3;
}

.conversation-message.ola .conversation-bubble ul,
.conversation-message.ola .conversation-bubble ol {
  margin: 0 0 13px;
  padding-left: 22px;
}

.conversation-message.ola .conversation-bubble li {
  margin: 4px 0;
}

.conversation-message.ola .conversation-bubble pre {
  margin: 12px 0;
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
  background: var(--ola-soft);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.conversation-message.ola .conversation-bubble code {
  padding: 1px 4px;
  border-radius: 5px;
  background: var(--ola-soft);
  font: 13px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.conversation-message.ola .conversation-bubble pre code {
  padding: 0;
  background: transparent;
}

.conversation-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.conversation-choice {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--ola-line);
  border-radius: 999px;
  background: var(--ola-surface);
  color: var(--ola-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.conversation-choice:hover {
  border-color: var(--ola-orange);
  background: rgb(242 106 46 / .08);
}

.ola-thinking {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 4px 2px;
  color: var(--ola-muted);
  font-size: 13px;
}

.ola-thinking.visible {
  display: flex;
}

.ola-thinking-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-right: 24px;
  border-radius: 50%;
  background: var(--ola-orange);
  box-shadow: 12px 0 0 var(--ola-orange), 24px 0 0 var(--ola-orange);
  animation: ola-thinking-pulse 1.1s infinite ease-in-out;
}

.conversation-attachment {
  display: flex;
  align-items: center;
  max-width: 280px;
  gap: 9px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--ola-soft);
  color: var(--ola-muted);
  font-size: 12px;
}

.conversation-attachment img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
}

.conversation-attachment-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.conversation-attachment-name {
  overflow: hidden;
  color: var(--ola-ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes ola-thinking-pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ola-composer,
  .ola-composer * {
    transition: none;
    animation: none;
  }
}

@media (max-width: 640px) {
  .ola-composer {
    padding: 10px 10px 8px;
    border-radius: 16px;
  }

  .ola-composer-toolbar {
    margin-top: 7px;
  }

  .ola-composer .composer-footer {
    gap: 6px;
  }

  .ola-composer .tools {
    gap: 4px;
  }

  .ola-composer .tool,
  .ola-composer .mode-pill,
  .ola-composer .attachment-button {
    height: 34px;
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .ola-composer .attachment-button {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 19px;
  }

  .ola-composer .send {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-basis: 36px;
  }

  .ola-composer #promptText {
    font-size: 15px;
  }

  .conversation-thread {
    gap: 18px;
    padding: 12px 0 20px;
  }

  .conversation-message {
    max-width: 88%;
  }

  .conversation-bubble {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .ola-composer .writing-card-grid {
    grid-template-columns: 1fr;
  }
}
