/* ── Velma "Design 2" — dt Call report styles, ported from dt/dt.css ──────────
   Scoped: the dt tokens reuse the showcase's --m__* names, so the token block
   lives on .velma-report-view (NOT :root) and every selector is vr-prefixed.
   The report is deliberately its own brand (Proto Grotesk / Stratos, white
   paper) — it renders as a light document even in dark theme.
   Fonts stay in /dt/fonts/ — @font-face fetches lazily on first use. */

@font-face {
  font-family: 'Stratos';
  src: url('/dt/fonts/stratos-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Stratos';
  src: url('/dt/fonts/stratos-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Proto Grotesk';
  src: url('/dt/fonts/proto-grotesk-light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Proto Grotesk';
  src: url('/dt/fonts/proto-grotesk-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* Hidden unless velma mode + Design 2 (body classes set by app.js). */
#velma-report-view { display: none; }
body[data-mode="velma"].velma-design2 #velma-report-view { display: block; }

.velma-report-view {
  /* Tokens (dt values, scoped so they can't clobber the showcase's) */
  --m__color-black: #000;
  --m__color-white: #fff;
  --m__color-gray-50: #f5f5f5;
  --m__color-gray-100: #e8e8e8;
  --m__color-gray-500: #6e6e6e;
  --m__color-gray-700: #333;
  --m__color-gray-850: #1b1b1b;
  --m__color-gray-900: #0e0e0e;
  --m__color-blue-400: #0082ff;
  --m__color-blue-500: #0064f0;
  --m__color-green-400: #00dc00;
  --m__color-green-600: #00966e;
  --m__color-red-500: #f0545f;
  --m__color-signal-positive: #16c25b;

  --m__bg: var(--m__color-white);
  --m__bg-surface: var(--m__color-gray-50);
  --m__bg-accent: var(--m__color-blue-500);
  --m__text: var(--m__color-gray-700);
  --m__text-accent: var(--m__color-black);
  --m__text-caption: var(--m__color-gray-500);
  --m__text-link-hover: var(--m__color-green-600);
  --m__border: color-mix(in srgb, var(--m__text) 12%, transparent);
  --m__border-strong: color-mix(in srgb, var(--m__text) 30%, transparent);
  --m__signal-card-bg: var(--m__bg-surface);

  --m__emotion-neutral-group: #5a5a6e;

  --m__font-family-sans: 'Stratos', -apple-system, 'Helvetica Neue', sans-serif;
  --m__font-family-ids-display: 'Proto Grotesk', 'Stratos', -apple-system, 'Helvetica Neue', sans-serif;
  --m__font-size-xs: .65rem;
  --m__font-size-s: .8rem;
  --m__font-size-m: 1rem;
  --m__font-size-l: 1.15rem;
  --m__font-size-xxxl: 2rem;
  --m__font-size-xxxxl: 3.4rem;
  --m__line-height-tight: 1.05;
  --m__line-height-base: 1.3;
  --m__line-height-copy: 1.44;

  --m__space-xxs: .3rem;
  --m__space-xs: .7rem;
  --m__space-s: .9rem;
  --m__space-m: 1.2rem;
  --m__space-l: 2.4rem;
  --m__space-xl: 4.8rem;
  --m__space-message-gap: .4rem;

  --m__radius-s: .3rem;
  --m__radius-m: .4rem;
  --m__radius-xl: .75rem;
  --m__radius-xxxl: 2rem;

  --m__duration-hover-in: 0s;
  --m__duration-hover-out: .5s;
  --m__easing-hover: ease;

  /* The "paper" — dt's body, as an embedded document */
  background: var(--m__bg);
  color: var(--m__text);
  font-family: var(--m__font-family-sans);
  font-size: var(--m__font-size-m);
  line-height: var(--m__line-height-base);
  -webkit-font-smoothing: antialiased;
  border-radius: var(--m__radius-xxxl);
  padding: var(--m__space-m) var(--m__space-l) var(--m__space-l);
}
.velma-report-view button { font-family: inherit; }
.velma-report-view [hidden] { display: none !important; }
/* The design system decorates every li with a "⋅" ::before plus padding —
   the report's lists are layout, not prose. Neutralize inside the view. */
.velma-report-view li {
  padding-left: 0;
  margin-bottom: 0;
}
.velma-report-view li::before { content: none; }

.vr-report-flow {
  display: flex;
  flex-direction: column;
  gap: var(--m__space-l);
  padding-block: var(--m__space-s) var(--m__space-m);
}
/* ── Player ── */
.vr-player-port {
  --initial-height: 14rem;
  --viz-height: 75%;
  --stuck-height: 8.2rem;
  --stuck-viz-height: 62%;
  --player-bg: var(--m__color-gray-900);
  --player-surface: var(--m__color-gray-850);
  --player-text: var(--m__color-white);
  --player-text-muted: color-mix(in srgb, var(--m__color-white) 45%, transparent);
  --player-control: var(--m__color-blue-400);
  height: var(--initial-height);
  display: block;
}
.vr-media-container { height: 100%; }
.vr-player-port.stuck .vr-media-container {
  position: fixed;
  z-index: 30;
  top: 0;
  left: var(--fixed-left, 0);
  width: var(--fixed-width, 100%);
  height: auto;
  padding-top: var(--m__space-xxs);
  background: var(--m__bg);
  box-shadow: 0 .5rem .5rem 0 var(--m__bg);
}
.vr-media-box {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--m__radius-xxxl);
  background: var(--player-bg);
  color: var(--player-text);
  overflow: hidden;
  transition: height .35s ease;
}
.vr-player-port.stuck .vr-media-box { height: var(--stuck-height); }
.vr-player-visualization {
  position: relative;
  height: var(--viz-height);
  background: var(--player-surface);
}
.vr-player-port.stuck .vr-player-visualization,
.vr-player-port.stuck .vr-speaker-labels,
.vr-player-port.stuck .vr-behaviour-indicators { height: var(--stuck-viz-height); }

.vr-transcript-clip {
  position: absolute;
  top: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}
.vr-clip-visualization {
  position: absolute;
  left: 0; right: 0;
  top: var(--row-top);
  height: var(--row-height);
  background: var(--clip-color, var(--m__emotion-neutral-group));
  transition: filter var(--m__duration-hover-out) var(--m__easing-hover);
}
.vr-transcript-clip:hover .vr-clip-visualization,
.vr-transcript-clip.playing .vr-clip-visualization {
  filter: brightness(150%) saturate(115%);
  transition-duration: var(--m__duration-hover-in);
}

.vr-speaker-labels {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: var(--viz-height);
  pointer-events: none;
  font-size: .8em;
}
.vr-speaker-label {
  position: absolute;
  top: var(--row-top);
  height: var(--row-height);
  display: flex;
  align-items: flex-end;
  padding-left: .1em;
}
.vr-speaker-label span {
  background: var(--player-surface);
  color: color-mix(in srgb, var(--player-text) 35%, transparent);
  padding: .1em .25em 0 .15em;
  white-space: nowrap;
}
.vr-player-port.stuck .vr-speaker-label span { display: none; }

.vr-behaviour-indicators {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: var(--viz-height);
  pointer-events: none;
  z-index: 2;
}
.vr-behaviour-indicator {
  --indicator-size: 1.05em;
  position: absolute;
  top: calc(var(--row-top) + var(--row-height) - var(--indicator-size));
  display: flex;
  align-items: flex-end;
  font-size: .8em;
  line-height: 1.2;
  pointer-events: auto;
  cursor: pointer;
}
.vr-behaviour-icon {
  width: var(--indicator-size);
  height: var(--indicator-size);
  flex: none;
  color: var(--player-text);
  filter: drop-shadow(0 0 2px rgba(0,0,0,.8));
}
.vr-behaviour-icon svg { width: 100%; height: 100%; fill: currentColor; }
.vr-behaviour-label-text {
  visibility: hidden;
  opacity: 0;
  order: 3;
  white-space: nowrap;
  margin-left: .15em;
  padding: .05em .4em;
  background: var(--player-surface);
  color: var(--player-text);
  font-weight: 700;
  position: relative;
  z-index: 2;
}
.vr-behaviour-indicator:hover { z-index: 20; }
.vr-behaviour-indicator:hover .vr-behaviour-label-text { visibility: visible; opacity: 1; }
.vr-behaviour-indicator:hover .vr-behaviour-icon { filter: drop-shadow(0 0 2px rgba(0,0,0,.8)) brightness(140%); }

.vr-player-line, .vr-player-hover-line {
  position: absolute;
  top: 0;
  width: 1px;
  height: var(--viz-height);
  background: color-mix(in srgb, var(--player-text) 65%, transparent);
  pointer-events: none;
  z-index: 3;
}
.vr-player-hover-line { background: color-mix(in srgb, var(--player-text) 30%, transparent); }
.vr-player-port.stuck .vr-player-line,
.vr-player-port.stuck .vr-player-hover-line { height: var(--stuck-viz-height); }
.vr-player-hover-caption {
  position: absolute;
  bottom: .6em;
  transform: translateX(-50%);
  color: var(--player-text-muted);
  font-size: .75em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 3;
}

.vr-player-controls {
  position: relative;
  display: flex;
  align-items: center;
  height: calc(100% - var(--viz-height));
}
.vr-player-port.stuck .vr-player-controls { height: calc(100% - var(--stuck-viz-height)); }
.vr-player-control-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--player-control);
  cursor: pointer;
  transition: background-color .2s;
}
.vr-player-control-center:hover:not(:disabled) { background: color-mix(in srgb, var(--player-surface) 40%, transparent); }
.vr-player-control-center:disabled { cursor: not-allowed; opacity: .45; }
.vr-player-icon {
  display: inline-flex;
  width: 1.9em;
  height: 1.9em;
  transition: transform .2s;
}
.vr-player-control-center:hover:not(:disabled) .vr-player-icon { transform: scale(1.1); }
.vr-player-icon svg { width: 100%; height: 100%; fill: currentColor; }
.vr-player-time {
  position: relative;
  z-index: 1;
  color: var(--player-text-muted);
  font-size: .8em;
  font-variant-numeric: tabular-nums;
  padding-inline: 1em;
  pointer-events: none;
}
.vr-player-time-total { margin-left: auto; }

/* ── Section nav ── */
.vr-report-nav {
  display: flex;
  gap: var(--m__space-m);
  flex-wrap: wrap;
}
.vr-report-nav a {
  color: var(--m__text);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--m__duration-hover-out) var(--m__easing-hover);
}
.vr-report-nav a:hover { color: var(--m__text-link-hover); transition-duration: var(--m__duration-hover-in); }

/* ── Sections ── */
.vr-report-card, .vr-report-section {
  display: flex;
  flex-direction: column;
  gap: var(--m__space-m);
  scroll-margin-top: calc(var(--m__space-xl) + 4rem);
}
.vr-section-heading { display: flex; flex-direction: column; gap: var(--m__space-xxs); }
.vr-report-card .vr-h2, .vr-report-section .vr-h2 {
  margin: 0;
  color: var(--m__text-accent);
  font-family: var(--m__font-family-ids-display);
  font-size: var(--m__font-size-xxxl);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: var(--m__line-height-tight);
}

.vr-summary-text {
  margin: 0;
  max-width: 44rem;
  font-size: var(--m__font-size-l);
  line-height: var(--m__line-height-copy);
}
.vr-summary-text:empty::before { content: 'Waiting for summary…'; color: var(--m__text-caption); font-size: var(--m__font-size-m); }

.vr-conversation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--m__space-xxs) var(--m__space-l);
  color: var(--m__text-caption);
  font-size: var(--m__font-size-s);
}
.vr-conversation-meta .vr-meta-item { display: flex; flex-direction: column; gap: .1em; }
.vr-conversation-meta .vr-meta-label { font-size: var(--m__font-size-xs); text-transform: uppercase; letter-spacing: .06em; }
.vr-conversation-meta .vr-meta-value { color: var(--m__text); font-size: var(--m__font-size-m); font-weight: 500; }
.vr-conversation-meta .vr-meta-value .vr-conf { color: var(--m__text-caption); font-weight: 400; font-size: var(--m__font-size-s); }

