/* Daisy I/O Mini — chat panel.
   Light Daisy-themed warm palette. Works on jny-edition-life, jny-edition-daisy,
   or standalone via /daisy-io-preview.html. */

.daisy-io {
  --d-warm: #b85c2e;        /* Daisy warmth — terracotta */
  --d-warm-soft: #f6e4d4;   /* speech-bubble for Daisy */
  --d-cream: #faf6ef;       /* background — Baltimore kitchen warmth */
  --d-ink: #1f1a14;
  --d-mute: #6b6157;
  --d-line: #e8e1d4;
  display: flex;
  flex-direction: column;
  background: var(--d-cream);
  color: var(--d-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100%;
  min-height: 0;
}

.daisy-io-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--d-line);
  flex-shrink: 0;
}
.daisy-io-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--d-warm), #d48a4d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.daisy-io-titles {
  flex: 1;
  min-width: 0;
}
.daisy-io-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.daisy-io-subtitle {
  font-size: 12px;
  color: var(--d-mute);
  line-height: 1.2;
}
.daisy-io-toolbar {
  display: flex;
  gap: 8px;
}
.daisy-io-mic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--d-line);
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms, border-color 150ms;
}
.daisy-io-mic:disabled,
.daisy-io-mic.is-disabled { opacity: 0.4; cursor: not-allowed; }
.daisy-io-mic.is-listening {
  background: var(--d-warm);
  border-color: var(--d-warm);
  color: #fff;
  animation: dioMicPulse 1.2s infinite ease-in-out;
}
@keyframes dioMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 92, 46, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(184, 92, 46, 0); }
}
.daisy-io-tts-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--d-line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.daisy-io-tts-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.daisy-io-tts-btn[aria-pressed="false"] { background: #f0e6d8; }

/* Conversation stream */
.daisy-io-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.daisy-io-empty {
  text-align: center;
  color: var(--d-mute);
  padding: 40px 20px;
  font-size: 14px;
}
.daisy-io-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: dioFadeIn 200ms ease;
}
@keyframes dioFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.daisy-io-msg-user {
  align-self: flex-end;
  background: #1a1a30;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.daisy-io-msg-daisy {
  align-self: flex-start;
  background: var(--d-warm-soft);
  color: var(--d-ink);
  border-bottom-left-radius: 4px;
}
.daisy-io-msg-meta {
  font-size: 11px;
  color: var(--d-mute);
  margin: 2px 6px;
  text-align: right;
}
.daisy-io-msg-daisy + .daisy-io-msg-meta { text-align: left; }

.daisy-io-typing {
  align-self: flex-start;
  background: var(--d-warm-soft);
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  display: inline-flex;
  gap: 4px;
}
.daisy-io-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--d-mute);
  animation: dioBounce 1.2s infinite ease;
}
.daisy-io-typing span:nth-child(2) { animation-delay: 0.15s; }
.daisy-io-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dioBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Composer */
.daisy-io-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--d-line);
  flex-shrink: 0;
}
.daisy-io-input {
  flex: 1;
  min-height: 38px;
  max-height: 140px;
  padding: 9px 14px;
  background: var(--d-cream);
  border: 1px solid var(--d-line);
  border-radius: 20px;
  font-size: 16px;  /* prevent iOS zoom-on-focus */
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.daisy-io-input:focus {
  border-color: var(--d-warm);
  background: #fff;
}
.daisy-io-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--d-warm);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.daisy-io-send:hover { background: #9a4923; }
.daisy-io-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* iPhone safe-area awareness when standalone */
.daisy-io-standalone .daisy-io {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
