:root {
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: #f8fafc;
  --panel-strong: #ffffff;
  --text: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --border: #e4e7ec;
  --primary: #175cd3;
  --primary-strong: #0b4bb3;
  --success: #12b76a;
  --error: #f04438;
  --warning: #f79009;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 28px rgba(16, 24, 40, 0.08);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, #f7f9fc 55%, #eef2f7 100%);
  color: var(--text);
}
button, input, textarea, summary { font: inherit; }

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0 94px, var(--bg) 94px 100%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 10px 14px 8px;
  background: #ffffff;
  border-bottom: 1px solid rgba(16, 24, 40, 0.10);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

.brand-logo-full {
  width: 138px;
  height: 30px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.brand-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  flex-shrink: 0;
}
.header-analysis {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-analysis-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
}
.header-analysis-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(56vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 13px;
  border: 1px solid #d6e4ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
  z-index: 30;
}
.header-analysis:hover .header-analysis-popover,
.header-analysis:focus-within .header-analysis-popover,
.header-analysis.is-open .header-analysis-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.header-analysis .analysis-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1849a9;
  margin-bottom: 5px;
}
.header-analysis .analysis-headline {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: #0f1728;
}
.header-analysis .analysis-preview {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: #667085;
}
.header-analysis-body {
  margin-top: 8px;
}
.header-analysis .analysis-grid {
  display: grid;
  gap: 8px;
}
.header-analysis .analysis-summary-expanded {
  font-size: 12px;
  line-height: 1.5;
  color: #344054;
}
.header-analysis .analysis-points-list {
  margin: 0;
  padding-left: 18px;
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}
.header-analysis .analysis-next-inline {
  font-size: 12px;
  line-height: 1.45;
  color: #344054;
}
.header-analysis .analysis-attention-inline {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(240, 68, 56, .08);
  color: #b42318;
  font-size: 11px;
  font-weight: 700;
}
.status-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgba(152, 162, 179, 0.14);
}
.status-dot.is-success { background: var(--success); box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.14); }
.status-dot.is-error { background: var(--error); box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.14); }
.status-dot.is-neutral { background: var(--muted-2); }

.tabbar {
  display: grid;
  gap: 8px;
  padding: 10px 14px 8px;
  margin-bottom: 2px;
  background: var(--bg);
}
.tabbar-3 { grid-template-columns: repeat(3, 1fr); }
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.tab:hover { background: rgba(255,255,255,0.72); }
.tab.is-active {
  background: #ffffff;
  border-color: rgba(16, 24, 40, 0.08);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

.panel { display: none; flex: 1; min-height: 0; padding: 8px 14px 14px; }
.panel.is-active { display: flex; flex-direction: column; gap: 10px; }

.section-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.section-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.search-results-meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

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

.match-workbench,
.composer-card,
.chat-thread,
.hero-card,
.selected-card,
.thread-signal-card,
.related-cases-card {
  padding: 12px;
}

.panel#panel-cases,
#panel-cases {
  overflow-y: auto;
}

.search-input, .composer-input {
  width: 100%;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
}
.search-input {
  padding-right: 42px;
}
.search-input:disabled {
  cursor: wait;
}
.search-input:focus, .composer-input:focus {
  border-color: #b2ccff;
  box-shadow: 0 0 0 4px rgba(23, 92, 211, 0.08);
}

