:root {
  color-scheme: light;
  --bg: #f2efe8;
  --panel: rgba(255, 252, 245, 0.88);
  --text: #1c1a17;
  --muted: #6c655d;
  --line: rgba(28, 26, 23, 0.08);
  --accent: #c66a3d;
  --accent-strong: #a94d22;
  --assistant: #ffffff;
  --user: #1f3a5f;
  --user-text: #f4f7fb;
  --shadow: 0 18px 40px rgba(60, 46, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(198, 106, 61, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f2e8, #ede7dc 55%, #e8e1d6);
  color: var(--text);
}

.app {
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar,
.messages,
.composer {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  border-radius: 24px;
  padding: 18px 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 22px;
}

.messages {
  flex: 1;
  min-height: 55vh;
  border-radius: 28px;
  padding: 18px;
  overflow-y: auto;
}

.bubble {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant {
  background: var(--assistant);
}

.user {
  margin-left: auto;
  background: var(--user);
  color: var(--user-text);
}

.composer {
  border-radius: 24px;
  padding: 12px;
}

.password,
textarea,
button {
  font: inherit;
}

.password,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.password {
  margin-bottom: 10px;
  border-radius: 14px;
  padding: 10px 12px;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

textarea {
  resize: none;
  min-height: 52px;
  max-height: 180px;
  border-radius: 18px;
  padding: 14px;
}

button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  min-width: 84px;
  height: 52px;
}

button:disabled {
  opacity: 0.6;
}

@media (max-width: 640px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }

  .messages {
    min-height: 50vh;
  }

  .bubble {
    max-width: 94%;
  }
}
