/* Blob Watch tab (src/e2e/blob-watch.ts, blob-backend specs/053 revision 2):
   the timing overview — filters, a coverage line and ten metric cards in three
   groups. Builds on session-viewer.css: the panel also carries `.sv`, so its
   cards, buttons, chips and filters apply. Everything here is scoped to
   #tab-watch. One session's timings are styled by session-timings.css. */

#tab-watch .bw-lede {
  margin: 4px 0 0;
  max-width: 80ch;
  font-size: 13px;
  color: var(--muted);
}
#tab-watch .bw-titleactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
#tab-watch .bw-asof {
  font-size: 12px;
  color: var(--muted);
}

/* ── Filters ──────────────────────────────────────────────────────────── */
/* Six filters, six equal columns with one even gap; the toggle row below keeps
   that same gap. Narrower screens step down to 3, 2 and 1 equal columns, so
   the fields always fill the row instead of leaving an empty track. */
#tab-watch .bw-filters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
#tab-watch .bw-filters .sv-field,
#tab-watch .bw-filters .sv-field input,
#tab-watch .bw-filters .sv-field select {
  min-width: 0;
  width: 100%;
}
#tab-watch #bw-toolbar .sv-toolrow {
  margin-top: 14px;
}
@media (max-width: 1180px) {
  #tab-watch .bw-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  #tab-watch .bw-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 460px) {
  #tab-watch .bw-filters {
    grid-template-columns: 1fr;
  }
}
#tab-watch .bw-clamp {
  background: var(--sv-amber-bg);
  color: var(--sv-amber-ink);
}

/* The device-timings toggle: a check box inside the pill. Pressed (included)
   is filled with a tick; unpressed (left out) is an empty box, dashed and
   muted — the two never look alike, and neither relies on colour alone. */
#tab-watch .bw-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#tab-watch .bw-toggle-box {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  flex: none;
}
#tab-watch .bw-toggle-box .sv-ic {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  vertical-align: 0;
}
#tab-watch .bw-toggle[aria-pressed='true'] {
  background: var(--sv-blue-bg);
  color: var(--sv-blue-ink);
  border-color: var(--sv-blue-ink);
}
#tab-watch .bw-toggle[aria-pressed='true'] .bw-toggle-box {
  background: var(--sv-blue-ink);
  border-color: var(--sv-blue-ink);
  color: #fff;
}
#tab-watch .bw-toggle[aria-pressed='false'] {
  background: #fff;
  color: var(--muted);
  border-style: dashed;
}
#tab-watch .bw-toggle[aria-pressed='false'] .bw-toggle-box .sv-ic {
  visibility: hidden;
}

/* ── Coverage line (FR-004, FR-009, FR-010) ───────────────────────────── */
#tab-watch .bw-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}
#tab-watch .bw-coverage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}
#tab-watch .bw-coverage-line {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#tab-watch .bw-viewlink {
  font-weight: 800;
  white-space: nowrap;
}
#tab-watch .bw-truncated {
  margin: 0;
  background: var(--sv-amber-bg);
  color: var(--sv-amber-ink);
}
#tab-watch .bw-computing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ── Metric cards (FR-005), in three groups ───────────────────────────── */
#tab-watch .bw-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#tab-watch .bw-group-h {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
#tab-watch .bw-mcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
#tab-watch .bw-mcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
}
#tab-watch .bw-mcard-h {
  margin: 0;
  font-size: 13px;
}
#tab-watch .bw-mcard-avg {
  margin: 2px 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