.selected-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f5f8ff 100%);
  border-color: #bfd3ff;
}
.selected-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.eyebrow {
  color: #1849a9;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.selected-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.selected-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.selected-heading-main {
  min-width: 0;
}
.selected-badge-row {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.pill-with-menu {
  position: relative;
  padding-right: 4px;
}
.pill-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pill-menu-trigger {
  border: 0;
  background: transparent;
  color: currentColor;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.pill-menu-trigger:hover {
  background: #f4f7ff;
}
.pill-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #dbe7ff;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(18, 38, 95, 0.16);
  padding: 6px;
  display: none;
  z-index: 30;
}
.pill-menu.is-open {
  display: block;
}
.pill-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #16325c;
}
.pill-menu-item:hover {
  background: #f4f7ff;
}
.selected-title-row {
  justify-content: flex-start;
}
.case-profile-link {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(31, 65, 187, 0.16);
  background: #ffffff;
  color: #2a54d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(18, 38, 95, 0.08);
  transition: background .15s ease, transform .15s ease;
}
.case-profile-link:hover {
  background: #f4f7ff;
  transform: translateY(-1px);
}
.case-profile-link svg {
  width: 16px;
  height: 16px;
  display: block;
}
.selected-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #dbe7ff;
  background: #ffffff;
  color: #1849a9;
}
.pill.soft {
  color: var(--muted);
  border-color: var(--border);
}
.sentiment-pill.negative { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.sentiment-pill.positive { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.sentiment-pill.neutral { color: #1849a9; }

.route-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid #dbe7ff;
  border-radius: var(--radius-md);
  padding: 12px;
}
.route-countries {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.route-country {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.route-arrow {
  color: #1849a9;
  font-weight: 800;
  font-size: 18px;
}
.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.country-flag,
.country-flag-fallback {
  width: 24px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: #fff;
}
.country-flag-fallback {
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted);
}

.selected-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini-stat {
  background: rgba(255,255,255,0.88);
  border: 1px solid #dbe7ff;
  border-radius: var(--radius-sm);
  padding: 10px;
}
.mini-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mini-value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
}

.details-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-pair {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0 0;
  border-top: 1px dashed #dbe7ff;
}
.detail-value-left {
  font-size: 13px;
  font-weight: 600;
}

.selected-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.match-workbench {
  padding-top: 14px;
  padding-bottom: 14px;
}

.related-cases-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.related-cases-card summary::-webkit-details-marker { display: none; }
.related-cases-card summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.summary-hide-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
}
.summary-hide-btn:hover {
  color: var(--text);
  background: rgba(16, 24, 40, 0.04);
}
.summary-hide-btn:focus-visible {
  outline: 2px solid rgba(23, 92, 211, 0.22);
  outline-offset: 2px;
}
.related-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.search-input-wrap {
  position: relative;
}
.search-inline-loader {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(23, 92, 211, 0.16);
  border-top-color: #175cd3;
  opacity: 0;
  pointer-events: none;
  transform: scale(.9);
  transition: opacity .16s ease, transform .16s ease;
}
.search-inline-loader.is-active {
  opacity: 1;
  transform: scale(1);
  animation: searchSpin .8s linear infinite;
}
.search-helper-text {
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.search-action-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.search-action-btn:disabled {
  cursor: wait;
  opacity: .9;
}
.button-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.42);
  border-top-color: currentColor;
  animation: searchSpin .8s linear infinite;
}
.loading-state .empty-icon {
  background: #eff6ff;
  color: transparent;
}
.loading-spinner {
  position: relative;
}
.loading-spinner::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 999px;
  border: 2px solid rgba(23, 92, 211, 0.16);
  border-top-color: #175cd3;
  animation: searchSpin .8s linear infinite;
}
@keyframes searchSpin {
  to { transform: rotate(360deg); }
}
.list-card-inline {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.case-card {
  appearance: none;
  width: 100%;
  text-align: left;
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: #fcfcfd;
}
.case-card:hover { border-color: #dbe7ff; background: #fafcff; }
.case-card.is-selected {
  border-color: #bfd3ff;
  background: linear-gradient(180deg, #f8fbff 0%, #f5f8ff 100%);
}
.case-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #98a2b3 0%, #d0d5dd 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.case-content { min-width: 0; }
.case-title { font-size: 14px; font-weight: 700; }

.case-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.case-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.case-chip.is-matched {
  background: #e8f1ff;
  color: var(--primary);
}
.case-subtitle { margin-top: 2px; color: var(--muted); font-size: 13px; }
.case-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.case-link-state {
  margin-left: auto;
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}
.case-card.is-selected .case-link-state {
  opacity: 0.9;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: radial-gradient(circle at 18% 18%, rgba(255,255,255,0.55), rgba(255,255,255,0.0) 40%), linear-gradient(135deg, #0b4bb3 0%, #175cd3 55%, #39c3ff 100%);
  color: white;
  border-color: rgba(255,255,255,0.14);
}
.hero-card h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.hero-card p { margin: 4px 0 0; font-size: 13px; opacity: 0.94; }
.hero-orb {
  width: 48px; height: 48px; border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.96), rgba(255,255,255,0.24) 46%, rgba(255,255,255,0.08) 80%);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.16);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-copy { min-width: 0; }

.thread-signal-card {
  background: #fff;
  border-color: #dbe7ff;
}
.thread-signal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.thread-signal-title {
  font-size: 14px;
  font-weight: 700;
}
.thread-signal-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-row { display: flex; }
.message-row.user { justify-content: flex-end; }
.message-bubble {
  max-width: 88%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--text);
  white-space: pre-wrap;
}
.message-row.user .message-bubble {
  background: #175cd3;
  border-color: #175cd3;
  color: white;
}
.message-bubble p:first-child { margin-top: 0; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble strong { font-weight: 700; }
.message-bubble em { font-style: italic; }
.message-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(23, 92, 211, 0.08);
}


.composer-input { min-height: 94px; resize: vertical; }
.composer-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.hint { color: var(--muted); font-size: 12px; }
.buttons { display: flex; gap: 8px; }

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.button.primary {
  background: var(--primary);
  color: #fff;
}
.button.primary:hover { background: var(--primary-strong); }
.button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.action-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow);
}
.action-card strong { display: block; font-size: 14px; }
.action-card span {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.action-card:hover { border-color: #bfd3ff; background: #f8fbff; }
.action-card-secondary { background: #fcfcfd; }

.empty-state {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #98a2b3 0%, #d0d5dd 100%);
  color: white;
  font-weight: 700;
}
.empty-copy strong {
  display: block;
  margin-bottom: 4px;
}
.empty-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 460px) {
  .selected-grid, .actions-grid, .route-countries { grid-template-columns: 1fr; }
  .route-arrow { display: none; }
  .thread-signal-header, .selected-top { flex-direction: column; }
}


/* MI analysis dock refresh */
.analysis-dock {
  padding: 0;
  overflow: hidden;
  border-color: #d6e4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 24px rgba(23, 92, 211, 0.06);
}
.analysis-toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}
.analysis-toggle-copy { min-width: 0; flex: 1; }
.analysis-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1849a9;
  margin-bottom: 4px;
}
.analysis-headline {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: #0f1728;
}
.analysis-preview {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: #667085;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.analysis-dock:hover .analysis-preview,
.analysis-dock.is-open .analysis-preview {
  -webkit-line-clamp: 5;
}
.analysis-toggle-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 1px;
}
.analysis-chevron {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(23,92,211,.08);
  color: #175cd3;
  font-size: 13px;
  font-weight: 800;
}
.analysis-dock-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  transition: max-height .24s ease, opacity .18s ease, padding .18s ease;
  border-top: 1px solid transparent;
}
.analysis-dock.is-open .analysis-dock-body,
.analysis-dock:hover .analysis-dock-body {
  max-height: 280px;
  opacity: 1;
  padding: 0 14px 14px;
  border-top-color: #e3ecff;
}
.analysis-dock.is-open .analysis-chevron,
.analysis-dock:hover .analysis-chevron { transform: rotate(180deg); }
.analysis-grid { display: grid; gap: 10px; }
.analysis-summary-expanded {
  font-size: 13px;
  line-height: 1.55;
  color: #101828;
}
.analysis-points-list {
  margin: 0;
  padding-left: 18px;
  color: #344054;
  font-size: 12px;
  line-height: 1.5;
}
.analysis-points-list li + li { margin-top: 4px; }
.analysis-next-inline {
  font-size: 12px;
  line-height: 1.5;
  color: #344054;
  padding-top: 2px;
}
.analysis-next-inline strong {
  color: #0f1728;
}
.analysis-attention-inline {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #fecdca;
}
.pill.sentiment-urgent { color: #b42318; border-color: #fecdca; background: #fff1f0; }
.pill.sentiment-negative { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.pill.sentiment-mixed { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.pill.sentiment-neutral { color: #175cd3; border-color: #bfd3ff; background: #eef4ff; }
.pill.sentiment-positive { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.chat-thread { padding: 10px; }
.message-row { margin-bottom: 10px; }
.message-row.assistant .message-bubble { background: #fff; border: 1px solid #dbe7ff; }
.message-row.user .message-bubble { background: linear-gradient(135deg, #175cd3 0%, #3ba7f0 100%); color: white; border: 0; }
.message-bubble {
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: none;
  line-height: 1.45;
  font-size: 13px;
}
#panel-chat { overflow: hidden; }


.is-hidden { display: none !important; }
.selected-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.selected-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-button {
  border: 1px solid rgba(31, 65, 187, 0.16);
  background: #ffffff;
  color: #2a54d6;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(18, 38, 95, 0.08);
}
.icon-button:hover {
  background: #f4f7ff;
}

.selected-top-side { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.analysis-chevron-icon { width:12px; height:12px; display:block; }
.analysis-chevron { padding:0; }


.message-row.is-typing {
  margin: 4px 0 10px;
}
.typing-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
}
.typing-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.typing-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.typing-label {
  font-size: 13px;
  font-weight: 600;
  color: #1849a9;
}
.typing-note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: #5b6885;
  max-width: 255px;
  opacity: 0.88;
}
.typing-note[hidden] {
  display: none !important;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #7eaef8;
  opacity: 0.35;
  animation: miTypingPulse 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes miTypingPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.28; }
  40% { transform: translateY(-2px); opacity: 1; }
}

.analysis-dock { display: none !important; }
.header-analysis .pill {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}
.header-analysis .pill.sentiment-neutral { border: 1px solid #bfd3ff; background: #f7fbff; color: #175cd3; }
.header-analysis .pill.sentiment-positive { border: 1px solid rgba(18,183,106,.28); background: rgba(18,183,106,.08); color: #067647; }
.header-analysis .pill.sentiment-mixed { border: 1px solid rgba(247,144,9,.28); background: rgba(247,144,9,.08); color: #b54708; }
.header-analysis .pill.sentiment-negative,
.header-analysis .pill.sentiment-urgent { border: 1px solid rgba(240,68,56,.28); background: rgba(240,68,56,.08); color: #b42318; }


@media (max-width: 420px) {
  .header-analysis-popover {
    width: min(248px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }
}


/* Lock the overall add-in pane and allow scrolling only inside intended panels */
html, body {
  overflow: hidden;
}

body {
  height: 100vh;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
}

.panel {
  min-height: 0;
}

#panel-chat {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#panel-chat.is-active {
  display: flex;
  flex-direction: column;
}

.chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.suggestions,
.composer-card {
  flex-shrink: 0;
}

#panel-actions {
  overflow-y: auto;
}


/* Keep popover anchored from centered control */
.header-analysis-popover {
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-4px);
}
.header-analysis:hover .header-analysis-popover,
.header-analysis:focus-within .header-analysis-popover,
.header-analysis.is-open .header-analysis-popover {
  transform: translateX(-50%) translateY(0);
}


/* Cleaner centered header sentiment */
.header-analysis {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: calc(100% - 180px);
}

.header-analysis-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--muted);
}

.header-analysis-prefix {
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  color: #667085;
}

.header-analysis-value {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  color: #344054;
}

.header-analysis-value.sentiment-neutral { color: #175cd3; }
.header-analysis-value.sentiment-positive { color: #067647; }
.header-analysis-value.sentiment-mixed { color: #b54708; }
.header-analysis-value.sentiment-negative,
.header-analysis-value.sentiment-urgent { color: #b42318; }

/* Neutralize old pill styling in the header sentiment line */
.header-analysis .pill,
.header-analysis-chip {
  display: contents;
}

.header-status {
  margin-left: auto;
  position: relative;
  z-index: 2;
}


.header-analysis-popover .analysis-kicker,
.header-analysis-popover .analysis-headline,
.header-analysis-popover .analysis-summary-expanded,
.header-analysis-popover .analysis-points-list,
.header-analysis-popover .analysis-next-inline,
.header-analysis-popover .analysis-attention-inline,
.header-analysis-popover li,
.header-analysis-popover p,
.header-analysis-popover div,
.header-analysis-popover span {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* Sentiment popover: retired preview line */
.header-analysis-popover .analysis-preview { display: none !important; }
.message-bubble .message-list {
  margin: 0;
  padding-left: 18px;
}
.message-bubble .message-list li + li {
  margin-top: 4px;
}
.message-bubble .message-paragraph + .message-list,
.message-bubble .message-list + .message-paragraph,
.message-bubble .message-paragraph + .message-paragraph {
  margin-top: 8px;
}


.results-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}


/* v54 header layout fix */
.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 52px;
  padding: 8px 12px 8px;
}

.brand {
  min-width: 0;
  position: relative;
  z-index: 2;
}

.brand-logo.brand-logo-compact {
  width: 84px;
  height: 26px;
  object-fit: contain;
}

.header-analysis {
  position: relative;
  left: auto;
  transform: none;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  z-index: 1;
}

.header-analysis-toggle {
  min-width: 0;
  max-width: 100%;
  justify-content: center;
}

.header-analysis-prefix,
.header-analysis-value {
  white-space: nowrap;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-status {
  margin-left: 0;
  min-width: 0;
  gap: 6px;
}

.status-text {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

@media (max-width: 380px) {
  .app-header {
    grid-template-columns: auto 1fr auto;
    column-gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-logo.brand-logo-compact {
    width: 72px;
    height: 22px;
  }

  .header-analysis-prefix {
    font-size: 11px;
  }

  .header-analysis-value {
    font-size: 12px;
  }

  .status-text {
    max-width: 56px;
    font-size: 11px;
  }
}


.case-details-card.is-hidden{display:none;}
.case-details-card{padding:18px 20px;}
.case-activity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.case-activity-head p{margin:4px 0 0;color:var(--muted,#667085);font-size:12px;}
.case-activity-groups{display:grid;gap:10px;}
.activity-group{border:1px solid #d9e2ff;border-radius:16px;background:#fff;}
.activity-group-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:none;border:0;font:inherit;font-weight:700;color:#1d2a57;cursor:pointer;}
.activity-group-meta{font-size:12px;color:#5b6b92;background:#eef3ff;border-radius:999px;padding:3px 8px;}
.activity-group-body{padding:0 14px 14px;display:grid;gap:10px;}
.activity-group-body.is-hidden{display:none;}
.activity-item{padding:10px 12px;border:1px solid #edf1fb;border-radius:12px;background:#fbfcff;}
.activity-item-title{font-weight:700;font-size:13px;color:#18254d;margin-bottom:4px;}
.activity-item-meta{font-size:12px;color:#667085;margin-bottom:4px;}
.activity-item-copy{font-size:12px;color:#344054;white-space:pre-wrap;word-break:break-word;}
.activity-empty,.activity-more{font-size:12px;color:#667085;padding:8px 2px;}
.refresh-case-btn{margin-left:auto;}

.case-details-card{padding:0;background:transparent;border:none;box-shadow:none;}
.case-activity-label-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:2px 2px 12px;}
.case-activity-label-row p{margin:4px 0 0;color:var(--muted,#667085);font-size:12px;}
.activity-group{border:1px solid #d9e2ff;border-radius:16px;background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.04);}
.activity-group.is-disabled{opacity:.7;}
.activity-group-toggle{gap:10px;}
.activity-group-title{display:flex;align-items:center;gap:8px;}
.activity-group-actions{display:flex;align-items:center;gap:8px; margin-left:auto;}
.activity-add-btn{border:1px solid #d9e2ff;background:#fff;color:#245fd7;border-radius:999px;padding:4px 10px;font:inherit;font-size:12px;font-weight:700;cursor:pointer;}
.activity-add-btn:hover{background:#f5f8ff;}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:999px;border:1px solid #d9e2ff;background:#fff;color:#245fd7;cursor:pointer;box-shadow:0 1px 2px rgba(16,24,40,.04);}
.icon-button:hover{background:#f5f8ff;}
.icon-button:disabled{opacity:.6;cursor:not-allowed;}
.icon-button svg{width:16px;height:16px;}
.refresh-icon-button{flex-shrink:0;}
.selected-badge-row{align-items:center;}
.activity-empty.standalone{margin-bottom:12px;}

.selected-badge-tools{display:flex;align-items:center;gap:8px;}
.selected-badge-row{display:flex;align-items:center;justify-content:space-between;}
.case-details-card{padding:0;background:transparent;border:none;box-shadow:none;}
.case-activity-label-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:2px 2px 12px;}
.case-activity-label-row p{margin:4px 0 0;color:var(--muted,#667085);font-size:12px;}
.activity-group-actions{display:flex;align-items:center;gap:8px;margin-left:auto;}
.activity-add-btn{position:relative;z-index:2;}

.activity-group-toggle{align-items:center;}
.activity-group-title{display:flex;align-items:center;gap:6px;font-weight:800;}
.activity-group-count-inline{font-size:13px;color:#667085;font-weight:700;}
.activity-group-actions{display:none;}
.activity-group-chevron{margin-left:auto;color:#667085;font-size:18px;line-height:1;font-weight:700;}
.activity-group-body{padding:0 14px 14px;display:grid;gap:10px;max-height:280px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;}
.activity-group-body-head{display:flex;justify-content:flex-end;padding-top:2px;}
.activity-add-btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d9e2ff;background:#fff;color:#245fd7;border-radius:999px;padding:5px 10px;font:inherit;font-size:12px;font-weight:700;cursor:pointer;}
.activity-group-body.is-hidden .activity-add-btn{display:none;}

.tab.has-badge { display:flex; align-items:center; justify-content:center; gap:6px; }
.tab-badge { min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#2563eb; color:#fff; font-size:11px; font-weight:800; line-height:18px; text-align:center; box-shadow:0 1px 3px rgba(37,99,235,0.28); }


/* Condensed matched case card */
.selected-card {
  gap: 8px;
}
.match-workbench,
.selected-card {
  padding: 10px;
}
.selected-top {
  gap: 6px;
}
.selected-badge-row {
  margin-bottom: 4px;
}
.selected-title {
  font-size: 16px;
  line-height: 1.15;
}
.selected-title-row {
  gap: 6px;
}
.selected-subtitle {
  display: none;
}
.selected-top-side .pill.soft {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}
.route-card {
  padding: 10px;
  border-radius: 14px;
}
.route-countries {
  gap: 8px;
}
.route-country {
  gap: 4px;
}
.route-label {
  font-size: 10px;
}
.country-pill {
  gap: 7px;
}
.country-pill span:last-child {
  font-size: 12px;
}
.selected-grid {
  gap: 8px;
}
.mini-stat {
  padding: 8px 10px;
  border-radius: 12px;
}
.mini-label {
  font-size: 10px;
}
.mini-value {
  margin-top: 2px;
  font-size: 12px;
}
.selected-actions {
  display: none;
}
.refresh-icon-button,
.case-profile-link {
  width: 26px;
  height: 26px;
}
.refresh-icon-button svg,
.case-profile-link svg {
  width: 14px;
  height: 14px;
}

.refresh-icon-button.is-loading svg{animation:mi-spin 0.95s linear infinite;}
.refresh-icon-button.is-success{color:#16a34a;border-color:#b7e7c5;background:#f0fdf4;}
.refresh-icon-button.is-error{color:#dc2626;border-color:#fecaca;background:#fef2f2;}
@keyframes mi-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}


.message-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  background: #fbfdff;
}
.message-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  font-size: 13px;
  line-height: 1.45;
}
.message-table th,
.message-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid #e8efff;
}
.message-table thead th {
  position: sticky;
  top: 0;
  background: #f3f7ff;
  color: #183b8c;
  font-weight: 700;
  z-index: 1;
}
.message-table tbody tr:last-child td {
  border-bottom: 0;
}
.message-table tbody tr:nth-child(even) td {
  background: #ffffff;
}
.message-table tbody tr:nth-child(odd) td {
  background: #fcfdff;
}
.message-bubble .message-table-wrap + .message-paragraph,
.message-bubble .message-paragraph + .message-table-wrap,
.message-bubble .message-list + .message-table-wrap,
.message-bubble .message-table-wrap + .message-list {
  margin-top: 10px;
}


/* Markdown table readability fix */
.message-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #d9e3ff;
}
.message-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  color: #102a6b;
}
.message-table th,
.message-table td {
  color: #102a6b !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e8eeff;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}
.message-table th {
  background: #f4f7ff !important;
  font-weight: 700;
}
.message-table tr:last-child td {
  border-bottom: none;
}
/* Keep tables readable inside outgoing blue bubbles */
.message.outgoing .message-table-wrap,
.message-bubble.outgoing .message-table-wrap,
.outgoing .message-table-wrap {
  background: #ffffff !important;
}
.message.outgoing .message-table,
.message-bubble.outgoing .message-table,
.outgoing .message-table {
  background: #ffffff !important;
}
.message.outgoing .message-table th,
.message.outgoing .message-table td,
.message-bubble.outgoing .message-table th,
.message-bubble.outgoing .message-table td,
.outgoing .message-table th,
.outgoing .message-table td {
  color: #102a6b !important;
  background: #ffffff !important;
}



.message-row {
  position: relative;
}

.message-timestamp {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(16, 42, 107, 0.45);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
  user-select: none;
}

.message-row.user .message-timestamp {
  text-align: right;
  padding-right: 6px;
}

.message-row.assistant .message-timestamp {
  text-align: left;
  padding-left: 6px;
}

.message-row:hover .message-timestamp,
.message-row:focus-within .message-timestamp {
  opacity: 1;
  transform: translateY(0);
}


/* Hover timestamps below messages */
.chat-message,
.message,
.message-row {
  position: relative;
}

.chat-message .message-timestamp,
.message .message-timestamp,
.message-row .message-timestamp {
  display: block !important;
  position: static !important;
  margin-top: 4px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  color: rgba(16, 42, 107, 0.45) !important;
  opacity: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  transition: opacity 120ms ease, max-height 120ms ease, margin-top 120ms ease !important;
}

.chat-message:hover .message-timestamp,
.message:hover .message-timestamp,
.message-row:hover .message-timestamp {
  opacity: 1 !important;
  max-height: 16px !important;
}

/* Keep outgoing messages glued right */
.chat-message.outgoing,
.message.outgoing,
.message-row.outgoing {
  align-items: flex-end !important;
}

.chat-message.outgoing .message-bubble,
.message.outgoing .message-bubble,
.message-row.outgoing .message-bubble,
.chat-message.outgoing .bubble,
.message.outgoing .bubble,
.message-row.outgoing .bubble {
  margin-left: auto !important;
  margin-right: 0 !important;
}

.chat-message.outgoing .message-timestamp,
.message.outgoing .message-timestamp,
.message-row.outgoing .message-timestamp {
  align-self: flex-end !important;
  text-align: right !important;
}

.chat-message.incoming .message-timestamp,
.message.incoming .message-timestamp,
.message-row.incoming .message-timestamp {
  align-self: flex-start !important;
  text-align: left !important;
}



/* Hover timestamp layout fix */
.message-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  margin-bottom: 10px !important;
}
.message-row.user {
  justify-content: initial !important;
  align-items: flex-end !important;
}
.message-row.assistant {
  align-items: flex-start !important;
}
.message-row .message-bubble {
  margin: 0 !important;
}
.message-timestamp {
  display: block !important;
  position: static !important;
  margin-top: 4px !important;
  padding: 0 !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  max-height: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
.message-row:hover .message-timestamp,
.message-row:focus-within .message-timestamp {
  opacity: 1 !important;
  max-height: 16px !important;
}
.message-row.user .message-timestamp {
  align-self: flex-end !important;
  text-align: right !important;
}
.message-row.assistant .message-timestamp {
  align-self: flex-start !important;
  text-align: left !important;
}



/* Final timestamp layout override */
.message-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
.message-row.user {
  align-items: flex-end !important;
}
.message-row.assistant,
.message-row.system,
.message-row.incoming {
  align-items: flex-start !important;
}
.message-row .message-bubble {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.message-row.user .message-bubble {
  margin-left: auto !important;
  margin-right: 0 !important;
}
.message-timestamp {
  position: static !important;
  display: block !important;
  width: auto !important;
  margin-top: 4px !important;
  padding: 0 !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  float: none !important;
  clear: both !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  color: rgba(16, 42, 107, 0.42) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.message-row:hover .message-timestamp,
.message-row:focus-within .message-timestamp {
  opacity: 1 !important;
  max-height: 20px !important;
}
.message-row.user .message-timestamp {
  align-self: flex-end !important;
  text-align: right !important;
}
.message-row.assistant .message-timestamp,
.message-row.system .message-timestamp,
.message-row.incoming .message-timestamp {
  align-self: flex-start !important;
  text-align: left !important;
}









/* Compact chat tables + CSV download */
.message-table-block {
  margin-top: 4px;
}
.message-table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
}
.message-table-actions.under-table {
  margin-top: 4px;
}
.message-table-download,
.message-table-chart,
.message-table-back,
.message-chart-download {
  appearance: none;
  border: 1px solid #d9e3ff;
  background: #fff;
  color: #255fd6;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  box-shadow: none;
}
.message-table-chart {
  background: #f7fbff;
}
.message-table-download:hover,
.message-table-chart:hover,
.message-table-back:hover,
.message-chart-download:hover {
  background: #f5f8ff;
}
.message-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dfe7ff;
  border-radius: 12px;
  background: #ffffff;
}
.message-table {
  width: 100%;
  min-width: 560px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.message-table.is-compact {
  min-width: 460px;
}
.message-table.is-two-col {
  min-width: 0;
  width: 100%;
}
.message-table-wrap.is-two-col {
  overflow-x: hidden;
}
.message-table.is-two-col th,
.message-table.is-two-col td {
  width: 50%;
}
.message-table th,
.message-table td {
  font-size: 11px !important;
  line-height: 1.2 !important;
  padding: 6px 8px !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal !important;
  vertical-align: top;
}
.message-table th {
  background: #f6f8ff !important;
}
.message-table.is-wide th,
.message-table.is-wide td {
  font-size: 10px !important;
  padding: 6px 7px !important;
}
.message-bubble .message-table-download,
.message-bubble .message-table-chart,
.message-bubble .message-table-back,
.message.outgoing .message-table-download,
.message.outgoing .message-table-chart,
.message.outgoing .message-table-back,
.message-row.user .message-table-download,
.message-row.user .message-table-chart,
.message-row.user .message-table-back {
  background: rgba(255,255,255,0.98) !important;
}
.message-paragraph {
  margin: 0 !important;
}
.message-paragraph + .message-paragraph {
  margin-top: 4px !important;
}
.message-paragraph + .message-table-block {
  margin-top: 4px !important;
}
.message-table-block + .message-paragraph {
  margin-top: 4px !important;
}
.message-bubble {
  gap: 0 !important;
}
.message-bubble > * + * {
  margin-top: 4px !important;
}
.message-bubble .message-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.message-bubble .message-table-wrap::-webkit-scrollbar-thumb {
  background: #c8d6ff;
  border-radius: 999px;
}

.message-chart-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.message-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.message-chart-title {
  font-size: 12px;
  font-weight: 800;
  color: #123161;
  letter-spacing: -0.01em;
}
.message-chart-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #d9e3ff;
  background: #f7fbff;
  color: #255fd6;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.message-chart-meta {
  font-size: 10px;
  color: #667085;
}
.message-chart-canvas-wrap {
  position: relative;
  height: 240px;
  border: 1px solid #dfe7ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  padding: 10px;
}
.message-chart-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.message-chart-echart {
  display: block;
  width: 100%;
  height: 100%;
}
.message-chart-fallback {
  display: none;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}
.message-chart-block.is-unavailable .message-chart-canvas {
  display: none;
}
.message-chart-block.is-unavailable .message-chart-fallback {
  display: block !important;
}
.message-table-block + .message-chart-block,
.message-chart-block + .message-paragraph,
.message-paragraph + .message-chart-block {
  margin-top: 6px !important;
}
/* tighten overall bubble internals */
.message-bubble.user,
.message-bubble.assistant,
.message.assistant .message-bubble,
.message.user .message-bubble {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}


/* Fix blank space around rendered table blocks inside chat messages */
.message-bubble {
  white-space: normal !important;
}
.message-paragraph {
  white-space: pre-wrap !important;
  margin: 0 !important;
}
.message-list {
  white-space: normal !important;
  margin: 0 !important;
}
.message-table-block,
.message-table-wrap,
.message-table-actions {
  white-space: normal !important;
}
.message-bubble > .message-paragraph + .message-table-block {
  margin-top: 4px !important;
}
.message-bubble > .message-table-block + .message-table-actions,
.message-bubble > .message-table-block + .message-paragraph {
  margin-top: 4px !important;
}
.message-bubble > * {
  margin-bottom: 0 !important;
}
.message-bubble > * + * {
  margin-top: 4px !important;
}



/* Slim composer safe */
.composer-card {
  position: relative !important;
  padding: 8px 10px 8px !important;
  border-radius: 20px !important;
}

.composer-card textarea,
.composer-card #prompt,
#prompt {
  width: 100% !important;
  min-height: 64px !important;
  max-height: 120px !important;
  resize: vertical !important;
  border: 1px solid #d9e3ff !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  padding: 14px 56px 14px 14px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.composer-card textarea::placeholder,
.composer-card #prompt::placeholder,
#prompt::placeholder {
  color: #7f8aa3 !important;
}

.composer-card .composer-actions {
  position: relative !important;
  margin-top: 4px !important;
  min-height: 0 !important;
  padding: 0 4px !important;
}

.composer-card .hint {
  display: block !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: #7f8aa3 !important;
  margin: 0 !important;
}

.composer-card .buttons {
  position: static !important;
}

.composer-card #sendBtn,
.composer-card .button.primary {
  position: absolute !important;
  right: 18px !important;
  top: -54px !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  font-size: 0 !important;
  z-index: 2 !important;
}

.composer-card #sendBtn::before,
.composer-card .button.primary::before {
  content: "↑";
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  font-weight: 700;
}

/* Keep clear button for JS, but hide it visually */
.composer-card #clearBtn,
.composer-card .button.secondary {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}



/* Composer visual refinement inside unified chat surface */
.composer-card-inline {
  position: relative !important;
  padding: 10px 10px 10px !important;
}

.composer-card-inline textarea,
.composer-card-inline #prompt,
.chat-surface #prompt {
  width: 100% !important;
  min-height: 52px !important;
  max-height: 120px !important;
  resize: vertical !important;
  border: 1px solid #d9e3ff !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  padding: 14px 54px 14px 14px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.composer-card-inline #sendBtn,
.chat-surface #sendBtn {
  position: absolute !important;
  right: 20px !important;
  top: 22px !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  font-size: 0 !important;
  z-index: 2 !important;
}

.composer-card-inline #sendBtn::before,
.chat-surface #sendBtn::before {
  content: "↑";
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  font-weight: 700;
}

.composer-card-inline #clearBtn,
.chat-surface #clearBtn {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.composer-card-inline .hint,
.chat-surface .hint {
  display: block !important;
  margin-top: 6px !important;
  padding-left: 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: #7f8aa3 !important;
}

/* Slightly tighter overall MI panel */
#panel-chat.panel {
  padding-top: 8px;
  padding-bottom: 10px;
}


/* Chat surface: unified message + composer window */
/* Super slick send-in-composer */
#panel-chat.is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#panel-chat.panel {
  padding-top: 8px;
  padding-bottom: 10px;
}

.chat-surface {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dbe7ff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.chat-surface .chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 6px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.chat-surface .composer-card {
  flex-shrink: 0;
  position: relative !important;
  border: 0 !important;
  border-top: 1px solid #edf2ff !important;
  border-radius: 0 0 22px 22px !important;
  box-shadow: none !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, #ffffff 100%) !important;
  margin: 0 !important;
  padding: 10px 10px 10px !important;
}

.chat-surface .composer-card .composer-input,
.chat-surface .composer-card textarea,
.chat-surface #prompt {
  width: 100% !important;
  min-height: 58px !important;
  max-height: 120px !important;
  resize: vertical !important;
  border: 1px solid #d9e3ff !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 0 rgba(16,24,40,0.02) !important;
  padding: 14px 58px 14px 14px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  display: block !important;
}

.chat-surface .composer-card .composer-input::placeholder,
.chat-surface .composer-card textarea::placeholder,
.chat-surface #prompt::placeholder {
  color: #7f8aa3 !important;
}

.chat-surface .composer-card .composer-actions {
  position: relative !important;
  margin-top: 6px !important;
  min-height: 18px !important;
  padding: 0 4px !important;
  display: block !important;
}

.chat-surface .composer-card .buttons {
  position: static !important;
}

.chat-surface .composer-card #sendBtn,
.chat-surface .composer-card .button.primary,
#panel-chat #sendBtn {
  position: absolute !important;
  right: 20px !important;
  top: 21px !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
  z-index: 50 !important;
  box-shadow: 0 3px 10px rgba(37,95,214,0.24) !important;
}

.chat-surface .composer-card #sendBtn::before,
.chat-surface .composer-card .button.primary::before,
#panel-chat #sendBtn::before {
  content: "↑";
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  font-weight: 700;
}

.chat-surface .composer-card #clearBtn,
.chat-surface .composer-card .button.secondary,
#panel-chat #clearBtn {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.chat-surface .composer-card .hint,
#panel-chat .composer-card .hint {
  display: block !important;
  margin-top: 0 !important;
  padding-left: 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: #7f8aa3 !important;
}

.suggestions {
  display: none !important;
}





/* v97 refined slim integrated composer */
.chat-surface .composer-card {
  position: relative !important;
  padding: 8px 10px 8px !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, #ffffff 100%) !important;
}

.chat-surface .composer-card textarea,
.chat-surface .composer-card #prompt {
  width: 100% !important;
  min-height: 52px !important;
  max-height: 108px !important;
  resize: none !important;
  overflow-y: auto !important;
  border: 1px solid #d8e3ff !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 1px 2px rgba(16,24,40,0.04) !important;
  padding: 14px 56px 14px 14px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  display: block !important;
}

.chat-surface .composer-card textarea::-webkit-resizer,
.chat-surface .composer-card #prompt::-webkit-resizer {
  display: none !important;
}

.chat-surface .composer-card textarea::placeholder,
.chat-surface .composer-card #prompt::placeholder {
  color: #7f8aa3 !important;
}

.chat-surface .composer-card .composer-actions {
  position: static !important;
  min-height: auto !important;
  margin-top: 4px !important;
  padding: 0 6px !important;
}

.chat-surface .composer-card .buttons {
  position: static !important;
}

.chat-surface .composer-card #sendBtn,
.chat-surface .composer-card .button.primary,
#panel-chat .composer-card #sendBtn {
  position: absolute !important;
  right: 16px !important;
  bottom: 24px !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  z-index: 90 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-shadow: 0 3px 8px rgba(37,95,214,0.18) !important;
}

.chat-surface .composer-card #sendBtn::before,
.chat-surface .composer-card .button.primary::before,
#panel-chat .composer-card #sendBtn::before {
  content: "↑";
  font-size: 16px;
  line-height: 1;
  color: #ffffff;
  font-weight: 700;
}

.chat-surface .composer-card #clearBtn,
.chat-surface .composer-card .button.secondary,
#panel-chat .composer-card #clearBtn {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.chat-surface .composer-card .hint,
#panel-chat .composer-card .hint {
  display: block !important;
  margin-top: 0 !important;
  padding-left: 4px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: #8a94ab !important;
}



/* =========================
   v10 final composer
   ========================= */
#panel-chat .composer-card-final,
.composer-card-final {
  position: relative !important;
  padding: 10px 10px 8px !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#panel-chat .composer-card-final .composer-frame,
.composer-card-final .composer-frame {
  position: relative !important;
  width: 100% !important;
}

#panel-chat .composer-card-final #prompt,
.composer-card-final #prompt,
#panel-chat .composer-card-final .composer-input-final,
.composer-card-final .composer-input-final {
  display: block !important;
  width: 100% !important;
  min-height: 68px !important;
  max-height: 140px !important;
  resize: none !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 18px 106px 18px 18px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(180, 198, 236, 0.95) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  color: #111827 !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 2px rgba(15,23,42,0.04),
    0 8px 20px rgba(15,23,42,0.04) !important;
}

#panel-chat .composer-card-final #prompt::placeholder,
.composer-card-final #prompt::placeholder {
  color: #667085 !important;
}

#panel-chat .composer-card-final #prompt:focus,
.composer-card-final #prompt:focus {
  outline: none !important;
  border-color: rgba(111, 132, 255, 0.48) !important;
  box-shadow:
    0 0 0 4px rgba(111, 132, 255, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.92),
    0 8px 20px rgba(15,23,42,0.05) !important;
}

#panel-chat .composer-card-final .composer-controls,
.composer-card-final .composer-controls {
  position: absolute !important;
  right: 14px !important;
  bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 30 !important;
}

#panel-chat .composer-card-final .composer-control,
.composer-card-final .composer-control {
  appearance: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  cursor: pointer !important;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    opacity 140ms ease !important;
}

#panel-chat .composer-card-final #sendBtn,
.composer-card-final #sendBtn,
#panel-chat .composer-card-final .composer-send-final,
.composer-card-final .composer-send-final {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-shadow:
    0 8px 18px rgba(15,23,42,0.12),
    0 1px 3px rgba(15,23,42,0.08),
    inset 0 1px 0 rgba(255,255,255,0.92) !important;
  overflow: visible !important;
}

#panel-chat .composer-card-final #sendBtn::before,
.composer-card-final #sendBtn::before,
#panel-chat .composer-card-final .composer-send-final::before,
.composer-card-final .composer-send-final::before {
  content: none !important;
}

#panel-chat .composer-card-final #sendBtn:hover,
.composer-card-final #sendBtn:hover {
  transform: translateY(-1px) !important;
  box-shadow:
    0 10px 22px rgba(15,23,42,0.14),
    0 2px 5px rgba(15,23,42,0.09),
    inset 0 1px 0 rgba(255,255,255,0.95) !important;
}

#panel-chat .composer-card-final #sendBtn:disabled,
.composer-card-final #sendBtn:disabled {
  opacity: 0.45 !important;
  cursor: default !important;
  transform: none !important;
}

#panel-chat .composer-card-final .send-glyph,
.composer-card-final .send-glyph {
  font-size: 24px !important;
  line-height: 1 !important;
  position: relative !important;
  top: -1px !important;
}

#panel-chat .composer-card-final #dictateBtn,
.composer-card-final #dictateBtn {
  position: static !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: #475467 !important;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
}

#panel-chat .composer-card-final #dictateBtn:hover,
.composer-card-final #dictateBtn:hover {
  background: rgba(15, 23, 42, 0.10) !important;
  transform: translateY(-1px) !important;
}

#panel-chat .composer-card-final #dictateBtn.is-hidden,
.composer-card-final #dictateBtn.is-hidden {
  display: none !important;
}

#panel-chat .composer-card-final .mic-glyph,
.composer-card-final .mic-glyph {
  position: relative !important;
  display: inline-block !important;
  width: 12px !important;
  height: 16px !important;
  border: 2px solid currentColor !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
}
#panel-chat .composer-card-final .mic-glyph::before,
.composer-card-final .mic-glyph::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -7px !important;
  width: 2px !important;
  height: 6px !important;
  background: currentColor !important;
  transform: translateX(-50%) !important;
}
#panel-chat .composer-card-final .mic-glyph::after,
.composer-card-final .mic-glyph::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -11px !important;
  width: 12px !important;
  height: 6px !important;
  border: 2px solid currentColor !important;
  border-top: 0 !important;
  border-bottom-left-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  box-sizing: border-box !important;
  transform: translateX(-50%) !important;
}

#panel-chat .composer-card-final .dictate-ring,
.composer-card-final .dictate-ring {
  position: absolute !important;
  inset: -6px !important;
  border-radius: 999px !important;
  background: radial-gradient(circle, rgba(239,68,68,0.18) 0%, rgba(239,68,68,0.08) 45%, rgba(239,68,68,0) 72%) !important;
  opacity: 0 !important;
  transform: scale(0.8) !important;
  pointer-events: none !important;
}

#panel-chat .composer-card-final.is-recording #dictateBtn,
.composer-card-final.is-recording #dictateBtn {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #b42318 !important;
  box-shadow:
    inset 0 0 0 1px rgba(239,68,68,0.18),
    0 0 0 4px rgba(239,68,68,0.06) !important;
}

#panel-chat .composer-card-final.is-recording .dictate-ring,
.composer-card-final.is-recording .dictate-ring {
  opacity: 1 !important;
  animation: finalComposerPulse 1.45s ease-out infinite !important;
}

@keyframes finalComposerPulse {
  0% { transform: scale(0.82); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

#panel-chat .composer-card-final .composer-hint-row,
.composer-card-final .composer-hint-row {
  padding: 8px 8px 0 !important;
}

#panel-chat .composer-card-final #composerHint,
.composer-card-final #composerHint {
  display: block !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  color: #667085 !important;
}

#panel-chat .composer-card-final.is-recording #composerHint,
.composer-card-final.is-recording #composerHint {
  color: #b42318 !important;
  font-weight: 600 !important;
}



/* =========================
   v11 composer icon polish
   ========================= */
#panel-chat .composer-card-final #sendBtn,
.composer-card-final #sendBtn,
#panel-chat .composer-card-final .composer-send-final,
.composer-card-final .composer-send-final {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%) !important;
  color: #111827 !important;
}

#panel-chat .composer-card-final #sendBtn:disabled,
.composer-card-final #sendBtn:disabled {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
  color: #98a2b3 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.82),
    0 1px 2px rgba(15,23,42,0.04) !important;
}

#panel-chat .composer-card-final #sendBtn:not(:disabled),
.composer-card-final #sendBtn:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%) !important;
  color: #111827 !important;
}

