/* Lab history: marker sparkline button, History sheet, trend citation chip (static/trends.js). Brand tokens only. */
.marker .tr-btn { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  margin-top: 2px; padding: 2px 8px 2px 4px; min-height: 28px; border: 1px solid var(--rapha-line); border-radius: 8px;
  background: var(--rapha-surface); color: var(--rapha-accent); font: 600 11.5px inherit; font-family: inherit; cursor: pointer; }
.marker .tr-btn:hover, .marker .tr-btn:focus-visible { border-color: var(--rapha-accent-line); background: var(--rapha-accent-soft); }
.tr-spark { display: block; color: var(--rapha-accent); }
.tr-dot.above, .tr-pt.above { fill: var(--high, #c2410c); }
.tr-dot.below, .tr-pt.below { fill: var(--low, #1d5fa8); }
.tr-dot.within, .tr-pt.within, .tr-pt.not_detected, .tr-pt.unknown { fill: var(--rapha-accent); }

body.tr-open { overflow: hidden; }
.tr-sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.tr-backdrop { position: absolute; inset: 0; background: rgba(27, 37, 51, .38); }
.tr-sheet { position: relative; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: #fff; color: var(--rapha-ink); border-radius: 16px; padding: 18px 20px 20px;
  box-shadow: 0 18px 50px rgba(27, 37, 51, .25); }
.tr-sheet header { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin-bottom: 8px; }
.tr-sheet h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.tr-sheet h3 { font-size: 14px; margin: 16px 0 4px; }
.tr-close { border: 1px solid var(--rapha-line); background: var(--rapha-surface); color: var(--rapha-ink-2);
  border-radius: 10px; min-width: 40px; min-height: 40px; font-size: 16px; cursor: pointer; }
.tr-grab { display: none; }
.tr-note { background: var(--rapha-accent-soft); color: var(--rapha-ink); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 6px 0 10px; }
.tr-facts { font-size: 13.5px; line-height: 1.5; margin: 6px 0 10px; }
.tr-chart { width: 100%; height: auto; display: block; margin: 4px 0 12px; }
.tr-band { fill: var(--rapha-accent-soft); }
.tr-grid { stroke: var(--rapha-line); stroke-width: 1; }
.tr-axis { fill: var(--rapha-ink-3); font-size: 11px; font-family: inherit; }
.tr-line { fill: none; stroke: var(--rapha-accent); stroke-width: 2; stroke-linejoin: round; }
.tr-pt { stroke: #fff; stroke-width: 2; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-table th { text-align: left; font-size: 11.5px; color: var(--rapha-ink-3); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--rapha-line); }
.tr-table td { padding: 8px 6px; border-bottom: 1px solid var(--rapha-line); vertical-align: top; }
.tr-table td.v { font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-table tr.nc td { color: var(--rapha-ink-2); }
.tr-st { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--rapha-surface-2); color: var(--rapha-ink-2); }
.tr-st.above { background: var(--high-soft, #fdeee4); color: var(--high, #c2410c); }
.tr-st.below { background: var(--low-soft, #e6effa); color: var(--low, #1d5fa8); }
.tr-st.within, .tr-st.not_detected { background: var(--rapha-accent-soft); color: var(--rapha-accent); }
.tr-demo { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #fff4d6; color: #7a5b00; }
.tr-foot { margin: 12px 0 0; }
.tr-pop-list { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.tr-pop-list .id { margin-left: 4px; }
.cite.trend { color: var(--rapha-accent-hover); border-color: var(--rapha-accent-line); background: #fff; }

/* Phones: a bottom sheet */
@media (max-width: 640px) {
  .tr-sheet-wrap { align-items: flex-end; }
  .tr-sheet { width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
  .tr-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rapha-line); margin: 0 auto 10px; }
  .tr-table th:nth-child(4), .tr-table td:nth-child(4) { display: none; }
}
