.chat-component-host {
  width: min(96%, 430px);
  justify-self: start;
}

.chat-component {
  overflow: hidden;
  border: 1px solid rgba(131, 196, 173, .25);
  border-radius: 17px;
  background: linear-gradient(155deg, rgba(54, 102, 87, .12), rgba(255, 255, 255, .02)), var(--surface);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .16);
}

.chat-component header {
  min-height: 58px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.chat-component header span {
  display: grid;
  gap: 3px;
}

.chat-component header small {
  color: var(--mint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.chat-component header b {
  font: 400 19px/1.1 var(--serif);
}

.chat-component header em {
  padding: 5px 7px;
  border: 1px solid rgba(131, 196, 173, .24);
  border-radius: 8px;
  color: #cce1d9;
  font-size: 8px;
  font-style: normal;
}

.chat-list-collection,
.chat-list-items {
  padding: 5px 11px;
}

.chat-list-collection > button {
  width: 100%;
  min-height: 50px;
  padding: 7px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.chat-list-collection > button:last-child,
.chat-list-item:last-child {
  border-bottom: 0;
}

.chat-list-collection span {
  display: grid;
  gap: 4px;
}

.chat-list-collection b {
  font-size: 11px;
}

.chat-list-collection small {
  color: var(--muted);
  font-size: 9px;
}

.chat-list-collection i {
  color: var(--faint);
  font-size: 18px;
  font-style: normal;
}

.chat-list-item {
  width: 100%;
  min-height: 46px;
  padding: 6px 1px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.chat-list-item b {
  font-size: 10.5px;
  font-weight: 600;
}

.chat-list-item.done b {
  color: var(--faint);
  font-weight: 500;
  text-decoration: line-through;
}

.chat-list-add {
  margin: 2px 11px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
}

.chat-list-add input {
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #10161a;
  color: var(--text);
  font-size: 16px;
}

.chat-list-add button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(131, 196, 173, .32);
  border-radius: 11px;
  background: var(--mintsoft);
  color: var(--mint);
  font-size: 19px;
}

.chat-component footer {
  min-height: 45px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.chat-component footer small {
  color: var(--faint);
  font-size: 8px;
}

.chat-component footer button,
.chat-component-error button {
  min-height: 40px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 9px;
}

.chat-component-empty,
.chat-component-loading,
.chat-component-error {
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.chat-component-loading,
.chat-component-error {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.chat-component-error button {
  display: block;
  margin-top: 5px;
}

/* Keep conversational controls useful without letting one card take over Chat. */
.chat-component-host { width: min(92%, 410px); }
.chat-component { border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .13); }
.chat-component header { min-height: 46px; padding: 8px 10px; }
.chat-component header span { gap: 2px; }
.chat-component header b { font-size: 16px; }
.chat-component header em { padding: 4px 6px; }
.chat-list-collection,
.chat-list-items { padding: 2px 9px; }
.chat-list-collection > button { min-height: 42px; padding: 5px 1px; }
.chat-list-item { min-height: 44px; padding: 4px 1px; gap: 7px; }
.chat-list-add { margin: 2px 9px 6px; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px; }
.chat-list-add input { min-height: 40px; padding: 7px 9px; border-radius: 10px; }
.chat-list-add button { width: 40px; height: 40px; border-radius: 10px; }
.chat-component footer { min-height: 40px; padding: 4px 10px; }
.chat-component-more { padding: 5px 1px; color: var(--faint); font-size: 8.5px; }