#panel-chat .composer-card-final #sendBtn:not(:disabled):hover,
.composer-card-final #sendBtn:not(:disabled):hover {
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%) !important;
}

#panel-chat .composer-card-final .send-glyph,
.composer-card-final .send-glyph {
  position: relative !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  font-size: 0 !important;
  top: 0 !important;
}

#panel-chat .composer-card-final .send-glyph::before,
.composer-card-final .send-glyph::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 1px !important;
  width: 2px !important;
  height: 11px !important;
  background: currentColor !important;
  border-radius: 2px !important;
  transform: translateX(-50%) !important;
}

#panel-chat .composer-card-final .send-glyph::after,
.composer-card-final .send-glyph::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: -1px !important;
  width: 8px !important;
  height: 8px !important;
  border-top: 2px solid currentColor !important;
  border-right: 2px solid currentColor !important;
  transform: translateX(-50%) rotate(-45deg) !important;
  box-sizing: border-box !important;
}

#panel-chat .composer-card-final #dictateBtn,
.composer-card-final #dictateBtn {
  background: linear-gradient(180deg, rgba(15,23,42,0.05) 0%, rgba(15,23,42,0.08) 100%) !important;
  color: #475467 !important;
}

#panel-chat .composer-card-final #dictateBtn:hover,
.composer-card-final #dictateBtn:hover {
  background: linear-gradient(180deg, rgba(15,23,42,0.07) 0%, rgba(15,23,42,0.12) 100%) !important;
}

