.chat-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(ellipse at top left, rgba(47, 143, 91, 0.2), transparent 50%),
    linear-gradient(180deg, #dcefe2, #eef6ef);
}

.chat-shell {
  width: min(480px, 100%);
  height: min(720px, calc(100vh - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.4s ease;
}

.chat-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
}

.back {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1rem;
}

.chat-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
}
.chat-status {
  font-size: 0.78rem;
  color: var(--muted);
}

.online-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #9aa8a0;
  box-shadow: 0 0 0 4px rgba(154, 168, 160, 0.25);
}
.online-dot.on {
  background: #2f8f5b;
  box-shadow: 0 0 0 4px rgba(47, 143, 91, 0.22);
  animation: pulse 1.8s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.typing-bar {
  padding: 0 1.1rem 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.hot-questions {
  padding: 0.35rem 0.9rem 0.55rem;
  border-top: 1px solid transparent;
  background: rgba(255,255,255,0.35);
}
.hot-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}
.hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hot-list button {
  border: 1px solid rgba(31, 107, 69, 0.22);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hot-list button:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.hot-list button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.name-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: transparent;
  max-width: 360px;
  width: calc(100% - 2rem);
}
.name-dialog::backdrop {
  background: rgba(16, 28, 20, 0.35);
  backdrop-filter: blur(4px);
}
.name-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.4rem 1.3rem 1.2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
}
.name-card h2 {
  margin: 0;
  font-family: var(--display);
  color: var(--brand);
}
.name-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.name-card input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
}
.name-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

@media (max-width: 520px) {
  .chat-page { padding: 0; }
  .chat-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
}
