/* Shared primitives for interactive widgets (see js/widgets/kit.js).
   Widget-specific rules live in widgets-cs.css and widgets-ai.css. */

.w-stage {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; position: relative;
}
.w-svg { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
.w-svg text { fill: var(--muted); font: 11px var(--sans); }
.w-svg .w-axis { stroke: var(--border-2); stroke-width: 1; fill: none; }
.w-svg .w-grid { stroke: var(--border); stroke-width: 1; fill: none; }
.w-svg .w-strong { fill: var(--text); font-weight: 650; }

.w-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 12px 0 0; }
.w-control { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.w-label { font-weight: 600; white-space: nowrap; }
.w-slider { accent-color: var(--accent); width: 170px; }
.w-value { font: 600 12.5px var(--mono); color: var(--accent); min-width: 44px; }
.w-seg .seg-item { padding: 4px 10px; font-size: 12.5px; }
.w-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.w-stat { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; min-width: 96px; }
.w-stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.w-stat-value { font: 650 15px var(--mono); color: var(--text); }
.w-note { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.w-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); }
.w-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.w-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--wc, var(--muted)); }
.w-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.w-panel { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); font-size: 13.5px; }
.w-input { background: var(--code-bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 10px; font: 13.5px var(--mono); color: var(--text); outline: none; min-width: 0; }
.w-input:focus { border-color: var(--accent); }
.w-mono { font-family: var(--mono); }

/* Series colours: usable as class on SVG shapes (stroke/fill) and on swatches. */
.w-c1 { --wc: #60a5fa; } .w-c2 { --wc: #34d399; } .w-c3 { --wc: #f6b73c; }
.w-c4 { --wc: #fb7185; } .w-c5 { --wc: #a78bfa; } .w-c6 { --wc: #22d3ee; }
.w-svg .w-line { stroke: var(--wc, var(--accent)); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.w-svg .w-fill { fill: var(--wc, var(--accent)); }
.w-svg .w-stroke { stroke: var(--wc, var(--accent)); }
.w-svg .w-fill-accent { fill: var(--accent); } .w-svg .w-fill-ok { fill: var(--ok); }
.w-svg .w-fill-bad { fill: var(--bad); } .w-svg .w-fill-info { fill: var(--info); }
.w-svg .w-fill-muted { fill: var(--surface-3); } .w-svg .w-fill-violet { fill: var(--violet); }
.w-svg .w-stroke-accent { stroke: var(--accent); } .w-svg .w-stroke-ok { stroke: var(--ok); }
.w-svg .w-stroke-bad { stroke: var(--bad); } .w-svg .w-stroke-info { stroke: var(--info); }
.w-svg .w-stroke-muted { stroke: var(--border-2); }

@media (max-width: 720px) {
  .w-split { grid-template-columns: 1fr; }
  .w-slider { width: 130px; }
}
