/* ============================================================
   Mad Monkey Creative — Office UI
   Dark navy + gold design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:          #06091a;
  --navy-mid:      #080c20;
  --navy-card:     #0c1028;
  --navy-input:    #0f1430;
  --navy-msg-user: #0d1635;
  --navy-msg-agent:#0a0e24;
  --navy-tool:     #0b0f26;
  --border:        #1a1f45;
  --border-light:  #242952;
  --gold:          #c9a84c;
  --gold-hover:    #e0be6e;
  --gold-dim:      rgba(201, 168, 76, 0.12);
  --gold-border:   rgba(201, 168, 76, 0.35);
  --text-primary:  #e8e8f0;
  --text-secondary:#8890b8;
  --text-muted:    #464e78;
  --error:         #e05353;
  --success:       #4caf7a;
  --radius:        10px;
  --radius-sm:     6px;
  --font-display:  'Playfair Display', Georgia, serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:     "Cascadia Code", "Fira Code", "JetBrains Mono", "Consolas", monospace;
}

html, body {
  height: 100%;
  background: var(--navy);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Login page
   ============================================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.07) 0%, transparent 60%),
    var(--navy);
}

.login-card {
  background: var(--navy-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,168,76,0.06);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.login-logo-text {
  text-align: left;
}

.login-logo-company {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.01em;
}

.login-logo-product {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.25rem;
}

.login-logo h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  letter-spacing: -0.3px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.login-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.login-error {
  background: rgba(224, 83, 83, 0.1);
  border: 1px solid rgba(224, 83, 83, 0.35);
  color: #ffb3b3;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.login-form input {
  width: 100%;
  background: var(--navy-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.login-form input:focus {
  border-color: var(--gold);
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.btn-login {
  width: 100%;
  margin-top: 1.25rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

.btn-login:hover {
  background: var(--gold-hover);
}

/* ============================================================
   2FA verify page
   ============================================================ */

.verify-hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.verify-hint strong {
  color: var(--gold);
}

.code-input {
  width: 100%;
  background: var(--navy-input);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.8rem 1rem;
  font-size: 1.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 1rem;
}

.code-input:focus {
  border-color: var(--gold);
}

.verify-back {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s;
}

.verify-back:hover {
  color: var(--text-secondary);
}

/* ============================================================
   Chat layout
   ============================================================ */

.chat-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.sidebar-user {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  font-weight: 500;
  text-transform: capitalize;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0 1rem 0.5rem;
}

.conv-list {
  list-style: none;
}

.conv-list li {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-list li.conv-loading {
  color: var(--text-muted);
  font-style: italic;
}

.conv-list li.conv-item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 0 0.5rem;
  padding: 0.4rem 0.6rem;
  transition: background 0.1s;
}

.conv-list li.conv-item:hover {
  background: var(--navy-card);
  color: var(--text-primary);
}

.agent-title-small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.05rem;
}

.sidebar-link {
  display: block;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: 0 0.5rem;
  transition: background 0.1s, color 0.1s;
}

.sidebar-link:hover {
  background: var(--navy-card);
  color: var(--text-primary);
}

.sidebar-link.active {
  color: var(--gold);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-help {
  display: block;
  text-align: center;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: all 0.15s;
}

.btn-help:hover {
  background: rgba(201,168,76,0.22);
  color: var(--gold-hover);
}

.btn-logout {
  display: block;
  text-align: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: var(--navy-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* --- Main chat area --- */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--navy);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--navy-mid);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chat-header-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1;
}

.chat-header-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-connecting { background: var(--gold); animation: pulse 1.5s infinite; }
.status-ready      { background: var(--success); }
.status-working    { background: var(--gold); animation: pulse 1s infinite; }
.status-error      { background: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* --- Messages --- */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.msg-user  { align-self: flex-end;  align-items: flex-end; }
.msg-agent { align-self: flex-start; align-items: flex-start; }

.msg-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.msg-agent .msg-label {
  color: var(--gold);
  opacity: 0.8;
}

.msg-bubble {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  line-height: 1.65;
  word-break: break-word;
}

.msg-user .msg-bubble {
  background: var(--navy-msg-user);
  border: 1px solid rgba(201,168,76,0.15);
  color: var(--text-primary);
  border-bottom-right-radius: 3px;
}

.msg-agent .msg-bubble {
  background: var(--navy-msg-agent);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  border-bottom-left-radius: 3px;
}

/* Markdown inside agent messages */
.msg-agent .msg-bubble h1,
.msg-agent .msg-bubble h2,
.msg-agent .msg-bubble h3 {
  margin: 0.75em 0 0.4em;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
}

.msg-agent .msg-bubble h1 { font-size: 1.2em; }
.msg-agent .msg-bubble h2 {
  font-size: 1.05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25em;
}
.msg-agent .msg-bubble h3 { font-size: 1em; }

.msg-agent .msg-bubble p { margin: 0.4em 0; }
.msg-agent .msg-bubble p:first-child { margin-top: 0; }
.msg-agent .msg-bubble p:last-child  { margin-bottom: 0; }

.msg-agent .msg-bubble ul,
.msg-agent .msg-bubble ol {
  padding-left: 1.4em;
  margin: 0.4em 0;
}

.msg-agent .msg-bubble li { margin: 0.2em 0; }

.msg-agent .msg-bubble code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

.msg-agent .msg-bubble pre {
  background: var(--navy-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.6em 0;
}

.msg-agent .msg-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82em;
}

.msg-agent .msg-bubble strong { color: var(--text-primary); font-weight: 700; }
.msg-agent .msg-bubble em     { color: var(--text-secondary); }

.msg-agent .msg-bubble blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 0.8em;
  color: var(--text-secondary);
  margin: 0.5em 0;
}

