/* The conversation owns one scroll region; the composer stays within reach. */
.island-dialog[data-mode='chat'] {
  height: min(660px, calc(100dvh - 80px));
  overflow: hidden;
}
.island-dialog[data-mode='chat'] > .island-header,
.island-dialog[data-mode='chat'] > .island-tabs {
  flex-shrink: 0;
}
.island-dialog[data-mode='chat'] .island-chat {
  flex: 1;
  min-height: 0;
}
.island-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  padding-bottom: 4px;
}
.island-clear-history {
  gap: 4px;
  min-height: 36px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
}
.island-clear-history svg {
  width: 14px;
  height: 14px;
}
.island-clear-history:hover:not(:disabled) {
  color: var(--red);
}
.island-clear-confirm {
  padding: 12px;
  margin: 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
  overflow: auto;
  flex: 0 1 auto;
  min-height: 112px;
}
.island-clear-confirm h3 {
  font-size: 14px;
  margin: 0 0 4px;
}
.island-clear-confirm p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
}
.island-clear-confirm > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.island-clear-confirm .secondary {
  min-height: 40px;
  font-size: 12px;
  padding: 8px 12px;
}
.island-clear-confirm [data-island-clear-confirm] {
  border-color: var(--red);
  color: var(--red);
}
.island-chat .island-messages {
  max-height: none;
  padding: 12px 4px 4px;
  scrollbar-width: thin;
  scrollbar-color: #606671 transparent;
  scrollbar-gutter: stable;
}
.island-chat .island-turn {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  margin: 0 0 24px;
  border: 0;
}
.island-message {
  min-width: 0;
}
.island-message.is-user {
  max-width: 85%;
  margin-inline-start: auto;
  margin-bottom: 0;
}
.island-message-author {
  display: block;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 4px;
}
.is-user .island-message-author {
  text-align: end;
  padding-inline-end: 4px;
}
.island-chat .island-user {
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: #2c3933;
  color: #f0f7f2;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.island-message.is-assistant {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-inline-end: 12px;
}
.island-message-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.island-reply-body {
  min-width: 0;
}
.island-chat .island-reply {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}
.island-reply-body [data-proposal] {
  margin-top: 12px;
  font-size: 12px;
  min-height: 40px;
}
.island-chat-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
}
.island-chat-empty img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 12px;
}
.island-chat-empty h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
}
.island-chat-empty p {
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
}
.island-chat .island-status,
.island-chat .island-error {
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 0;
  flex-shrink: 0;
}
.island-chat .island-error {
  background: rgb(255 182 182 / 0.09);
  color: #ffcccc;
  border: 1px solid rgb(255 182 182 / 0.3);
  padding: 8px 12px;
}
.island-chat .island-suggestions {
  gap: 8px;
  padding-top: 8px;
  flex-shrink: 0;
}
.island-chat .island-suggestions button {
  flex: 0 1 auto;
  font-size: 11px;
  padding: 8px 12px;
  min-height: 36px;
}
.island-chat .island-compose {
  padding-top: 12px;
}
.island-compose label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.island-chat .island-compose > div {
  border: 1px solid #707985;
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
  background: #24272d;
}
.island-chat .island-compose > div:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.island-chat .island-compose textarea {
  min-height: 44px;
  max-height: 112px;
  height: 44px;
  border: 0;
  padding: 10px 12px;
  line-height: 1.5;
  background: transparent;
  color: var(--text);
  resize: none;
  border-radius: 20px;
  box-shadow: none;
}
.island-chat .island-compose textarea:focus {
  outline: none;
  box-shadow: none;
}
.island-chat .island-send {
  flex-shrink: 0;
  border-radius: 50%;
  min-height: 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 10px;
}
@media (max-width: 599px) {
  .island-clear-history,
  .island-clear-confirm .secondary,
  .island-chat .island-suggestions button {
    min-height: 44px;
  }
  .island-dialog[data-mode='chat'] {
    height: min(660px, calc(100dvh - 16px));
  }
}
@media (max-height: 480px) {
  .island-chat-empty {
    padding: 8px;
  }
  .island-chat-empty img {
    display: none;
  }
  .island-dialog[data-mode='chat'] {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    margin-top: 8px;
    padding: 12px;
  }
  .island-dialog[data-mode='chat'] .island-tabs {
    margin: 8px 0;
  }
  .island-clear-confirm {
    position: absolute;
    inset: 12px;
    z-index: 1;
    background: #24272d;
    margin: 0;
  }
}
