/* clean/base.css — the calm layer over command.css.
   Loaded after command.css. Two jobs: (1) quiet the whole dashboard down — more air, one-line
   page intros, fewer competing labels; (2) style the shared visuals in lib/viz.js so every page
   shows numbers as pictures in the same language. Page-specific polish lives next to this file
   (clean/<pages>.css). Tokens (--text-2, --line, --accent…) come from command.css. */

/* ---------------------------------------------------------------- calm globals */
:root { --vz-gap: 14px; }

/* page header: a clear title, a single quiet line under it */
.view-head { padding-top: 30px; padding-bottom: 20px; }
.view-head h1 { font-size: 21px; font-weight: 600; letter-spacing: -0.024em; }
.view-head p {
  margin-top: 6px; font-size: 13px; color: var(--text-3); max-width: 86ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* sections breathe; their descriptions never turn into paragraphs */
.sec { padding-top: 34px; }
.sec:first-of-type { padding-top: 26px; }
.sec-head { margin-bottom: 18px; padding-bottom: 11px; }
.sec-title { font-size: 13.5px; }
.sec-desc { margin: -10px 0 18px; font-size: 12.5px; color: var(--text-4); max-width: 86ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.panel > .panel-head { padding-top: 28px; padding-bottom: 12px; }
.panel-body { padding-top: 18px; }

/* sidebar: quieter group labels, a touch more air between groups */
.nav-group + .nav-group { margin-top: 10px; }
.nav-group-head { color: var(--text-4); opacity: 0.85; }
.nav-item { height: 33px; }

/* softer pills */
.pill { border-color: transparent; background: rgba(255, 255, 255, 0.05); }
.pill.good, .pill.warn, .pill.bad, .pill.accent, .pill.mag { border-color: transparent; }

/* tables read as clean rows */
.tbl th { padding-bottom: 8px; }

/* ---------------------------------------------------------------- viz: ring */
.vz-ring { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; --vz-c: var(--accent); }
.vz-ring-fig { position: relative; width: var(--vz-size); height: var(--vz-size); }
.vz-ring-svg { display: block; }
.vz-ring-track { stroke: rgba(255, 255, 255, 0.07); }
.vz-ring-arc { stroke: var(--vz-c); transition: stroke-dasharray 0.6s var(--ease); filter: drop-shadow(0 0 6px rgba(var(--vz-rgb, var(--tac)), 0.35)); }
.vz-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.vz-ring-v { font-size: calc(var(--vz-size) * 0.22); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.vz-ring-s { margin-top: 3px; font: 9.5px/1.1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); }
.vz-cap { font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------------------------------------------------------------- viz: KPI strip */
.vz-kpis {
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.vz-kpi {
  display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 16px 18px 15px;
  background: none; border: 0; border-left: 1px solid var(--line); color: inherit; font: inherit; text-align: left;
}
.vz-kpi:first-child { border-left: 0; padding-left: 2px; }
.vz-kpi.link { cursor: pointer; transition: background 0.14s var(--ease); }
.vz-kpi.link:hover { background: rgba(255, 255, 255, 0.025); }
.vz-kpi-l { font: 500 9.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-kpi-v { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-kpi[class*=" t-"] .vz-kpi-v { color: var(--vz-c); }
.vz-kpi.t-muted .vz-kpi-v { color: var(--text-3); }
.vz-kpi-h { font-size: 11.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-kpi-viz { display: block; height: 22px; margin-top: 2px; }
.vz-kpi-viz > * { width: 100%; height: 100%; }
@media (max-width: 760px) { .vz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vz-kpi:nth-child(odd) { border-left: 0; padding-left: 2px; } .vz-kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------------------------------------------------------------- viz: meter / track */
.vz-track { display: block; position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.vz-track > i { display: block; height: 100%; border-radius: inherit; background: var(--vz-c, var(--accent)); transition: width 0.5s var(--ease); }
.vz-meter { display: flex; flex-direction: column; gap: 7px; --vz-c: var(--accent); }
.vz-meter.thin .vz-track { height: 4px; }
.vz-meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.vz-meter-l { font-size: 12.5px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-meter-r { font: 500 12px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- viz: stacked split */
.vz-split { display: flex; flex-direction: column; gap: 10px; }
.vz-split-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.05); }
.vz-split-bar > i { display: block; min-width: 3px; background: var(--vz-c, var(--accent)); transition: flex-grow 0.5s var(--ease); }
.vz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.vz-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); --vz-c: var(--accent); }
.vz-leg b { width: 8px; height: 8px; border-radius: 2px; background: var(--vz-c); }
.vz-leg em { font: normal 500 12px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- viz: column chart */
.vz-cols { display: flex; align-items: stretch; gap: 8px; min-height: calc(var(--vz-h) + 36px); }
.vz-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; --vz-c: var(--accent); }
.vz-col-v { font: 500 10.5px var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.vz-col-bar { flex: none; width: 100%; max-width: 34px; height: var(--vz-h); display: flex; align-items: flex-end; border-radius: 6px; background: rgba(255, 255, 255, 0.035); overflow: hidden; }
.vz-col-bar > i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--vz-c), rgba(var(--vz-rgb, var(--tac)), 0.45)); transition: height 0.5s var(--ease); }
.vz-col-l { font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------------------------------------------------------------- viz: ranked bars */
.vz-hbars { display: flex; flex-direction: column; gap: 11px; }
.vz-hbar { display: grid; grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.6fr) auto; align-items: center; gap: 14px; --vz-c: var(--accent); }
.vz-hbar-l { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-hbar-r { font: 500 12px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 48px; }

/* ---------------------------------------------------------------- viz: flow diagram */
.vz-flow { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.vz-flow::-webkit-scrollbar { display: none; }
.vz-node {
  flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; color: inherit; font: inherit; text-align: left;
  --vz-c: var(--text-4);
}
.vz-node.link { cursor: pointer; transition: border-color 0.14s var(--ease), background 0.14s var(--ease); }
.vz-node.link:hover { border-color: var(--line-3); background: var(--surface-2); }
.vz-node.sel { border-color: rgba(var(--tac), 0.55); box-shadow: 0 0 0 3px var(--accent-soft); }
.vz-node-dot {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px var(--mono); color: var(--vz-c); border: 1.5px solid var(--vz-c); background: rgba(255, 255, 255, 0.02);
}
.vz-node-dot .i { width: 14px; height: 14px; }
.vz-node-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vz-node-l { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.vz-node-s { font-size: 11.5px; color: var(--text-4); white-space: nowrap; }
.vz-node.s-done { --vz-c: var(--good); }
.vz-node.s-done .vz-node-dot { background: rgba(95, 191, 138, 0.1); }
.vz-node.s-active { --vz-c: var(--accent); border-color: rgba(var(--tac), 0.4); }
.vz-node.s-active .vz-node-dot { box-shadow: 0 0 0 4px var(--accent-soft); animation: vz-pulse 1.6s ease-out infinite; }
.vz-node.s-warn { --vz-c: var(--warn); }
.vz-node.s-bad { --vz-c: var(--bad); border-color: rgba(229, 107, 98, 0.4); }
.vz-node.s-idle .vz-node-l { color: var(--text-2); }
.vz-flow-link { flex: 1 0 18px; min-width: 18px; max-width: 64px; height: 1.5px; background: var(--line-2); position: relative; }
.vz-flow-link::after { content: ''; position: absolute; right: -1px; top: -3px; width: 6px; height: 6px; border-top: 1.5px solid var(--line-3); border-right: 1.5px solid var(--line-3); transform: rotate(45deg); }
.vz-flow-link.on { background: linear-gradient(90deg, rgba(95, 191, 138, 0.6), rgba(95, 191, 138, 0.25)); }
.vz-flow.compact .vz-node { padding: 6px 11px 6px 6px; gap: 8px; border-radius: 10px; }
.vz-flow.compact .vz-node-dot { width: 20px; height: 20px; font-size: 10px; }
.vz-flow.compact .vz-node-l { font-size: 12px; }
@keyframes vz-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--tac), 0.5); } 70% { box-shadow: 0 0 0 8px rgba(var(--tac), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--tac), 0); } }

/* ---------------------------------------------------------------- viz: timeline */
.vz-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.vz-tl::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.vz-tl-i { position: relative; display: flex; gap: 14px; padding: 7px 0; --vz-c: var(--text-4); }
.vz-tl-dot { flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--vz-c); position: relative; z-index: 1; }
.vz-tl-i[class*=" t-"] .vz-tl-dot { background: var(--vz-c); }
.vz-tl-body { min-width: 0; flex: 1; }
.vz-tl-top { display: flex; align-items: baseline; gap: 12px; }
.vz-tl-t { font-size: 13px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.vz-tl-w { font: 11px var(--mono); color: var(--text-4); white-space: nowrap; }
.vz-tl-s { margin-top: 2px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------------------------------------------------------------- viz: dot, figure, spark */
.vz-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--vz-c, var(--text-4)); flex: none; }
.vz-dot.live { animation: livepulse 1.4s ease-out infinite; }
.vz-fig { display: flex; align-items: center; gap: 20px; --vz-c: var(--text); }
.vz-fig-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vz-fig-v { font-size: 34px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--vz-c); }
.vz-fig-l { font-size: 12.5px; color: var(--text-2); }
.vz-fig-h { font-size: 11.5px; color: var(--text-4); }
.vz-fig-viz { flex: 1; min-width: 80px; }
.vz-spark { display: block; width: 100%; height: 100%; --vz-c: var(--accent); }
.vz-spark-line { stroke: var(--vz-c); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.vz-spark-area { fill: rgba(var(--vz-rgb, var(--tac)), 0.1); stroke: none; }

/* ---------------------------------------------------------------- details / capped / quiet */
.vz-more { margin-top: 12px; }
.vz-more-sum { list-style: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 12px; color: var(--text-3); transition: color 0.12s; }
.vz-more-sum::-webkit-details-marker { display: none; }
.vz-more-sum:hover { color: var(--text); }
.vz-more-c { width: 10px; height: 10px; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.18s var(--ease); }
.vz-more-c::before { content: ''; width: 4px; height: 4px; margin-top: -2px; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(45deg); }
.vz-more[open] > .vz-more-sum .vz-more-c { transform: rotate(180deg); }
.vz-more-body { padding-top: 12px; animation: ui-rise 0.22s var(--ease); }
.vz-capped { display: flex; flex-direction: column; }
.vz-showall { align-self: flex-start; margin-top: 10px; padding: 0; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; transition: color 0.12s; }
.vz-showall:hover { color: var(--text); }
.vz-quiet { display: flex; align-items: center; gap: 12px; padding: 18px 0; color: var(--text-4); font-size: 12.5px; }
.vz-quiet-i { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--text-3); }
.vz-quiet-t { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- layout helpers */
/* a row of visuals that wraps gracefully: rings, figures, meters side by side */
.vz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px; }
.vz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 36px; }

/* ---------------------------------------------------------------- tones
   Last in the file on purpose: a tone class must beat each viz's own default colour. */
.t-accent { --vz-c: var(--accent); --vz-rgb: 127, 178, 195; }
.t-good { --vz-c: var(--good); --vz-rgb: 95, 191, 138; }
.t-warn { --vz-c: var(--warn); --vz-rgb: 223, 174, 82; }
.t-bad { --vz-c: var(--bad); --vz-rgb: 229, 107, 98; }
.t-muted { --vz-c: var(--text-4); --vz-rgb: 80, 84, 93; }
.t-mag { --vz-c: var(--mag); --vz-rgb: 185, 140, 255; }
