:root {
  --accent: #ff4031;
  --accent-dark: #d6321f;
  --header-bg: #fdf5ec;
  --bg: #ffffff;
  --text: #000000;
  --text-muted: #666;
  --bubble-user: #fdf5ec;
  --bubble-assistant: #f7f7f5;
  --border: #e5e3df;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Karla", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-link img {
  height: 44px;
  display: block;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 16px;
  gap: 16px;
}

.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scroll-behavior: smooth;
  min-height: 0;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.msg-user {
  align-items: flex-end;
}

.msg-assistant {
  align-items: flex-start;
}

.bubble {
  background: var(--bubble-assistant);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  max-width: 92%;
  white-space: normal;
  word-wrap: break-word;
}

.msg-user .bubble {
  background: var(--bubble-user);
  border-color: #ead8c4;
}

.bubble p {
  margin: 0 0 10px;
}
.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul, .bubble ol {
  margin: 10px 0;
  padding-left: 22px;
}

.bubble li {
  margin: 6px 0;
}

.bubble strong {
  color: var(--accent-dark);
}

.bubble a {
  color: var(--accent);
  text-decoration: underline;
}

.bubble img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.bubble code {
  background: #fff;
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}

.bubble pre {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
}

.suggestions {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-btn {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.suggestion-btn:hover {
  background: var(--header-bg);
  border-color: var(--accent);
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.chat-form:focus-within {
  border-color: var(--accent);
}

.chat-form textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  padding: 8px 6px;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
}

.chat-form button[type="submit"] {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-form button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-dark);
}
.chat-form button[type="submit"]:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.footnote {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.typing span {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .chat-shell { padding: 16px 14px 10px; }
  .logo-link img { height: 36px; }
  .header-title { font-size: 16px; }
}