#tab-watch .bw-mcard-n,
#tab-watch .bw-mcard-src,
#tab-watch .bw-mcard-est {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
#tab-watch .bw-src-word {
  cursor: help;
  border-bottom: 1px dotted var(--border);
}
#tab-watch .bw-mcard-est {
  color: var(--sv-amber-ink);
}
/* avg_ms: null → "not reported", greyed; never "0 ms". */
#tab-watch .bw-mcard.is-missing .bw-mcard-avg {
  font-size: 16px;
}
#tab-watch .bw-missing {
  color: var(--muted);
  font-style: italic;
  font-weight: 700;
}
/* Slow averages (US5): never colour alone — a border and an underline too. */
#tab-watch .bw-mcard.is-slow {
  border-color: var(--sv-red-ink);
  box-shadow: inset 4px 0 0 var(--sv-red-ink);
  background: var(--sv-red-bg);
}
#tab-watch .bw-mcard.is-slow .bw-avg-v {
  color: var(--sv-red-ink);
  text-decoration: underline dotted;
}
#tab-watch .bw-skelcard {
  gap: 10px;
}
#tab-watch .bw-skel-avg {
  height: 24px;
}

/* ── Empty ────────────────────────────────────────────────────────────── */
#tab-watch .bw-empty {
  padding: 24px 12px;
}

/* Phones: the cards stack in one column; nothing scrolls sideways. */
@media (max-width: 720px) {
  #tab-watch .bw-mcards {
    grid-template-columns: 1fr;
  }
  #tab-watch .bw-titleactions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ══ specs/055: sub-tabs, card links, Trends & outliers, the Bars panel ══ */
/* The console is light-only (session-viewer.css), so these use its tokens
   and no colour of their own: a dark theme would follow the tokens. */
#tab-watch {
  --bw-slow: var(--sv-red-ink);
  --bw-fast: #c27a00;
  --bw-dot: #9a97ad;
  --bw-line: var(--sv-blue-ink);
}

/* ── Sub-tabs (console-ui §1) ─────────────────────────────────────────── */
#tab-watch .bw-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 12px;
  border-bottom: 1px solid var(--border);
}
#tab-watch .bw-tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
#tab-watch .bw-tab.is-on {
  color: var(--text);
  border-bottom-color: var(--sv-blue-ink);
}
#tab-watch .bw-tab:focus-visible {
  outline: none;
  box-shadow: var(--sv-ring);
  border-radius: 8px 8px 0 0;
}
#tab-watch .bw-barsnote:empty,
#tab-watch #bw-barsnote:empty {
  display: none;
}

/* ── Overview cards: one stretched link, the "bar" button above it (M8) ── */
#tab-watch .bw-mcard.has-link {
  position: relative;
  transition: box-shadow 0.15s var(--sv-ease);
}
#tab-watch .bw-mcard.has-link:hover {
  box-shadow: var(--sv-shadow-hover);
}
#tab-watch .bw-mcard-link {
  color: inherit;
  text-decoration: none;
}
#tab-watch .bw-mcard-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
#tab-watch .bw-mcard-link:focus-visible {
  outline: none;
}
#tab-watch .bw-mcard-link:focus-visible::after {
  box-shadow: var(--sv-ring);
}
#tab-watch .bw-mcard-bar {
  margin: 0;
}
#tab-watch .bw-barbtn {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline dotted;
  cursor: pointer;
}
#tab-watch .bw-barbtn:hover,
#tab-watch .bw-barbtn:focus-visible {
  color: var(--sv-blue-ink);
}
#tab-watch .bw-seetrend {
  font-size: 12px;
  font-weight: 700;
  color: var(--sv-blue-ink);
  opacity: 0;
  transition: opacity 0.15s var(--sv-ease);
}
#tab-watch .bw-mcard.has-link:hover .bw-seetrend,
#tab-watch .bw-mcard.has-link:focus-within .bw-seetrend {
  opacity: 1;
}
@media (hover: none) {
  #tab-watch .bw-seetrend {
    opacity: 1;
  }
}

/* ── Trends & outliers (console-ui §3–§8) ─────────────────────────────── */
#tab-watch .bw-trends.is-loading .bw-t-chartwrap,
#tab-watch .bw-trends.is-loading .bw-t-list {
  opacity: 0.55;
  transition: opacity 0.2s;
}
#tab-watch .bw-t-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}
#tab-watch .bw-t-field {
  min-width: 180px;
}
#tab-watch .bw-t-field select {
  width: 100%;
}
#tab-watch .bw-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
#tab-watch .bw-seg-b {
  appearance: none;
  border: 0;
  background: var(--surface);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