/* ── Tables ── */
.vr-table-scroll { max-width: 100%; overflow-x: auto; }
.velma-report-view table { width: 100%; border-collapse: collapse; }
.velma-report-view th {
  color: var(--m__text-caption);
  font-size: var(--m__font-size-s);
  font-weight: 500;
  text-align: start;
  text-transform: none;
  letter-spacing: normal;
  background: transparent;
  padding: .3rem .6rem .3rem 0;
  border-bottom: 1px solid var(--m__border);
}
.velma-report-view th.vr-num { text-align: right; padding-right: 0; }
.velma-report-view td {
  vertical-align: top;
  padding: .8rem .6rem .8rem 0;
  border-bottom: 1px solid var(--m__border);
  font-size: var(--m__font-size-m);
}
.velma-report-view tbody tr:last-child td { border-bottom: 0; }
.velma-report-view td.vr-num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }

.vr-speakers-table .vr-col-speaker { width: 24%; }
.vr-speakers-table .vr-col-pattern { width: 58%; }
.vr-speakers-table .vr-col-time { width: 18%; }

.vr-speaker-name { color: var(--m__text-accent); font-weight: 500; }

.vr-emotion-pattern { display: flex; flex-direction: column; gap: var(--m__space-xxs); }
.vr-emotion-bar {
  display: flex;
  width: 100%;
  max-width: 16rem;
  min-height: 1.8rem;
  border-radius: var(--m__radius-m);
  overflow: hidden;
}
.vr-emotion-segment {
  flex-basis: 0;
  flex-grow: var(--w, 1);
  min-width: 2px;
  border: 0;
  padding: 0;
  background: var(--seg-color, var(--m__emotion-neutral-group));
  cursor: pointer;
  transition: filter var(--m__duration-hover-out) var(--m__easing-hover);
}
.vr-emotion-segment:hover { filter: brightness(125%) saturate(115%); transition-duration: var(--m__duration-hover-in); }
.vr-emotion-legend { color: var(--m__text-caption); font-size: var(--m__font-size-s); line-height: var(--m__line-height-base); }
.vr-emotion-legend span { color: var(--tone, var(--m__text-caption)); }

