.ask-rich-response {
  --ask-rich-bg: var(--panel, var(--surface, #fff));
  --ask-rich-soft: var(--surface-subtle, #f7f8fa);
  --ask-rich-border: var(--border, #dfe3e8);
  --ask-rich-text: var(--text, #18212f);
  --ask-rich-muted: var(--text-muted, #667085);
  display: grid;
  gap: 12px;
  color: var(--ask-rich-text);
}

.ask-rich-response__header h3,
.ask-rich-block h4 {
  margin: 0;
  color: inherit;
}

.ask-rich-response__header p,
.ask-rich-definitions p {
  margin: 4px 0 0;
  color: var(--ask-rich-muted);
  font-size: 0.82rem;
}

.ask-rich-blocks {
  display: grid;
  gap: 10px;
}

.ask-rich-layout--two_column_desktop .ask-rich-blocks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ask-rich-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ask-rich-border);
  border-radius: var(--radius-lg, 10px);
  background: var(--ask-rich-bg);
}

.ask-rich-status--attention,
.ask-rich-status--warning {
  border-inline-start: 4px solid var(--warning, #b7791f);
}

.ask-rich-status--critical {
  border-inline-start: 4px solid var(--danger, #c53030);
}

.ask-rich-status--positive {
  border-inline-start: 4px solid var(--success, #2f855a);
}

.ask-rich-status--restricted {
  border-style: dashed;
  color: var(--ask-rich-muted);
}

.ask-rich-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ask-rich-metric {
  min-width: 0;
  padding: 9px;
  border-radius: var(--radius-md, 8px);
  background: var(--ask-rich-soft);
}

.ask-rich-metric__value,
.ask-rich-metric__label {
  display: block;
  overflow-wrap: anywhere;
}

.ask-rich-metric__value {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.ask-rich-metric__label {
  margin-top: 2px;
  color: var(--ask-rich-muted);
  font-size: 0.76rem;
}

.ask-rich-entity__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ask-rich-entity__head p {
  margin: 2px 0 0;
  color: var(--ask-rich-muted);
}

.ask-rich-facts {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}

.ask-rich-facts > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.4fr);
  gap: 8px;
}

.ask-rich-facts dt {
  color: var(--ask-rich-muted);
  font-size: 0.78rem;
}

.ask-rich-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ask-rich-list,
.ask-rich-sources ul {
  margin: 9px 0 0;
  padding-inline-start: 20px;
}

.ask-rich-list li {
  margin: 5px 0;
}

.ask-rich-entity-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.ask-rich-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.ask-rich-action {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--ask-rich-border);
  border-radius: var(--radius-md, 8px);
  background: var(--ask-rich-soft);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.ask-rich-action:hover,
.ask-rich-action:focus-visible {
  border-color: var(--primary, #2563eb);
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 24%, transparent);
}

.ask-rich-confidence {
  margin: 8px 0;
}

.ask-rich-draft__badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ask-rich-soft);
  color: var(--ask-rich-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ask-rich-draft__preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.ask-rich-sources {
  border-top: 1px solid var(--ask-rich-border);
  padding-top: 8px;
  color: var(--ask-rich-muted);
}

.ask-rich-sources summary {
  min-height: 40px;
  cursor: pointer;
  font-weight: 650;
}

.ask-rich-sources li span,
.ask-rich-sources li small {
  display: block;
}

.ask-rich-source-item {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid var(--ask-rich-border);
}

.ask-rich-source-item:first-child {
  border-top: 0;
}

.ask-rich-source-type {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ask-rich-accent, #6366f1) 12%, transparent);
  color: var(--ask-rich-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ask-rich-source-detail {
  color: var(--ask-rich-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ask-rich-divider {
  border: 0;
  border-top: 1px solid var(--ask-rich-border);
}

.ask-rich-contact-card__hero,
.ask-rich-deal-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ask-rich-descriptor,
.ask-rich-entity__company {
  margin: 4px 0 0;
  color: var(--ask-rich-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.ask-rich-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ask-rich-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ask-rich-badge small {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.82;
  text-transform: lowercase;
}

.ask-rich-badge--role {
  align-self: flex-start;
  margin-top: 2px;
  border-radius: 8px;
  font-weight: 650;
}

.ask-rich-deal-card__aside {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.ask-rich-score-row {
  display: flex;
  gap: 6px;
}

.ask-rich-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ask-rich-score--health {
  background: color-mix(in srgb, var(--success, #2f855a) 14%, var(--ask-rich-soft));
  color: var(--success, #2f855a);
}

.ask-rich-score--priority {
  background: color-mix(in srgb, var(--primary, #2563eb) 14%, var(--ask-rich-soft));
  color: var(--primary, #2563eb);
}

.ask-rich-action--deal-doctor {
  border-color: color-mix(in srgb, #7c3aed 35%, var(--ask-rich-border));
  background: color-mix(in srgb, #7c3aed 10%, var(--ask-rich-soft));
  color: #6d28d9;
  font-weight: 700;
}

.ask-rich-action--deal-doctor:hover,
.ask-rich-action--deal-doctor:focus-visible {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px color-mix(in srgb, #7c3aed 24%, transparent);
}

html[data-theme="dark"] .ask-rich-action--deal-doctor,
body.dark-mode .ask-rich-action--deal-doctor {
  color: #c4b5fd;
}

.ask-rich-response__header--dashboard {
  margin-bottom: -4px;
}

.ask-rich-response__eyebrow {
  margin: 0;
  color: var(--ask-rich-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ask-rich-layout--relationship_dashboard .ask-rich-blocks {
  gap: 8px;
}

.ask-rich-relationship-dashboard {
  padding: 14px;
  border: 1px solid var(--ask-rich-border);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ask-rich-soft) 88%, transparent), var(--ask-rich-bg));
}

.ask-rich-relationship-dashboard__hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.ask-rich-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary, #2563eb) 16%, var(--ask-rich-soft));
  color: var(--primary, #2563eb);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ask-rich-relationship-dashboard__identity h4 {
  font-size: 1.05rem;
}

.ask-rich-relationship-dashboard__subtitle,
.ask-rich-relationship-dashboard__descriptor {
  margin: 3px 0 0;
  color: var(--ask-rich-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ask-rich-status-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ask-rich-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ask-rich-status-pill small {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.82;
  text-transform: lowercase;
}

.ask-rich-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ask-rich-kpi {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--ask-rich-soft);
  border: 1px solid color-mix(in srgb, var(--ask-rich-border) 80%, transparent);
}

.ask-rich-kpi__value {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ask-rich-kpi__label {
  display: block;
  margin-top: 2px;
  color: var(--ask-rich-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ask-rich-kpi--warning .ask-rich-kpi__value {
  color: var(--warning, #b45309);
}

.ask-rich-snapshot {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.ask-rich-snapshot li {
  position: relative;
  padding: 0 0 0 12px;
  color: var(--ask-rich-text, inherit);
  font-size: 0.84rem;
  line-height: 1.45;
}

.ask-rich-snapshot li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #2563eb) 55%, var(--ask-rich-muted));
}

.ask-rich-nba-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 28%, var(--ask-rich-border));
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--ask-rich-soft));
}

.ask-rich-nba-card__label {
  display: block;
  margin-bottom: 4px;
  color: var(--ask-rich-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ask-rich-nba-card strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ask-rich-concern-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warning, #b45309) 30%, var(--ask-rich-border));
  background: color-mix(in srgb, var(--warning, #b45309) 10%, var(--ask-rich-soft));
  font-size: 0.82rem;
  line-height: 1.45;
}

.ask-rich-concern-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning, #b45309) 18%, transparent);
  color: var(--warning, #b45309);
  font-size: 0.72rem;
  font-weight: 800;
}

.ask-rich-actions--compact {
  margin-top: 10px;
  gap: 6px;
}

.ask-rich-list-block--dashboard {
  padding: 0;
  border: 0;
  background: transparent;
}

.ask-rich-list-block__title--compact {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ask-rich-muted);
}

.ask-rich-entity-list--dashboard {
  display: grid;
  gap: 8px;
}

.ask-rich-deal-tile {
  padding: 10px 12px;
  border: 1px solid var(--ask-rich-border);
  border-radius: 12px;
  background: var(--ask-rich-bg);
}

.ask-rich-deal-tile__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ask-rich-deal-tile__head h5 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.ask-rich-deal-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.ask-rich-deal-tile__stage {
  color: var(--ask-rich-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.ask-lite-card--rich-intelligence {
  padding-top: 10px;
}

.ask-lite-card--rich-intelligence .ask-lite-card__body {
  display: grid;
  gap: 8px;
}

.ask-lite-card--rich-intelligence .ask-rich-response {
  margin-top: 0;
}

.ask-lite-card--rich-intelligence .ask-owner-scope-chips {
  margin-bottom: 0;
}

.ask-lite-card--rich-intelligence .ask-lite-card__actions:empty {
  display: none;
}

@media (max-width: 899px) {
  .ask-rich-layout--two_column_desktop .ask-rich-blocks,
  .ask-rich-metric-grid {
    grid-template-columns: 1fr;
  }

  .ask-rich-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ask-rich-relationship-dashboard__hero {
    grid-template-columns: auto 1fr;
  }

  .ask-rich-relationship-dashboard__status {
    grid-column: 1 / -1;
    justify-self: start;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .ask-rich-block {
    padding: 10px;
  }

  .ask-rich-action {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-rich-response *,
  .ask-rich-response *::before,
  .ask-rich-response *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

html[data-theme="dark"] .ask-rich-response,
body.dark-mode .ask-rich-response {
  --ask-rich-bg: var(--panel, #171b24);
  --ask-rich-soft: var(--surface-subtle, #202633);
  --ask-rich-border: var(--border, #343c4b);
  --ask-rich-text: var(--text, #f3f4f6);
  --ask-rich-muted: var(--text-muted, #aab2c0);
}
