:root {
  --bg: #f6efe3;
  --bg-soft: #fbf7ef;
  --paper: rgba(255, 252, 246, 0.86);
  --line: rgba(85, 67, 47, 0.16);
  --ink: #2d241b;
  --subtle: #695747;
  --accent: #b85c38;
  --accent-deep: #8f4427;
  --user: #f4d8be;
  --bot: #fffaf2;
  --shadow: 0 18px 50px rgba(91, 58, 26, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, 'Noto Serif SC', 'Songti SC', serif;
  background:
    radial-gradient(circle at top left, rgba(218, 144, 87, 0.18), transparent 28%),
    radial-gradient(circle at right center, rgba(99, 149, 117, 0.12), transparent 24%),
    linear-gradient(180deg, #f8f2e7 0%, #f4ebdc 100%);
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.hero,
.chat-wrap {
  background: var(--paper);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
}

.intro {
  margin: 16px 0 24px;
  color: var(--subtle);
  line-height: 1.7;
}

.panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 248, 238, 0.9);
  border: 1px solid rgba(184, 92, 56, 0.15);
}

.panel.muted {
  background: rgba(247, 242, 232, 0.86);
}

.panel-title {
  margin-bottom: 8px;
  font-weight: 700;
}

.panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--subtle);
  line-height: 1.65;
}

.chat-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-header h2 {
  margin: 0;
  font-size: 28px;
}

.chat-header p {
  margin: 6px 0 0;
  color: var(--subtle);
}

.ghost-btn,
.send-btn {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
  font: inherit;
}

.ghost-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-btn:hover,
.send-btn:hover {
  transform: translateY(-1px);
}

.chat {
  flex: 1;
  padding: 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 84%;
  padding: 16px 18px;
  border-radius: 20px;
  line-height: 1.75;
  white-space: pre-wrap;
  animation: rise 0.24s ease;
}

.message.user {
  align-self: flex-end;
  background: var(--user);
  border-bottom-right-radius: 6px;
}

.message.bot {
  align-self: flex-start;
  background: var(--bot);
  border: 1px solid rgba(85, 67, 47, 0.08);
  border-bottom-left-radius: 6px;
}

.message.meta {
  align-self: center;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.66);
}

.message.loading {
  align-self: center;
  max-width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--line);
  font-style: italic;
}

.composer {
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  background: rgba(251, 247, 239, 0.85);
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  border-radius: 18px;
  border: 1px solid rgba(85, 67, 47, 0.18);
  padding: 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.composer-bar {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hint {
  color: var(--subtle);
  font-size: 14px;
}

.send-btn {
  padding: 12px 22px;
  background: var(--accent);
  color: #fff8f1;
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .chat-wrap {
    min-height: 70vh;
  }

  .message {
    max-width: 100%;
  }
}