#panel-chat .composer-card-final .mic-glyph,
.composer-card-final .mic-glyph {
  width: 10px !important;
  height: 14px !important;
  border-width: 2px !important;
  border-radius: 7px !important;
}

#panel-chat .composer-card-final .mic-glyph::before,
.composer-card-final .mic-glyph::before {
  bottom: -6px !important;
  height: 5px !important;
}

#panel-chat .composer-card-final .mic-glyph::after,
.composer-card-final .mic-glyph::after {
  bottom: -10px !important;
  width: 10px !important;
  height: 5px !important;
}




/* =========================
   v13 icon redesign
   ========================= */
#panel-chat .composer-card-final .composer-controls,
.composer-card-final .composer-controls {
  right: 14px !important;
  bottom: 12px !important;
  gap: 10px !important;
}

#panel-chat .composer-card-final .composer-control,
.composer-card-final .composer-control {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0 !important;
}

#panel-chat .composer-card-final #sendBtn,
.composer-card-final #sendBtn {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  padding: 0 !important;
}

#panel-chat .composer-card-final #dictateBtn,
.composer-card-final #dictateBtn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;
  padding: 0 !important;
}

#panel-chat .composer-card-final .send-icon,
.composer-card-final .send-icon {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  overflow: visible !important;
}

#panel-chat .composer-card-final .send-icon path,
.composer-card-final .send-icon path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.25 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#panel-chat .composer-card-final #sendBtn:disabled .send-icon,
.composer-card-final #sendBtn:disabled .send-icon {
  opacity: 0.72 !important;
}

#panel-chat .composer-card-final .send-glyph,
.composer-card-final .send-glyph {
  display: none !important;
}

#panel-chat .composer-card-final .mic-icon,
.composer-card-final .mic-icon {
  width: 17px !important;
  height: 17px !important;
  display: block !important;
  overflow: visible !important;
}

#panel-chat .composer-card-final .mic-icon rect,
.composer-card-final .mic-icon rect,
#panel-chat .composer-card-final .mic-icon path,
.composer-card-final .mic-icon path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#panel-chat .composer-card-final .mic-glyph,
.composer-card-final .mic-glyph {
  display: none !important;
}

#panel-chat .composer-card-final #sendBtn:not(:disabled),
.composer-card-final #sendBtn:not(:disabled) {
  color: #111827 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%) !important;
}

#panel-chat .composer-card-final #sendBtn:disabled,
.composer-card-final #sendBtn:disabled {
  color: #98a2b3 !important;
  background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%) !important;
}

#panel-chat .composer-card-final #dictateBtn,
.composer-card-final #dictateBtn {
  color: #475467 !important;
  background: linear-gradient(180deg, rgba(15,23,42,0.05) 0%, rgba(15,23,42,0.08) 100%) !important;
}

#panel-chat .composer-card-final #dictateBtn:hover,
.composer-card-final #dictateBtn:hover {
  color: #344054 !important;
}

#panel-chat .composer-card-final.is-recording #dictateBtn,
.composer-card-final.is-recording #dictateBtn {
  color: #b42318 !important;
}

#panel-chat .composer-card-final .dictate-ring,
.composer-card-final .dictate-ring {
  inset: -7px !important;
}


/* =========================
   v14 dictation reliability
   ========================= */
#panel-chat .composer-card-final #dictateBtn.is-hidden,
.composer-card-final #dictateBtn.is-hidden {
  display: none !important;
}


/* =========================
   v15 assistant summary formatting
   ========================= */
.message-list-summary {
  margin: 2px 0 0 !important;
  padding-left: 1.1rem !important;
}

.message-list-summary li {
  margin: 0 0 8px !important;
  line-height: 1.45 !important;
}

.message-list-summary li:last-child {
  margin-bottom: 0 !important;
}

.message-list-summary strong {
  font-weight: 700 !important;
}


/* =========================
   v16 stronger assistant summary formatting
   ========================= */
.message-bubble .message-list-summary {
  margin-top: 8px !important;
}

.message-bubble .message-list-summary li {
  margin-bottom: 8px !important;
}

.message-bubble .message-list-summary li:last-child {
  margin-bottom: 0 !important;
}


/* =========================
   v17 HTML summary formatting
   ========================= */
.message-bubble .message-list-summary {
  margin: 8px 0 0 !important;
  padding-left: 1.1rem !important;
}

.message-bubble .message-list-summary li {
  margin: 0 0 8px !important;
  line-height: 1.45 !important;
}

.message-bubble .message-list-summary li:last-child {
  margin-bottom: 0 !important;
}


/* =========================
   v18 smarter summary formatting
   ========================= */
.message-bubble .message-list-summary {
  margin: 8px 0 !important;
  padding-left: 1.1rem !important;
}

.message-bubble .message-list-summary li {
  margin: 0 0 8px !important;
  line-height: 1.45 !important;
}

.message-bubble .message-list-summary li:last-child {
  margin-bottom: 0 !important;
}

.message-bubble .message-list-summary + .message-paragraph {
  margin-top: 10px !important;
}


/* =========================
   v20 labeled-line summary rendering
   ========================= */
.message-bubble .message-list-summary li strong {
  font-weight: 700 !important;
}

.message-bubble .message-list-summary + .message-paragraph,
.message-bubble .message-paragraph + .message-list-summary {
  margin-top: 10px !important;
}


/* =========================
   v22 top bar brand
   ========================= */
.topbar,
.header,
.app-header {
  display: flex !important;
  align-items: center !important;
}

.topbar-left {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}

.topbar-brand-benivo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 34px !important;
  min-width: 120px !important;
}

.topbar-brand-logo {
  display: block !important;
  height: 24px !important;
  width: auto !important;
  object-fit: contain !important;
}

.brand-mark,
.brand-row,
.hero-brand,
.hero-logo,
.app-brand-below-header {
  display: none !important;
}

