/* The Filter: shared components. Requires tokens.css.
 * Prefix tf- so these never collide with legacy app classes while screens are
 * migrated. Only tokens in here, no raw colors, sizes, radii or durations.
 * Live reference: /design.html
 */

/* ---------- type roles ---------- */
.tf-display { font: 800 var(--fs-display)/var(--lh-tight) var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tf-h1 { font: 800 var(--fs-h1)/var(--lh-tight) var(--font-display); margin: 0; }
.tf-h2 { font: 800 var(--fs-h2)/1.2 var(--font-display); margin: 0; }
.tf-h3 { font: 700 var(--fs-h3)/var(--lh-snug) var(--font-display); margin: 0; }
.tf-h4 { font: 700 var(--fs-body-l)/1.35 var(--font-sans); margin: 0; }
.tf-body-l { font: 400 var(--fs-body-l)/var(--lh-body) var(--font-sans); }
.tf-body { font: 400 var(--fs-body)/var(--lh-body) var(--font-sans); }
.tf-small { font: 400 var(--fs-small)/1.5 var(--font-sans); }
.tf-caption { font: 400 var(--fs-caption)/1.4 var(--font-sans); color: var(--text-2); }
.tf-label { font: 700 var(--fs-label)/1.3 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
.tf-data { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.tf-muted { color: var(--text-2); }

/* ---------- layout ---------- */
.tf-container { max-width: var(--container); margin: 0 auto; padding-inline: var(--s-4); }
.tf-section { padding-block: var(--s-7); }
.tf-stack { display: flex; flex-direction: column; gap: var(--s-4); }
.tf-stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.tf-stack-lg { display: flex; flex-direction: column; gap: var(--s-5); }
.tf-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.tf-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- buttons ---------- */
.tf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5);
  font: 700 14px/1 var(--font-sans);
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; position: relative;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tf-btn:hover { border-color: var(--text-2); }
.tf-btn:active { transform: translateY(1px); }
.tf-btn svg { width: 18px; height: 18px; flex: none; }
.tf-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tf-btn-primary:hover { background: var(--accent-alt); border-color: var(--accent-alt); }
.tf-btn-secondary { background: transparent; border-color: var(--trust); color: var(--trust); }
.tf-btn-secondary:hover { background: var(--trust-soft); border-color: var(--trust); }
.tf-btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
.tf-btn-ghost:hover { background: var(--surface); border-color: transparent; }
.tf-btn-danger { background: transparent; border-color: var(--fail); color: var(--fail); }
.tf-btn-danger:hover { background: var(--fail-soft); border-color: var(--fail); }
.tf-btn-icon { width: var(--tap); padding: 0; }
.tf-btn-sm { min-height: 36px; padding: 0 var(--s-4); font-size: 13px; }
.tf-btn[disabled], .tf-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.tf-btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.tf-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--text-2); border-top-color: transparent;
  animation: tf-spin 700ms linear infinite;
}
.tf-btn-primary[aria-busy="true"]::after { border-color: var(--on-accent); border-top-color: transparent; }
@keyframes tf-spin { to { transform: rotate(360deg); } }

/* ---------- inputs ---------- */
.tf-field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.tf-field > label, .tf-field > .tf-label { font: 700 var(--fs-label)/1.3 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
.tf-input, .tf-select, .tf-textarea {
  width: 100%; min-height: var(--tap); padding: 0 var(--s-3);
  font: 500 15px/1.4 var(--font-mono); font-variant-numeric: tabular-nums;
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease);
}
.tf-textarea { padding: var(--s-3); font-family: var(--font-sans); line-height: var(--lh-body); min-height: 88px; resize: vertical; }
.tf-input:hover, .tf-select:hover, .tf-textarea:hover { border-color: var(--text-2); }
.tf-input[aria-invalid="true"] { border-color: var(--fail); }
.tf-help { font-size: var(--fs-caption); color: var(--text-2); }
.tf-error { font-size: var(--fs-caption); color: var(--fail); display: flex; gap: var(--s-1); align-items: center; }

/* checkbox / radio */
.tf-check { display: inline-flex; align-items: center; gap: var(--s-3); min-height: var(--tap); cursor: pointer; font-size: var(--fs-body); }
.tf-check input { appearance: none; margin: 0; width: 20px; height: 20px; flex: none; background: var(--surface-raised); border: 1.5px solid var(--text-2); border-radius: var(--r-sm); display: grid; place-content: center; cursor: pointer; min-height: 0; padding: 0; transition: background var(--t-fast) var(--ease); }
.tf-check input[type="radio"] { border-radius: 50%; }
.tf-check input:checked { background: var(--trust); border-color: var(--trust); }
.tf-check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: translateY(-1px) rotate(-45deg); }
.tf-check input[type="radio"]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--bg); transform: none; }

