/* ── How well your agent hears ────────────────────────────────────────────────
 * The campaign Insights card and Agent Studio's compact card (stt-accuracy.js).
 * Built from app.css's tokens and existing pieces only: the grouped card, the
 * history tiles' figure, the Overview chart's ink line and recessive grid, the
 * workspace switch, the quiet buttons. One series, so one ink; the "words
 * added" mark is a dashed line plus a "+N" label, never a colour alone
 * (app.css rule 2). Nothing moves on arrival (rule 3). */
.hear[hidden], .hear [hidden] { display: none !important; }
.hear { container: hear / inline-size; }

/* the Insights tab's card: the report's grouped-card material */
#cdhear { margin: 0 0 14px; padding: 16px 18px 14px; background: var(--c-surface);
          border-radius: var(--ui-r-card); box-shadow: var(--ui-card); }

.hear-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin: 0 0 12px; }
.hear-titles { flex: 1 1 200px; min-width: 0; }
.hear-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -0.008em; color: var(--c-ink); }
.hear-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--c-ink-3); }
.hear[data-state="off"] .hear-head, .hear[data-state="measuring"] .hear-head,
.hear[data-state="not_enough_calls"] .hear-head { margin: 0; }
.hear-head button.small { margin: 0; flex: none; }

/* three numbers: the history tiles' figure */
.hear-tiles { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.hear-tile { min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--c-line); border-radius: var(--r-md);
             display: flex; flex-direction: column; gap: 5px; }
.hear-tile-k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; line-height: 1;
               color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hear-tile strong { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1; color: var(--c-ink); }
.hear-tile-main strong { font-size: 26px; }
.hear-tile-s { font-size: 11.5px; line-height: 1.35; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }

/* the day-by-day line */
.hear-chart { margin: 0 0 6px; }
.hear-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px;
            margin: 0 0 4px; font-size: 11.5px; color: var(--c-ink-2); }
.hear-key { display: inline-flex; align-items: center; gap: 6px; color: var(--c-ink-3); }
.hear-key::before { content: ""; width: 0; height: 11px; border-left: 1px dashed var(--c-ink-3); }
.hear-plot { position: relative; min-width: 0; }
.hear-svg { display: block; overflow: visible; max-width: 100%; height: auto; }
.hear-line { fill: none; stroke: var(--c-ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hear-dot { fill: var(--c-surface); stroke: var(--c-ink-2); stroke-width: 2; }
.hear-dot-now { fill: var(--c-ink); stroke: var(--c-surface); }
.hear-now { font-size: 11px; font-weight: 600; fill: var(--c-ink); font-variant-numeric: tabular-nums; }
.hear-grid { stroke: var(--c-line); stroke-width: 1; }
.hear-base { stroke: var(--c-line-strong); stroke-width: 1; }
.hear-axis { font-size: 10.5px; fill: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.hear-mark-line { stroke: var(--c-ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.hear-mark-t { font-size: 10.5px; font-weight: 600; fill: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.hear-hit { fill: transparent; cursor: default; }
.hear-tip { position: absolute; top: 6px; z-index: 2; min-width: 150px; max-width: 260px; padding: 8px 10px;
            transform: translateX(-50%); pointer-events: none; background: var(--c-surface);
            border-radius: var(--ui-r-control); box-shadow: var(--ui-float);
            font-size: 12px; line-height: 1.45; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.hear-tip p { margin: 0; overflow-wrap: anywhere; }
.hear-tip-day { font-weight: 600; color: var(--c-ink); margin-bottom: 2px !important; }
.hear-detail { margin: 0 0 14px; font-size: 11.5px; line-height: 1.5; color: var(--c-ink-3); }

/* the words it gets wrong */
.hear-words-box { border-top: 1px solid var(--ui-sep); padding-top: 12px; }
.hear-words-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hear-h { margin: 0; font-size: 13px; font-weight: 600; color: var(--c-ink); letter-spacing: -0.006em; }
.hear-hint, .hear-empty { margin: 3px 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--c-ink-3); }
.hear-hint .linkbtn { padding: 0; font-size: 12.5px; }
.hear-words { list-style: none; margin: 0; padding: 0; }
.hear-word { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0;
             border-bottom: 1px solid var(--ui-sep); }
.hear-word:last-child { border-bottom: 0; }
.hear-word-main { flex: 1 1 260px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.hear-term { font-size: 13px; font-weight: 600; color: var(--c-ink); overflow-wrap: anywhere; }
.hear-as { font-size: 12.5px; color: var(--c-ink-2); overflow-wrap: anywhere; }
.hear-spell { font-size: 11.5px; color: var(--c-ink-3); overflow-wrap: anywhere; }
.hear-why { font-size: 11.5px; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.hear-acts { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.hear-acts button { margin: 0; }
.hear-acts .camp-quiet { min-height: 26px; padding: 4px 10px; font-size: 12px; }
.hear-add { min-width: 52px; }
/* a fact about the word, not a button: the workspace chip's tint */
.hear-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--ui-fill-2);
            font-size: 11.5px; font-weight: 500; color: var(--c-ink-2); white-space: nowrap; }
.hear-added::before { content: "✓"; margin-right: 5px; }
.hear-err { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--c-alarm-ink); }
.hear-more { padding: 6px 0 0; }
.hear-learn-wrap .hear-err { margin-top: 6px; }
.hear-learn { margin-top: 12px; cursor: pointer; }
.hear-method { margin: 12px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--c-ink-3); max-width: 78ch; }

/* Agent Studio → Behavior: the compact card */
.hear-agent .hear-head { margin-bottom: 10px; }
.hear-agent[data-state="measuring"] .hear-head, .hear-agent[data-state="not_enough_calls"] .hear-head { margin: 0; }
.hear-agent-row { display: flex; align-items: center; gap: 16px; }
.hear-agent-fig { flex: 1 1 auto; min-width: 0; }
.hear-agent-fig strong { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; line-height: 1; color: var(--c-ink); margin-right: 8px; }
.hear-agent-fig > span { font-size: 12.5px; color: var(--c-ink-2); }
.hear-plot-mini { flex: 0 1 220px; }
.hear-top { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--c-ink-2); overflow-wrap: anywhere; }
.hear-top-k { color: var(--c-ink-3); }
.hear-top b { font-weight: 600; color: var(--c-ink); }
.hear-agent .hear-method { margin-top: 8px; }

/* a narrow column: the test panel open, or a phone */
@container hear (max-width: 560px) {
  .hear-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hear-tile-main { grid-column: 1 / -1; }
  .hear-agent-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .hear-plot-mini { flex-basis: auto; }
}
@container hear (max-width: 300px) {
  .hear-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #cdhear { padding: 14px 14px 12px; }
  .hear-acts { margin-left: 0; }
}
