:root {
  color-scheme: light;
  --bg: #edf2ef;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #17211c;
  --muted: #617067;
  --line: #dce5df;
  --accent: #0b7f68;
  --accent-dark: #095f50;
  --warn: #9a5b12;
  --shadow: 0 18px 55px rgba(23, 33, 28, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(11, 127, 104, 0.13), rgba(59, 130, 246, 0.08)),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
}

.workspace {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.panel {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(247, 250, 248, 0.9);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 24px;
}

.brand h1,
.brand p,
.chat-header h2,
.chat-header span,
.status-card p,
.topics h2 {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
}

.brand p,
.status-card p {
  color: var(--muted);
  line-height: 1.45;
}

.status-card {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #16a34a;
}

.topics {
  display: grid;
  gap: 10px;
}

.topics h2 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.topics button,
.secondary-button,
.composer button,
.rating button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-height: 42px;
}

.topics button {
  text-align: left;
  padding: 0 14px;
}

.topics button:hover,
.secondary-button:hover,
.rating button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.chat-card {
  min-width: 0;
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

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

.chat-header span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.chat-header h2 {
  font-size: 22px;
}

.secondary-button {
  padding: 0 16px;
}

.messages {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(rgba(247, 250, 248, 0.76), rgba(247, 250, 248, 0.76)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(220, 229, 223, 0.55) 32px);
}

.message {
  width: min(78%, 680px);
  padding: 13px 15px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: #e8f3ef;
  border-color: #b9d8ce;
}

.message.bot {
  align-self: flex-start;
}

.message.handoff {
  border-color: #e2bd7d;
  background: #fff8eb;
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.rating {
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.rating[hidden] {
  display: none;
}

.rating button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.composer {
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
}

.composer input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
}

.composer button {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
}

.composer button:hover {
  background: var(--accent-dark);
}

@media (max-width: 820px) {
  .shell {
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }

  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topics h2 {
    grid-column: 1 / -1;
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .messages {
    padding: 18px;
    min-height: 380px;
  }

  .message {
    width: 100%;
  }

  .composer {
    padding: 14px 18px 18px;
    grid-template-columns: 1fr;
  }
}