/* Make the top bar feel more like a native add-in title row */
.topbar {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.topbar-center {
  margin-left: auto !important;
  margin-right: 12px !important;
}


/* =========================
   v23 remove secondary logo
   ========================= */
.brand-mark,
.brand-row,
.hero-brand,
.hero-logo,
.app-brand-below-header,
.topbar + .brand-mark,
.topbar + .brand-row,
.topbar + .hero-brand {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}


/* =========================
   v24 remove in-app header logo
   ========================= */
.app-header .brand,
.app-header .brand-logo,
.app-header .brand-logo-compact {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.app-header {
  justify-content: flex-end !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.app-header .header-right {
  margin-left: auto !important;
}


/* =========================
   v101 real Sentiment tab
   ========================= */
.app-header {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tabbar-sentiment-real {
  display: block !important;
  padding: 8px 6px 6px !important;
  background: var(--bg) !important;
  overflow: visible !important;
}

.tabbar-sentiment-real-scroll {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 0 6px 4px 4px !important;
}
.tabbar-sentiment-real-scroll::-webkit-scrollbar {
  display: none !important;
}

.tabbar-sentiment-real-scroll > * {
  flex: 0 0 auto !important;
}

.tabbar-sentiment-real .tab {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 76px !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.08) !important;
  color: #344054 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  transition: background .14s ease, box-shadow .14s ease, color .14s ease !important;
}
.tabbar-sentiment-real .tab:hover {
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(16,24,40,0.05), inset 0 0 0 1px rgba(16,24,40,0.10) !important;
}
.tabbar-sentiment-real .tab.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%) !important;
  box-shadow:
    0 2px 8px rgba(47,85,212,0.10),
    inset 0 0 0 2px rgba(47,85,212,0.18) !important;
  color: #163a9a !important;
}
.tabbar-sentiment-real .tab.is-active::after {
  content: "" !important;
  position: absolute !important;
  left: 16px !important;
  right: 16px !important;
  bottom: 7px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: rgba(47,85,212,0.55) !important;
}

.status-mini-shell {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 12px !important;
  min-width: 12px !important;
  height: 42px !important;
}
.status-mini-shell #status {
  width: 12px !important;
  min-width: 12px !important;
  height: 12px !important;
  border-radius: 999px !important;
}
.status-mini-popover {
  position: absolute !important;
  left: -2px !important;
  top: calc(100% + 8px) !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: max-content !important;
  max-width: 180px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  border: 1px solid #d6e4ff !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 10px 24px rgba(15,23,42,0.12), 0 2px 6px rgba(15,23,42,0.08) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-4px) !important;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease !important;
  pointer-events: none !important;
  z-index: 70 !important;
  white-space: nowrap !important;
}
.status-mini-shell:hover .status-mini-popover,
.status-mini-shell:focus-within .status-mini-popover {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}
.status-mini-text {
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.tab-sentiment-badge {
  font-weight: 800 !important;
  text-transform: lowercase !important;
  color: #2f55d4 !important;
}

/* Real sentiment panel */
.panel-sentiment {
  display: none;
}
.panel-sentiment.is-active {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
.analysis-panel-card {
  margin: 4px 14px 0 !important;
  padding: 14px 14px 16px !important;
  border: 1px solid #d6e4ff !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 4px 14px rgba(16,24,40,0.05) !important;
}
.analysis-panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 6px !important;
}
.analysis-panel-kicker {
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  color: #1849a9 !important;
}
.analysis-panel-badge {
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: lowercase !important;
}
.analysis-panel-headline {
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  color: #0f1728 !important;
}
.analysis-panel-body {
  margin-top: 10px !important;
}
.panel-sentiment .analysis-grid {
  display: grid !important;
  gap: 10px !important;
}
.panel-sentiment .analysis-summary-expanded,
.panel-sentiment .analysis-next-inline,
.panel-sentiment .analysis-points-list {
  font-size: 13px !important;
  line-height: 1.5 !important;
}
.panel-sentiment .analysis-points-list {
  padding-left: 18px !important;
  margin: 0 !important;
}

@media (max-width: 420px) {
  .tabbar-sentiment-real .tab {
    min-width: 72px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}


/* =========================
   v103 MI-tab sidebar threads
   ========================= */
#panel-chat {
  min-width: 0 !important;
}

.mi-chat-workspace {
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
}

.mi-chat-sidebar {
  display: flex !important;
  align-items: stretch !important;
  flex: 0 0 auto !important;
  min-height: 100% !important;
}

.mi-chat-sidebar-rail {
  width: 44px !important;
  min-width: 44px !important;
  background: #f1f4f9 !important;
  border-right: 1px solid rgba(16,24,40,0.06) !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: 14px !important;
  border-top-left-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
}

.mi-chat-sidebar-toggle {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
}
.mi-chat-sidebar-toggle span {
  display: block !important;
  width: 16px !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: #667085 !important;
}

.mi-chat-sidebar-panel {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  background: #f7f9fc !important;
  border-right: 1px solid rgba(16,24,40,0.06) !important;
  transition: width .18s ease, min-width .18s ease !important;
}

.mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: 220px !important;
  min-width: 220px !important;
}

.mi-chat-sidebar-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 14px 12px 10px !important;
}

.mi-chat-sidebar-title {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f1728 !important;
}

.mi-new-chat-btn {
  appearance: none !important;
  border: 0 !important;
  border-radius: 999px !important;
  min-height: 28px !important;
  padding: 0 12px !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.08) !important;
  color: #344054 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.mi-chat-list {
  display: grid !important;
  gap: 8px !important;
  padding: 0 10px 12px !important;
  max-height: calc(100vh - 180px) !important;
  overflow-y: auto !important;
}

.mi-chat-item {
  appearance: none !important;
  border: 0 !important;
  width: 100% !important;
  text-align: left !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.08) !important;
  cursor: pointer !important;
  display: grid !important;
  gap: 4px !important;
}
.mi-chat-item:hover {
  box-shadow: 0 1px 2px rgba(16,24,40,0.05), inset 0 0 0 1px rgba(16,24,40,0.10) !important;
}
.mi-chat-item.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%) !important;
  box-shadow: 0 2px 8px rgba(47,85,212,0.10), inset 0 0 0 2px rgba(47,85,212,0.18) !important;
}
.mi-chat-item-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f1728 !important;
  line-height: 1.35 !important;
}
.mi-chat-item-meta {
  font-size: 11px !important;
  color: #667085 !important;
  line-height: 1.3 !important;
}

.mi-chat-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* Keep the original chat surface intact */
.mi-chat-main .chat-surface {
  min-width: 0 !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar-rail {
    width: 40px !important;
    min-width: 40px !important;
  }
  .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
    width: 200px !important;
    min-width: 200px !important;
  }
}


/* =========================
   v104 MI tab sidebar UX revamp
   ========================= */
.mi-chat-workspace {
  gap: 12px !important;
}

.mi-chat-sidebar {
  align-self: stretch !important;
  filter: drop-shadow(0 8px 20px rgba(16,24,40,0.06)) !important;
}

.mi-chat-sidebar-rail {
  width: 46px !important;
  min-width: 46px !important;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%) !important;
  border: 1px solid rgba(16,24,40,0.06) !important;
  border-right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-top: 12px !important;
  padding-bottom: 10px !important;
  border-top-left-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72) !important;
}

.mi-chat-sidebar-toggle {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,0.82) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.06) !important;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease !important;
}
.mi-chat-sidebar-toggle:hover {
  background: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(16,24,40,0.08), inset 0 0 0 1px rgba(16,24,40,0.08) !important;
}
.mi-chat-sidebar-toggle span {
  width: 15px !important;
}

.mi-chat-sidebar-rail-label {
  margin-top: 14px !important;
  writing-mode: vertical-rl !important;
  transform: rotate(180deg) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  color: #98a2b3 !important;
  user-select: none !important;
}

.mi-chat-sidebar-panel {
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%) !important;
  border: 1px solid rgba(16,24,40,0.06) !important;
  border-left: 0 !important;
  border-top-right-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72) !important;
}
.mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: 272px !important;
  min-width: 272px !important;
}

.mi-chat-sidebar-header {
  align-items: flex-start !important;
  padding: 16px 14px 10px !important;
  border-bottom: 1px solid rgba(16,24,40,0.05) !important;
  margin-bottom: 6px !important;
}

.mi-chat-sidebar-heading {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.mi-chat-sidebar-title {
  font-size: 15px !important;
  letter-spacing: -0.01em !important;
}

.mi-chat-sidebar-subtitle {
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: #667085 !important;
  max-width: 150px !important;
}

.mi-new-chat-btn {
  min-height: 32px !important;
  padding: 0 13px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  color: #1849a9 !important;
  box-shadow: inset 0 0 0 1px rgba(24,73,169,0.12) !important;
}
.mi-new-chat-btn:hover {
  box-shadow: 0 1px 3px rgba(24,73,169,0.12), inset 0 0 0 1px rgba(24,73,169,0.16) !important;
}

.mi-chat-list {
  gap: 10px !important;
  padding: 2px 10px 12px !important;
  max-height: calc(100vh - 210px) !important;
}

.mi-chat-item {
  padding: 11px 12px !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.07) !important;
  gap: 5px !important;
  transition: transform .14s ease, box-shadow .14s ease !important;
}
.mi-chat-item:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 10px rgba(16,24,40,0.06), inset 0 0 0 1px rgba(16,24,40,0.09) !important;
}

.mi-chat-item-title {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  line-height: 1.35 !important;
}

.mi-chat-item-meta {
  font-size: 10px !important;
  letter-spacing: .01em !important;
}

.mi-chat-empty-state {
  display: grid !important;
  gap: 6px !important;
  padding: 14px 12px 12px !important;
  margin: 4px 10px 12px !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,0.74) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.05) !important;
}
.mi-chat-empty-state.is-hidden {
  display: none !important;
}
.mi-chat-empty-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #344054 !important;
}
.mi-chat-empty-copy {
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: #667085 !important;
}

.mi-chat-main .chat-surface {
  border-radius: 22px !important;
}
.mi-chat-main .chat-thread {
  padding-left: 2px !important;
  padding-right: 2px !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar-rail {
    width: 42px !important;
    min-width: 42px !important;
  }
  .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
    width: 228px !important;
    min-width: 228px !important;
  }
  .mi-chat-sidebar-subtitle {
    max-width: 128px !important;
  }
}


/* =========================
   v105 MI sidebar refinement
   ========================= */
.mi-chat-workspace {
  gap: 0 !important;
}

.mi-chat-sidebar {
  align-self: stretch !important;
  filter: none !important;
}

.mi-chat-sidebar-rail {
  width: 34px !important;
  min-width: 34px !important;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%) !important;
  border: 1px solid rgba(16,24,40,0.06) !important;
  border-right: 0 !important;
  gap: 10px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  border-top-left-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72) !important;
}

.mi-chat-sidebar-toggle,
.mi-chat-rail-new {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.88) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.06) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease !important;
  padding: 0 !important;
}
.mi-chat-sidebar-toggle:hover,
.mi-chat-rail-new:hover {
  background: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(16,24,40,0.08), inset 0 0 0 1px rgba(16,24,40,0.08) !important;
}
.mi-chat-sidebar-toggle span {
  width: 12px !important;
  height: 1.8px !important;
}
.mi-chat-rail-new svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #667085 !important;
  stroke-width: 2 !important;
  fill: none !important;
  stroke-linecap: round !important;
}
.mi-chat-sidebar-rail-label {
  display: none !important;
}

.mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: 286px !important;
  min-width: 286px !important;
}

.mi-chat-sidebar-subtitle {
  max-width: 152px !important;
}

.mi-chat-list {
  gap: 8px !important;
  height: calc(100vh - 205px) !important;
  max-height: none !important;
}

.mi-chat-item {
  transition: transform .14s ease, box-shadow .14s ease !important;
}
.mi-chat-item:hover {
  transform: translateY(-1px) !important;
}

.mi-chat-main {
  margin-left: 10px !important;
}
.mi-chat-sidebar:not(.is-collapsed) + .mi-chat-main {
  margin-left: 12px !important;
}

/* No cramped preview state; when drawer is open keep the main area clean */
.mi-chat-sidebar:not(.is-collapsed) + .mi-chat-main {
  min-width: 0 !important;
}

.mi-chat-main.is-empty-session .chat-thread {
  min-height: calc(100vh - 250px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.mi-chat-main.is-empty-session .chat-thread::before {
  content: "Start a new MI conversation" !important;
  display: block !important;
  max-width: 280px !important;
  padding: 18px 20px !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.07) !important;
  color: #667085 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  text-align: center !important;
}
.mi-chat-main.is-empty-session .chat-thread > * {
  display: none !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar-rail {
    width: 30px !important;
    min-width: 30px !important;
  }
  .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
    width: 236px !important;
    min-width: 236px !important;
  }
}


/* =========================
   v106 MI sidebar overlay + space fix
   ========================= */
.mi-chat-workspace {
  position: relative !important;
  gap: 0 !important;
  min-height: calc(100vh - 185px) !important;
}

.mi-chat-sidebar {
  position: relative !important;
  z-index: 30 !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
}

.mi-chat-sidebar-rail {
  width: 34px !important;
  min-width: 34px !important;
  height: 100% !important;
  gap: 8px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-radius: 16px !important;
}

.mi-chat-sidebar-toggle,
.mi-chat-rail-new {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
}

.mi-chat-sidebar-toggle span {
  width: 11px !important;
}
.mi-chat-rail-new svg {
  width: 13px !important;
  height: 13px !important;
}

/* Overlay drawer: do not squeeze the MI chat */
.mi-chat-sidebar-panel {
  position: absolute !important;
  left: 34px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  overflow: hidden !important;
  z-index: 35 !important;
  box-shadow: 0 18px 36px rgba(16,24,40,0.12), inset 0 1px 0 rgba(255,255,255,0.72) !important;
}
.mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: min(292px, calc(100vw - 74px)) !important;
  min-width: min(292px, calc(100vw - 74px)) !important;
}

.mi-chat-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: calc(100% - 42px) !important;
  margin-left: 8px !important;
}

.mi-chat-main .chat-surface {
  padding: 10px !important;
  min-height: calc(100vh - 190px) !important;
}
.mi-chat-main .chat-thread {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.mi-chat-main .composer-card-final {
  margin-top: 8px !important;
}
.mi-chat-main .composer-hint-row {
  padding-left: 4px !important;
}

.mi-chat-sidebar-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(248,250,252,0.62) !important;
  backdrop-filter: blur(1.5px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .16s ease !important;
  z-index: 20 !important;
  border-radius: 22px !important;
}
.mi-chat-workspace.is-drawer-open .mi-chat-sidebar-overlay {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Better empty-state behavior for a new chat */
.mi-chat-main.is-empty-session .chat-surface {
  display: flex !important;
  flex-direction: column !important;
}
.mi-chat-main.is-empty-session .chat-thread {
  flex: 1 1 auto !important;
  min-height: calc(100vh - 310px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.mi-chat-main.is-empty-session .chat-thread::before {
  content: "Start a new MI conversation" !important;
  display: block !important;
  max-width: 300px !important;
  padding: 16px 18px !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.07) !important;
  color: #667085 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
  text-align: center !important;
}
.mi-chat-main.is-empty-session .chat-thread > * {
  display: none !important;
}

.mi-chat-item-meta::before {
  content: "Last updated " !important;
  color: #98a2b3 !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar {
    flex-basis: 30px !important;
    width: 30px !important;
    min-width: 30px !important;
  }
  .mi-chat-sidebar-rail {
    width: 30px !important;
    min-width: 30px !important;
  }
  .mi-chat-sidebar-panel {
    left: 30px !important;
  }
  .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
    width: min(244px, calc(100vw - 56px)) !important;
    min-width: min(244px, calc(100vw - 56px)) !important;
  }
  .mi-chat-main {
    width: calc(100% - 36px) !important;
    margin-left: 6px !important;
  }
}


/* =========================
   v107 flush-left + max MI space
   ========================= */

/* Remove wasted outer padding around tab content */
#panel-chat {
  padding: 0 !important;
  margin: 0 !important;
}

.mi-chat-workspace {
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: calc(100vh - 160px) !important;
  gap: 0 !important;
  align-items: stretch !important;
}

