/* References remain small in dense clinical tables; the whole button is clickable. */
.asst-content .evidence-cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; margin: 0 2px 0 4px; padding: 0 5px;
  vertical-align: super; position: relative; top: 1px;
  border: 1px solid #ddd4f1; border-radius: 6px; background: #f3effb;
  color: #7251a3; font: 600 11px/1 var(--font, sans-serif);
  cursor: pointer; white-space: nowrap; user-select: none;
}
.asst-content .evidence-cite:hover { background: #e7dff7; border-color: #b7a1d9; }
.asst-content .evidence-cite:focus-visible, .evidence-panel :is(button, a):focus-visible {
  outline: 2px solid #9571cb; outline-offset: 3px;
}
.evidence-overlay[hidden] { display: none !important; }
.evidence-overlay {
  position: fixed; inset: 0; z-index: 950; pointer-events: none;
  --ev-bg: #fff; --ev-soft: #f8f7fa; --ev-line: #e9e6ed;
  --ev-ink: #282331; --ev-muted: #756d80; --ev-accent: #7251a3;
  color: var(--ev-ink);
}
.evidence-backdrop { display: none; }
.evidence-panel {
  position: absolute; inset: 0 0 0 auto; width: 440px; max-width: 100%;
  background: var(--ev-bg); border-left: 1px solid var(--ev-line);
  box-shadow: -8px 0 32px #2920350a; display: flex; flex-direction: column;
  pointer-events: auto; font: 13px/1.7 var(--font, sans-serif);
}
.evidence-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 24px 24px 21px; border-bottom: 1px solid var(--ev-line); flex-shrink: 0;
}
.evidence-eyebrow { color: var(--ev-muted); font-size: 10px; letter-spacing: 1.5px; }
.evidence-header h2 { font-size: 20px; font-weight: 600; margin: 5px 0 0; letter-spacing: -.3px; }
.evidence-close {
  width: 36px; height: 36px; border: 1px solid var(--ev-line); border-radius: 50%;
  background: var(--ev-bg); color: var(--ev-muted); font: 25px/1 sans-serif; cursor: pointer; flex-shrink: 0;
}
.evidence-close:hover { background: var(--ev-soft); color: var(--ev-ink); }
.evidence-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; overscroll-behavior: contain; }
.evidence-body h3 { margin: 12px 0; font-size: 17px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.evidence-body h4 { margin: 0 0 9px; font-size: 12px; font-weight: 600; }
.evidence-source-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.evidence-source-number { background: #eee8f8; color: var(--ev-accent); border-radius: 5px; padding: 3px 8px; font-size: 11px; }
.evidence-provider { color: var(--ev-muted); font-size: 11px; overflow-wrap: anywhere; }
.evidence-captured { margin: 8px 0 0; font-size: 10px; color: var(--ev-muted); line-height: 1.8; }
.evidence-saved { font-size: 11px; color: #647268; display: inline-flex; gap: 6px; align-items: center; }
.evidence-saved::before { content: ''; width: 5px; height: 5px; background: #84998b; border-radius: 50%; }
.evidence-facts { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid var(--ev-line); font-size: 11px; }
.evidence-facts > div { display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 10px; margin: 7px 0; }
.evidence-facts dt { color: var(--ev-muted); }
.evidence-facts dd { margin: 0; overflow-wrap: anywhere; }
.evidence-record-link { display: block; background: none; border: 0; color: var(--ev-accent); font: inherit; font-size: 11px; padding: 8px 0; margin: 4px 0 9px; cursor: pointer; text-align: left; }
.evidence-record-link:hover { text-decoration: underline; }
.evidence-metadata { margin-top: 19px; border-top: 1px solid var(--ev-line); border-bottom: 1px solid var(--ev-line); padding: 11px 0; }
.evidence-metadata > summary, .evidence-extra-links > summary { color: var(--ev-accent); font-size: 11px; cursor: pointer; padding: 3px 0; }
.evidence-metadata .evidence-facts { border-top: 0; margin-top: 7px; padding-top: 0; }
.evidence-extra-links .evidence-link-list { margin-top: 9px; }
.evidence-context { margin-top: 19px; padding: 14px 15px; background: var(--ev-soft); border-left: 2px solid #cabbdf; border-radius: 0 5px 5px 0; }
.evidence-context h4 { color: var(--ev-muted); font-size: 10px; margin-bottom: 6px; font-weight: 400; }
.evidence-context p { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.evidence-links, .evidence-original { margin-top: 25px; }
.evidence-link-list { display: flex; flex-direction: column; gap: 8px; }
.evidence-link {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  color: var(--ev-ink); text-decoration: none; border: 1px solid var(--ev-line);
  border-radius: 7px; padding: 11px 13px; transition: background .15s;
}
.evidence-link:hover { background: var(--ev-soft); border-color: #cfc1e2; }
.evidence-link strong { font-size: 12px; font-weight: 500; display: block; overflow-wrap: anywhere; }
.evidence-link small { color: var(--ev-muted); font-size: 10px; display: block; margin-top: 3px; overflow-wrap: anywhere; }
.evidence-link-arrow { font-size: 20px; color: var(--ev-accent); flex-shrink: 0; }
.evidence-muted, .evidence-note { color: var(--ev-muted); font-size: 11px; margin: 9px 0 12px; line-height: 1.8; overflow-wrap: anywhere; }
.evidence-raw {
  border: 1px solid var(--ev-line); border-radius: 7px; padding: 16px;
  font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.evidence-raw mark { color: inherit; background: #fff0c9; padding: 1px 2px; border-radius: 2px; }
.evidence-footer { padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--ev-line); color: var(--ev-muted); font-size: 10px; flex-shrink: 0; background: var(--ev-soft); }
.evidence-state { padding: 50px 12px; text-align: center; }
.evidence-state-icon { color: #b4a3cb; font-size: 28px; margin: 10px 0 18px; }
.evidence-state h3 { font-size: 15px; }
.evidence-state p { color: var(--ev-muted); font-size: 12px; margin: 10px 0 20px; }
.evidence-retry { border: 1px solid var(--ev-line); padding: 9px 18px; border-radius: 6px; background: var(--ev-bg); color: var(--ev-accent); font: inherit; cursor: pointer; }
@media (min-width: 1101px) {
  body.evidence-open #main { padding-right: calc(var(--legal-w, 0px) + var(--redact-w, 0px) + 440px); }
  body.evidence-open { --content-w: min(860px, calc(100vw - var(--sidebar-w, 0px) - var(--legal-w, 0px) - var(--redact-w, 0px) - 488px)); }
  body.evidence-open #turn-nav { display: none; }
}
@media (max-width: 1100px) {
  .evidence-backdrop { display: block; position: absolute; inset: 0; background: #1a13294d; pointer-events: auto; }
  .evidence-panel { width: min(500px, 100%); box-shadow: -8px 0 40px #18102522; }
}
@media (max-width: 560px) {
  .evidence-panel { inset: 14px 0 0; width: 100%; border: 0; border-radius: 16px 16px 0 0; }
  .evidence-header { padding: 20px 20px 16px; }
  .evidence-body { padding: 20px; }
  .evidence-close { width: 42px; height: 42px; }
  .evidence-footer { padding-left: 20px; padding-right: 20px; }
  .asst-content .evidence-cite { min-width: 24px; height: 24px; }
}
body.private-active .evidence-overlay { --ev-bg: #1c1925; --ev-soft: #25212f; --ev-line: #373040; --ev-ink: #eee9f4; --ev-muted: #b1a6bf; --ev-accent: #c6adeb; }
body.private-active .evidence-source-number, body.private-active .evidence-cite { background: #372b4c; color: #d2bced; border-color: #514063; }
body.private-active .evidence-saved { color: #b2c1b6; }
body.private-active .evidence-raw mark { background: #564625; }
