/* Settings -> Telemetry. Categorical series use the validated 8-hue order
   (dataviz reference palette), stepped separately for dark and light. */
.tm {
  --tm-s1: #3987e5; --tm-s2: #d95926; --tm-s3: #199e70; --tm-s4: #c98500;
  --tm-s5: #d55181; --tm-s6: #008300; --tm-s7: #9085e9; --tm-other: #6b6b6b;
  --tm-grid: rgba(255, 255, 255, 0.07); --tm-axis: var(--text-faint);
}
html[data-theme="light"] .tm {
  --tm-s1: #2a78d6; --tm-s2: #eb6834; --tm-s3: #1baf7a; --tm-s4: #eda100;
  --tm-s5: #e87ba4; --tm-s6: #008300; --tm-s7: #4a3aa7; --tm-other: #a3a3a3;
  --tm-grid: rgba(0, 0, 0, 0.07);
}
.tm .tm-s1 { fill: var(--tm-s1); background: var(--tm-s1); }
.tm .tm-s2 { fill: var(--tm-s2); background: var(--tm-s2); }
.tm .tm-s3 { fill: var(--tm-s3); background: var(--tm-s3); }
.tm .tm-s4 { fill: var(--tm-s4); background: var(--tm-s4); }
.tm .tm-s5 { fill: var(--tm-s5); background: var(--tm-s5); }
.tm .tm-s6 { fill: var(--tm-s6); background: var(--tm-s6); }
.tm .tm-s7 { fill: var(--tm-s7); background: var(--tm-s7); }
.tm .tm-other { fill: var(--tm-other); background: var(--tm-other); }

.tm-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.tm-scopes { display: flex; flex-wrap: wrap; gap: .4rem; }
.tm-scope {
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--stroke);
  font-size: .85rem; color: var(--text-soft); background: var(--chip-bg); cursor: pointer;
}
.tm-scope:hover { color: var(--text); border-color: var(--stroke-strong); }
.tm-scope.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.tm-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; padding: .9rem 1rem; }
.tm-field { display: flex; flex-direction: column; gap: .25rem; min-width: 9rem; font-size: .75rem; color: var(--text-faint); }
.tm-field.hidden { display: none; }
.tm-field > span { text-transform: uppercase; letter-spacing: .12em; }
.tm-field select, .tm-field input {
  font-size: .85rem; color: var(--text); background: var(--surface-muted); border: 1px solid var(--stroke);
  border-radius: .6rem; padding: .45rem .6rem; min-height: 2.25rem; max-width: 18rem;
}
.tm-search { flex: 1 1 16rem; }
.tm-search input { max-width: none; width: 100%; }
.tm-filter-actions { flex-direction: row; align-items: center; gap: .75rem; min-width: 0; }
.tm-inline { flex-direction: row; align-items: center; gap: .5rem; min-width: 0; }

.tm-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tm-chip {
  display: inline-flex; gap: .4rem; align-items: center; font-size: .8rem; padding: .25rem .65rem;
  border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--stroke-strong); color: var(--text);
}
.tm-chip:hover { border-color: var(--danger); }
.tm-focus, .tm-served { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; }
.tm-served { font-size: .9rem; color: var(--text-soft); }
.tm-served:hover { border-color: var(--stroke-strong); }
.tm-link { color: var(--text-soft); text-decoration: underline; text-decoration-color: var(--stroke-strong); text-underline-offset: 3px; cursor: pointer; }
.tm-link:hover { color: var(--text); text-decoration-color: currentColor; }
.tm-delta { color: var(--text-soft); }

.tm-card-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.tm-chart-card { padding: 1rem; }
.tm-chart-controls { display: flex; flex-wrap: wrap; gap: .75rem; }
.tm-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: .75rem 0 .25rem; font-size: .8rem; color: var(--text-soft); }
.tm-legend a, .tm-legend span { display: inline-flex; gap: .35rem; align-items: center; }
.tm-legend a { text-decoration: none; }
.tm-legend a:hover { color: var(--text); text-decoration: underline; }
.tm-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; flex: none; }
.tm-chart { position: relative; margin-top: .5rem; }
.tm-chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.tm-grid { stroke: var(--tm-grid); stroke-width: 1; }
.tm-baseline { stroke: var(--stroke-strong); stroke-width: 1; }
.tm-axis { fill: var(--tm-axis); font-size: 10px; }
.tm-hit { fill: transparent; }
.tm-col { outline: none; }
.tm-col[data-href] { cursor: pointer; }
.tm-col.is-hover .tm-hit, .tm-col:focus-visible .tm-hit { fill: var(--tm-grid); }
.tm-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-soft); font-size: .9rem; }
.tm-tip {
  position: absolute; z-index: 5; min-width: 12rem; max-width: 18rem; pointer-events: none;
  background: var(--surface-strong); border: 1px solid var(--stroke-strong); border-radius: .6rem;
  box-shadow: var(--shadow); padding: .6rem .7rem; font-size: .78rem; color: var(--text-soft);
}
.tm-tip.hidden { display: none; }
.tm-tip-title { color: var(--text); font-weight: 600; }
.tm-tip-total { margin: .15rem 0 .35rem; }
.tm-tip-row { display: flex; gap: .45rem; align-items: center; }
.tm-tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-tip-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tm-tip-hint { margin-top: .35rem; color: var(--text-faint); }

.tm-split { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tm-bars { list-style: none; padding: 0; display: grid; gap: .35rem; }
.tm-bar-row { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr auto; gap: .75rem; align-items: center; padding: .3rem .4rem; border-radius: .5rem; font-size: .85rem; }
.tm-bar-row:hover { background: var(--chip-bg); }
.tm-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-bar-track { display: block; width: 100%; height: .5rem; border-radius: 999px; background: var(--tm-grid); overflow: hidden; }
.tm-bar-fill { fill: var(--tm-s1); }
.tm-bar-value { color: var(--text-faint); font-size: .75rem; font-variant-numeric: tabular-nums; }

.tm-table { width: 100%; text-align: left; font-size: .875rem; border-collapse: collapse; }
.tm-table thead { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); border-bottom: 1px solid var(--stroke); }
.tm-table th { padding: .7rem 1rem; font-weight: 500; }
.tm-table td { padding: .7rem 1rem; border-top: 1px solid var(--stroke); vertical-align: top; }
.tm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tm-table tbody tr:hover { background: var(--chip-bg); }
.tm-table tr.is-active { background: var(--accent-soft); }
.tm-compact td { padding: .45rem 1rem; }
.tm-drill { display: block; cursor: pointer; }
.tm-drill:hover .font-medium { text-decoration: underline; text-underline-offset: 3px; }
.tm-share { display: block; margin-top: .4rem; width: 100%; height: 3px; border-radius: 999px; background: var(--tm-grid); max-width: 14rem; overflow: hidden; }
.tm-share rect { fill: var(--tm-s1); }
.tm-sort { color: inherit; cursor: pointer; }
.tm-sort.is-active, .tm-sort:hover { color: var(--text); }
.tm-row-actions { white-space: nowrap; }
.tm-row-actions a + a { margin-left: .75rem; }
.tm-pager { display: flex; gap: 1rem; justify-content: center; align-items: center; padding: .75rem; font-size: .8rem; color: var(--text-faint); border-top: 1px solid var(--stroke); }
