/* ==========================================================================
   Terminal Light — shared components. Requires tl/tokens.css.
   Values are the handoff's code/components.css with every literal grey and
   white swapped for its token so dark mode follows. Pico is still loaded, so
   interactive elements carry explicit resets (see memory: pico-css-gotchas).
   ========================================================================== */

/* ---------- Base ---------- */
html, body { background: var(--tl-page); }
body {
  margin: 0;
  font-family: var(--tl-font);
  color: var(--tl-ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum', 'cv11';
}
.tl-mono { font-family: var(--tl-mono); }
.tl-num { font-variant-numeric: tabular-nums; }
.tl-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Links and buttons inside TL surfaces: inherit, no Pico chrome. :where keeps
   the specificity at a single class so every component rule below wins. */
:where([class^="tl-"], [class*=" tl-"]) :where(a),
a:where([class^="tl-"], [class*=" tl-"]) { color: inherit; text-decoration: none; }
/* Attribute selectors (0,1,1) so this outranks Pico's [type=button] and
   button margins, while any TL class rule (.tl-x or deeper) still wins. */
button[class*="tl-"],
[class*="tl-"] > button {
  margin: 0; font-family: var(--tl-font); line-height: normal;
  text-align: center; box-shadow: none; appearance: none; -webkit-appearance: none;
}

/* Visible focus: an ink ring, everywhere in the system. */
:where([class^="tl-"], [class*=" tl-"]):focus-visible,
:where([class^="tl-"], [class*=" tl-"]) :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--tl-focus-ring) !important;
}

/* The prototypes run at line-height: normal. Pico sets 1.5 on body, which
   inflates bands, tabs and card titles; TL surfaces reset it. Body copy that
   wants 1.45-1.5 sets it explicitly, as in the prototypes. */
.tl-topbar, .tl-sidebar, .tl-main { line-height: normal; }
.tl-nav, .tl-tabs { justify-content: flex-start; }

