:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667085;
  --line: #d9dee7;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(244, 247, 251, 0.88), rgba(244, 247, 251, 0.88)),
    url("https://images.unsplash.com/photo-1491002052546-bf38f186af56?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  width: min(1320px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  margin: 16px auto;
}

.catalog-pane,
.chat-pane {
  min-height: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 222, 231, 0.9);
  box-shadow: var(--shadow);
}

.catalog-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  overflow: hidden;
}

.brand-row,
.toolbar,
.composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.status-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.metric-grid > div {
  min-width: 0;
  padding: 12px;
  background: var(--soft);
  border-right: 1px solid var(--line);
}

.metric-grid > div:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metric-grid strong {
  display: block;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding-right: 2px;
}

.product-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-card img,
.image-fallback {
  width: 88px;
  height: 92px;
  border-radius: 6px;
  object-fit: cover;
  background: #e9eef5;
}

.image-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.product-card h2 {
  margin: 0 0 7px;
  font-size: 15px;
  line-height: 1.25;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft);
}

.chat-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 8px;
  overflow: hidden;
}

.toolbar {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-buttons button,
.composer button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.scenario-buttons button {
  padding: 0 12px;
}

.scenario-buttons button:hover,
.composer button:hover {
  border-color: var(--accent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  height: 18px;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: rgba(244, 247, 251, 0.78);
}

.message {
  width: min(720px, 88%);
  margin-bottom: 14px;
  padding: 13px 14px;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  color: #fff;
  background: var(--accent);
}

.message.agent {
  background: #fff;
  border: 1px solid var(--line);
}

.message.system {
  width: 100%;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
}

.composer {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer input {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.composer button {
  width: 92px;
  height: 44px;
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 24px);
    width: min(100vw - 24px, 720px);
    margin: 12px auto;
  }

  .catalog-pane {
    max-height: none;
  }

  .chat-pane {
    min-height: 620px;
  }

  .toolbar,
  .composer {
    align-items: stretch;
    flex-direction: column;
  }

  .scenario-buttons button,
  .composer button {
    width: 100%;
  }
}
