/* Live evidence (evidence.js): a strip above the chat input, and a side panel next to the rail on desktop. */
.ev-strip { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.ev-strip[hidden] { display: none; }
.ev-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; min-width: 0; }
.ev-status { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-kind=checking] .ev-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: var(--accent); vertical-align: 1px; animation: ev-pulse 1s ease-in-out infinite alternate; }
[data-kind=ok] .ev-status { color: var(--ok); }
[data-kind=warn] .ev-status { color: var(--warn); }
[data-kind=bad] .ev-status, [data-kind=ref] .ev-status { color: var(--ink-3); }
@keyframes ev-pulse { from { opacity: .35; } to { opacity: 1; } }
.ev-chips { display: inline-flex; gap: 3px; flex: none; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ev-pop .2s ease-out; }
.ev-dot.paper { background: #7c5cc4; } .ev-dot.symptom { background: var(--warn); } .ev-dot.wearable { background: var(--low); }
@keyframes ev-pop { from { transform: scale(0); } }
.ev-more { flex: none; min-height: 30px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ev-more:disabled { opacity: .5; cursor: default; }
.ev-more:focus-visible, .ev-close:focus-visible, .ev-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev-body { max-height: 42vh; overflow: auto; padding: 0 10px 10px; border-top: 1px solid var(--line); }
.ev-body[hidden] { display: none; }

.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev-item { display: grid; gap: 4px; padding: 8px 0 0; min-width: 0; }
.ev-item + .ev-item { border-top: 1px solid var(--line); }
.ev-item.ev-new { animation: ev-in .22s cubic-bezier(.2, .8, .2, 1); }
.ev-item.ev-new .ev-quote { animation: ev-quote .28s cubic-bezier(.2, .8, .2, 1) .06s backwards; }
@keyframes ev-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes ev-quote { from { opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0); } }
.ev-top { display: flex; min-width: 0; }
.ev-top .cite { cursor: default; white-space: normal; text-align: left; }
.ev-for { margin: 0; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.ev-quote { margin: 0; padding: 6px 10px; border-left: 3px solid #d4c6ef; background: #f7f3fd; border-radius: 0 8px 8px 0;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.ev-src, .ev-val { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.ev-acts { display: flex; }
.ev-btn { min-height: 30px; padding: 3px 10px; border: 1px solid var(--rapha-accent-line, var(--line)); border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ev-unsourced { font-size: 12px; color: var(--warn); }
.ev-unsourced p { margin: 8px 0 4px; font-weight: 600; }
.ev-unsourced ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); overflow-wrap: anywhere; }

/* the report page with the highlighted row */
.ev-pdf { margin: 8px 0 0; }
.ev-pdf[hidden] { display: none; }
.ev-pdf-cap { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; overflow-wrap: anywhere; }
.ev-pdf-page { height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ev-pdf-canvas { position: relative; }
.ev-pdf-canvas canvas { display: block; }
.ev-pdf-page img { display: block; width: 100%; }
.ev-pdf-load { padding: 12px; font-size: 12px; color: var(--ink-3); }
.ev-pdf-page .ev-val { padding: 12px; }
.ev-hl { position: absolute; pointer-events: none; background: rgba(255, 196, 0, .28); outline: 2px solid #e0a100; border-radius: 3px;
  animation: ev-hl .5s ease-out; }
@keyframes ev-hl { from { transform: scale(1.3); opacity: 0; } }

/* desktop: a panel beside the chat rail */
.ev-panel { display: none; }
@media (min-width: 1100px) {
  .ev-panel:not([hidden]) { position: fixed; z-index: 25; display: flex; flex-direction: column; gap: 6px;
    top: calc(var(--hdr, 110px) + 20px); right: calc(max(24px, (100vw - 1480px) / 2 + 24px) + 380px + 12px);
    width: 320px; max-height: calc(100vh - var(--hdr, 110px) - 40px); overflow: auto; padding: 12px 14px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(20, 30, 25, .14), 0 2px 6px rgba(20, 30, 25, .06); animation: ev-panel-in .24s cubic-bezier(.2, .8, .2, 1); }
  .ev-panel header { display: flex; align-items: flex-start; gap: 8px; }
  .ev-panel header > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .ev-panel h2 { font-size: 14px; }
  .ev-panel .ev-status { white-space: normal; }
  .ev-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; }
  .ev-strip.open .ev-body { display: none; }
}
@keyframes ev-panel-in { from { opacity: 0; transform: translateX(16px); } }
@media (max-width: 640px) { .ev-more { min-height: 36px; } .ev-btn { min-height: 36px; } }
@media (prefers-reduced-motion: reduce) {
  .ev-item.ev-new, .ev-item.ev-new .ev-quote, .ev-dot, .ev-hl, .ev-panel:not([hidden]) { animation: none; }
  [data-kind=checking] .ev-status::before { animation: none; }
}
.ev-item.lab { cursor: pointer; }