/* ---------- App shell ---------- */
.tl-topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--tl-topbar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 20px;
  background: var(--tl-header-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tl-line-07);
}
.tl-brand { display: flex; align-items: center; gap: 9px; flex: none; }
.tl-brand img { width: 26px; height: 26px; border-radius: 7px; background: transparent; }
.tl-brand span { font-size: 16.5px; font-weight: 700; letter-spacing: -0.3px; font-style: italic; white-space: nowrap; color: var(--tl-ink); }
.tl-nav { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.tl-nav a {
  position: relative; height: 32px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--tl-r-chip);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--tl-ink-62);
}
.tl-nav a:hover { color: var(--tl-ink); }
.tl-nav a[aria-current="page"] { color: var(--tl-ink); background: var(--tl-fill-06); }
.tl-pro-tag { font-family: var(--tl-mono); font-size: 9px; font-weight: 400; line-height: normal; padding: 1px 4px; border-radius: var(--tl-r-tag); border: 1px solid var(--tl-pro-line); color: var(--tl-pro); }
.tl-soon { font-family: var(--tl-mono); font-size: 9px; font-weight: 400; line-height: normal; padding: 1px 4px; border-radius: var(--tl-r-tag); border: 1px solid var(--tl-line-20); color: var(--tl-ink-45); }
.tl-topbar-spacer { flex: 1; }
.tl-topbar-right { display: flex; align-items: center; gap: 16px; }
.tl-topbar-actions { display: flex; align-items: center; gap: 8px; }
.tl-search {
  width: 300px; height: 34px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px 0 11px;
  border-radius: var(--tl-r-btn);
  border: 1px solid var(--tl-line-10);
  background: var(--tl-fill-03);
  font-size: 13px; color: var(--tl-ink-50);
}
.tl-kbd { height: 20px; padding: 0 6px; display: inline-flex; align-items: center; border-radius: 5px; border: 1px solid var(--tl-line-12); font-family: var(--tl-mono); font-size: 10.5px; color: var(--tl-ink-50); }
.tl-iconbtn {
  position: relative; width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--tl-r-btn); border: 1px solid var(--tl-line-12);
  background: transparent; color: var(--tl-ink-70); cursor: pointer;
}
.tl-iconbtn:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.tl-iconbtn .tl-badge-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--tl-down); box-shadow: 0 0 0 2px var(--tl-page); }
.tl-btn-outline-lg {
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center;
  border-radius: var(--tl-r-btn); border: 1px solid var(--tl-line-12);
  background: transparent; color: var(--tl-ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.tl-btn-outline-lg:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.tl-btn-ink-lg {
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center;
  border: 0; border-radius: var(--tl-r-btn);
  background: var(--tl-ink); color: var(--tl-on-ink);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tl-btn-ink-lg:hover { background: var(--tl-ink-hover); color: var(--tl-on-ink); }

/* Shell grid: sidebar + main */
.tl-shell { display: grid; grid-template-columns: var(--tl-sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--tl-topbar-h)); }
.tl-shell.is-bare { grid-template-columns: minmax(0, 1fr); }
.tl-main { min-width: 0; }

/* Sidebar */
.tl-sidebar {
  position: sticky; top: var(--tl-topbar-h);
  height: calc(100vh - var(--tl-topbar-h));
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  border-right: 1px solid var(--tl-line-07);
  overflow-y: auto;
  background: var(--tl-page);
}
.tl-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; margin-bottom: 14px; }
.tl-side-head > span { font-size: 15px; font-weight: 600; }
.tl-side-edit {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0 !important; padding: 0 !important;
  border: 1px solid transparent !important; border-radius: var(--tl-r-btn); background: transparent !important;
  color: var(--tl-ink-55) !important; box-shadow: none !important; cursor: pointer;
}
.tl-side-edit[hidden] { display: none; }
.tl-side-edit:hover:not(:disabled), .tl-side-edit.is-on { color: var(--tl-ink) !important; background: var(--tl-fill-05) !important; }
.tl-side-edit:disabled { cursor: default; opacity: 1; }
.tl-side-label { padding: 0 8px 8px; font-family: var(--tl-mono); font-size: 10.5px; letter-spacing: 0.6px; color: var(--tl-ink-40); }
.tl-side-link {
  height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
  border-radius: var(--tl-r-chip); font-size: 13.5px; color: var(--tl-ink-60);
}
.tl-side-link:hover { background: var(--tl-fill-04); color: var(--tl-ink); }
.tl-side-link[aria-current="true"], .tl-side-link.is-on { background: var(--tl-fill-06); color: var(--tl-ink); font-weight: 500; }
.tl-side-link.is-more { gap: 6px; color: var(--tl-ink-45); }
.tl-side-link.is-more .chev { display: inline-block; transition: transform 0.25s var(--tl-ease); }
.tl-side-link.is-more[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tl-side-spacer { flex: 1; min-height: 16px; }
.tl-earn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin-bottom: 10px;
  border-radius: var(--tl-r-btn); border: 1px dashed var(--tl-line-14);
}
.tl-earn:hover { background: var(--tl-fill-03); }
.tl-earn-ring {
  --p: 0;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--tl-pro-ring) 0 calc(var(--p) * 1%), var(--tl-line-10) calc(var(--p) * 1%) 100%);
}
.tl-earn-ring > i {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tl-page); font-style: normal; font-size: 10px; font-weight: 600; color: var(--tl-ink-60);
}
.tl-earn-text { display: flex; flex-direction: column; min-width: 0; }
.tl-earn-text > span:first-child { font-size: 12.5px; font-weight: 600; }
.tl-earn-text > span:last-child { font-size: 11.5px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-promo {
  position: relative; overflow: hidden; padding: 14px;
  border-radius: var(--tl-r-card); background: var(--tl-card-bg);
  box-shadow: var(--tl-float-shadow);
}
.tl-promo-title { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.tl-promo-body { font-size: 12px; line-height: 1.45; color: var(--tl-ink-60); margin-bottom: 12px; }
.tl-promo-actions { display: flex; gap: 6px; }
.tl-btn-ink-sm, .tl-btn-outline-sm {
  height: 28px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: var(--tl-r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tl-btn-ink-sm { border: 0; background: var(--tl-ink); color: var(--tl-on-ink); }
.tl-btn-ink-sm:hover { background: var(--tl-ink-hover); color: var(--tl-on-ink); }
.tl-btn-outline-sm { border: 1px solid var(--tl-line-12); background: transparent; color: var(--tl-ink-70); font-weight: 500; }
.tl-btn-outline-sm:hover { background: var(--tl-fill-05); color: var(--tl-ink); }

/* Drawer toggle (hidden on wide screens) */
.tl-menu-btn { display: none; }
.tl-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.32); opacity: 0; pointer-events: none; transition: opacity 0.25s var(--tl-ease); }

/* ---------- Header band ---------- */
.tl-band { position: relative; overflow: hidden; padding: 22px 28px 0; border-bottom: 1px solid var(--tl-line-07); }
.tl-band > canvas.tl-field { position: absolute; left: 0; top: 0; opacity: var(--tl-field-opacity); pointer-events: none; }
.tl-band > *:not(canvas) { position: relative; }
.tl-band-head { margin-bottom: 18px; }
.tl-league-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; margin: 0 0 8px -2px; padding: 0 8px 0 9px;
  border: 0; border-radius: var(--tl-r-pill);
  background: var(--tl-fill-05); box-shadow: inset 0 0 0 1px var(--tl-line-08);
  font-family: var(--tl-mono); font-size: 11px; letter-spacing: 0.6px; color: var(--tl-ink-60);
  cursor: pointer;
}
.tl-h1 { margin: 0; padding-bottom: 4px; font-size: 34px; font-weight: 500; letter-spacing: -0.9px; line-height: 1.2; color: var(--tl-ink); }
.tl-h1 .is-muted { color: var(--tl-ink-45); }
.tl-dek { margin: 6px 0 0; max-width: 520px; font-size: 13.5px; line-height: 1.5; color: var(--tl-ink-60); }

/* Underline tabs */
.tl-tabs { display: flex; justify-content: flex-start; gap: 4px; margin: 0 -10px; padding: 0; overflow-x: auto; scrollbar-width: none; }
.tl-tabs::-webkit-scrollbar { display: none; }
.tl-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 10px 13px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; color: var(--tl-ink-50);
}
.tl-tab:hover, .tl-tab.is-on, .tl-tab[aria-selected="true"], .tl-tab[aria-current="page"] { color: var(--tl-ink); }
.tl-tab::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--tl-ink);
  transform: scaleX(0); transition: transform 0.3s var(--tl-ease);
}
.tl-tab.is-on::after, .tl-tab[aria-selected="true"]::after, .tl-tab[aria-current="page"]::after { transform: scaleX(1); }
.tl-tab .count { font-family: var(--tl-mono); font-size: 10.5px; color: var(--tl-ink-40); }

