/* Structured answer blocks for the chat transcript. All surfaces inherit the
   active theme and user type scale; the muted material supports the answer. */
.chat-rich-block {
  min-width: 0;
  margin: var(--space-md, 16px) 0;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid rgb(var(--c-tint) / .2);
  border-radius: 16px;
  color: rgb(var(--c-on-bg));
  background: linear-gradient(145deg, rgb(var(--c-surface-hi) / .42), rgb(var(--c-surface) / .62));
  box-shadow: 0 12px 30px rgb(var(--c-shadow) / .2), inset 0 1px 0 rgb(var(--c-tint) / .08);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
}
.chat-rich-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chat-rich-head-icon { flex: none; color: rgb(var(--c-accent)); font-size: var(--type-title); }
.chat-rich-title { margin: 0; color: rgb(var(--c-on-bg)); font-size: var(--type-title); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.prose-tarot .chat-rich-points > ul, .prose-tarot .chat-rich-bars > ul { margin: 0; padding: 0; list-style: none; }
.prose-tarot .chat-rich-points > ul > li, .prose-tarot .chat-rich-bars > ul > li { margin: 0; }
.chat-rich-point { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid rgb(var(--c-tint) / .13); }
.chat-rich-point:first-child { padding-top: 0; border-top: 0; }
.chat-rich-point:last-child { padding-bottom: 0; }
.chat-rich-point-icon { margin-top: 1px; color: rgb(var(--c-accent)); font-size: var(--type-label); }
.chat-rich-point-icon--action, .chat-rich-point-icon--caution { color: rgb(var(--c-accent)); }
.chat-rich-point strong { display: block; margin-bottom: 3px; color: rgb(var(--c-on-bg)); font-size: var(--type-label); line-height: 1.45; }
.chat-rich-point p { margin: 0; color: rgb(var(--c-on-surface-variant)); font-size: var(--type-body); line-height: 1.6; overflow-wrap: anywhere; }

.chat-rich-stats dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.chat-rich-stat { min-width: 0; padding: 12px 14px; border-inline-start: 1px solid rgb(var(--c-tint) / .2); }
.chat-rich-stat:nth-child(odd) { border-inline-start: 0; }
.chat-rich-stat:nth-child(n + 3) { border-top: 1px solid rgb(var(--c-tint) / .13); }
.chat-rich-stat dt { color: rgb(var(--c-on-surface-variant)); font-size: var(--type-supporting); line-height: 1.5; overflow-wrap: anywhere; }
.chat-rich-stat dd { margin: 4px 0 0; color: rgb(var(--c-accent)); font-size: var(--type-title); font-weight: 750; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chat-rich-stat-detail { display: block; margin: 4px 0 0; color: rgb(var(--c-on-surface-variant)); font-size: var(--type-supporting); line-height: 1.5; overflow-wrap: anywhere; }

.chat-rich-table-scroll { max-width: 100%; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid rgb(var(--c-tint) / .15); border-radius: 10px; }
.chat-rich-table-scroll:focus-visible { outline: 2px solid rgb(var(--c-accent)); outline-offset: 3px; }
.chat-rich-table-scroll table { width: 100%; min-width: 28rem; margin: 0; border-collapse: collapse; font-size: var(--type-body); }
.chat-rich-table-scroll th, .chat-rich-table-scroll td { padding: 10px 12px; border-bottom: 1px solid rgb(var(--c-tint) / .13); text-align: start; vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; }
.chat-rich-table-scroll thead th { color: rgb(var(--c-accent)); background: rgb(var(--c-tint) / .09); font-weight: 700; }
.chat-rich-table-scroll tbody th { color: rgb(var(--c-on-bg)); font-weight: 650; }
.chat-rich-table-scroll tbody td { color: rgb(var(--c-on-surface-variant)); }
.chat-rich-table-scroll tbody tr:last-child > * { border-bottom: 0; }
.chat-rich-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.chat-rich-bars ul { display: grid; gap: 14px; }
.chat-rich-bars li { min-width: 0; }
.chat-rich-bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 5px; font-size: var(--type-body); }
.chat-rich-bar-label span { min-width: 0; color: rgb(var(--c-on-bg)); overflow-wrap: anywhere; }
.chat-rich-bar-label strong { flex: none; color: rgb(var(--c-on-bg)); font-variant-numeric: tabular-nums; }
.chat-rich-bars meter { display: block; width: 100%; height: 12px; border: 0; border-radius: 999px; background: rgb(var(--c-tint) / .14); appearance: none; }
.chat-rich-bars meter::-webkit-meter-bar { border: 0; border-radius: 999px; background: rgb(var(--c-tint) / .14); }
.chat-rich-bars meter::-webkit-meter-optimum-value { border-radius: 999px; background: linear-gradient(90deg, rgb(var(--c-tertiary)), rgb(var(--c-accent))); }
.chat-rich-bars meter::-moz-meter-bar { border-radius: 999px; background: linear-gradient(90deg, rgb(var(--c-tertiary)), rgb(var(--c-accent))); }
.chat-rich-bars figcaption { display: grid; gap: 4px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgb(var(--c-tint) / .13); color: rgb(var(--c-on-surface-variant)); font-size: var(--type-supporting); line-height: 1.5; overflow-wrap: anywhere; }
.chat-rich-loading { display: flex; align-items: center; gap: 8px; margin: var(--space-sm, 12px) 0; color: rgb(var(--c-on-surface-variant)); font-size: var(--type-supporting); }
.chat-rich-loading .material-symbols-outlined { color: rgb(var(--c-accent)); font-size: var(--type-label); }

@media (max-width: 420px) {
  .chat-rich-stats dl { grid-template-columns: minmax(0, 1fr); }
  .chat-rich-stat, .chat-rich-stat:nth-child(odd) { padding-inline: 0; border-inline-start: 0; }
  .chat-rich-stat + .chat-rich-stat { border-top: 1px solid rgb(var(--c-tint) / .13); }
  .chat-rich-table-scroll table { min-width: 24rem; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-rich-block, .chat-rich-loading { scroll-behavior: auto; }
}