/* toggle */
.tf-toggle { display: inline-flex; align-items: center; gap: var(--s-3); min-height: var(--tap); cursor: pointer; }
.tf-toggle input { appearance: none; margin: 0; width: 44px; height: 26px; min-height: 0; padding: 0; background: var(--neutral-soft); border: 1.5px solid var(--text-2); border-radius: var(--r-pill); position: relative; cursor: pointer; transition: background var(--t-base) var(--ease); }
.tf-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--text-2); transition: transform var(--t-base) var(--ease), background var(--t-base) var(--ease); }
.tf-toggle input:checked { background: var(--trust-soft); border-color: var(--trust); }
.tf-toggle input:checked::after { transform: translateX(18px); background: var(--trust); }

/* slider */
.tf-slider { width: 100%; accent-color: var(--trust); min-height: var(--tap); }

/* segmented control (timeframe alignment, theme) */
.tf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface-raised); }
.tf-seg button { min-height: var(--tap); background: transparent; border: 0; border-right: 1px solid var(--border); color: var(--text-2); font: 700 var(--fs-small)/1 var(--font-sans); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.tf-seg button:last-child { border-right: 0; }
.tf-seg button[aria-pressed="true"] { background: var(--trust-soft); color: var(--trust-ink); box-shadow: inset 0 -2px 0 var(--trust); }

/* ---------- cards ---------- */
.tf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--e-1); }
.tf-card-interactive { cursor: pointer; transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.tf-card-interactive:hover { box-shadow: var(--e-2); border-color: var(--text-2); transform: translateY(-1px); }
.tf-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }

/* metric / stat */
.tf-stat { display: flex; flex-direction: column; gap: var(--s-1); }
.tf-stat-value { font: 800 var(--fs-h1)/var(--lh-tight) var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); }
.tf-stat-value[data-tone="pass"] { color: var(--pass); }
.tf-stat-value[data-tone="fail"] { color: var(--fail); }
.tf-stat-delta { font: 500 var(--fs-small)/1 var(--font-mono); color: var(--text-2); }

/* insight (a note about the trader's own behavior, never advice) */
.tf-insight { display: flex; gap: var(--s-3); padding: var(--s-4); background: var(--trust-soft); border: 1px solid var(--border); border-left: 3px solid var(--trust); border-radius: var(--r-md); }
.tf-insight p { margin: 0; font-size: var(--fs-small); line-height: 1.5; }

/* ---------- badges + status ---------- */
.tf-badge { display: inline-flex; align-items: center; gap: var(--s-1); padding: 3px var(--s-2); border-radius: var(--r-sm); font: 700 var(--fs-label)/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--neutral-soft); color: var(--text-2); }
.tf-badge svg { width: 12px; height: 12px; }
.tf-badge[data-tone="pass"] { background: var(--pass-soft); color: var(--pass); }
.tf-badge[data-tone="caution"] { background: var(--caution-soft); color: var(--caution-ink); }
.tf-badge[data-tone="fail"] { background: var(--fail-soft); color: var(--fail); }
.tf-badge[data-tone="trust"] { background: var(--trust-soft); color: var(--trust-ink); }
.tf-pill { display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-3); border-radius: var(--r-pill); font: 700 var(--fs-caption)/1.5 var(--font-sans); background: var(--neutral-soft); color: var(--text-2); }
.tf-pill[data-tone="pass"] { background: var(--pass-soft); color: var(--pass); }
.tf-pill[data-tone="fail"] { background: var(--fail-soft); color: var(--fail); }

/* ---------- the grade: ONE visual, reused on every screen ----------
 * data-grade = a | b | skip. Letter is Archivo, color from grade tokens.
 * Sizes: sm (tables, journal rows), md (cards), lg (trade result, share card). */