/* ---------- Page body + grid ---------- */
.tl-body { padding: 18px 28px 56px; }
.tl-grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tl-grid12.is-stretch { align-items: stretch; }
.tl-span-3 { grid-column: span 3; } .tl-span-4 { grid-column: span 4; } .tl-span-5 { grid-column: span 5; }
.tl-span-6 { grid-column: span 6; } .tl-span-7 { grid-column: span 7; } .tl-span-8 { grid-column: span 8; }
.tl-span-12 { grid-column: 1 / -1; }
.tl-split-8-4 { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 14px; align-items: start; }
.tl-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tl-sticky { position: sticky; top: calc(var(--tl-topbar-h) + 16px); }
.tl-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tl-toolbar .spacer { flex: 1; }
.tl-toolbar-note { font-size: 12.5px; color: var(--tl-ink-50); }

/* ---------- Card ---------- */
.tl-card {
  border-radius: var(--tl-r-card); border: 1px solid var(--tl-line-07);
  background: var(--tl-card-bg); box-shadow: var(--tl-card-shadow);
  overflow: hidden; min-width: 0;
}
.tl-card.is-visible { overflow: visible; }
.tl-card.is-lift { transition: transform 0.3s var(--tl-ease), box-shadow 0.3s; }
.tl-card.is-lift:hover { transform: translateY(-2px); box-shadow: var(--tl-card-shadow-hover); }
.tl-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; min-width: 0; }
.tl-card-head.has-rule { border-bottom: 1px solid var(--tl-line-06); }
.tl-card-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.2px; white-space: nowrap; color: var(--tl-ink); }
.tl-card-sub { font-size: 12px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-card-head .spacer { flex: 1; }
.tl-card-link { font-size: 12.5px; color: var(--tl-ink-60); white-space: nowrap; }
.tl-card-link:hover { color: var(--tl-ink); }
.tl-card-body { padding: 0 18px 16px; }
.tl-card-foot { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--tl-line-05); font-size: 12px; color: var(--tl-ink-50); }
.tl-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tl-ink-50); white-space: nowrap; }
.tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tl-live); flex: none; }
.tl-section-title { display: flex; align-items: center; gap: 10px; padding: 18px 2px 0; margin-bottom: 12px; }
.tl-section-title > :first-child { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.3px; color: var(--tl-ink); }
.tl-section-title .spacer { flex: 1; }