#tab-watch .bw-seg-b + .bw-seg-b {
  border-left: 1px solid var(--border);
}
#tab-watch .bw-seg-b.is-on {
  background: var(--sv-blue-bg);
  color: var(--sv-blue-ink);
}
#tab-watch .bw-t-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
#tab-watch .bw-t-summary {
  margin: 14px 0 8px;
  font-size: 14px;
}
#tab-watch .bw-t-slow {
  color: var(--bw-slow);
}
#tab-watch .bw-t-fast {
  color: var(--bw-fast);
}
#tab-watch .bw-t-daychip {
  margin-left: 6px;
}
#tab-watch .bw-t-how-panel {
  padding: 14px 16px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}
#tab-watch .bw-t-how-h {
  margin: 0 0 6px;
}
#tab-watch .bw-t-method {
  margin: 6px 0 0;
  color: var(--muted);
}
#tab-watch .bw-t-msg.is-error {
  background: var(--sv-red-bg);
  color: var(--sv-red-ink);
}

/* Chart */
#tab-watch .bw-t-chartwrap {
  position: relative;
  margin: 4px 0 14px;
}
#tab-watch .bw-chart,
#tab-watch .bw-strip {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}
/* The canvas only paints the dots; clicks go through to the chart under it. */
#tab-watch .bw-t-canvas {
  position: absolute;
  inset: 0 auto auto 0;
  max-width: 100%;
  pointer-events: none;
}
/* Labels over the data keep a halo of the page colour, so they stay legible. */
#tab-watch .bw-fence text,
#tab-watch .bw-strip-gate text,
#tab-watch .bw-nocover text {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
#tab-watch .bw-tick line {
  stroke: var(--border);
  stroke-width: 1;
}
#tab-watch .bw-tick text,
#tab-watch .bw-xlab,
#tab-watch .bw-strip-lab {
  font-size: 11px;
  fill: var(--muted);
}
#tab-watch .bw-col {
  fill: transparent;
  cursor: pointer;
}
#tab-watch .bw-col:hover {
  fill: var(--sv-hover);
}
#tab-watch .bw-col.is-sel {
  fill: var(--sv-blue-bg);
}
#tab-watch .bw-nocover rect {
  pointer-events: none;
  opacity: 0.6;
}
#tab-watch #bw-hatch line {
  stroke: var(--border);
  stroke-width: 2;
}
#tab-watch .bw-nocover text {
  font-size: 11px;
  fill: var(--muted);
}
#tab-watch .bw-fence line {
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}
#tab-watch .bw-fence text {
  font-size: 11px;
  font-weight: 600;
}
#tab-watch .bw-fence.is-hi line,
#tab-watch .bw-fence.is-bar line {
  stroke: var(--bw-slow);
}
#tab-watch .bw-fence.is-hi text,
#tab-watch .bw-fence.is-bar text {
  fill: var(--bw-slow);
}
#tab-watch .bw-fence.is-lo line {
  stroke: var(--bw-fast);
}
#tab-watch .bw-fence.is-lo text {
  fill: var(--bw-fast);
}
#tab-watch .bw-line,
#tab-watch .bw-week-flat {
  fill: none;
  stroke: var(--bw-line);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
#tab-watch .bw-pt {
  fill: var(--bw-line);
  stroke: var(--surface);
  stroke-width: 1.5;
  cursor: pointer;
}
#tab-watch .bw-pt.is-partial {
  fill: var(--surface);
  stroke: var(--bw-line);
  stroke-width: 2;
}
#tab-watch .bw-pt:focus-visible {
  outline: none;
  stroke: var(--text);
  stroke-width: 3;
}
#tab-watch .bw-dot {
  fill: var(--bw-dot);
  opacity: 0.75;
  cursor: pointer;
}
#tab-watch .bw-dot.is-slow {
  fill: var(--bw-slow);
  opacity: 0.9;
}
#tab-watch .bw-dot.is-fast {
  fill: var(--bw-fast);
  opacity: 0.9;
}
#tab-watch .bw-dot.is-few {
  fill: var(--bw-dot);
}
#tab-watch .bw-strip-bar {
  fill: var(--sv-blue-ink);
  opacity: 0.45;
}
#tab-watch .bw-strip-bar.is-gated {
  opacity: 0.15;
}
#tab-watch .bw-strip-gate line {
  stroke: var(--muted);
  stroke-dasharray: 4 3;
}
#tab-watch .bw-strip-gate text {
  font-size: 10px;
  fill: var(--muted);
}
#tab-watch .bw-t-tip {
  position: absolute;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* What's different */
