.chat-wrap {
  background: var(--bg-muted);
  min-height: calc(100vh - var(--nav-h));
  padding: 128px 0 112px;
}
.chat-header { text-align: center; margin-bottom: 48px; }
.chat-header__h1 {
  font-size: clamp(32px, 4vw, 52px); font-weight: 700;
  line-height: 1.1; color: var(--text-primary); letter-spacing: -0.03em; margin-bottom: 16px;
}
.chat-header__sub { font-size: 18px; color: var(--text-muted); max-width: 460px; margin: 0 auto; }

.chat-box {
  max-width: 720px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.04);
}
.chat-topbar {
  padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-identity { display: flex; align-items: center; gap: 12px; }
.chat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.chat-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.chat-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.chat-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); }
.chat-status-text { font-size: 12px; color: var(--text-muted); }

/* Model dropdown */
.model-dropdown { position: relative; }
.model-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  background: #f9fafb; border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: background 0.2s;
}
.model-btn:hover { background: var(--icon-bg); }
.model-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  width: 208px; background: var(--bg);
  border: 1px solid rgba(0,0,0,0.08); border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08); overflow: hidden; z-index: 10;
}
.model-menu.open { display: block; }
.model-item {
  width: 100%; padding: 12px 16px; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: background 0.15s; background: transparent;
}
.model-item:hover, .model-item.selected { background: #f9fafb; }
.model-item__name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.model-item__desc { font-size: 12px; color: var(--text-muted); }
.model-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-blue); }

/* Messages */
.chat-messages {
  padding: 24px 20px; background: var(--bg-muted);
  min-height: 400px; max-height: 480px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}
.message { display: flex; gap: 12px; }
.message--human { flex-direction: row-reverse; }
.message__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.message__avatar--ai { background: var(--text-primary); color: #fff; }
.message__avatar--human { background: #e5e7eb; color: var(--text-secondary); }
.message__bubble {
  max-width: 80%; padding: 14px 16px; border-radius: 16px;
}
.message__bubble--ai {
  border-radius: 16px 16px 16px 4px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 14px; color: #374151; line-height: 1.7; white-space: pre-line;
}
.message__bubble--human {
  border-radius: 16px 16px 4px 16px;
  background: var(--text-primary);
  font-size: 14px; color: #fff; line-height: 1.7;
}

/* Input */
.chat-input-row {
  padding: 16px 20px; border-top: 1px solid rgba(0,0,0,0.05); background: var(--bg);
}
.chat-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: #f9fafb; border: 1px solid var(--border);
}
.chat-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-primary);
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-send {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #e5e7eb; color: var(--text-muted);
  transition: background 0.2s, color 0.2s; flex-shrink: 0;
}
.chat-send.active { background: var(--text-primary); color: #fff; }
