/* =============================================================================
 * styles.css — Ferroglobe C-Suite Copilot
 * Clean executive interface inspired by a modern chat workspace.
 * All colors / spacing live in CSS variables (per build spec §14).
 * ========================================================================== */

:root {
  /* Ferroglobe brand */
  --navy: #1B2A4A;
  --navy-700: #24365c;
  --navy-500: #33507f;
  --amber: #F5A623;
  --amber-600: #e0940f;
  --steel: #4472C4;
  --teal: #3FA796;
  --grey: #8496B0;

  /* Light theme surfaces */
  --bg: #f6f5f2;
  --bg-panel: #ffffff;
  --bg-sidebar: #f0eee9;
  --bg-elevated: #ffffff;
  --bg-hover: #eceae4;
  --bubble-user: #1B2A4A;
  --bubble-ai: #ffffff;
  --border: #e5e2db;
  --border-strong: #d6d2c8;

  --text: #1f2430;
  --text-soft: #4a5568;
  --text-muted: #8a8f9c;
  --text-invert: #ffffff;

  /* Agent badge colors */
  --a-orchestrator: #1B2A4A;
  --a-retriever: #4472C4;
  --a-analyst: #C55A11;
  --a-report: #2f8f5b;
  --a-excel: #6C5CE7;

  /* geometry */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-w: 268px;
  --activity-w: 320px;
  --shadow-sm: 0 1px 2px rgba(20,25,40,0.06), 0 1px 3px rgba(20,25,40,0.05);
  --shadow-md: 0 4px 16px rgba(20,25,40,0.08);
  --shadow-lg: 0 18px 50px rgba(20,25,40,0.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html.dark {
  --bg: #0f1626;
  --bg-panel: #151d31;
  --bg-sidebar: #0c1220;
  --bg-elevated: #1a2338;
  --bg-hover: #1f2942;
  --bubble-user: #2a3d63;
  --bubble-ai: #182034;
  --border: #26314c;
  --border-strong: #33405f;
  --text: #e7ecf3;
  --text-soft: #b7c1d4;
  --text-muted: #7e8aa2;
  --text-invert: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.view { height: 100vh; height: 100dvh; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ------------------------------- buttons -------------------------------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-hover); }
.icon-btn {
  background: transparent; border: none; color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.pill {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: var(--amber); color: var(--navy);
  padding: 2px 7px; border-radius: 20px; text-transform: uppercase;
}

/* ================================ LOGIN ================================ */
#view-login {
  display: flex; justify-content: center;
  overflow-y: auto; /* scroll instead of clipping the top on short viewports */
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(68,114,196,0.18), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, rgba(245,166,35,0.16), transparent 55%),
    var(--bg);
  padding: 24px;
}
/* margin:auto centres the card AND stays fully scrollable when it is taller
   than the viewport (align-items:center would clip the top — avoid it). */
.login-wrap { width: 100%; max-width: 420px; margin: auto; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; justify-content: center; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; color: var(--text); }
.brand-sub { font-size: 12.5px; color: var(--text-muted); margin-top: -2px; }
.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; }
.login-card p { margin: 0 0 20px; font-size: 13.5px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text); font-size: 14.5px;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}
.login-error {
  background: #fdecec; color: #b42318; border: 1px solid #f6c9c4;
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px;
}
html.dark .login-error { background: #3a1c1c; color: #ffb4a8; border-color: #5a2a2a; }
.login-form button { margin-top: 4px; }
.demo-creds { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.demo-creds-head { font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.demo-creds-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cred-chip {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px;
  background: var(--bg-elevated); cursor: pointer; text-align: left; transition: border .12s, background .12s;
}
.cred-chip:hover { border-color: var(--steel); background: var(--bg-hover); }
.cred-role { font-size: 12px; font-weight: 700; color: var(--text); }
.cred-user { font-size: 11px; color: var(--text-muted); }
.login-foot { text-align: center; margin-top: 20px; font-size: 12px; }

/* ================================ SHELL ================================ */
#view-app { display: flex; overflow: hidden; }

/* -------------------------------- sidebar ------------------------------- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 12px;
  gap: 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; padding: 4px 6px 8px; letter-spacing: -.01em; }
.sidebar-top { display: flex; flex-direction: column; gap: 8px; }
.btn-newchat { width: 100%; justify-content: flex-start; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-soft);
  font-size: 13.5px; font-weight: 500; width: 100%; text-align: left;
}
.side-link:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-section { flex: 1; overflow-y: auto; min-height: 0; }
.sidebar-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 4px 8px; }
.history-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.history-item {
  padding: 8px 11px; border-radius: var(--radius-sm); font-size: 13px;
  color: var(--text-soft); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid transparent;
}
.history-item:hover { background: var(--bg-hover); color: var(--text); }
.history-item.active { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.history-empty { font-size: 12.5px; color: var(--text-muted); padding: 6px 8px; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), var(--steel));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.user-meta { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--text-muted); }
.sidebar-actions { display: flex; gap: 2px; }

/* --------------------------------- main --------------------------------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.topbar-title { font-weight: 600; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-status {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-hover); padding: 4px 10px; border-radius: 20px;
}

/* ------------------------------ dashboard ------------------------------- */
.dashboard-scroll { flex: 1; overflow-y: auto; padding: 34px 40px 60px; }
.greeting h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.02em; font-weight: 800; }
.greeting p { margin: 0; font-size: 15px; }
.dash-controls { display: flex; align-items: center; gap: 14px; margin: 26px 0 22px; }
.search-box {
  flex: 1; max-width: 480px; display: flex; align-items: center; gap: 9px;
  background: var(--bg-panel); border: 1px solid var(--border-strong);
  border-radius: 24px; padding: 9px 16px; color: var(--text-muted);
}
.search-box input { border: none; background: transparent; color: var(--text); font-size: 14px; width: 100%; }
.search-box input:focus { outline: none; }

.uc-groups { display: flex; flex-direction: column; gap: 14px; }
.uc-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); overflow: hidden; box-shadow: var(--shadow-sm); }
.uc-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.uc-group-head:hover { background: var(--bg-hover); }
.uc-group-title { font-weight: 700; font-size: 14.5px; flex: 1; }
.uc-group-count { font-size: 12px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 9px; border-radius: 20px; }
.uc-chevron { transition: transform .2s; color: var(--text-muted); }
.uc-group.collapsed .uc-chevron { transform: rotate(-90deg); }
.uc-group.collapsed .uc-grid { display: none; }
.uc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 10px; padding: 4px 16px 18px;
}
.uc-card {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elevated); transition: border .13s, box-shadow .13s, transform .05s;
}
.uc-card:hover { border-color: var(--steel); box-shadow: var(--shadow-md); }
.uc-card:active { transform: translateY(1px); }
.uc-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(68,114,196,0.12); color: var(--steel);
}
.uc-body { min-width: 0; }
.uc-label { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.uc-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.uc-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 5px; background: var(--bg-hover); color: var(--text-soft);
}
.uc-tag.excel { background: rgba(108,92,231,0.14); color: #6C5CE7; }
.uc-tag.chart { background: rgba(63,167,150,0.16); color: #2f8f74; }
.uc-tag.table { background: rgba(245,166,35,0.16); color: #b9770a; }

/* --------------------------------- chat --------------------------------- */
.chat-main { min-width: 0; }
.chat-body { flex: 1; display: flex; min-height: 0; }
.chat-column { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 26px 0 20px; scroll-behavior: smooth; }

.empty-chat { max-width: 640px; margin: 8vh auto 0; text-align: center; padding: 0 24px; }
.empty-chat h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 16px 0 6px; }
.empty-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.suggestion {
  border: 1px solid var(--border-strong); background: var(--bg-panel);
  border-radius: 20px; padding: 8px 14px; font-size: 13px; color: var(--text-soft);
  transition: border .12s, background .12s;
}
.suggestion:hover { border-color: var(--steel); background: var(--bg-hover); color: var(--text); }

.msg { max-width: 760px; margin: 0 auto 26px; padding: 0 28px; }
.msg-row { display: flex; gap: 14px; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.msg-avatar.user { background: linear-gradient(135deg, var(--navy), var(--steel)); color: #fff; }
.msg-avatar.ai { background: var(--navy); }
.msg-avatar.ai img { width: 20px; height: 20px; }
.msg-content { min-width: 0; flex: 1; }
.msg-author { font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }

.msg.user .msg-text {
  background: var(--bubble-user); color: #fff;
  padding: 11px 15px; border-radius: 4px 14px 14px 14px; display: inline-block;
  font-size: 14.5px;
}
.msg.ai .msg-text { font-size: 14.8px; color: var(--text); }

/* rendered markdown */
.md h1, .md h2, .md h3 { font-weight: 700; letter-spacing: -.01em; margin: 14px 0 8px; line-height: 1.3; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md p { margin: 8px 0; }
.md strong { color: var(--text); font-weight: 700; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md a { color: var(--steel); }
.md code { background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.md .cite-ref { color: var(--steel); font-weight: 700; font-size: 12px; vertical-align: super; }

.blink::after { content: "▋"; color: var(--steel); animation: blink 1s steps(2) infinite; margin-left: 1px; }
@keyframes blink { 0%,50%{opacity:1;} 50.01%,100%{opacity:0;} }

/* inline agent "chain of steps" (Claude-style, in the chat window) */
.chain {
  border: 1px solid var(--border); border-radius: 10px; margin: 2px 0 14px;
  background: var(--bg-elevated); overflow: hidden;
}
.chain-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: var(--text-soft);
}
.chain-head:hover { background: var(--bg-hover); }
.chain-spinner {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border-strong); border-top-color: var(--steel);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.chain.done .chain-spinner { display: none; }
.chain-check { display: none; color: var(--a-report); flex-shrink: 0; }
.chain.done .chain-check { display: inline-flex; }
.chain-title { flex: 1; }
.chain-chevron { color: var(--text-muted); transition: transform .2s; }
.chain.collapsed .chain-steps { display: none; }
.chain.collapsed .chain-chevron { transform: rotate(-90deg); }
.chain-steps { padding: 2px 13px 11px; }
.chain-step {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12.8px; color: var(--text-soft);
  padding: 4px 0; padding-left: 4px; border-left: 2px solid var(--border); margin-left: 4px;
  animation: stepIn .25s ease;
}
@keyframes stepIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.chain-step .cs-badge { font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--csb, var(--grey)); flex-shrink: 0; min-width: 74px; }
.chain-step .cs-text { flex: 1; }
.chain-step.pending .cs-tick { color: var(--text-muted); }
.chain-step .cs-tick { color: var(--a-report); }
.chain-step.badge-orchestrator { --csb: var(--a-orchestrator); }
.chain-step.badge-retriever { --csb: var(--a-retriever); }
.chain-step.badge-analyst { --csb: var(--a-analyst); }
.chain-step.badge-report { --csb: var(--a-report); }
.chain-step.badge-excel { --csb: var(--a-excel); }
html.dark .chain-step.badge-orchestrator { --csb: #7fa0d8; }
.chain-hits { font-size: 11.5px; color: var(--text-muted); margin: 3px 0 0 82px; }
.chain-hits summary { cursor: pointer; color: var(--steel); font-weight: 600; }
.chain-hit { padding: 3px 0; }
.chain-hit .score { color: var(--teal); font-weight: 700; }

/* metric cards */
.metric-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.metric-card {
  flex: 1 1 130px; min-width: 130px; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--bg-elevated); box-shadow: var(--shadow-sm);
}
.metric-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.metric-value { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.metric-delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.metric-delta.up { color: #2f8f5b; } .metric-delta.down { color: #c0392b; } .metric-delta.neutral { color: var(--text-muted); }

/* tables */
.data-table-wrap { margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.data-table-title { font-size: 13px; font-weight: 700; padding: 11px 14px; background: var(--bg-hover); color: var(--text-soft); border-bottom: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 9px 14px; background: var(--bg-panel); color: var(--text-muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: rgba(132,150,176,0.05); }
.data-table-note { font-size: 12px; color: var(--text-muted); padding: 8px 14px; }

/* charts */
.chart-block { margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.chart-canvas-wrap { position: relative; height: 260px; }
.chart-takeaway { font-size: 12.5px; color: var(--text-soft); margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--amber); }

/* citations */
.citations { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; }
.citation-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-soft);
  background: var(--bg-hover); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 20px;
}
.citation-chip .cn { font-weight: 700; color: var(--steel); }

/* artifact download */
.artifact {
  display: inline-flex; align-items: center; gap: 12px; margin: 12px 0;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: var(--bg-elevated); box-shadow: var(--shadow-sm);
}
.artifact-ico { width: 38px; height: 38px; border-radius: 8px; background: rgba(108,92,231,0.14); color: #6C5CE7; display: flex; align-items: center; justify-content: center; }
.artifact-meta { flex: 1; }
.artifact-name { font-size: 13.5px; font-weight: 600; }
.artifact-sub { font-size: 11.5px; color: var(--text-muted); }
.artifact button { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.artifact button:hover { background: var(--navy-700); }

/* footer note */
.msg-footer { font-size: 11.5px; color: var(--text-muted); font-style: italic; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }

/* cached badge */
.cached-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); background: var(--bg-hover); border: 1px solid var(--border);
  padding: 2px 9px; border-radius: 20px;
}

/* error bubble */
.error-bubble { background: #fdecec; color: #b42318; border: 1px solid #f6c9c4; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }
html.dark .error-bubble { background: #3a1c1c; color: #ffb4a8; border-color: #5a2a2a; }

/* composer */
.composer-wrap { padding: 6px 28px 18px; }
.composer {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-panel); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-md);
  transition: border .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(68,114,196,0.13); }
.composer textarea {
  flex: 1; border: none; background: transparent; resize: none; color: var(--text);
  font-size: 15px; line-height: 1.5; max-height: 160px; padding: 6px 0;
}
.composer textarea:focus { outline: none; }
.send-btn {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; border: none;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s, opacity .15s;
}
.send-btn:hover { background: var(--navy-700); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }
.composer-hint { text-align: center; max-width: 760px; margin: 8px auto 0; font-size: 11.5px; }

/* follow-up suggestion chips (above the composer) */
.followups { max-width: 760px; margin: 0 auto 10px; display: flex; flex-direction: column; gap: 7px; }
.followups-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.followups-row { display: flex; flex-wrap: wrap; gap: 7px; }
.followup-chip {
  display: inline-flex; align-items: center; gap: 7px; text-align: left;
  border: 1px solid var(--border-strong); background: var(--bg-panel);
  border-radius: 20px; padding: 7px 13px; font-size: 12.8px; color: var(--text-soft);
  transition: border .12s, background .12s, color .12s;
}
.followup-chip:hover { border-color: var(--steel); background: var(--bg-hover); color: var(--text); }
.followup-chip svg { color: var(--steel); flex-shrink: 0; }

/* message action bar (copy / like / dislike / read aloud / share) */
.msg-actions { display: flex; align-items: center; gap: 2px; margin-top: 12px; }
.msg-action {
  width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.msg-action:hover { background: var(--bg-hover); color: var(--text); }
.msg-action.on { color: var(--steel); }
.msg-action.on.down { color: #c0392b; }
.msg-action.reading { color: var(--teal); background: var(--bg-hover); }

/* ---------------------------- activity panel ---------------------------- */
/* Hidden by default for executives; shown via the "Activity" toggle. */
.chat-body.activity-hidden .activity-panel { display: none; }
.activity-panel {
  width: var(--activity-w); flex-shrink: 0; border-left: 1px solid var(--border);
  background: var(--bg-panel); display: flex; flex-direction: column; min-height: 0;
}
.activity-head-actions { margin-left: auto; }
.act-toggle {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--text-soft); background: transparent; border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 6px 12px; transition: background .12s, border .12s;
}
.act-toggle:hover { background: var(--bg-hover); color: var(--text); }
.act-toggle.on { border-color: var(--steel); color: var(--steel); }
.activity-head {
  height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 18px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .04em;
}
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.activity-dot.live { background: var(--teal); box-shadow: 0 0 0 0 rgba(63,167,150,0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(63,167,150,0.5);} 70%{box-shadow:0 0 0 7px rgba(63,167,150,0);} 100%{box-shadow:0 0 0 0 rgba(63,167,150,0);} }
.activity-list { flex: 1; overflow-y: auto; padding: 14px; }
.activity-empty { font-size: 12.5px; padding: 8px; line-height: 1.5; }

.act-item { margin-bottom: 12px; padding-left: 14px; border-left: 2px solid var(--border); position: relative; }
.act-item::before { content: ""; position: absolute; left: -5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--badge-c, var(--grey)); }
.act-agent { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--badge-c, var(--grey)); }
.act-task { font-size: 13px; color: var(--text); margin-top: 2px; font-weight: 600; }
.act-step { font-size: 12.5px; color: var(--text-soft); margin: 5px 0 0; padding-left: 2px; }
.act-hits { margin-top: 6px; }
.act-hits summary { font-size: 12px; color: var(--steel); cursor: pointer; font-weight: 600; }
.act-hit { font-size: 11.5px; color: var(--text-muted); padding: 4px 0 2px 6px; border-bottom: 1px dashed var(--border); }
.act-hit .doc { color: var(--text-soft); font-weight: 600; }
.act-hit .score { color: var(--teal); font-weight: 700; }

.badge-orchestrator { --badge-c: var(--a-orchestrator); }
.badge-retriever { --badge-c: var(--a-retriever); }
.badge-analyst { --badge-c: var(--a-analyst); }
.badge-report { --badge-c: var(--a-report); }
.badge-excel { --badge-c: var(--a-excel); }
html.dark .badge-orchestrator { --badge-c: #7fa0d8; }

/* --------------------------------- toast -------------------------------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 100; max-width: 90vw;
}

/* ------------------------------ responsive ------------------------------ */
.mobile-only { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .activity-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 320px; max-width: 88vw;
    z-index: 40; transform: translateX(100%); transition: transform .25s; box-shadow: var(--shadow-lg);
  }
  .activity-panel.open { transform: translateX(0); }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(10,15,25,0.4); z-index: 45; }
  .dashboard-scroll { padding: 22px 18px 50px; }
  .greeting h1 { font-size: 24px; }
  .msg { padding: 0 16px; }
  .composer-wrap { padding: 6px 14px 14px; }
  .uc-grid { grid-template-columns: 1fr; }
  .dash-controls { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}