#tab-watch .bw-t-diff {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--sv-radius-sm);
  background: var(--sv-soft);
}
#tab-watch .bw-t-diff-h {
  margin: 0 0 6px;
  font-size: 13px;
}
#tab-watch .bw-t-diffs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
#tab-watch .bw-t-diff-bars {
  display: grid;
  gap: 2px;
  margin-top: 3px;
  max-width: 320px;
}
#tab-watch .bw-t-diff-f,
#tab-watch .bw-t-diff-a {
  display: block;
  height: 4px;
  border-radius: 2px;
}
#tab-watch .bw-t-diff-f {
  background: var(--bw-slow);
}
#tab-watch .bw-t-diff-a {
  background: var(--bw-dot);
}

/* List */
#tab-watch .bw-t-listhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
}
#tab-watch .bw-ltabs {
  display: inline-flex;
  gap: 4px;
}
#tab-watch .bw-ltab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#tab-watch .bw-ltab.is-on {
  background: var(--sv-blue-bg);
  border-color: transparent;
  color: var(--sv-blue-ink);
}
#tab-watch .bw-t-check {
  font-size: 13px;
}
#tab-watch .bw-t-howlink {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--sv-blue-ink);
  text-decoration: underline;
  cursor: pointer;
  margin-left: auto;
}
#tab-watch .bw-ltable {
  border: 1px solid var(--border);
  border-radius: var(--sv-radius-sm);
  overflow-x: auto;
}
#tab-watch .bw-lrow {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr 0.6fr 0.5fr 0.7fr 0.6fr 1.6fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 760px;
  padding: 8px 12px;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
#tab-watch .bw-lhead {
  border-top: 0;
  background: var(--sv-soft);
  font-weight: 700;
  color: var(--muted);
  cursor: default;
}
#tab-watch button.bw-lrow:hover {
  background: var(--sv-hover);
}
#tab-watch button.bw-lrow:focus-visible {
  outline: none;
  box-shadow: inset var(--sv-ring);
}
#tab-watch .bw-lrow .is-sorted {
  font-weight: 700;
}
#tab-watch .bw-mono {
  font-family: var(--sv-mono);
}
#tab-watch .bw-flag.is-slow {
  color: var(--bw-slow);
  font-weight: 700;
}
#tab-watch .bw-flag.is-fast {
  color: var(--bw-fast);
  font-weight: 700;
}
#tab-watch .bw-t-more {
  margin-top: 8px;
}

/* Session card: a popover on desktop, a bottom sheet on phones (§8) */
#tab-watch .bw-card {
  position: fixed;
  z-index: 10000;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--sv-radius);
  background: var(--surface);
  box-shadow: var(--sv-shadow-hover);
  font-size: 13px;
}
#tab-watch .bw-card:focus {
  outline: none;
}
#tab-watch .bw-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
#tab-watch .bw-card-id {
  margin: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
#tab-watch .bw-card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 10px 0;
}
#tab-watch .bw-card-facts dt {
  color: var(--muted);
  font-size: 11px;
}
#tab-watch .bw-card-facts dd {
  margin: 0;
}
#tab-watch .bw-card-bars {
  display: block;
  width: 100%;
  height: 72px;
  margin: 6px 0;
}
#tab-watch .bw-card-bar {
  fill: var(--bw-dot);
}
#tab-watch .bw-card-bar.is-worst {
  fill: var(--bw-slow);
}
#tab-watch .bw-card-barline {
  stroke: var(--bw-slow);
  stroke-width: 0.6;
  stroke-dasharray: 2 1.5;
}
#tab-watch .bw-card-pattern {
  margin: 6px 0;
}
#tab-watch .bw-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
#tab-watch .bw-card-newtab {
  font-size: 12px;
}