/* ---------- Tables / list rows ---------- */
.tl-colhead {
  display: grid; gap: 8px; align-items: center; padding: 8px 18px;
  border-top: 1px solid var(--tl-line-06); border-bottom: 1px solid var(--tl-line-06);
  background: var(--tl-fill-025);
  font-size: 11.5px; font-weight: 500; color: var(--tl-ink-50);
}
.tl-row { display: grid; gap: 8px; align-items: center; padding: 9px 18px; font-size: 14px; color: var(--tl-ink); }
.tl-row + .tl-row { border-top: 1px solid var(--tl-line-05); }
a.tl-row:hover, .tl-row.is-hover:hover, button.tl-row:hover { background: var(--tl-fill-03); }
.tl-row.is-me, .tl-row.is-spot { background: var(--tl-fill-045); font-weight: 650; }
.tl-rank { font-family: var(--tl-mono); font-size: 12.5px; color: var(--tl-ink-40); }
.tl-rank.is-top { color: var(--tl-ink); }
.tl-logo { flex: none; display: inline-block; background: center / contain no-repeat; }
img.tl-logo { object-fit: contain; background: transparent; }
.tl-rec { font-family: var(--tl-mono); font-size: 10.5px; color: var(--tl-ink-40); }
.tl-move { font-size: 12.5px; text-align: right; }
.tl-move.is-up { color: var(--tl-up); }
.tl-move.is-down { color: var(--tl-down); }
.tl-move.is-flat { color: var(--tl-ink-35); }
.tl-num-r { text-align: right; font-variant-numeric: tabular-nums; }

/* Real <table> in the system (Pico paints td; reset it) */
.tl-table-wrap { overflow-x: auto; }
table.tl-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; color: var(--tl-ink); }
table.tl-table :is(th, td) { padding: 9px 12px; border: 0; background: transparent; color: inherit; text-align: left; white-space: nowrap; }
table.tl-table :is(th, td):first-child { padding-left: 18px; }
table.tl-table :is(th, td):last-child { padding-right: 18px; }
table.tl-table thead th {
  padding-top: 8px; padding-bottom: 8px;
  background: var(--tl-fill-025);
  border-top: 1px solid var(--tl-line-06); border-bottom: 1px solid var(--tl-line-06);
  font-size: 11.5px; font-weight: 500; color: var(--tl-ink-50);
}
table.tl-table thead th.is-sort { color: var(--tl-ink); }
table.tl-table tbody tr + tr td { border-top: 1px solid var(--tl-line-05); }
table.tl-table tbody tr:hover td { background: var(--tl-fill-03); }
table.tl-table td.is-sort { font-weight: 650; }
table.tl-table tr.is-next td { background: var(--tl-control); }
table.tl-table tr.is-total td { background: var(--tl-fill-025); font-weight: 600; }

/* ---------- Controls ---------- */
.tl-seg { display: inline-flex; padding: 2px; border-radius: var(--tl-r-chip); background: var(--tl-fill-05); }
.tl-seg > button, .tl-seg > a {
  height: 26px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: var(--tl-r-seg-in); cursor: pointer;
  font: 500 12.5px var(--tl-font); white-space: nowrap;
  background: transparent; color: var(--tl-ink-55);
  transition: background 0.2s var(--tl-ease), color 0.2s var(--tl-ease);
}
.tl-seg > :is(button, a):hover { color: var(--tl-ink); }
.tl-seg > :is(button, a):is([aria-pressed="true"], [aria-selected="true"], [aria-current="page"], .is-on) {
  background: var(--tl-control); color: var(--tl-ink); box-shadow: var(--tl-seg-on-shadow);
}
.tl-seg.is-sm > :is(button, a) { height: 24px; padding: 0 10px; font-size: 12px; }
/* Pico skins [role=group] (and tablist) as a joined, full-width button group
   with a blue focus ring and flex:1 children. A segmented control carries
   those roles for accessibility, so undo all of it here, whatever the role. */