.tf-grade {
  --g: var(--grade-skip); --g-soft: var(--grade-skip-soft);
  display: inline-grid; place-items: center; flex: none;
  width: 2em; height: 2em; font: 800 20px/1 var(--font-display);
  color: var(--g); background: var(--g-soft); border: 1.5px solid var(--g); border-radius: var(--r-md);
}
.tf-grade[data-grade="a"] { --g: var(--grade-a); --g-soft: var(--grade-a-soft); }
.tf-grade[data-grade="b"] { --g: var(--grade-b); --g-soft: var(--grade-b-soft); }
.tf-grade[data-grade="skip"] { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; width: 3em; }
.tf-grade-sm { font-size: 14px; border-radius: var(--r-sm); }
.tf-grade-sm[data-grade="skip"] { font-size: 10px; }
.tf-grade-lg { font-size: 44px; border-radius: var(--r-lg); border-width: 2px; }
.tf-grade-lg[data-grade="skip"] { font-size: 18px; }
.tf-grade-reveal { animation: tf-settle var(--t-slow) var(--ease) both; }
@keyframes tf-settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* score: "82 / 100" */
.tf-score { display: inline-flex; align-items: baseline; gap: var(--s-1); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.tf-score b { font-size: var(--fs-display); font-weight: 800; line-height: 1; }
.tf-score span { font: 500 var(--fs-body)/1 var(--font-mono); color: var(--text-2); }

/* progress / score meter. Fill takes the grade color, never the accent. */
.tf-progress { height: 8px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--r-pill); overflow: hidden; }
.tf-progress > i { display: block; height: 100%; width: 0; background: var(--g, var(--trust)); border-radius: inherit; transition: width var(--t-slow) var(--ease); }
.tf-progress[data-grade="a"] { --g: var(--grade-a); }
.tf-progress[data-grade="b"] { --g: var(--grade-b); }
.tf-progress[data-grade="skip"] { --g: var(--grade-skip); }

/* ---------- gate rows: pass/fail is icon + word, never color alone ---------- */
.tf-gates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.tf-gate { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--fs-small); line-height: 1.45; }
.tf-gate svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.tf-gate[data-state="pass"] svg { color: var(--pass); }
.tf-gate[data-state="fail"] svg { color: var(--fail); }
.tf-gate[data-state="open"] svg { color: var(--text-2); }
.tf-gate-state { font: 700 var(--fs-label)/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; margin-left: auto; color: var(--text-2); white-space: nowrap; }
.tf-gates[data-animate] .tf-gate { animation: tf-settle var(--t-base) var(--ease) both; }
.tf-gates[data-animate] .tf-gate:nth-child(2) { animation-delay: 40ms; }
.tf-gates[data-animate] .tf-gate:nth-child(3) { animation-delay: 80ms; }
.tf-gates[data-animate] .tf-gate:nth-child(4) { animation-delay: 120ms; }
.tf-gates[data-animate] .tf-gate:nth-child(5) { animation-delay: 160ms; }
.tf-gates[data-animate] .tf-gate:nth-child(6) { animation-delay: 200ms; }

/* ---------- TRADE RESULT: the core component ----------
 * Order: setup line, grade + score + R:R, plain verdict, passed | failed,
 * the "your rules say" line, then the two decisions. */
.tf-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e-2); overflow: hidden; }
.tf-result-top { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.tf-result-meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
.tf-result-main { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.tf-result-figs { display: flex; gap: var(--s-5); flex-wrap: wrap; align-items: flex-end; }
.tf-result-verdict { margin: 0; font: 700 var(--fs-body-l)/1.35 var(--font-sans); }
.tf-result-cols { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--border); }
.tf-result-col { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.tf-result-col + .tf-result-col { border-top: 1px solid var(--border); }
.tf-result-note { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.tf-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--bg); }
.tf-result[data-grade="a"] .tf-result-top { background: var(--grade-a-soft); }
.tf-result[data-grade="b"] .tf-result-top { background: var(--grade-b-soft); }
@media (min-width: 640px) {
  .tf-result-cols { grid-template-columns: 1fr 1fr; }
  .tf-result-col + .tf-result-col { border-top: 0; border-left: 1px solid var(--border); }
}

/* ---------- tables ---------- */
.tf-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.tf-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.tf-table th { text-align: left; padding: var(--s-3) var(--s-4); font: 700 var(--fs-label)/1.3 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tf-table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tf-table tr:last-child td { border-bottom: 0; }
.tf-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tf-table tbody tr:hover { background: var(--surface-raised); }

/* ---------- navigation ---------- */
.tf-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--bg); border-bottom: 1px solid var(--border); }
.tf-wordmark { font: 800 20px/1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--text); text-decoration: none; display: inline-flex; align-items: baseline; gap: 1px; }
.tf-wordmark i { color: var(--accent); font-style: normal; }
.tf-tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); }
.tf-tab { min-height: var(--tap); padding: 0 var(--s-4); background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-2); font: 700 var(--fs-label)/1 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; cursor: pointer; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.tf-tab:hover { color: var(--text); }
.tf-tab[aria-selected="true"], .tf-tab[aria-pressed="true"] { color: var(--trust-ink); border-bottom-color: var(--trust); }
.tf-crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-caption); color: var(--text-2); }
.tf-crumbs a { color: var(--text-2); }
.tf-crumbs li { list-style: none; } .tf-crumbs ol { display: flex; gap: var(--s-2); margin: 0; padding: 0; }
.tf-crumbs li + li::before { content: "/"; margin-right: var(--s-2); }
.tf-crumbs [aria-current="page"] { color: var(--text); font-weight: 700; }