/* ── The Bars panel (§11): a side sheet, a bottom sheet on phones ──────── */
/* Above the console's status pill (z-index 9999, top right), which would
   otherwise cover the panel's close button. */
#tab-watch .bw-sheet {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  overflow: auto;
  padding: 18px 20px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--sv-shadow-hover);
  font-size: 14px;
}
/* The header (with Close) stays in view however long History gets. */
#tab-watch .bw-bars-head {
  position: sticky;
  top: -18px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -18px -20px 0;
  padding: 14px 20px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
#tab-watch .bw-bars-x {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#tab-watch .bw-bars-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
#tab-watch .bw-bars-title {
  margin: 0;
  font-size: 17px;
}
#tab-watch .bw-bars-title:focus {
  outline: none;
}
#tab-watch .bw-bars-lede,
#tab-watch .bw-bars-src,
#tab-watch .bw-bars-last {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}
#tab-watch .bw-bars-src.is-warn {
  background: var(--sv-amber-bg);
  color: var(--sv-amber-ink);
}
#tab-watch .bw-bars-list {
  margin: 12px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
#tab-watch .bw-bars-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
#tab-watch .bw-bars-list li > span:first-child,
#tab-watch .bw-bars-list li > label {
  flex: 1;
}
#tab-watch .bw-bars-in input {
  width: 84px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}
#tab-watch .bw-bars-in input:focus-visible {
  outline: none;
  box-shadow: var(--sv-ring);
}
#tab-watch .bw-bars-err {
  flex-basis: 100%;
  color: var(--sv-red-ink);
  font-size: 12px;
}
#tab-watch .bw-bars-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
#tab-watch .bw-bars-note input {
  width: 100%;
}
#tab-watch .bw-bars-conflict {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--sv-radius-sm);
  background: var(--sv-amber-bg);
}
#tab-watch .bw-bars-cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#tab-watch .bw-bars-cmp th,
#tab-watch .bw-bars-cmp td {
  text-align: left;
  padding: 3px 6px;
}
#tab-watch .bw-bars-toast {
  background: var(--sv-green-bg);
  color: var(--sv-green-ink);
}
#tab-watch .bw-bars-hist {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
#tab-watch .bw-bars-histbox summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 720px) {
  #tab-watch .bw-card,
  #tab-watch .bw-card.is-sheet {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: var(--sv-radius) var(--sv-radius) 0 0;
  }
  #tab-watch .bw-sheet {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 85vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--sv-radius) var(--sv-radius) 0 0;
  }
  #tab-watch .bw-t-field {
    min-width: 0;
    flex: 1 1 100%;
  }
  #tab-watch .bw-t-howlink {
    margin-left: 0;
  }
}

/* ══ spec 055 revision 3: one page — cards on top of the trend ══════════ */
#tab-watch .bw-board {
  margin-top: 14px;
  padding: 16px 18px 18px;
}
#tab-watch .bw-board .bw-trends {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
#tab-watch .bw-overview.is-loading .bw-mcards {
  opacity: 0.55;
  transition: opacity 0.2s;
}

/* Over the bar: amber up to 10 % over (warn), red beyond (crit). Never
   colour alone: the border, the inset stripe and the underline stay. */
#tab-watch .bw-mcard.is-slow.is-warn {
  border-color: var(--bw-fast);
  box-shadow: inset 4px 0 0 var(--bw-fast);
  background: var(--sv-amber-bg);
}
#tab-watch .bw-mcard.is-slow.is-warn .bw-avg-v {
  color: var(--sv-amber-ink);
}

