/* datawin.css — the Data Window, the right dock's "Data" tab (datawin.js; design/42 §2). Dense on purpose — a
   TradingView data window: 11.5 px tabular figures, ~18 px rows, a label | values grid per row. Scoped to .dw
   (built inside the dock's .rdock-host), so nothing here reaches the chart. The Market group's tones reuse
   statsbar.css's palette variables (defined on :root there). */
.dw {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 2px 0 10px;
  font-size: 11.5px; line-height: 18px; font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.dw-g { border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.dw-g[hidden] { display: none; }
.dw-gh {
  display: flex; align-items: baseline; gap: 6px; width: 100%;
  margin: 0; padding: 5px 10px 3px 8px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--muted); text-align: left; user-select: none;
}
.dw-gh:hover { color: var(--fg); }
.dw-gh:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.dw-caret { display: inline-block; width: 9px; transition: transform 0.12s ease; }
.dw-g.folded .dw-caret { transform: rotate(-90deg); }
.dw-g.folded .dw-grid { display: none; }
.dw-gs { font-weight: 500; letter-spacing: 0.2px; text-transform: none; }
.dw-gr { margin-left: auto; font-weight: 500; letter-spacing: 0.2px; text-transform: none; }
.dw-g.dw-none .dw-gh { opacity: 0.7; }

/* One row = a 2-column grid: label | values (right-aligned). NOTHING WRAPS (review #10): a value that does not fit
   ellipsizes and keeps its whole text in its tooltip; an indicator with several values gets one line each (.dw-sub). */
.dw-row {
  display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); column-gap: 8px;
  min-height: 18px; padding: 0 10px 0 12px; align-items: start;
}
.dw-row[hidden] { display: none; }
.dw-row:hover { background: var(--hover); }
.dw-kv { grid-template-columns: 62px minmax(0, 1fr); }
.dw-g[data-g="mkt"] .dw-kv { grid-template-columns: 92px minmax(0, 1fr); } /* "24h High / Low", "Funding /8h" */
.dw-k { min-width: 0; display: flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.dw-ind .dw-k { color: var(--fg); }
.dw-vs { min-width: 0; display: flex; flex-wrap: nowrap; justify-content: flex-end; column-gap: 7px; text-align: right; overflow: hidden; }
.dw-v { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dw-v:last-child { flex: 0 1 auto; }
.dw-v:empty { display: none; }
.dw-v2 { color: var(--muted); }
.dw-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent) !important; }
.dw-stale { opacity: 0.55; }

/* An indicator = a block: its line (swatch in its plot's colour, the name, its params muted, eye / gear on hover,
   and its value when it has ONE), then one indented sub-line per value when it has several. */
.dw-ind { display: block; }
.dw-ind .dw-row:hover { background: transparent; }
.dw-ind:hover { background: var(--hover); }
.dw-ind.dw-multi .dw-line { grid-template-columns: minmax(0, 1fr); }
.dw-ind.dw-multi .dw-line .dw-vs { display: none; }
.dw-sub { grid-template-columns: fit-content(56%) minmax(0, 1fr); padding-left: 25px; min-height: 17px; line-height: 17px; }
.dw-sk { min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-sw { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.dw-name { flex: 0 0 auto; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dw-params { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.dw-params:empty { display: none; }
.dw-acts { flex: 0 0 auto; display: none; margin-left: auto; gap: 1px; }
.dw-ind:hover .dw-acts { display: inline-flex; }
.dw-ind:hover .dw-params { display: none; }
.dw-act {
  width: 18px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: 0; border-radius: 4px; cursor: pointer;
}
.dw-act svg { width: 12px; height: 12px; pointer-events: none; }
.dw-act:hover { color: var(--fg); background: var(--panel-2); }
/* A ghost (eye-hidden) row: struck through, its eye always on screen so it can be shown again. */
.dw-ind[data-state="hidden"] .dw-name { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.dw-ind[data-state="hidden"] .dw-acts { display: inline-flex; }
.dw-ind[data-state="hidden"] .dw-act[data-act="gear"] { display: none; }
.dw-ind[data-state="hidden"]:hover .dw-act[data-act="gear"] { display: inline-flex; }
.dw-ind[data-state="collapsed"] .dw-name::after { content: ' ▸'; color: var(--muted); font-weight: 400; }
.dw-pop {
  font: inherit; font-size: 11px; color: var(--accent); background: transparent; border: 0; padding: 0; cursor: pointer;
}
.dw-pop:hover { text-decoration: underline; }
.dw-empty { padding: 0 12px; color: var(--muted); font-size: 11px; }
.dw-foot { padding: 8px 12px 0; color: var(--muted); font-size: 10.5px; }

/* The Market group's tones = the topbar strip's (statsbar.css variables). */
.dw-t-up { color: var(--pos); }
.dw-t-down { color: var(--neg); }
.dw-t-oiup { color: var(--tbs-oi-up, var(--pos)); }
.dw-t-oidown { color: var(--tbs-oi-down, var(--neg)); }
.dw-t-muted { color: var(--muted); }
.dw-t-strong { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dw-t-act0 { color: var(--muted); }
.dw-t-act1 { color: var(--tbs-cool, var(--fg)); }
.dw-t-act2 { color: var(--fg); }
.dw-t-act3 { color: var(--tbs-warm, var(--fg)); }
.dw-t-act4 { color: var(--tbs-hot, var(--fg)); }