/* Glue the rail to the very left edge of the MI panel */
.mi-chat-sidebar {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  z-index: 40 !important;
  width: 30px !important;
  min-width: 30px !important;
  flex: 0 0 30px !important;
}

.mi-chat-sidebar-rail {
  width: 30px !important;
  min-width: 30px !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: 0 14px 14px 0 !important;
  border-left: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  gap: 8px !important;
}

.mi-chat-sidebar-toggle,
.mi-chat-rail-new {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
}

.mi-chat-sidebar-toggle span {
  width: 10px !important;
}

/* Drawer overlays from the left edge; does not consume layout width */
.mi-chat-sidebar-panel {
  position: absolute !important;
  left: 30px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: calc(100vw - 44px) !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: min(286px, calc(100vw - 44px)) !important;
  min-width: min(286px, calc(100vw - 44px)) !important;
}

/* Chat surface should use almost all available width/height */
.mi-chat-main {
  position: relative !important;
  margin-left: 36px !important;
  width: calc(100% - 36px) !important;
  min-width: 0 !important;
  min-height: calc(100vh - 160px) !important;
  flex: 1 1 auto !important;
}

.mi-chat-main .chat-surface {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100vh - 160px) !important;
  border-radius: 18px !important;
  padding: 8px 10px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.mi-chat-main .chat-thread {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Reduce empty top/bottom whitespace */
.mi-chat-main .message-row:first-child {
  margin-top: 0 !important;
}
.mi-chat-main .message-row:last-child {
  margin-bottom: 0 !important;
}

.mi-chat-main .composer-card-final {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

.mi-chat-main .composer-hint-row {
  padding-left: 2px !important;
  padding-bottom: 0 !important;
}

/* Empty state should still use full height */
.mi-chat-main.is-empty-session .chat-surface {
  min-height: calc(100vh - 160px) !important;
}
.mi-chat-main.is-empty-session .chat-thread {
  min-height: calc(100vh - 280px) !important;
}

/* When drawer is open, keep main width; only dim it */
.mi-chat-workspace.is-drawer-open .mi-chat-main {
  width: calc(100% - 36px) !important;
  margin-left: 36px !important;
}

.mi-chat-sidebar-overlay {
  border-radius: 18px !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar {
    width: 28px !important;
    min-width: 28px !important;
    flex-basis: 28px !important;
  }
  .mi-chat-sidebar-rail {
    width: 28px !important;
    min-width: 28px !important;
  }
  .mi-chat-sidebar-panel {
    left: 28px !important;
  }
  .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
    width: min(236px, calc(100vw - 36px)) !important;
    min-width: min(236px, calc(100vw - 36px)) !important;
  }
  .mi-chat-main {
    margin-left: 32px !important;
    width: calc(100% - 32px) !important;
  }
}


/* =========================
   v108 docked drawer instead of rail
   ========================= */

/* Use a subtle dock attached to the chat surface, not a standalone rail */
.mi-chat-workspace {
  position: relative !important;
}

.mi-chat-sidebar {
  position: absolute !important;
  left: 8px !important;
  top: 10px !important;
  bottom: 10px !important;
  width: 0 !important;
  min-width: 0 !important;
  z-index: 50 !important;
  pointer-events: none !important;
}

.mi-chat-sidebar-rail {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 32px !important;
  min-width: 32px !important;
  height: calc(100% - 0px) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(247,249,252,0.94) 0%, rgba(238,243,248,0.94) 100%) !important;
  border: 1px solid rgba(16,24,40,0.05) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  pointer-events: auto !important;
}

.mi-chat-sidebar-toggle,
.mi-chat-rail-new {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
}

.mi-chat-sidebar-panel {
  position: absolute !important;
  left: 40px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%) !important;
  border: 1px solid rgba(16,24,40,0.06) !important;
  box-shadow: 0 18px 36px rgba(16,24,40,0.14), inset 0 1px 0 rgba(255,255,255,0.72) !important;
  opacity: 0 !important;
  transform: translateX(-8px) !important;
  transition: width .18s ease, min-width .18s ease, opacity .16s ease, transform .16s ease !important;
  z-index: 60 !important;
  pointer-events: none !important;
}

.mi-chat-sidebar.is-open .mi-chat-sidebar-panel {
  width: min(292px, calc(100vw - 64px)) !important;
  min-width: min(292px, calc(100vw - 64px)) !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

.mi-chat-sidebar-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(248,250,252,0.46) !important;
  backdrop-filter: blur(2px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .16s ease !important;
  z-index: 45 !important;
  border-radius: 18px !important;
}

.mi-chat-workspace.is-drawer-open .mi-chat-sidebar-overlay {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mi-chat-main {
  margin-left: 40px !important;
  width: calc(100% - 40px) !important;
}

.mi-chat-main .chat-surface {
  min-height: calc(100vh - 160px) !important;
  padding: 8px 10px 10px !important;
}

/* Keep the chat area fully visible when drawer is open */
.mi-chat-workspace.is-drawer-open .mi-chat-main {
  margin-left: 40px !important;
  width: calc(100% - 40px) !important;
}

@media (max-width: 420px) {
  .mi-chat-sidebar {
    left: 6px !important;
  }
  .mi-chat-sidebar-rail {
    width: 28px !important;
    min-width: 28px !important;
  }
  .mi-chat-sidebar-panel {
    left: 36px !important;
  }
  .mi-chat-sidebar.is-open .mi-chat-sidebar-panel {
    width: min(244px, calc(100vw - 50px)) !important;
    min-width: min(244px, calc(100vw - 50px)) !important;
  }
  .mi-chat-main {
    margin-left: 34px !important;
    width: calc(100% - 34px) !important;
  }
}


/* =========================
   v109 flat dock + full-height MI layout
   ========================= */

/* Use the full MI panel footprint */
#panel-chat {
  padding: 0 !important;
  margin: 0 !important;
  height: calc(100vh - 112px) !important;
  min-height: calc(100vh - 112px) !important;
}

.mi-chat-workspace {
  position: relative !important;
  width: 100% !important;
  height: calc(100vh - 112px) !important;
  min-height: calc(100vh - 112px) !important;
  gap: 0 !important;
  align-items: stretch !important;
}

/* Flat left dock, not a pill/rail */
.mi-chat-sidebar {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 28px !important;
  min-width: 28px !important;
  z-index: 52 !important;
}

.mi-chat-sidebar-rail {
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 28px !important;
  min-width: 28px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  gap: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #eef2f6 !important;
  box-shadow: none !important;
}

.mi-chat-sidebar-toggle,
.mi-chat-rail-new {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.08) !important;
}

.mi-chat-sidebar-toggle span {
  width: 10px !important;
  height: 1.8px !important;
}

/* Real visible drawer */
.mi-chat-sidebar-panel {
  position: absolute !important;
  left: 28px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: calc(100vw - 40px) !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transform: translateX(-10px) !important;
  transition: width .18s ease, min-width .18s ease, opacity .16s ease, transform .16s ease !important;
  border-radius: 0 16px 16px 0 !important;
  z-index: 60 !important;
  pointer-events: none !important;
}

.mi-chat-sidebar.is-open .mi-chat-sidebar-panel {
  width: min(286px, calc(100vw - 40px)) !important;
  min-width: min(286px, calc(100vw - 40px)) !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

/* Main MI area uses nearly all available space */
.mi-chat-main {
  margin-left: 28px !important;
  width: calc(100% - 28px) !important;
  min-width: 0 !important;
  height: calc(100vh - 112px) !important;
  min-height: calc(100vh - 112px) !important;
  flex: 1 1 auto !important;
}

.mi-chat-main .chat-surface {
  width: 100% !important;
  max-width: none !important;
  height: calc(100vh - 112px) !important;
  min-height: calc(100vh - 112px) !important;
  border-radius: 0 0 16px 16px !important;
  padding: 4px 8px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.mi-chat-main .chat-thread {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Pull content left; remove waste */
.mi-chat-main .message-row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.mi-chat-main .message-row.assistant .message-bubble {
  margin-left: 4px !important;
}
.mi-chat-main .message-row.user .message-bubble {
  margin-right: 4px !important;
}

.mi-chat-main .composer-card-final {
  margin-top: 6px !important;
  margin-bottom: 0 !important;
}
.mi-chat-main .composer-hint-row {
  padding-left: 2px !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Empty state uses the full tab height */
.mi-chat-main.is-empty-session .chat-surface {
  height: calc(100vh - 112px) !important;
  min-height: calc(100vh - 112px) !important;
}
.mi-chat-main.is-empty-session .chat-thread {
  min-height: calc(100vh - 230px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Subtler overlay while drawer open */
.mi-chat-sidebar-overlay {
  background: rgba(248,250,252,0.28) !important;
  backdrop-filter: blur(1px) !important;
  border-radius: 0 0 16px 16px !important;
}

@media (max-width: 420px) {
  #panel-chat,
  .mi-chat-workspace,
  .mi-chat-main,
  .mi-chat-main .chat-surface {
    height: calc(100vh - 108px) !important;
    min-height: calc(100vh - 108px) !important;
  }
  .mi-chat-sidebar,
  .mi-chat-sidebar-rail {
    width: 26px !important;
    min-width: 26px !important;
  }
  .mi-chat-sidebar-panel {
    left: 26px !important;
  }
  .mi-chat-sidebar.is-open .mi-chat-sidebar-panel {
    width: min(238px, calc(100vw - 32px)) !important;
    min-width: min(238px, calc(100vw - 32px)) !important;
  }
  .mi-chat-main {
    margin-left: 26px !important;
    width: calc(100% - 26px) !important;
  }
}


/* =========================
   v110 stretch MI to bottom
   ========================= */

/* Let the MI tab consume the full visible panel height */
.panel,
#panel-chat,
.mi-chat-workspace,
.mi-chat-main,
.mi-chat-main .chat-surface {
  height: 100% !important;
  min-height: 100% !important;
}

.tabs-shell,
.panels,
main,
.app-main,
.app,
body,
html {
  min-height: 100vh !important;
}

/* Calculate from the actual viewport and keep the composer pinned low */
#panel-chat {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - 106px) !important;
  min-height: calc(100vh - 106px) !important;
}

.mi-chat-workspace {
  flex: 1 1 auto !important;
  height: calc(100vh - 106px) !important;
  min-height: calc(100vh - 106px) !important;
}

.mi-chat-main {
  height: calc(100vh - 106px) !important;
  min-height: calc(100vh - 106px) !important;
}

.mi-chat-main .chat-surface {
  height: calc(100vh - 106px) !important;
  min-height: calc(100vh - 106px) !important;
  justify-content: flex-end !important;
}

.mi-chat-main .chat-thread {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Keep the composer attached to the bottom edge */
.mi-chat-main .composer-card-final {
  margin-top: auto !important;
}

.mi-chat-main .composer-hint-row {
  margin-top: 2px !important;
}

/* Empty state still uses the full available height */
.mi-chat-main.is-empty-session .chat-thread {
  min-height: calc(100vh - 220px) !important;
}

@media (max-width: 420px) {
  #panel-chat,
  .mi-chat-workspace,
  .mi-chat-main,
  .mi-chat-main .chat-surface {
    height: calc(100vh - 102px) !important;
    min-height: calc(100vh - 102px) !important;
  }

  .mi-chat-main.is-empty-session .chat-thread {
    min-height: calc(100vh - 214px) !important;
  }
}


/* =========================
   v111 drawer list UX + scope toggle
   ========================= */
.mi-chat-sidebar-header {
  gap: 10px !important;
}

.mi-chat-sidebar-subtitle {
  max-width: 170px !important;
}

.mi-new-chat-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
}
.mi-new-chat-btn svg {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.mi-chat-scope-toggle {
  display: inline-flex !important;
  align-items: center !important;
  margin-top: 4px !important;
  cursor: pointer !important;
}
.mi-chat-scope-toggle input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.mi-chat-scope-toggle-ui {
  position: relative !important;
  display: inline-grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: center !important;
  width: 156px !important;
  min-height: 30px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.92) !important;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,0.07) !important;
}
.mi-chat-scope-toggle-ui::before {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: calc(50% - 3px) !important;
  height: calc(100% - 6px) !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 1px 3px rgba(16,24,40,0.08), inset 0 0 0 1px rgba(24,73,169,0.10) !important;
  transition: transform .16s ease !important;
}
.mi-chat-scope-toggle input:checked + .mi-chat-scope-toggle-ui::before {
  transform: translateX(100%) !important;
}
.mi-chat-scope-label {
  position: relative !important;
  z-index: 1 !important;
  text-align: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #667085 !important;
  user-select: none !important;
}
.mi-chat-scope-toggle input:not(:checked) + .mi-chat-scope-toggle-ui .mi-chat-scope-label-thread,
.mi-chat-scope-toggle input:checked + .mi-chat-scope-toggle-ui .mi-chat-scope-label-all {
  color: #1849a9 !important;
}

/* Do not stretch a single chat card to fill the drawer */
.mi-chat-list {
  align-content: start !important;
  align-items: start !important;
  grid-auto-rows: max-content !important;
}
.mi-chat-item {
  align-self: start !important;
  height: auto !important;
  min-height: 76px !important;
  max-height: 104px !important;
}
.mi-chat-item-title {
  min-height: 18px !important;
  max-height: 38px !important;
}
.mi-chat-item-meta {
  margin-top: auto !important;
}


/* =========================
   v112 MI panel visibility + drawer header fix
   ========================= */

/* Hard-stop the MI panel from affecting non-MI tabs */
#panel-chat:not(.is-active) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

#panel-chat.is-active {
  display: block !important;
}

/* Keep MI drawer only within active MI tab */
#panel-chat:not(.is-active) .mi-chat-sidebar,
#panel-chat:not(.is-active) .mi-chat-workspace,
#panel-chat:not(.is-active) .mi-chat-main {
  display: none !important;
}

/* Fix New chat button overlapping the subtitle */
.mi-chat-sidebar-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  column-gap: 10px !important;
  row-gap: 8px !important;
}

.mi-chat-sidebar-heading {
  min-width: 0 !important;
  padding-right: 6px !important;
}

.mi-chat-sidebar-title {
  line-height: 1.15 !important;
}

.mi-chat-sidebar-subtitle {
  max-width: none !important;
  padding-right: 0 !important;
}

.mi-new-chat-btn {
  align-self: start !important;
  white-space: nowrap !important;
  margin-top: 0 !important;
  min-width: 96px !important;
  justify-content: center !important;
}

/* Give the toggle row a bit more breathing room below the header */
.mi-chat-scope-toggle {
  margin-top: 6px !important;
}

/* Ensure the drawer content starts at natural height */
.mi-chat-list {
  align-content: start !important;
}


/* =========================
   v113 compact new-chat CTA
   ========================= */
.mi-chat-sidebar-header {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
}

.mi-new-chat-btn {
  min-width: 34px !important;
  width: 34px !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  transition: width .16s ease, min-width .16s ease, padding .16s ease, gap .16s ease !important;
}

.mi-new-chat-btn span {
  display: inline-block !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  transition: max-width .16s ease, opacity .12s ease !important;
}

.mi-new-chat-btn:hover,
.mi-new-chat-btn:focus-visible {
  width: 104px !important;
  min-width: 104px !important;
  padding: 0 12px !important;
  gap: 6px !important;
}

.mi-new-chat-btn:hover span,
.mi-new-chat-btn:focus-visible span {
  max-width: 64px !important;
  opacity: 1 !important;
}

.mi-new-chat-btn svg {
  flex: 0 0 auto !important;
}

.mi-chat-sidebar-subtitle {
  padding-right: 8px !important;
}


/* =========================
   v114 new-chat hover actually compact + fill remaining height
   ========================= */

/* Make the button truly compact by default */
.mi-new-chat-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  transition: width .18s ease, max-width .18s ease, padding .18s ease, gap .18s ease !important;
}