/* ── Behaviors module card ── */
.vr-signal-module-stack { display: flex; flex-direction: column; gap: var(--m__space-xs); }
.vr-signal-module-card {
  --card-padding: var(--m__space-s);
  display: flex;
  flex-direction: column;
  gap: var(--m__space-m);
  border-radius: var(--m__radius-xxxl);
  background: var(--m__signal-card-bg);
  padding: var(--m__space-xxs) var(--card-padding) var(--card-padding);
}
.vr-signal-module-head {
  display: flex;
  align-items: center;
  gap: var(--m__space-xs);
  margin-inline: calc(var(--card-padding) * -1);
  padding: var(--m__space-xs) var(--card-padding);
  border-bottom: 1px solid var(--m__border);
}
.vr-signal-module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--m__text-accent);
  flex: none;
}
.vr-signal-module-copy { display: flex; align-items: baseline; gap: var(--m__space-xs); min-width: 0; flex-wrap: wrap; }
.vr-signal-module-copy h3 {
  margin: 0;
  color: var(--m__text-accent);
  font-size: var(--m__font-size-m);
  font-weight: 500;
  white-space: nowrap;
}
.vr-signal-module-copy p { margin: 0; color: var(--m__text-caption); font-size: var(--m__font-size-m); }

.vr-module-signals-table .vr-speaker-column { width: 18%; }
.vr-module-signals-table .vr-signal-column { width: 26%; }
.vr-module-signals-table .vr-reasoning-column { width: 44%; }
.vr-module-signals-table .vr-confidence-column { width: 12%; }
.vr-speaker-group-cell { color: var(--m__text-accent); font-weight: 500; }

