:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --accent: #1957d2;
  --accent-soft: #e9f0ff;
  --ok: #16825d;
  --warn: #b7791f;
  --bad: #b42318;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 24px 18px;
  overflow-y: auto;
  background: #111827;
  color: #f9fafb;
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-weight: 800;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  color: #aeb6c5;
  font-size: 12px;
  margin-top: 2px;
}

.nav-label {
  color: #aeb6c5;
  font-size: 11px;
  font-weight: 700;
  margin: 20px 10px 8px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 10px 11px;
  border-radius: 8px;
  color: #d5dae4;
  font-size: 14px;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 28px 28px 64px;
  scroll-behavior: smooth;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--ok);
}

.section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.agent-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.advisor-section {
  margin-top: 34px;
}

.advisor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.advisor-card {
  display: grid;
  min-height: 306px;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px;
  border: 1px solid #e7eaf0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.advisor-card:hover {
  transform: translateY(-3px);
  border-color: #ccd5e4;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.11);
}

.advisor-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.advisor-card.finance .advisor-icon {
  background: #b98c80;
}

.advisor-card.operations .advisor-icon {
  background: #7aa7e6;
}

.advisor-card.sales .advisor-icon {
  background: #58a784;
}

.advisor-card.purchase .advisor-icon {
  background: #db8f84;
}

.advisor-card.hr .advisor-icon {
  background: #9a86df;
}

.advisor-card.strategy .advisor-icon {
  background: #d26f95;
}

.advisor-card.super .advisor-icon {
  background: #111827;
}

.advisor-title {
  margin: 0;
  color: #172033;
  font-size: 17px;
  line-height: 1.35;
}

.advisor-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.advisor-label {
  margin-top: 18px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 700;
}

.advisor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.advisor-tag {
  color: #4d5b70;
  font-size: 12px;
  line-height: 1.2;
}

.advisor-tag.more {
  color: #172033;
  font-weight: 700;
}

.advisor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.advisor-action {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #52607a;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: background 160ms ease;
  text-align: center;
  padding: 8px 10px;
}

.advisor-action.primary {
  grid-column: 1 / -1;
}

.advisor-action.secondary {
  border: 1px solid #d8dee9;
  background: #fff;
  color: #344054;
  font-size: 12px;
}

.advisor-card:hover .advisor-action.primary {
  background: var(--accent);
}

.advisor-action.secondary:hover {
  border-color: #b9c3d2;
  background: #f7f9fc;
}

.two-col {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.card {
  padding: 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.12);
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 800;
}

.kpi-trend {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.agent-name {
  font-size: 17px;
  font-weight: 800;
}

.agent-role {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.agent-scope {
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 12px;
  min-height: 56px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.chart {
  width: 100%;
  height: 280px;
}

.activity-list,
.table-list {
  display: grid;
  gap: 10px;
}

.activity-row,
.table-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
}

.row-title {
  font-weight: 700;
}

.row-meta {
  color: var(--muted);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 24px 28px;
  overflow: hidden;
}

/* Agent nav bar — hidden on desktop, scrollable tabs on tablet/mobile */
.agent-nav-bar {
  display: none;
  gap: 8px;
  padding: 10px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.agent-nav-bar::-webkit-scrollbar { display: none; }

.agent-nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 130ms, border-color 130ms, color 130ms;
  flex-shrink: 0;
}

.agent-nav-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.agent-nav-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-topbar h1 {
  font-size: 20px;
}

.chat-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: min(900px, 100%);
  margin: 0 auto;
}

.welcome-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.welcome-state.hidden {
  display: none;
}

.autorocket-orb {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.16);
}

.welcome-state h2 {
  max-width: 760px;
  margin: 0;
  color: #172033;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.welcome-state p {
  max-width: 620px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.chat-messages {
  display: none;
  width: min(760px, 100%);
  min-width: 0;
  min-height: 0;
  max-height: none;
  margin: 24px auto 16px;
  padding: 4px 4px 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-messages.has-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-content: start;
  gap: 14px;
}

.chat-input-shell {
  display: grid;
  flex-shrink: 0;
  width: min(760px, 100%);
  margin: 0 auto;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid #d9dee8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.11);
}

.chat-input-shell textarea {
  min-height: 46px;
  max-height: 160px;
  border: 0;
  border-radius: 12px;
  outline: 0;
  padding: 12px 10px;
  background: transparent;
  font-size: 15px;
}

.chat-input-shell button {
  height: 44px;
  min-width: 74px;
  border-radius: 12px;
}

.profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 13px;
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.config-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0.42);
}

.config-modal {
  display: grid;
  width: min(1180px, 100%);
  max-height: min(860px, calc(100dvh - 56px));
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: 1px solid #d9dee8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
}

.config-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.config-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.config-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: #4d5b70;
  white-space: nowrap;
}

.config-tabs button.active {
  border-color: #cbd5e1;
  background: #fff;
  color: var(--text);
}

.config-body {
  overflow: auto;
  padding: 22px 24px 26px;
}

.config-section {
  display: grid;
  gap: 16px;
}