.mi-new-chat-btn .mi-new-chat-label {
  display: inline-block !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  transition: max-width .18s ease, opacity .14s ease !important;
}

.mi-new-chat-btn:hover,
.mi-new-chat-btn:focus-visible {
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  padding: 0 12px !important;
  gap: 6px !important;
  justify-content: flex-start !important;
}

.mi-new-chat-btn:hover .mi-new-chat-label,
.mi-new-chat-btn:focus-visible .mi-new-chat-label {
  max-width: 64px !important;
  opacity: 1 !important;
}

.mi-new-chat-btn svg {
  flex: 0 0 auto !important;
}

/* Let the MI content truly use the remaining vertical space */
#panel-chat,
.mi-chat-workspace,
.mi-chat-main,
.mi-chat-main .chat-surface {
  height: calc(100vh - 96px) !important;
  min-height: calc(100vh - 96px) !important;
}

.mi-chat-main .chat-surface {
  display: flex !important;
  flex-direction: column !important;
}

.mi-chat-main .chat-thread {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

.mi-chat-main .composer-card-final {
  margin-top: auto !important;
}

.mi-chat-main .composer-hint-row {
  margin-bottom: 0 !important;
  padding-bottom: 2px !important;
}

/* Empty state still fills remaining space */
.mi-chat-main.is-empty-session .chat-thread {
  min-height: calc(100vh - 210px) !important;
}

@media (max-width: 420px) {
  #panel-chat,
  .mi-chat-workspace,
  .mi-chat-main,
  .mi-chat-main .chat-surface {
    height: calc(100vh - 92px) !important;
    min-height: calc(100vh - 92px) !important;
  }
}


/* =========================
   v115 eliminate residual bottom gap
   ========================= */

/* Force the MI tab to consume the full visible area below the tabs */
#panel-chat {
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  height: calc(100vh - 74px) !important;
  min-height: calc(100vh - 74px) !important;
  max-height: calc(100vh - 74px) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.mi-chat-workspace {
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.mi-chat-main {
  box-sizing: border-box !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
}

.mi-chat-main .chat-surface {
  box-sizing: border-box !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  padding-bottom: 6px !important;
}

.mi-chat-main .chat-thread {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

.mi-chat-main .composer-card-final {
  margin-top: auto !important;
  flex: 0 0 auto !important;
}

.mi-chat-main .composer-hint-row {
  flex: 0 0 auto !important;
  margin-top: 2px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* keep empty state aligned while still filling */
.mi-chat-main.is-empty-session .chat-thread {
  min-height: 0 !important;
  height: auto !important;
}

@media (max-width: 420px) {
  #panel-chat {
    height: calc(100vh - 70px) !important;
    min-height: calc(100vh - 70px) !important;
    max-height: calc(100vh - 70px) !important;
  }
}


/* =========================
   v116 query-param embed mode
   ========================= */
body.embed-mode {
  background: #f7f9fc !important;
}

body.embed-mode .brandbar,
body.embed-mode .topbar,
body.embed-mode .header,
body.embed-mode .app-header,
body.embed-mode .tabbar:not(.tabbar.tabbar-3):not(.tabbar.tabbar-4),
body.embed-mode .tabs-header {
  display: none !important;
}

body.embed-mode .tabbar {
  display: none !important;
}

body.embed-mode #panel-cases,
body.embed-mode #panel-actions,
body.embed-mode #panel-sentiment,
body.embed-mode #panel-summary,
body.embed-mode #panel-case,
body.embed-mode #panel-details {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.embed-mode #panel-chat {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

body.embed-mode .mi-chat-workspace,
body.embed-mode .mi-chat-main,
body.embed-mode .mi-chat-main .chat-surface {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

body.embed-mode .mi-chat-sidebar {
  display: none !important;
}

body.embed-mode .mi-chat-main {
  margin-left: 0 !important;
  width: 100% !important;
}

body.embed-mode .mi-chat-main .chat-surface {
  border-radius: 0 !important;
  padding: 10px 12px 8px !important;
}

body.embed-mode .mi-chat-main .chat-thread {
  padding: 0 !important;
}

body.embed-mode .composer-card-final {
  margin-top: auto !important;
}

body.embed-mode .composer-hint-row {
  padding-left: 2px !important;
  margin-bottom: 0 !important;
}

body.embed-mode .sentiment-panel,
body.embed-mode .analysis-panel,
body.embed-mode .related-cases,
body.embed-mode .case-summary-card {
  display: none !important;
}

/* Optional MI-only no-office fallback state */
body.embed-mode.embed-standalone .status-dot,
body.embed-mode.embed-standalone .status-pill {
  display: none !important;
}


/* =========================
   v117 embed mode with MI sidebar
   ========================= */
body.embed-mode #panel-chat .mi-chat-sidebar {
  display: block !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 30px !important;
  min-width: 30px !important;
}

body.embed-mode #panel-chat .mi-chat-workspace {
  height: 100vh !important;
  min-height: 100vh !important;
}

body.embed-mode #panel-chat .mi-chat-sidebar-rail {
  width: 30px !important;
  min-width: 30px !important;
  height: 100% !important;
  border-radius: 0 !important;
  background: #eef2f7 !important;
  box-shadow: none !important;
}

body.embed-mode #panel-chat .mi-chat-sidebar-panel {
  left: 30px !important;
  top: 0 !important;
  bottom: 0 !important;
}

body.embed-mode #panel-chat .mi-chat-sidebar.is-open .mi-chat-sidebar-panel,
body.embed-mode #panel-chat .mi-chat-sidebar:not(.is-collapsed) .mi-chat-sidebar-panel {
  width: min(286px, calc(100vw - 42px)) !important;
  min-width: min(286px, calc(100vw - 42px)) !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

body.embed-mode #panel-chat .mi-chat-main {
  margin-left: 30px !important;
  width: calc(100% - 30px) !important;
  height: 100vh !important;
  min-height: 100vh !important;
}

body.embed-mode #panel-chat .mi-chat-main .chat-surface {
  height: 100vh !important;
  min-height: 100vh !important;
  border-radius: 0 !important;
  padding-top: 8px !important;
}

body.embed-mode .mi-chat-scope-toggle {
  display: none !important;
}

body.embed-mode .mi-chat-item {
  min-height: 72px !important;
  max-height: 96px !important;
}

body.embed-mode .mi-chat-sidebar-overlay {
  display: none !important;
}


/* =========================
   v120 clickable URLs in chat
   ========================= */
.message-bubble a {
  color: #1849a9 !important;
  text-decoration: underline !important;
  word-break: break-word !important;
}

body.embed-mode .mi-chat-sidebar {
  display: block !important;
}


/* =========================
   v121 URL readability + table links
   ========================= */

/* Ensure links are clickable/readable everywhere */
.message-bubble a,
.message-table a,
.message-paragraph a,
.message-list a {
  text-decoration: underline !important;
  cursor: pointer !important;
  word-break: break-word !important;
}

/* Assistant/default links */
.message-row.assistant .message-bubble a,
.message-row:not(.user) .message-bubble a,
.message-table a {
  color: #1849a9 !important;
}

/* User bubble links need contrast against blue bubble */
.message-row.user .message-bubble a {
  color: #ffffff !important;
  text-decoration-color: rgba(255,255,255,0.85) !important;
}

/* Table cells with long URLs */
.message-table td a,
.message-table th a {
  display: inline !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}


/* =========================
   v122 table links direct anchors
   ========================= */
.message-table td a,
.message-table th a {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
}


/* =========================
   v123 status light and table links
   ========================= */
.tabbar,
.tabbar-sentiment-real,
.tabbar-sentiment,
.tabbar-merged-safe {
  overflow: visible !important;
  padding-left: 16px !important;
}

.status-mini-shell {
  width: 16px !important;
  min-width: 16px !important;
  overflow: visible !important;
}

.status-mini-shell #status,
.status-dot {
  box-shadow: 0 0 0 3px rgba(152, 162, 179, 0.12) !important;
}
.status-dot.is-success,
.status-mini-shell #status.is-success {
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12) !important;
}
.status-dot.is-error,
.status-mini-shell #status.is-error {
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12) !important;
}

.message-table td a,
.message-table th a {
  color: #1849a9 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 2 !important;
}


/* v25 logo safe area */
.topbar-brand-logo,
.brand-logo,
.brand-logo-full,
img[src*="icon-"],
img[src*="benivo-mi-logo"],
img[src*="Full logo blue"],
img[src*="Icon blue"] {
  border-radius: 0 !important;
  object-fit: contain !important;
  overflow: visible !important;
  clip-path: none !important;
}


.message-chart-svg-wrap {
  width: 100%;
  height: 100%;
}

.message-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}


/* v30 Teams/Outlook HTML chart fallback */
.message-chart-html {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 2px 2px 0;
}
.message-chart-html-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 2px;
}
.message-chart-html-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475467;
}
.message-chart-html-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 10px;
}
.message-chart-html-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-chart-html-row {
  display: grid;
  grid-template-columns: minmax(84px, 132px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.message-chart-html-label {
  font-size: 11px;
  line-height: 1.25;
  color: #344054;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-chart-html-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.message-chart-html-bar-track {
  position: relative;
  width: 100%;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}
.message-chart-html-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 2px;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.message-chart-html-bar.is-small {
  justify-content: flex-start;
  padding-left: 6px;
}
.message-chart-html-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  color: #667085;
  background: #f8fafc;
  border-radius: 12px;
}
.message-chart-block.is-unavailable .message-chart-html-wrap {
  display: block;
}
.message-chart-html-wrap {
  display: none;
  width: 100%;
  height: 100%;
}
.message-chart-block.is-unavailable .message-chart-fallback {
  display: none !important;
}


/* v3.5.7 chart type controls */
.message-chart-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.message-table-chart-menu {
  appearance: none;
  border: 1px solid #d9e3ff;
  border-left: 0;
  background: #f7fbff;
  color: #255fd6;
  border-radius: 0 999px 999px 0;
  font-size: 10px;
  line-height: 1;
  padding: 5px 8px 5px 7px;
}
.message-chart-selector .message-table-chart {
  border-radius: 999px 0 0 999px;
}
.message-chart-selector.is-open .message-table-chart,
.message-chart-selector.is-open .message-table-chart-menu,
.message-table-chart-menu:hover {
  background: #f1f6ff;
}
.message-chart-type-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 156px;
  padding: 6px;
  border: 1px solid #d9e3ff;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(18,49,97,0.14);
  gap: 6px;
}
.message-chart-selector.is-open .message-chart-type-menu {
  display: grid;
}
.message-chart-type-option,
.message-chart-type-button {
  appearance: none;
  border: 1px solid #d9e3ff;
  background: #fff;
  color: #255fd6;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 6px 9px;
  cursor: pointer;
  text-align: center;
}
.message-chart-type-option:hover,
.message-chart-type-button:hover {
  background: #f5f8ff;
}
.message-chart-type-option.is-active,
.message-chart-type-button.is-active {
  background: #255fd6;
  border-color: #255fd6;
  color: #fff;
}
.message-chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.message-chart-actions-label {
  font-size: 10px;
  font-weight: 700;
  color: #667085;
}
.message-chart-type-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.message-chart-actions-inline {
  justify-content: space-between;
  align-items: flex-start;
}
.message-table-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.message-table-inline-chart .message-chart-canvas-wrap {
  margin-top: 0;
}


