:root {
  --bg: #f4f0e8;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(26, 36, 33, 0.1);
  --text: #162421;
  --muted: #5d6d68;
  --accent: #0f6b57;
  --accent-2: #d8efe8;
  --assistant: #ffffff;
  --user: #daf0e8;
  --shadow: 0 20px 50px rgba(22, 36, 33, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 107, 87, 0.12), transparent 25%),
    radial-gradient(circle at bottom right, rgba(180, 138, 68, 0.1), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Text", "IBM Plex Sans", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.46));
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f6b57, #19463d);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.new-chat-button,
.send-button,
.attach-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.new-chat-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #173e35, #0f6b57);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.new-chat-button:hover,
.send-button:hover,
.attach-button:hover {
  transform: translateY(-1px);
}

.rail-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.rail-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-value {
  margin-top: 6px;
  font-size: 0.96rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.status-loading {
  background: #fff3d4;
  color: #8a5c00;
}

.status-ready {
  background: #d7f2e9;
  color: #0d5b49;
}

.status-error {
  background: #f6d9d9;
  color: #8f1f1f;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
}

.topbar {
  padding: 34px 42px 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.5vw, 2.7rem);
  line-height: 1.05;
}

.topbar p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.messages {
  padding: 0 42px 32px;
  overflow: auto;
}

.hero {
  margin: 18px auto 0;
  max-width: 860px;
  padding: 34px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(243, 251, 247, 0.88)),
    var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero h2 {
  margin: 18px 0 10px;
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
}

.message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  max-width: 920px;
  margin: 0 auto 22px;
  animation: rise 220ms ease;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #173e35, #0f6b57);
  box-shadow: var(--shadow);
}

.message.user .avatar {
  background: linear-gradient(135deg, #5f6f69, #33423d);
}

.bubble-wrap {
  min-width: 0;
}

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.role {
  font-weight: 700;
}

.mode {
  color: var(--muted);
  font-size: 0.85rem;
}

.bubble {
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--assistant);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  line-height: 1.5;
}

.message.user .bubble {
  background: var(--user);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.composer-shell {
  padding: 0 42px 34px;
}

.attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 920px;
  margin: 0 auto 14px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.attachment-chip img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 10px;
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.attachment-remove {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 28px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.attach-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-2);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.prompt-input {
  max-height: 220px;
  min-height: 48px;
  resize: none;
  overflow: auto;
  padding: 12px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.send-button {
  min-width: 86px;
  height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #173e35, #0f6b57);
  color: white;
  font-weight: 700;
}

.send-button[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.composer-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 920px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.typing {
  color: var(--muted);
  font-style: italic;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 680px) {
  .topbar,
  .messages,
  .composer-shell,
  .rail {
    padding-left: 18px;
    padding-right: 18px;
  }

  .composer-footnote {
    flex-direction: column;
  }
}