.vr-behavior-name {
  display: inline-flex;
  align-items: center;
  gap: .12em;
  border: 0;
  border-bottom: 3px solid currentColor;
  padding: 0 0 .02em;
  background: none;
  color: var(--m__text-accent);
  font-size: var(--m__font-size-m);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: var(--m__line-height-base);
  text-align: start;
  cursor: pointer;
  transition: color var(--m__duration-hover-out) var(--m__easing-hover);
}
.vr-behavior-name:hover { color: var(--m__text-link-hover); transition-duration: var(--m__duration-hover-in); }
.vr-behavior-icon { display: inline-flex; width: .78em; height: .78em; flex: none; }
.vr-behavior-icon svg { width: 100%; height: 100%; fill: currentColor; }

.vr-reasoning-text { margin: 0; color: var(--m__text); line-height: var(--m__line-height-copy); }
.vr-evidence-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--m__space-xxs);
  margin-top: var(--m__space-xs);
}
.vr-evidence-link {
  display: inline-block;
  max-width: 100%;
  border: 0;
  border-radius: var(--m__radius-m);
  padding: var(--m__space-xxs) var(--m__space-xs);
  background: var(--m__bg);
  color: var(--m__text);
  font-size: var(--m__font-size-s);
  text-align: start;
  line-height: var(--m__line-height-base);
  cursor: pointer;
  transition: color var(--m__duration-hover-out) var(--m__easing-hover);
  overflow-wrap: break-word;
}
.vr-evidence-link:hover { color: var(--m__text-link-hover); transition-duration: var(--m__duration-hover-in); }
.vr-evidence-link .vr-t { color: var(--m__text-caption); font-variant-numeric: tabular-nums; margin-right: .4em; }

