@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@500&display=swap");

:root {
  color: #1d2925;
  background: #f3f7f4;
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(185, 235, 211, .32), transparent 34rem),
    #f3f7f4;
}

.chat-shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 22px 48px;
}

.chat-header  {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #607169;
  font: 500 11px "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #56b987;
  box-shadow: 0 0 0 4px rgba(86, 185, 135, .12);
}

.save-button {
  border: 1px solid #c9ded2;
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .7);
  color: #287252;
  font: 500 10px "DM Mono", monospace;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.save-button:hover:not(:disabled) {
  border-color: #8ec8a9;
  background: #fff;
}

.save-button:disabled {
  cursor: wait;
  opacity: .6;
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 58px 0 0;
}

.message { max-width: 82%; }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }

.label {
  display: block;
  margin: 0 0 7px;
  color: #74827b;
  font: 500 10px "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.user .label { text-align: right; }

.bubble {
  padding: 15px 18px;
  border: 1px solid #dce7df;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 67, 48, .055);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble p {
  margin: 0 0 1em;
}

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

.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
  margin: 0 0 .55em;
  color: #213b2c;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.bubble h1 { font-size: 1.35em; }
.bubble h2 { font-size: 1.2em; }
.bubble h3 { font-size: 1.08em; }
.bubble h4 { font-size: 1em; }

.bubble ul,
.bubble ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.bubble li {
  padding-left: .25em;
  margin: .25em 0;
}

.bubble li:last-child {
  margin-bottom: 0;
}

.bubble code {
  padding: .12em .35em;
  border-radius: 5px;
  background: #edf3ef;
  color: #28684c;
  font: 500 .88em "DM Mono", monospace;
}

.code-block {
  position: relative;
  margin: 0 0 1em;
  padding: 18px;
  border: 1px solid #d6e3da;
  border-radius: 9px;
  background: #f3f7f4;
  overflow-x: auto;
  white-space: pre;
}

.code-block:last-child {
  margin-bottom: 0;
}

.code-block code {
  display: block;
  padding: 0;
  background: transparent;
  color: #294338;
  font-size: 12px;
  line-height: 1.6;
}

.code-language {
  display: block;
  margin-bottom: 8px;
  color: #789084;
  font: 500 9px "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.bubble a {
  color: #287252;
  text-decoration: underline;
  text-decoration-color: #9bcdb0;
  text-underline-offset: 2px;
}

.bubble a:hover {
  color: #164d35;
}

.user .bubble {
  border-color: #b9ebd3;
  border-bottom-right-radius: 5px;
  background: #c9f0dc;
}

.assistant .bubble {
  border-bottom-left-radius: 5px;
}

.empty {
  margin: 0;
  color: #74827b;
  font: 12px "DM Mono", monospace;
  text-align: center;
}

@media (max-width: 540px) {
  .chat-shell { padding: 20px 16px 36px; }
  .chat-header { gap: 12px; }
  .save-button { padding: 8px 9px; }
  .conversation { padding-top: 46px; gap: 24px; }
  .message { max-width: 92%; }
  .bubble { padding: 13px 15px; font-size: 14px; }
}
