/* Thresholds breach timeline and the SLO panel (run page). Incumbent tokens only. The strip follows
   the status-page pattern (incident.io, Better Stack): a thin segmented track per row, time running
   left to right over the run, states in the palette's good/bad/accent. */
.panel-thresholds .panel-head { flex-wrap: wrap; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--text-dim); }
.tl-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tl-key { width: 14px; height: 6px; border-radius: 2px; }
.tl-axis { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.th-tl { width: 26%; min-width: 160px; }
.thresholds .mono { overflow-wrap: normal; word-break: normal; }
.td-tl { min-width: 180px; }

.tl { position: relative; padding: 6px 0 10px; }
.tl-track { position: relative; display: block; height: 8px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; }
.tl-pending { background: var(--border); }
.tl-passing { background: var(--good); }
.tl-breached { background: var(--bad); }
.tl-recovered { background: var(--accent); }
.tl-ticks { position: absolute; left: 0; right: 0; top: 0; height: 26px; pointer-events: none; }
.tl-tick { position: absolute; top: 2px; width: 12px; height: 16px; margin-left: -6px; pointer-events: auto; cursor: help; border-radius: 3px; }
.tl-tick::after { content: ""; position: absolute; left: 5px; top: 0; width: 2px; height: 16px; border-radius: 1px; background: var(--text); }
.tl-tick-breached::after { background: var(--bad); box-shadow: 0 0 0 1px var(--panel); }
.tl-tick-recovered::after { background: var(--accent); box-shadow: 0 0 0 1px var(--panel); }
.tl-tick:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tl-abort { position: absolute; top: 2px; pointer-events: auto; cursor: help; width: 16px; height: 16px; margin-left: -8px; color: var(--warn); }
.tl-abort .icon { width: 16px; height: 16px; }

.chip-abort, .chip-stopped, .chip-aof, .chip-gating, .chip-soft {
  display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 0; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip-abort, .chip-stopped { background: var(--warn-soft); color: var(--warn); }
.chip-abort .icon, .chip-stopped .icon { width: 13px; height: 13px; }
.chip-aof { color: var(--text-dim); border: 1px solid var(--border); font-weight: 500; }
.tv-bound { display: block; margin-top: 2px; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.slo-list { list-style: none; margin: 10px 0 4px; padding: 0; }
.slo {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "head budget" "objective budget" "facts facts";
  gap: 4px 28px; padding: 14px 0; border-top: 1px solid var(--border-soft);
}
.slo:first-child { border-top: 0; }
.slo-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.slo-name { margin: 0; font-size: 15px; font-weight: 650; }
.slo-objective { grid-area: objective; margin: 0; color: var(--text-dim); font-size: 12.5px; overflow-wrap: anywhere; }
.slo-budget { grid-area: budget; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 12px; align-self: center; }
.slo-budget-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.slo-budget-text { justify-self: end; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: underline dotted var(--text-faint); text-underline-offset: 4px; cursor: help; }
.slo-track { grid-column: 1 / -1; position: relative; display: block; height: 6px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.slo-fill { position: absolute; inset: 0; border-radius: 3px; background: var(--good); transform-origin: left center; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.slo-track[data-state="burning"] .slo-fill { background: var(--warn); }
.slo-track[data-state="exhausted"] .slo-fill { background: var(--bad); }
.slo-track[data-state="pending"] .slo-fill { background: var(--border); }
.slo-facts { grid-area: facts; margin: 2px 0 0; font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.chip-gating { background: var(--accent-soft); color: var(--accent); }
.chip-soft { color: var(--text-dim); border: 1px solid var(--border); font-weight: 500; }
.slo-met { font-size: 12.5px; font-weight: 700; }
.slo-met.good { color: var(--good); }
.slo-met.bad { color: var(--bad); }
.panel-slos { margin-top: 16px; }

@media (max-width: 760px) {
  /* A phone stacks each threshold: name and value left, result right, the strip full width under them. */
  .panel-thresholds .table-scroll { overflow: visible; margin: 8px 0 0; }
  .thresholds, .thresholds tbody { display: block; }
  .thresholds thead { display: none; }
  .thresholds tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name result" "value result" "tl tl"; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
  .thresholds td { display: block; padding: 0; border: 0; }
  .thresholds td:nth-child(1) { grid-area: result; }
  .thresholds td:nth-child(2) { grid-area: name; overflow-wrap: anywhere; }
  .thresholds td:nth-child(3) { grid-area: value; }
  .thresholds td:nth-child(4) { grid-area: tl; min-width: 0; }
  .thresholds .mono { overflow-wrap: anywhere; }
  .th-result { align-items: flex-end; max-width: 13rem; }
  /* The abort chip is a sentence plus a ticking count: it wraps here instead of squeezing the name column. */
  .chip-abort { flex-wrap: wrap; white-space: normal; border-radius: 14px; }
  .slo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "objective" "budget" "facts"; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .slo-fill { transition: none; }
}
.slo-track[data-state="exhausted"] { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