.tl-seg[role] { display: inline-flex; width: auto; margin: 0; vertical-align: middle; border-radius: var(--tl-r-chip); }
.tl-seg, .tl-seg[role]:focus-within, .tl-seg[role]:has(:focus) { box-shadow: none !important; }
.tl-seg[role] > * { flex: none; position: static; margin: 0 !important; border-radius: var(--tl-r-seg-in) !important; }
.tl-seg[role] > :is(button, a):not(:is([aria-pressed="true"], [aria-selected="true"], [aria-current="page"], .is-on)) { box-shadow: none; }
.tl-chip {
  height: 30px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--tl-r-chip); border: 1px solid var(--tl-line-10);
  background: transparent; color: var(--tl-ink-70);
  font-size: 13px; font-weight: 400; white-space: nowrap; cursor: pointer;
}
.tl-chip:hover { color: var(--tl-ink); border-color: var(--tl-line-18); }
.tl-chip:is(.is-on, [aria-pressed="true"]) { border-color: var(--tl-ink); background: var(--tl-ink); color: var(--tl-on-ink); font-weight: 600; }
.tl-chip.is-dashed { border-style: dashed; border-color: var(--tl-line-18); color: var(--tl-ink-50); }
.tl-btn-ink {
  height: 32px; padding: 0 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--tl-r-btn);
  background: var(--tl-ink); color: var(--tl-on-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tl-btn-ink:hover { background: var(--tl-ink-hover); color: var(--tl-on-ink); }
.tl-btn-ghost {
  height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--tl-r-btn); border: 1px solid var(--tl-line-12);
  background: var(--tl-control); color: var(--tl-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tl-btn-ghost:hover { background: var(--tl-page); color: var(--tl-ink); }
:is(.tl-btn-ink, .tl-btn-ghost, .tl-btn-ink-lg, .tl-chip):is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed; opacity: 1; background: var(--tl-fill-06); color: var(--tl-ink-40); border-color: transparent;
}
.tl-arrow-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--tl-r-chip); border: 1px solid var(--tl-line-12);
  background: var(--tl-control); color: var(--tl-ink-70); cursor: pointer;
}
.tl-arrow-btn:hover { color: var(--tl-ink); }
.tl-input {
  height: 32px !important; margin: 0 !important; padding: 0 11px !important;
  border-radius: var(--tl-r-btn) !important; border: 1px solid var(--tl-line-10) !important;
  background: var(--tl-control) !important; color: var(--tl-ink) !important;
  font: 400 13px var(--tl-font) !important; box-shadow: none !important;
}
.tl-input::placeholder { color: var(--tl-ink-45); }
.tl-input:focus { border-color: var(--tl-ink) !important; box-shadow: 0 0 0 3px var(--tl-fill-06) !important; }
textarea.tl-input { height: auto !important; padding: 10px 12px !important; line-height: 1.5; resize: vertical; }

/* Tags */
.tl-tag {
  height: 22px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--tl-r-pill);
  font-family: var(--tl-mono); font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.tl-tag.is-up { background: var(--tl-up-bg); color: var(--tl-up); }
.tl-tag.is-down { background: var(--tl-down-bg); color: var(--tl-down); }
.tl-tag.is-neutral { background: var(--tl-fill-06); color: var(--tl-ink-60); }
.tl-tag.is-ink { background: var(--tl-ink); color: var(--tl-on-ink); }
.tl-kicker { font-family: var(--tl-mono); font-size: 10.5px; letter-spacing: 0.5px; color: var(--tl-ink-50); text-transform: uppercase; }

/* Progress dots */
.tl-dots { display: flex; gap: 4px; }
.tl-dots > :is(span, button) {
  width: 6px; height: 4px; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: var(--tl-line-15); transition: width 0.3s, background 0.3s;
}
.tl-dots > .is-on { width: 18px; background: var(--tl-ink); }

/* Stat tile */
.tl-tile { border-radius: var(--tl-r-card); border: 1px solid var(--tl-line-07); background: var(--tl-card-bg); box-shadow: var(--tl-card-shadow); padding: 11px 14px; }
.tl-tile .k { font-family: var(--tl-mono); font-size: 10px; letter-spacing: 0.5px; color: var(--tl-ink-50); margin-bottom: 4px; text-transform: uppercase; }
.tl-tile .v { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.tl-tile .v.is-up { color: var(--tl-up); }

/* Odds bar */
.tl-odds-head { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.tl-odds-head b { font-size: 14px; font-weight: 650; }
.tl-odds-bar { display: flex; gap: 2px; height: 5px; }
.tl-odds-bar > i { border-radius: 3px; }
.tl-odds-bar > i.fav { background: var(--tl-ink); }
.tl-odds-bar > i.dog { flex: 1; background: var(--tl-line-18); }

/* Percentile bar with a median tick */
.tl-pct { position: relative; height: 4px; border-radius: 2px; background: var(--tl-line-08); }
.tl-pct > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--tl-ink); transition: width 0.6s var(--tl-ease); }
.tl-pct::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--tl-ink-35); }