/* The picked card: an outline and a "Showing below" note. */
#tab-watch .bw-mcard.is-selected {
  outline: 2px solid var(--sv-blue-ink);
  outline-offset: 2px;
}
#tab-watch .bw-mcard.is-selected .bw-seetrend {
  opacity: 1;
}
#tab-watch .bw-mcard-pick {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
#tab-watch .bw-mcard-pick::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
#tab-watch .bw-mcard-pick:focus-visible {
  outline: none;
}
#tab-watch .bw-mcard-pick:focus-visible::after {
  box-shadow: var(--sv-ring);
}
#tab-watch .bw-mcard-window {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#tab-watch .bw-fewbadge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--sv-grey-bg);
  color: var(--sv-grey-ink);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* "Showing 12 Nov · back to 30 days" */
#tab-watch .bw-daybar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: var(--sv-radius-sm);
  background: var(--sv-blue-bg);
  color: var(--sv-blue-ink);
  font-size: 13px;
}
#tab-watch .bw-dayback {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The cards with no measured value, behind one chip. */
#tab-watch .bw-notreported {
  margin-top: 10px;
}
#tab-watch .bw-notreported-chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
#tab-watch .bw-notreported-chip::-webkit-details-marker {
  display: none;
}
#tab-watch .bw-notreported[open] .bw-mcards {
  margin-top: 10px;
}
#tab-watch .bw-t-metricname {
  margin: 0;
  align-self: center;
  font-size: 16px;
  font-weight: 800;
}

/* Phones: the cards become one sideways strip of compact chips (name, value,
   status colour) above the chart; the selected chip is scrolled into view. */
@media (max-width: 720px) {
  #tab-watch .bw-board {
    padding: 12px;
  }
  #tab-watch .bw-board .bw-groups {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
  }
  #tab-watch .bw-board .bw-group {
    display: contents;
  }
  #tab-watch .bw-board .bw-group-h,
  #tab-watch .bw-board .bw-mcard-n,
  #tab-watch .bw-board .bw-mcard-src,
  #tab-watch .bw-board .bw-mcard-est,
  #tab-watch .bw-board .bw-mcard-bar,
  #tab-watch .bw-board .bw-seetrend {
    display: none;
  }
  #tab-watch .bw-board .bw-mcards {
    display: contents;
  }
  #tab-watch .bw-board .bw-mcard {
    flex: 0 0 auto;
    min-width: 128px;
    max-width: 170px;
    padding: 8px 10px;
    gap: 2px;
    scroll-snap-align: center;
  }
  #tab-watch .bw-board .bw-mcard-h {
    font-size: 12px;
  }
  #tab-watch .bw-board .bw-mcard-avg {
    font-size: 18px;
  }
  #tab-watch .bw-board .bw-mcard.is-missing .bw-mcard-avg {
    font-size: 13px;
  }
  #tab-watch .bw-board .bw-notreported {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
  }
  #tab-watch .bw-board .bw-notreported[open] {
    display: contents;
  }
}

/* ══ The mockup cards: tags, a strip of tab-like cards, sparklines ═══════ */
#tab-watch .bw-gtabs {
  display: flex;
  gap: 4px;
  margin: 10px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#tab-watch .bw-gtabs::-webkit-scrollbar {
  display: none;
}
#tab-watch .bw-gtab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--sv-soft);
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
#tab-watch .bw-gtab.is-on {
  background: var(--surface);
  color: var(--text);
}
#tab-watch .bw-gtab:focus-visible {
  outline: none;
  box-shadow: var(--sv-ring);
}
#tab-watch .bw-gbadge {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
}
#tab-watch .bw-gbadge.is-crit {
  background: var(--sv-red-ink);
}
#tab-watch .bw-gbadge.is-warn {
  background: var(--bw-fast);
}

/* The strip: cards side by side like tabs; the picked one joins the chart. */
#tab-watch .bw-board .bw-groups {
  gap: 0;
}
#tab-watch .bw-board .bw-mstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 0 var(--sv-radius-sm) var(--sv-radius-sm) var(--sv-radius-sm);
  background: var(--sv-soft);
  overflow: hidden;
}
#tab-watch .bw-board .bw-mc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 10px 14px 10px;
  border: 0;
  border-right: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