.vr-behaviors-checked { margin: 0; color: var(--m__text-caption); font-size: var(--m__font-size-s); line-height: var(--m__line-height-copy); }
.vr-behaviors-empty { color: var(--m__text-caption); }

/* ── Transcript ── */
.vr-transcript-chat {
  --time-col: 3.5ch;
  display: flex;
  flex-direction: column;
  gap: var(--m__space-message-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--m__font-size-m);
  line-height: var(--m__line-height-copy);
}
.vr-report-transcript { width: 100%; scroll-margin-top: calc(var(--m__space-xl) + 4rem); }
.vr-report-transcript:not(:first-child).new-speaker { margin-top: calc(var(--m__space-s) - var(--m__space-message-gap)); }
.vr-report-transcript-trigger {
  display: flex;
  align-items: baseline;
  gap: var(--m__space-xs);
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.vr-report-item-time {
  flex: none;
  min-width: var(--time-col);
  color: var(--m__text-caption);
  font-size: var(--m__font-size-s);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: var(--m__line-height-copy);
}
.vr-report-transcript-body { min-width: 0; max-width: 90ch; overflow-wrap: anywhere; }
.vr-report-transcript-meta { display: flex; align-items: baseline; gap: var(--m__space-xxs); min-width: 0; flex-wrap: wrap; }
.vr-report-transcript-from { color: var(--m__text-caption); font-weight: 500; }
.vr-report-transcript-text { display: block; }
.vr-report-transcript-trigger:hover .vr-report-item-time,
.vr-report-transcript-trigger:hover .vr-report-transcript-from,
.vr-report-transcript-trigger:hover .vr-report-transcript-text {
  color: var(--m__text-link-hover);
  transition-duration: var(--m__duration-hover-in);
}
.vr-report-item-time, .vr-report-transcript-from, .vr-report-transcript-text {
  transition: color var(--m__duration-hover-out) var(--m__easing-hover);
}
.vr-report-transcript.playing .vr-report-item-time,
.vr-report-transcript.playing .vr-report-transcript-from,
.vr-report-transcript.playing .vr-report-transcript-text { color: var(--m__bg-accent); }
.vr-report-transcript.flash .vr-report-transcript-body { animation: vr-flash 1.6s ease-out; }
@keyframes vr-flash {
  0% { background: color-mix(in srgb, var(--m__bg-accent) 18%, transparent); }
  100% { background: transparent; }
}
.vr-emotion-pill {
  --tone: var(--m__emotion-neutral-group);
  display: inline-block;
  border-bottom: 1px solid color-mix(in srgb, var(--tone) 50%, transparent);
  color: color-mix(in srgb, var(--tone) 90%, transparent);
  font-size: .75em;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.vr-transcript-star {
  display: inline-flex;
  width: .7em; height: .7em;
  color: var(--m__text-accent);
}
.vr-transcript-star svg { width: 100%; height: 100%; fill: currentColor; }
/* Behavior name chips in the transcript meta row — spark + name per evidence
   clip; the definitive clip's chip reads bolder. */
.vr-transcript-behavior {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  color: var(--m__text-accent);
  font-size: .75em;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.vr-transcript-behavior .vr-transcript-star { width: .9em; height: .9em; }
.vr-transcript-behavior.definitive { font-weight: 700; }

/* ── Small screens ── */
@media (max-width: 700px) {
  .vr-speakers-table .vr-col-pattern { width: 55%; }
  .velma-report-view { padding-inline: var(--m__space-m); }
}