/* Tooltip */
.tl-tooltip {
  position: absolute; z-index: 30; pointer-events: none;
  padding: 7px 9px; border-radius: 7px;
  background: var(--tl-tooltip-bg); color: var(--tl-tooltip-ink);
  font-size: 11.5px; line-height: 1.4; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5);
}

/* Swap animation (carousels, leader card) */
.tl-swap { transition: opacity 0.22s var(--tl-ease), transform 0.22s var(--tl-ease); }
.tl-swap.is-leaving { opacity: 0; transform: translateY(6px); }
.tl-chev { display: inline-block; transition: transform 0.25s var(--tl-ease); }
[aria-expanded="true"] > .tl-chev, .is-open .tl-chev { transform: rotate(180deg); }

/* ---------- States ---------- */
.tl-empty { padding: 28px 18px; text-align: center; font-size: 13.5px; color: var(--tl-ink-50); }
.tl-empty > p { margin: 0 0 12px; }
.tl-empty.is-error > p { color: var(--tl-down); }
@keyframes tl-shimmer { from { background-position: -240px 0; } to { background-position: 240px 0; } }
.tl-skel {
  display: block; border-radius: 6px;
  background: var(--tl-fill-05) linear-gradient(90deg, transparent, var(--tl-fill-04), transparent) no-repeat;
  background-size: 240px 100%;
  animation: tl-shimmer 1.2s linear infinite;
}
.tl-skel.is-line { height: 12px; margin: 6px 0; }
.tl-skel.is-block { height: 120px; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .tl-shell { grid-template-columns: minmax(0, 1fr); }
  .tl-menu-btn { display: inline-flex; }
  .tl-sidebar {
    position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; height: 100vh;
    width: min(300px, 86vw); padding-top: 18px;
    transform: translateX(-100%); transition: transform 0.3s var(--tl-ease);
    box-shadow: var(--tl-card-shadow-hover);
  }
  body.tl-drawer-open .tl-sidebar { transform: none; }
  body.tl-drawer-open .tl-scrim { opacity: 1; pointer-events: auto; }
  .tl-topbar { gap: 16px; }
  .tl-search { width: 220px; }
}
@media (max-width: 1100px) {
  .tl-split-8-4 { grid-template-columns: minmax(0, 1fr); }
  .tl-grid12 > [class*="tl-span-"] { grid-column: 1 / -1; }
  .tl-grid12 > .tl-span-6.is-pair, .tl-grid12 > .tl-span-4.is-pair, .tl-grid12 > .tl-span-3.is-pair { grid-column: span 6; }
  .tl-sticky { position: static; }
}
@media (max-width: 1023px) {
  .tl-topbar .tl-nav { display: none; }
  .tl-sidebar .tl-side-nav { display: flex; }
}
@media (max-width: 720px) {
  .tl-topbar { padding: 0 12px; gap: 10px; }
  .tl-brand span { display: none; }
  .tl-search { width: auto; flex: 1; min-width: 0; }
  .tl-search .tl-kbd { display: none; }
  .tl-topbar-right { flex: 1; min-width: 0; gap: 8px; }
  .tl-topbar-actions .tl-btn-outline-lg { display: none; }
  .tl-band { padding: 18px 16px 0; }
  .tl-h1 { font-size: 28px; letter-spacing: -0.7px; }
  .tl-body { padding: 14px 16px 40px; }
  .tl-grid12 > [class*="tl-span-"].is-pair { grid-column: 1 / -1; }
  .tl-card-head { padding: 12px 14px 10px; flex-wrap: wrap; }
  .tl-row, .tl-colhead { padding-left: 14px; padding-right: 14px; }
}
.tl-side-nav { display: none; flex-direction: column; gap: 2px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--tl-line-07); }

@media (prefers-reduced-motion: reduce) {
  .tl-card.is-lift, .tl-tab::after, .tl-swap, .tl-chev, .tl-sidebar, .tl-pct > i, .tl-dots > * { transition: none !important; }
  .tl-card.is-lift:hover { transform: none; }
  .tl-skel { animation: none; }
}