/* v3.5.9 AI chart prompt controls */
.message-table-ai,
.message-ai-generate,
.message-ai-cancel,
.message-ai-suggestion,
.message-ai-prompt-pill {
  appearance: none;
  border: 1px solid #d9e3ff;
  background: #fff;
  color: #255fd6;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 6px 10px;
}
.message-table-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #fff8ff 0%, #f5f8ff 100%);
  color: #5b3fd0;
  border-color: #ddd7ff;
}
.message-table-ai:hover,
.message-ai-generate:hover,
.message-ai-cancel:hover,
.message-ai-suggestion:hover {
  background: #f6f8ff;
}
.message-ai-icon {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: currentColor;
  flex: 0 0 auto;
}
.message-ai-label {
  font-weight: 700;
}
.message-ai-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dfe7ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-ai-panel-header {
  font-size: 11px;
  font-weight: 800;
  color: #123161;
}
.message-ai-input {
  width: 100%;
  resize: vertical;
  min-height: 68px;
  border: 1px solid #d9e3ff;
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  font-size: 12px;
  color: #102a52;
  background: #fff;
  outline: none;
}
.message-ai-input:focus {
  border-color: #6f6ffb;
  box-shadow: 0 0 0 3px rgba(111,111,251,0.12);
}
.message-ai-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.message-ai-suggestion {
  cursor: pointer;
  white-space: nowrap;
}
.message-ai-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.message-ai-generate {
  cursor: pointer;
  background: #255fd6;
  border-color: #255fd6;
  color: #fff;
  font-weight: 700;
}
.message-ai-cancel {
}
.message-ai-status {
  min-height: 16px;
  font-size: 10px;
  color: #667085;
}
.message-ai-status.is-error {
  color: #b42318;
}
.message-ai-panel.is-loading {
  opacity: 0.84;
}
.message-ai-panel.is-loading .message-ai-status {
  color: #255fd6;
}
.message-ai-prompt-pill {
  display: inline-flex;
  align-items: center;
  max-width: 280px;
  background: #f8faff;
  color: #3a4f7a;
  border-color: #e0e8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-chart-ai-image-wrap {
  border: 1px solid #dfe7ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  overflow: hidden;
}
.message-chart-ai-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.message-chart-ai-media {
  margin-top: 0;
}
@media (max-width: 640px) {
  .message-ai-suggestions {
    flex-direction: column;
  }
  .message-ai-suggestion,
  .message-ai-prompt-pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
  }
}


.message-chart-debug-toggle,
.message-chart-debug-copy {
  appearance: none;
  border: 1px solid #d9e3ff;
  background: #fff;
  color: #255fd6;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 6px 10px;
}
.message-chart-debug-toggle:hover,
.message-chart-debug-copy:hover {
  background: #f5f8ff;
}
.message-chart-debug-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #d8e4ff;
  border-radius: 14px;
  background: #fbfcff;
}
.message-chart-debug-panel.is-hidden {
  display: none;
}
.message-chart-debug-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.message-chart-debug-title {
  font-size: 11px;
  font-weight: 800;
  color: #123161;
}
.message-chart-debug-log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 10px;
  line-height: 1.45;
  color: #3a4f7a;
  max-height: 180px;
  overflow: auto;
}

.trip-assessment-block {
  display: block;
  border: 1px solid #e6ecf5;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.trip-assessment-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.trip-assessment-toggle-copy {
  min-width: 0;
}
.trip-assessment-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}
.trip-assessment-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trip-assessment-heading {
  font-size: 22px;
  font-weight: 800;
  color: #122b5b;
}
.trip-assessment-subheading {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}
.trip-assessment-toggle-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e4ff;
  background: #f8fbff;
  color: #2956cc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.trip-assessment-toggle-pill:hover {
  background: #eef4ff;
}
.trip-assessment-block.is-details-collapsed .trip-assessment-detail {
  display: none;
}
.trip-assessment-block.is-details-collapsed .trip-assessment-header {
  display: none;
}
.trip-assessment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trip-assessment-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}
.trip-assessment-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex: 0 0 36px;
}
.trip-assessment-item.is-ok .trip-assessment-icon {
  background: #e8f8f3;
  color: #12b886;
}
.trip-assessment-item.is-risk .trip-assessment-icon {
  background: #fff1f2;
  color: #ef4444;
}
.trip-assessment-content {
  flex: 1;
  min-width: 0;
}
.trip-assessment-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.trip-assessment-row-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.trip-assessment-name {
  font-size: 16px;
  font-weight: 700;
  color: #122b5b;
}
.trip-assessment-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  border: 1px solid #fecdd3;
  font-size: 12px;
  font-weight: 700;
}
.trip-assessment-badge.is-ok {
  background: #effaf5;
  color: #0f9f75;
  border-color: #c9f0df;
}
.trip-assessment-summary {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
.trip-assessment-detail {
  margin-top: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e6ecf5;
  padding: 12px 14px;
}
.trip-assessment-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: #122b5b;
}
.trip-assessment-detail-list {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.trip-assessment-detail-list li + li {
  margin-top: 4px;
}


/* =========================
   v59 MI starter experience
   ========================= */
.mi-chat-main.is-empty-session .chat-thread.has-starter-surface {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 8px 6px 0 !important;
}
.mi-chat-main.is-empty-session .chat-thread.has-starter-surface::before {
  content: none !important;
  display: none !important;
}
.mi-chat-main.is-empty-session .chat-thread.has-starter-surface > * {
  display: block !important;
}

.mi-starter {
  width: min(100%, 1040px);
  margin: 8px auto 0;
  padding: 4px 4px 18px;
}

.mi-starter-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 24px 24px 22px;
  border: 1px solid rgba(167, 188, 235, 0.46);
  background:
    radial-gradient(circle at top right, rgba(70, 104, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(43, 198, 255, 0.12), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}
.mi-starter-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), transparent 42%);
  pointer-events: none;
}
.mi-starter-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow: inset 0 0 0 1px rgba(123, 145, 201, 0.22);
  color: #3551d1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mi-starter-hero h3 {
  position: relative;
  z-index: 1;
  margin: 14px 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #0f172a;
}
.mi-starter-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 760px;
  color: #526070;
  font-size: 14px;
  line-height: 1.65;
}
.mi-starter-mini-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.mi-starter-mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #3551d1;
  border: 1px solid rgba(141, 168, 231, 0.26);
  font-size: 12px;
  font-weight: 700;
}
.mi-starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.mi-starter-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(170, 188, 232, 0.44);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-radius: 22px;
  padding: 18px 18px 17px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.mi-starter-card:hover,
.mi-starter-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(76, 108, 220, 0.42);
  box-shadow: 0 18px 32px rgba(53, 81, 209, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  outline: none;
}
.mi-starter-card.is-featured {
  background:
    radial-gradient(circle at top right, rgba(63, 120, 255, 0.10), transparent 44%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
}
.mi-starter-card strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: -0.025em;
}
.mi-starter-card span:last-child {
  display: block;
  margin-top: 10px;
  color: #5f6f82;
  font-size: 13px;
  line-height: 1.55;
}
.mi-starter-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.mi-starter-pill-analytics { background: #e6f0ff; color: #1d4ed8; }
.mi-starter-pill-operations { background: #ebf7ef; color: #15803d; }
.mi-starter-pill-compliance { background: #fff0f0; color: #dc2626; }
.mi-starter-pill-cost-savings { background: #fff6e8; color: #c26b00; }
.mi-starter-pill-industry { background: #f1ecff; color: #6d28d9; }
.mi-starter-pill-policy { background: #eef5ff; color: #3551d1; }
.mi-starter-pill-platform { background: #eef7ff; color: #0f6bb3; }
.mi-starter-pill-default { background: #f3f4f6; color: #475467; }

@media (max-width: 980px) {
  .mi-starter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .mi-starter {
    padding-inline: 0;
  }
  .mi-starter-hero {
    padding: 20px 18px 18px;
    border-radius: 20px;
  }
  .mi-starter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mi-starter-card {
    border-radius: 18px;
  }
}


/* v72: always-visible reassurance under MI is thinking; message text rotates every 10s. */
.message-row.is-typing .typing-copy { display:flex !important; flex-direction:column !important; gap:4px !important; }
.message-row.is-typing .typing-note {
  display:block !important; visibility:visible !important; opacity:1 !important; max-height:none !important; overflow:visible !important;
  margin-top:2px !important; color:#6b7280 !important; font-size:12px !important; line-height:1.45 !important; max-width:340px !important; white-space:normal !important;
}


/* v74: cache-busted typing reassurance. The note is inside the same DOM node as "MI is thinking". */
.message-row.is-typing[data-build="v74-reassurance-cache-bust"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}
.message-row.is-typing[data-build="v74-reassurance-cache-bust"] .typing-inline {
  display: inline-flex !important;
  align-items: flex-start !important;
}
.message-row.is-typing[data-build="v74-reassurance-cache-bust"] .typing-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.message-row.is-typing[data-build="v74-reassurance-cache-bust"] .typing-note {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 2px 0 0 0 !important;
  padding: 0 !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  max-width: 340px !important;
  white-space: normal !important;
}


/* v75: robust long-wait reassurance. The visible label itself changes after 10s. */
.message-row.is-typing[data-build="v75-inline-label-reassurance"] .typing-main {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.message-row.is-typing[data-build="v75-inline-label-reassurance"] .typing-label {
  display: inline !important;
  white-space: normal !important;
  max-width: 330px !important;
  color: #1849a9 !important;
}
.message-row.is-typing[data-build="v75-inline-label-reassurance"] .typing-note {
  display: none !important;
}


/* v77: long-wait message is a subtle grey second line under the unchanged typing label. */
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  margin: 4px 0 10px !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-inline {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 2px 0 !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-main {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-label {
  display: inline !important;
  color: #1849a9 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-note {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 2px 0 0 0 !important;
  padding: 0 !important;
  color: #8a94a6 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  max-width: 340px !important;
  white-space: normal !important;
}
.message-row.is-typing[data-build="v77-subtle-grey-reassurance"] .typing-note[hidden] {
  display: none !important;
}


/* v83 FINAL typing reassurance layout */
.message-row.is-typing .typing-inline {
  display: inline-flex !important;
  align-items: flex-start !important;
  padding: 2px 0 !important;
}
.message-row.is-typing .typing-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 2px !important;
}
.message-row.is-typing .typing-main {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}
.message-row.is-typing .typing-label {
  color: #1849a9 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}
.message-row.is-typing .typing-note {
  display: block !important;
  margin-top: 2px !important;
  padding: 0 !important;
  color: #8a94a6 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  max-width: 340px !important;
  white-space: normal !important;
}
.message-row.is-typing .typing-note[hidden] { display: none !important; }


/* v86: Teams typing reassurance as a subtle grey second line under the unchanged typing label. */
.message-row.is-typing[data-build="v86-teams-grey-second-line"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  margin: 4px 0 10px !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-inline {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 2px 0 !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 2px !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-main {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-label {
  display: inline !important;
  color: #1849a9 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  max-width: none !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-note {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 2px 0 0 0 !important;
  padding: 0 !important;
  color: #8a94a6 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  max-width: 340px !important;
  white-space: normal !important;
}
.message-row.is-typing[data-build="v86-teams-grey-second-line"] .typing-note[hidden] {
  display: none !important;
}


/* =========================
   v87 MI chat drawer actions
   Shows the 3-dot remove menu in Outlook and prevents card overflow.
   ========================= */
#miChatList.mi-chat-list {
  overflow-x: hidden !important;
  padding-right: 8px !important;
  box-sizing: border-box !important;
}
#miChatList .mi-chat-item-row {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 30px !important;
  gap: 6px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
#miChatList .mi-chat-item-row > .mi-chat-item {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
#miChatList .mi-chat-item-title,
#miChatList .mi-chat-item-meta {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#miChatList .mi-chat-item-actions {
  position: relative !important;
  z-index: 5 !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  padding-top: 7px !important;
  display: flex !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
#miChatList .mi-chat-item-menu-trigger {
  appearance: none !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: #ffffff !important;
  color: #475467 !important;
  border-radius: 999px !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
#miChatList .mi-chat-item-menu-trigger:hover,
#miChatList .mi-chat-item-menu-trigger:focus-visible {
  background: #eef4ff !important;
  color: #1849a9 !important;
}
#miChatList .mi-chat-item-menu {
  position: absolute !important;
  top: 36px !important;
  right: 0 !important;
  min-width: 128px !important;
  padding: 6px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  background: #ffffff !important;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14) !important;
  display: none !important;
  z-index: 80 !important;
}
#miChatList .mi-chat-item-menu.is-open {
  display: block !important;
}
#miChatList .mi-chat-item-menu-button {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  padding: 9px 10px !important;
  border-radius: 10px !important;
  text-align: left !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  cursor: pointer !important;
}
#miChatList .mi-chat-item-menu-button:hover,
#miChatList .mi-chat-item-menu-button:focus-visible {
  background: #fff1f2 !important;
  color: #b42318 !important;
}


/* v88: starter prompt cards must disappear as soon as a real chat message is present. */
.chat-thread:not(.has-starter-surface) > .mi-starter,
.chat-thread:has(.message-row) > .mi-starter {
  display: none !important;
}


/* v92 numbered-list rendering fix */
.message-bubble .message-numbered-list {
  margin: 8px 0 !important;
  padding-left: 22px !important;
  white-space: normal !important;
}
.message-bubble .message-numbered-list li {
  margin: 0 0 8px 0 !important;
  padding-left: 2px !important;
  white-space: normal !important;
}
.message-bubble .message-numbered-list li:last-child {
  margin-bottom: 0 !important;
}


.cost-estimation-block {
  border: 1px solid rgba(31, 87, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.cost-estimation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cost-estimation-eyebrow {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #175cd3;
  margin-bottom: 8px;
}

.cost-estimation-total-label {
  font-size: 13px;
  font-weight: 650;
  color: #475467;
  margin-bottom: 4px;
}

.cost-estimation-total {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #101828;
}

.cost-estimation-breakdown {
  margin-top: 16px;
  border-top: 1px solid rgba(31, 87, 255, 0.14);
}

.cost-estimation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(31, 87, 255, 0.10);
}

.cost-estimation-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cost-estimation-row-label {
  min-width: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.cost-estimation-row-value {
  color: #101828;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.cost-estimation-empty {
  padding-top: 12px;
  color: #667085;
  font-size: 13px;
}


/* v107 environment indicator */
.benivo-mi-env-badge {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 2147483647;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.benivo-mi-env-development {
  background: #d97706;
}

.benivo-mi-env-production {
  background: rgba(18, 183, 106, 0.82);
}

.benivo-mi-env-local {
  background: #7c3aed;
}

.benivo-mi-env-unknown {
  background: #b42318;
}
