.chat-shell{
  padding: 4rem 0;
}

.chat-layout{
  display: grid;
  gap: 1.5rem;
}

.chat-head{
  max-width: 80ch;
}

.chat-title{
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  line-height: 1.1;
  margin: 0.25rem 0 0.75rem;
}

.chat-subtitle{
  color: rgba(70,70,70,0.92);
  max-width: 75ch;
}

.chat-subtitle code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(0,0,0,0.05);
  padding: 0.12rem 0.35rem;
  border-radius: 8px;
}

.chat-card{
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.08);
}

.chat-messages{
  height: min(62vh, 620px);
  overflow: auto;
  padding: 1.25rem 1.25rem 0.5rem;
  display: grid;
  gap: 0.75rem;
}

.chat-bubble{
  max-width: 82ch;
  width: fit-content;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-bubble--user{
  margin-left: auto;
  background: #3a3a3a;
  color: #f5f5f5;
  border-color: rgba(0,0,0,0.08);
}

.chat-bubble--assistant{
  margin-right: auto;
  background: rgba(0,0,0,0.03);
  color: #1f1f1f;
}

.chat-meta{
  font-size: 0.78rem;
  opacity: 0.72;
  margin-top: 0.25rem;
}

.chat-composer{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.96);
}

.chat-input{
  width: 100%;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  outline: none;
  font: inherit;
  background: rgba(255,255,255,0.98);
}

.chat-send{
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: none;
  background: #3a3a3a;
  color: #f5f5f5;
  font-weight: 800;
  cursor: pointer;
}

.chat-send:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.96);
}

.chat-clear{
  border: 1px solid rgba(0,0,0,0.14);
  background: transparent;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.chat-status{
  font-size: 0.9rem;
  color: rgba(70,70,70,0.9);
}

@media (max-width: 720px){
  .chat-composer{
    grid-template-columns: 1fr;
  }
  .chat-send{
    width: 100%;
  }
}

