*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f0f0;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  max-width: 640px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
}

header {
  padding: 16px 20px;
  background: #ff6b35;
  color: #fff;
  flex-shrink: 0;
}

header h1 { font-size: 1.2rem; font-weight: 700; }
header p  { font-size: 0.82rem; opacity: 0.88; margin-top: 2px; }

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 0.93rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user {
  align-self: flex-end;
  background: #ff6b35;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: #f2f2f2;
  color: #222;
  border-bottom-left-radius: 4px;
}

.message.assistant.thinking {
  opacity: 0.55;
  font-style: italic;
}

.message.error {
  align-self: flex-start;
  background: #ffe4e4;
  color: #b00020;
}

footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

#chat-form { display: flex; gap: 8px; }

#user-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 24px;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.15s;
}

#user-input:focus { border-color: #ff6b35; }

#send-btn {
  padding: 10px 20px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 0.93rem;
  cursor: pointer;
  transition: background 0.15s;
}

#send-btn:disabled { background: #ccc; cursor: default; }
#send-btn:not(:disabled):hover { background: #e85a25; }

.recipe-image-wrapper {
  align-self: flex-start;
  max-width: 80%;
}

.recipe-image {
  width: 320px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.recipe-image-loading {
  width: 320px;
  height: 200px;
  border-radius: 12px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #999;
}