.field-block {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.code-editor {
  width: 100%;
  min-height: auto;
  resize: vertical;
  border: 1px solid #d9dee8;
  border-radius: 10px;
  background: #fbfcfe;
  color: #172033;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 13px 14px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.control-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.control-top,
.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.control-card input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggle-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.config-test-output {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: #172033;
  font-size: 14px;
  line-height: 1.55;
}

.config-test-output p {
  margin: 0 0 12px;
}

.version-row {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.version-row span {
  color: var(--muted);
}

.chat-panel {
  position: sticky;
  top: 24px;
  display: grid;
  min-height: calc(100vh - 56px);
  grid-template-rows: auto 1fr auto;
}

.messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 360px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  padding: 4px;
}

/* When .messages is used as the full-screen chat container, undo the panel constraints */
.messages.chat-messages {
  min-height: 0;
  max-height: none;
}

.message {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  max-width: 72%;
  background: var(--accent);
  color: #fff;
}

.message.agent {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  white-space: normal;
  overflow: clip;
}

.message.agent h3,
.message.agent h4,
.message.agent h5 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
}

.message.agent p {
  margin: 0 0 10px;
}

.message.agent ul,
.message.agent ol {
  margin: 0 0 12px 18px;
  padding: 0;
}

.message.agent li {
  margin: 4px 0;
}

.message.agent strong {
  font-weight: 800;
}

.message.agent code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 34px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #667085;
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.stream-cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 2px;
  transform: translateY(2px);
  background: var(--accent);
  animation: cursor-blink 0.8s infinite;
}

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

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

/* Sidebar toggle button — hidden on desktop, shown on tablet/mobile */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(17, 24, 39, 0.42);
  cursor: pointer;
}

/* ── iPad / Tablet: ≤ 1024px — overlay sidebar ───────────────── */
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .agent-nav-bar { display: flex; }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 270px;
    height: 100dvh;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(17, 24, 39, 0.35);
  }

  .sidebar-backdrop.open { display: block; }

  .main {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 24px 56px;
  }

  .chat-main {
    height: 100dvh;
    min-height: 0;
    padding: 18px 20px 16px;
    overflow: hidden;
  }

  .chat-main .agent-nav-bar {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .kpi-grid,
  .agent-grid,
  .advisor-grid,
  .profile-grid,
  .two-col,
  .workspace-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-panel { position: static; min-height: 560px; }
  .chat-workspace { min-height: 0; }
}

/* ── Small tablet / large phone: ≤ 768px ─────────────────────── */
@media (max-width: 768px) {
  .kpi-grid,
  .agent-grid,
  .advisor-grid,
  .profile-grid,
  .two-col,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .main { padding: 20px 18px 48px; }
  .chat-main { padding: 16px 18px; }
  .topbar { flex-wrap: wrap; }
  .chat-topbar { flex-wrap: wrap; }
  .advisor-actions, .control-grid { grid-template-columns: 1fr; }
  .config-overlay { padding: 12px; }
  .config-header, .topbar-actions { flex-wrap: wrap; gap: 10px; }
  .welcome-state h2 { font-size: 22px; }
  .welcome-state p { font-size: 13px; }
  .welcome-state { padding: 20px 0; }
  .autorocket-orb { width: 40px; height: 40px; font-size: 16px; }
}

/* Context-only configure modal (v2 playground style) */
.context-editor {
  min-height: 380px;
  font-size: 13px;
  line-height: 1.6;
}

.context-meta {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
}

.context-preview {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 12px 14px;
  font-size: 13px;
}

.context-preview summary {
  cursor: pointer;
  font-weight: 700;
  color: #344054;
}

.context-preview-body {
  margin: 10px 0 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #172033;
}

/* Markdown extras rendered by marked.js inside agent bubbles */
.message.agent h2 {
  margin: 14px 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

.message.agent table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 14px;
  font-size: 13px;
  background: #fff;
}

.message.agent thead {
  background: #f4f6fb;
}

.message.agent th,
.message.agent td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.message.agent th {
  font-weight: 700;
  color: #344054;
}

.message.agent table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.message.agent pre {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.message.agent pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.message.agent blockquote {
  margin: 10px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--accent);
  color: #475467;
}

.message.agent hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.message.agent table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.stream-cursor::after {
  content: "▍";
  margin-left: 2px;
  opacity: 0.55;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  to { opacity: 0; }
}

/* ── Mobile phones: ≤ 480px ──────────────────────────────────── */
@media (max-width: 480px) {
  .sidebar { padding: 12px 14px 8px; }
  .brand { margin-bottom: 10px; }
  .brand-title { font-size: 14px; }
  .brand-subtitle { font-size: 10px; }
  .nav-label { font-size: 10px; margin: 10px 0 4px; }
  .nav-link { font-size: 13px; padding: 7px 10px; }
  .main { padding: 16px 14px 48px; }
  .chat-main { height: 100dvh; padding: 12px; }
  .topbar h1 { font-size: 18px; }
  .topbar p.subtle { font-size: 13px; }
  .chat-topbar h1 { font-size: 16px; }
  .chat-topbar .eyebrow { font-size: 10px; }
  .topbar-actions .button, .topbar-actions button { font-size: 12px; padding: 6px 12px; }
  .chat-workspace { width: 100%; }
  .chat-messages { width: 100%; margin: 12px auto 8px; padding: 4px 2px 12px; }
  .message { padding: 10px 12px; font-size: 13px; }
  .message.user { max-width: 85%; }
  .message.agent table { font-size: 11px; }
  .message.agent th, .message.agent td { padding: 5px 7px; }
  .chat-input-shell { width: 100%; padding: 8px; border-radius: 12px; }
  #chatInput { font-size: 14px; }
  .config-modal { max-height: 95dvh; border-radius: 14px; }
  .config-body { padding: 14px; }
  .context-editor { min-height: 220px; font-size: 12px; }
  .advisor-card { padding: 16px; }
  .status-pill { font-size: 12px; padding: 5px 10px; }
}
