/* watch.css — the Watchlist tab of the right dock (watch.js, design/42 §3).
 *
 * Scoped to .wl / .wl-* and inert until watch.js builds the tab inside the dock, so the page links it
 * unconditionally. Every colour is a chart.css token (--bg --panel --panel-2 --fg --muted --border --accent
 * --pos --neg --hover), which makes the light theme free.
 *
 * Dense on purpose (the north star: a lot of data at once): 20 px rows, 11.5 px tabular figures, and FIXED
 * column widths so a price that gains a digit never shoves its neighbours. The tab is a size container:
 * a narrow dock drops OI 1h first, then funding, then volume — never the VWAP position (the dock drags
 * 240-440 px). */
.wl {
  container: wl / inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--fg);
  --wl-last: 64px;
  --wl-chg: 50px;
  --wl-vwap: 42px;
  --wl-vol: 40px;
  --wl-fund: 48px;
  --wl-oi: 46px;
}

/* ---- the tab's own bar: "★ Favourites · 7"   +   ⋯ ---- */
.wl-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px 0 8px;
  border-bottom: 1px solid var(--border);
}
.wl-title { flex: 1 1 auto; min-width: 0; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* No favourites: the board is the top-volume seed (review #13) — say so in the accent, it is not your list. */
.wl-title.seed { color: var(--accent); cursor: help; }
.wl-btn {
  flex: 0 0 auto;
  width: 22px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}
.wl-btn:hover { background: var(--hover); color: var(--fg); }
.wl-btn:focus-visible { outline: 1px solid var(--accent); }

/* ---- rows and the header share one cell grid ---- */
.wl-head,
.wl-row {
  display: flex;
  align-items: center;
  height: 20px;
  padding: 0 6px 0 4px;
  gap: 4px;
  white-space: nowrap;
}
.wl-head {
  flex: 0 0 auto;
  height: 22px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
}
.wl-c { flex: 0 0 auto; overflow: hidden; text-align: right; font-variant-numeric: tabular-nums; }
.wl-c.wl-sym { flex: 1 1 auto; min-width: 0; text-align: left; display: flex; align-items: center; gap: 4px; }
.wl-c.wl-last { width: var(--wl-last); }
.wl-c.wl-chg { width: var(--wl-chg); }
.wl-c.wl-vwap { width: var(--wl-vwap); }
.wl-c.wl-vol { width: var(--wl-vol); }
.wl-c.wl-fund { width: var(--wl-fund); }
.wl-c.wl-oi { width: var(--wl-oi); }
.wl-head .wl-c.wl-sym { padding-left: 9px; } /* over the name, past the dot */
button.wl-c {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button.wl-c:hover,
.wl-head .wl-c.on { color: var(--fg); }

/* The optional columns: the user's ⋯ menu, a server without /assets/ctx or /vwap/levels, then the container
   width. */
.wl.wl-hide-chg .wl-chg,
.wl.wl-hide-vwap .wl-vwap,
.wl.wl-nolv .wl-vwap,
.wl.wl-hide-vol .wl-vol,
.wl.wl-hide-fund .wl-fund,
.wl.wl-hide-oi .wl-oi,
.wl.wl-noctx .wl-fund,
.wl.wl-noctx .wl-oi { display: none; }
@container wl (max-width: 385px) { .wl-oi { display: none; } }
@container wl (max-width: 335px) { .wl-fund { display: none; } }
@container wl (max-width: 293px) { .wl-vol { display: none; } }

/* ---- the list ---- */
.wl-list {
  flex: 1 1 auto;
  min-height: 0;
  position: relative; /* the rows' offsetParent: watch.js measures visibility off offsetTop */
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
}
.wl-list:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.wl-row { cursor: pointer; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.wl-row:hover { background: var(--hover); }
.wl-row.act { background: var(--panel-2); }
.wl-row.cur { box-shadow: inset 2px 0 0 var(--accent); }
.wl-row.cur .wl-name { font-weight: 700; }
.wl-row.drag { opacity: 0.45; }
.wl-row.drop-b { border-top-color: var(--accent); }
.wl-row.drop-a { border-bottom-color: var(--accent); }
.wl-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.wl-dex { color: var(--muted); font-weight: 400; }

/* live = a filled dot; a coin the hub cannot stream (a bond) = a hollow ring; otherwise nothing (the price
   is dimmed instead, so the column itself says which numbers are ticking). */
.wl-dot { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; }
.wl-dot.live { background: var(--pos); opacity: 0.85; }
.wl-dot.nolive { box-shadow: inset 0 0 0 1px var(--muted); }

.wl-c.dim { color: var(--muted); }
/* VWAP σ at or past ±2.00: a bull / bear colour in semi-bold (the side's colour mixed 88% toward the text, a
   touch softer than the 24h column's gain / loss); at or past ±3.00 (the ±3σ band) full bold. A dimmed cell
   (warm-up, not a live price) keeps the lean at about two thirds. */
.wl-c.vbull { color: color-mix(in srgb, var(--pos) 88%, var(--fg)); font-weight: 600; }
.wl-c.vbear { color: color-mix(in srgb, var(--neg) 88%, var(--fg)); font-weight: 600; }
.wl-c.dim.vbull { color: color-mix(in srgb, var(--pos) 62%, var(--muted)); }
.wl-c.dim.vbear { color: color-mix(in srgb, var(--neg) 62%, var(--muted)); }
.wl-c.vx { font-weight: 700; }
.wl-c.up { color: var(--pos); }
.wl-c.down { color: var(--neg); }
/* The tick flash: a tint that fades out when the class goes (watch.js adds it for ~450 ms). Light on
   purpose — a liquid coin ticks every second, so a heavy or long flash would leave the column tinted.
   Never under reduced motion — watch.js does not add it then, and this is the belt. */
.wl-last { border-radius: 2px; transition: background-color 0.35s ease-out; }
.wl-last.f-up { background-color: color-mix(in srgb, var(--pos) 20%, transparent); transition: none; }
.wl-last.f-down { background-color: color-mix(in srgb, var(--neg) 20%, transparent); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .wl-last,
  .wl-last.f-up,
  .wl-last.f-down { transition: none; background-color: transparent; }
}

.wl-empty { padding: 14px 10px; color: var(--muted); text-align: center; line-height: 1.5; }
.wl-rec-h {
  display: block;
  width: 100%;
  height: 22px;
  margin-top: 4px;
  padding: 0 8px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.wl-rec-h:hover { color: var(--fg); background: var(--hover); }

.wl-foot {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-foot:empty { display: none; }

/* ---- the ⋯ column menu ---- */
.wl-menu {
  position: absolute;
  top: 26px;
  right: 6px;
  z-index: 5;
  min-width: 170px;
  padding: 6px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.wl-menu-i { display: flex; align-items: center; gap: 8px; padding: 4px 12px; cursor: pointer; }
.wl-menu-i:hover { background: var(--hover); }
.wl-menu-note { padding: 6px 12px 2px; color: var(--muted); font-size: 10.5px; line-height: 1.4; white-space: normal; }