.msg-agent .msg-bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75em 0;
}

/* --- Thinking / loading indicator --- */

.thinking {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

.thinking-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.5;
  animation: bounce 1.2s infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

/* --- Tool indicator strip --- */

.tool-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.5rem;
  background: var(--navy-tool);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: opacity 0.2s;
}

.tool-indicator.hidden { display: none; }

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Input area --- */

.input-area {
  border-top: 1px solid var(--border);
  background: var(--navy-mid);
  flex-shrink: 0;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
}

.chat-input {
  flex: 1;
  background: var(--navy-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  resize: none;
  outline: none;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.chat-input:focus          { border-color: var(--gold); }
.chat-input::placeholder   { color: var(--text-muted); }
.chat-input:disabled       { opacity: 0.5; cursor: not-allowed; }

.btn-send {
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--navy);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) { background: var(--gold-hover); }
.btn-send:disabled             { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================================
   Help page
   ============================================================ */

.help-body {
  flex: 1;
  overflow-y: auto;
  background: var(--navy);
}

.help-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.help-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--navy-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.help-avatar-wrap {
  width: 80px;
  height: 80px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.help-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.help-hero h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.help-hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.help-section { margin-bottom: 2.75rem; }

.help-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.help-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.25rem 0 0.6rem;
}

.help-section > p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.help-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.help-card-icon   { font-size: 1.4rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.help-card strong { display: block; color: var(--text-primary); font-size: 0.9rem; margin-bottom: 0.2rem; }
.help-card span   { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.45; }

.help-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.platform-tag {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.help-callout {
  background: var(--gold-dim);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 1rem 0;
}

.help-callout code {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.help-examples {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prompt-pill {
  display: inline-block;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: default;
  transition: border-color 0.15s, color 0.15s;
}

.prompt-pill:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.help-feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.help-feature {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.help-feature-title { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; margin-bottom: 0.3rem; }
.help-feature-desc  { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }

.help-cross-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.help-cross-item {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.help-agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.help-agent {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.help-agent-name { font-weight: 700; color: var(--gold); font-size: 0.9rem; margin-bottom: 0.35rem; }
.help-agent-desc { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }

/* Team photo cards */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.team-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.team-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: var(--navy-mid);
}

.team-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  background: var(--avatar-color, var(--navy-mid));
  letter-spacing: 0.04em;
  user-select: none;
}

.team-card-body {
  padding: 0.85rem 1rem 1rem;
}

.team-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.team-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.team-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.help-agent-desc code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05em 0.3em;
}

.help-tips {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-left: 0;
  list-style: none;
}

.help-tips li {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.help-tips li strong { color: var(--text-primary); }

kbd {
  display: inline-block;
  background: var(--navy-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text-primary);
}

.help-back {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.btn-back-to-chat {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-sans);
  transition: background 0.15s;
}

.btn-back-to-chat:hover { background: var(--gold-hover); }

/* ============================================================
   Model switcher + Brainstorm panels
   ============================================================ */

.btn-brainstorm {
  width: 100%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-brainstorm:hover {
  background: rgba(201,168,76,0.22);
  color: var(--gold-hover);
}

.btn-models {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-models:hover {
  background: var(--navy-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* Shared panel base */
.models-panel,
.brainstorm-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: var(--navy-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.models-panel.hidden,
.brainstorm-panel.hidden {
  display: none;
}

.models-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.models-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.models-close:hover { color: var(--text-primary); }

.models-panel-body,
.brainstorm-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.models-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.models-hint strong { color: var(--text-secondary); }

/* Model row */
.model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  gap: 0.75rem;
}

.model-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  flex: 1;
}

.model-select {
  background: var(--navy-mid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  padding: 0.3rem 0.5rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 100px;
}

.model-select:focus { border-color: var(--gold); }

/* Cost badge */
.model-cost {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-cost-haiku  { background: rgba(76,175,122,0.15); color: #4caf7a; border: 1px solid rgba(76,175,122,0.3); }
.model-cost-sonnet { background: rgba(201,168,76,0.15);  color: var(--gold); border: 1px solid var(--gold-border); }
.model-cost-opus   { background: rgba(180,80,80,0.15);   color: #e07070; border: 1px solid rgba(180,80,80,0.3); }

.models-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-models-save {
  flex: 1;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-models-save:hover { background: var(--gold-hover); }

.btn-models-reconnect {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-models-reconnect:hover {
  background: var(--navy-input);
  color: var(--text-primary);
}

.models-status {
  font-size: 0.82rem;
  text-align: center;
  min-height: 1.2rem;
  color: var(--success);
}

/* Brainstorm */
.brainstorm-topic {
  width: 100%;
  background: var(--navy-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  padding: 0.7rem 0.9rem;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}

.brainstorm-topic:focus { border-color: var(--gold); }
.brainstorm-topic::placeholder { color: var(--text-muted); }

.brainstorm-output {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.bs-role-block {
  background: var(--navy-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bs-role-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.75rem;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--border);
}

.bs-role-optimist      .bs-role-label { color: #4caf7a; }
.bs-role-critic        .bs-role-label { color: #e07070; }
.bs-role-strategist    .bs-role-label { color: var(--gold); }
.bs-role-devil-advocate .bs-role-label { color: #9b8acc; }
.bs-role-synthesizer   .bs-role-label { color: #60b8e8; }

.bs-role-text {
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.bs-role-synthesizer .bs-role-text {
  color: var(--text-primary);
  font-size: 0.9rem;
}