#tab-watch .bw-board .bw-mc:last-child {
  border-right: 0;
}
#tab-watch .bw-board .bw-mc:hover {
  background: var(--surface);
}
#tab-watch .bw-board .bw-mc.is-selected {
  background: var(--surface);
  border-top-color: #9b59c9;
  outline: none;
}
#tab-watch .bw-board .bw-mc.is-slow,
#tab-watch .bw-board .bw-mc.is-slow.is-warn {
  background: transparent;
  box-shadow: none;
}
#tab-watch .bw-board .bw-mc.is-slow.is-selected {
  background: var(--surface);
}
#tab-watch .bw-mc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
#tab-watch .bw-mc-top .bw-mcard-h {
  min-width: 0;
  font-size: 12px;
  color: var(--sd-muted, var(--muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tab-watch .bw-overtag {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
#tab-watch .bw-overtag.is-crit {
  background: var(--sv-red-ink);
}
#tab-watch .bw-overtag.is-warn {
  background: var(--bw-fast);
}
#tab-watch .bw-devtag {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 6px;
}
#tab-watch .bw-mc-mid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
#tab-watch .bw-board .bw-mc .bw-mcard-avg {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
#tab-watch .bw-board .bw-mc.is-missing .bw-mcard-avg {
  font-size: 13px;
}
#tab-watch .bw-board .bw-mc.is-slow.is-crit .bw-avg-v {
  color: var(--sv-red-ink);
}
#tab-watch .bw-board .bw-mc.is-slow.is-warn .bw-avg-v {
  color: var(--sv-amber-ink);
}
#tab-watch .bw-spark {
  display: block;
  width: 100%;
  height: 26px;
  min-width: 60px;
}
#tab-watch .bw-spark path {
  fill: none;
  stroke: #1baf7a;
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
#tab-watch .bw-spark.is-warn path {
  stroke: var(--bw-fast);
}
#tab-watch .bw-spark.is-crit path {
  stroke: var(--sv-red-ink);
}
#tab-watch .bw-spark-bar {
  stroke: var(--sv-red-ink);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.6;
  vector-effect: non-scaling-stroke;
}
#tab-watch .bw-spark-day {
  stroke: #9b59c9;
  stroke-width: 2;
  opacity: 0.5;
  vector-effect: non-scaling-stroke;
}
#tab-watch .bw-mc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}
#tab-watch .bw-mc-meta .bw-barbtn {
  font-size: 11.5px;
}
#tab-watch .bw-mc-slow {
  color: var(--sv-red-ink);
  font-weight: 800;
}
#tab-watch .bw-mc-fast {
  color: var(--sv-amber-ink);
  font-weight: 700;
}
#tab-watch .bw-board .bw-mc .bw-mcard-n {
  margin: 0;
  font-size: 11.5px;
}
#tab-watch .bw-board .bw-mc .bw-mcard-window {
  font-size: 11.5px;
}
#tab-watch .bw-board .bw-mc .bw-seetrend {
  display: none;
}
#tab-watch .bw-board .bw-notreported {
  margin-top: 8px;
}

@media (max-width: 720px) {
  #tab-watch .bw-board .bw-mstrip {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    border-radius: 0 var(--sv-radius-sm) var(--sv-radius-sm) var(--sv-radius-sm);
  }
  #tab-watch .bw-board .bw-mc {
    flex: 0 0 auto;
    width: 168px;
    scroll-snap-align: center;
  }
  #tab-watch .bw-board .bw-mc .bw-mc-meta .bw-mcard-n {
    display: none;
  }
  #tab-watch .bw-board .bw-mc .bw-mcard-bar,
  #tab-watch .bw-board .bw-mc .bw-mc-meta {
    display: flex;
  }
  #tab-watch .bw-board .bw-groups {
    display: block;
    overflow: visible;
    padding: 0;
  }
}