/* sidebar (desktop) */
.tf-sidebar { display: flex; flex-direction: column; gap: var(--s-1); width: 220px; padding: var(--s-4); background: var(--surface); border-right: 1px solid var(--border); }
.tf-sidebar a { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font: 700 var(--fs-small)/1 var(--font-sans); }
.tf-sidebar a:hover { background: var(--surface-raised); color: var(--text); }
.tf-sidebar a[aria-current="page"] { background: var(--trust-soft); color: var(--trust-ink); }
.tf-sidebar svg { width: 20px; height: 20px; }

/* bottom nav (mobile: the thumb zone) */
.tf-bottomnav { position: sticky; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tf-bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--text-2); text-decoration: none; font: 700 var(--fs-label)/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.tf-bottomnav a[aria-current="page"] { color: var(--trust-ink); box-shadow: inset 0 2px 0 var(--trust); }
.tf-bottomnav svg { width: 22px; height: 22px; }

/* ---------- feedback ---------- */
.tf-alert { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-small); line-height: 1.5; }
.tf-alert svg { width: 20px; height: 20px; flex: none; }
.tf-alert strong { display: block; margin-bottom: 2px; }
.tf-alert[data-tone="pass"] { background: var(--pass-soft); border-color: var(--pass); } .tf-alert[data-tone="pass"] svg { color: var(--pass); }
.tf-alert[data-tone="caution"] { background: var(--caution-soft); border-color: var(--caution); } .tf-alert[data-tone="caution"] svg { color: var(--caution-ink); }
.tf-alert[data-tone="fail"] { background: var(--fail-soft); border-color: var(--fail); } .tf-alert[data-tone="fail"] svg { color: var(--fail); }
.tf-alert[data-tone="info"] { background: var(--trust-soft); border-color: var(--trust); } .tf-alert[data-tone="info"] svg { color: var(--trust); }

.tf-toast { display: flex; align-items: center; gap: var(--s-3); max-width: 360px; padding: var(--s-3) var(--s-4); background: var(--text); color: var(--bg); border-radius: var(--r-md); box-shadow: var(--e-3); font-size: var(--fs-small); animation: tf-settle var(--t-base) var(--ease) both; }
.tf-toast svg { width: 18px; height: 18px; flex: none; }

.tf-tip { position: relative; }
.tf-tip > .tf-tip-body { position: absolute; z-index: 20; bottom: calc(100% + var(--s-2)); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; padding: var(--s-2) var(--s-3); background: var(--text); color: var(--bg); border-radius: var(--r-sm); font-size: var(--fs-caption); line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity var(--t-fast) var(--ease); }
.tf-tip:hover > .tf-tip-body, .tf-tip:focus-within > .tf-tip-body { opacity: 1; }

/* ---------- overlays ---------- */
.tf-scrim[hidden] { display: none; }
.tf-scrim { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s-4); background: rgba(11, 18, 32, .55); animation: tf-fade var(--t-base) var(--ease) both; }
.tf-modal { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e-3); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); animation: tf-settle var(--t-base) var(--ease) both; }
.tf-drawer { position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--e-3); padding: var(--s-5); overflow: auto; animation: tf-slide var(--t-base) var(--ease) both; }
@keyframes tf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-slide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- empty / loading / error ---------- */
.tf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-7) var(--s-5); border: 1px dashed var(--border); border-radius: var(--r-md); color: var(--text-2); }
.tf-empty svg { width: 40px; height: 40px; color: var(--text-2); }
.tf-empty h3 { margin: 0; color: var(--text); font: 700 var(--fs-body-l)/1.3 var(--font-sans); }
.tf-empty p { margin: 0; max-width: 38ch; font-size: var(--fs-small); }
.tf-skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-raised) 50%, var(--surface) 75%); background-size: 200% 100%; border-radius: var(--r-sm); min-height: 14px; animation: tf-shimmer 1.4s linear infinite; }
@keyframes tf-shimmer { to { background-position: -200% 0; } }

/* ---------- chart frame (SVG/canvas inside; labels always text) ---------- */
.tf-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); }
.tf-chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: var(--fs-caption); color: var(--text-2); }
.tf-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: var(--s-1); vertical-align: -1px; }

/* ---------- utilities ---------- */
.tf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
