/* ---- chat widget ---- */
.chat-log {
  height: 420px;
  overflow-y: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.chat-msg {
  max-width: 85%;
  padding: .5rem .75rem;
  border-radius: var(--pico-border-radius);
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-user {
  align-self: flex-end;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
}

.chat-assistant {
  align-self: flex-start;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}

/* ---- flash messages ---- */
.flash {
  padding: .75rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
}

.flash-error { background: #fee2e2; border-left: 4px solid #ef4444; }
.flash-success { background: #dcfce7; border-left: 4px solid #22c55e; }

/* ---- misc ---- */
.error { color: var(--pico-del-color); }
.secondary { color: var(--pico-muted-color); }

/* ---- Pico override: buttons inside flex rows must not stretch full-width ---- */
.chat-input-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.chat-input-row input[type="text"] {
  flex: 1;
  min-width: 0;      /* allow flex item to shrink below content width */
  margin-bottom: 0;
}
.chat-input-row button {
  width: auto;       /* override Pico's width:100% on form buttons */
  flex-shrink: 0;
  margin-bottom: 0;
}
