.chat-body {
  background:
    linear-gradient(180deg, rgba(244, 242, 236, 0.9), rgba(255, 255, 255, 0.96)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80") center top / cover fixed;
}

.chat-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  gap: 20px;
  align-items: start;
}

.chat-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.compact-workspace {
  display: block;
}

.horizontal-ai-line {
  margin-top: 16px;
  color: #ffffff;
  background: var(--brand);
}

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

.chat-split {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.right-chat-rail {
  position: sticky;
  top: 82px;
  z-index: 10;
  min-width: 0;
}

.chat-panel {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 104px);
  padding: 18px;
  overflow: auto;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(31, 70, 53, 0.98), rgba(23, 37, 29, 0.98));
  border: 1px solid rgba(244, 211, 122, 0.42);
  box-shadow: var(--shadow);
}

.chat-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.chat-top h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.chat-top .eyebrow {
  color: var(--accent-2);
}

.live-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #1f2933;
  background: var(--accent-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.match-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.match-status span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 6px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  text-align: center;
}

.chat-account-box {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  color: #1f2933;
  background: #fff7df;
  border: 1px solid rgba(244, 211, 122, 0.72);
  font-size: 13px;
  line-height: 1.65;
}

.chat-account-box p {
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.65;
}

.chat-account-box div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chat-account-box a,
.chat-account-box button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 0;
  color: #ffffff;
  background: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.chat-account-box form {
  margin: 0;
}

.chat-messages {
  display: grid;
  gap: 9px;
}

.message {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  line-height: 1.7;
}

.message p {
  margin: 5px 0 0;
  line-height: 1.7;
}

.message.assistant {
  background: rgba(255, 255, 255, 0.09);
}

.message.user {
  margin-left: 34px;
  color: #1f2933;
  background: #fff7df;
  border-color: rgba(244, 211, 122, 0.65);
}

.chat-form {
  display: grid;
  gap: 8px;
}

.chat-form label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.chat-form textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(244, 211, 122, 0.5);
  font: inherit;
  line-height: 1.6;
}

.chat-form button,
.chat-chips button {
  min-height: 42px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.chat-form button {
  color: #1f2933;
  background: var(--accent);
}

.chat-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.chat-chips button {
  padding: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.chat-chips button:hover,
.chat-chips button:focus-visible {
  color: #1f2933;
  background: var(--accent-2);
  outline: none;
}

.chat-ai-line {
  padding: 10px 11px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.18);
  border-left: 4px solid var(--accent);
  font-size: 12px;
  line-height: 1.6;
}

.match-list {
  display: grid;
  gap: 8px;
}

.match-card {
  display: grid;
  gap: 7px;
  padding: 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(244, 211, 122, 0.58);
}

.match-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.match-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.score {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 5px 7px;
  text-align: center;
  color: #ffffff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.match-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.match-meta span {
  padding: 4px 6px;
  background: #f2f4f0;
  border: 1px solid #e4e8df;
  color: #344054;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .chat-page {
    grid-template-columns: 1fr;
  }

  .right-chat-rail {
    position: static;
  }

  .chat-panel {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .chat-property-grid,
  .chat-split {
    grid-template-columns: 1fr;
  }

  .match-status,
  .chat-chips {
    grid-template-columns: 1fr;
  }
}
