:root {
  --bg: #f4efe6;
  --card: #fffaf2;
  --ink: #1d1b18;
  --muted: #6e665d;
  --accent: #b85c38;
  --accent-dark: #8e4529;
  --line: #e5d7c3;
  --system: #f7e8c8;
}
/* Store reusable colors in one place so the rest of the stylesheet stays easy to adjust. */

* {
  box-sizing: border-box;
}
/* Include padding and border inside width calculations to make layout sizing more predictable. */

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #fffdf8 0%, #f4efe6 55%, #eadfce 100%);
  color: var(--ink);
}
/* Fill the screen, choose readable fonts, and add a soft layered background. */

.app-shell {
  width: min(720px, calc(100% - 32px));
  margin: 40px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: 0 24px 60px rgba(29, 27, 24, 0.12);
}
/* Create the main chat card and keep it centered on the page. */

.app-header h1,
.app-header p {
  margin: 0;
}
/* Remove default spacing so the header text lines up more cleanly. */

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Style the small label above the title so the page feels more intentional. */

.app-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}
/* Make the main title large and responsive without needing media queries. */

.status {
  margin-top: 10px;
  color: var(--muted);
}
/* Give the live connection status a softer, secondary color. */

.messages {
  list-style: none;
  height: 360px;
  margin: 24px 0 0;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
/* Create the scrollable chat area where message list items will appear. */

.messages li {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8f2e8;
  line-height: 1.4;
}
/* Style each message bubble with spacing and a soft background. */

.messages li.system {
  background: var(--system);
  color: #5f4d2f;
}
/* Give system messages a separate color so they are easy to distinguish. */

.chat-form {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  margin-top: 16px;
}
/* Arrange the two inputs and button in a simple three-column form layout. */

.chat-form input,
.chat-form button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 16px;
  font: inherit;
}
/* Give the form controls a consistent shape and inherit the page font. */

.chat-form input:focus,
.chat-form button:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.18);
}
/* Make keyboard focus obvious without using the browser's default look. */

.chat-form button {
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
/* Turn the button into the main accent color so the primary action stands out. */

.chat-form button:hover {
  background: var(--accent-dark);
}
/* Darken the button slightly on hover to provide mouse feedback. */

@media (max-width: 640px) {
  .app-shell {
    margin: 20px auto;
    padding: 18px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
/* Stack the inputs and button on smaller screens so the layout stays comfortable. */
