/* ===================================================================
   wygge — the chart tile (dashboard_tile_chart.jsx, FND-1088 PR 4). Tokens only (C9): the chart sits on the dashboard
   card surface (--dash-card*, light + dark) so the tenant ramp --ad-viz-1…5 keeps its measured contrast (FND-403); the
   legend dots are that ramp in series order. Peter 2026-10-14: no counter, no arrow, no navigation on the face; WITHOUT a
   title the panel fills the whole square, WITH a title the title heads the tile (on the PR 1 plate over a background).
   =================================================================== */
.dash-ct { position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; min-width: 0; overflow: hidden; border-radius: inherit; }
.dash-ct.is-titled { padding: 10px; gap: 8px; }
.dash-ct-head { flex-shrink: 0; display: flex; align-items: center; min-width: 0; padding-right: 28px; }
.dash-ct-head .dash-tile-title { -webkit-line-clamp: 1; font-size: 13.5px; }
.dash-ct-L .dash-ct-head .dash-tile-title { font-size: 17px; }
.dash-ct-S.is-titled { padding: 7px; gap: 5px; }
.dash-ct-S .dash-ct-head { padding-right: 24px; }
.dash-ct-S .dash-ct-head .dash-tile-title { font-size: 11px; font-weight: 600; }

.dash-ct-panel {
  position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; box-sizing: border-box;
  padding: 10px 10px 8px; border-radius: calc(var(--dash-radius) - 5px); background: var(--dash-card); color: var(--dash-card-text);
}
.dash-ct-panel.is-full { position: absolute; inset: 0; border-radius: inherit; padding: 12px 12px 10px; }
.dash-ct-S .dash-ct-panel { padding: 8px; gap: 3px; }
.dash-ct-L .dash-ct-panel.is-full { padding: 16px 16px 12px; }

.dash-ct-canvas { position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; }
.dash-ct-legend {
  flex-shrink: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 10px;
  max-height: calc(2.8em + 3px); overflow: hidden; font-size: 11px; line-height: 1.4; color: var(--dash-card-muted);
}
.dash-ct-L .dash-ct-legend { font-size: 12px; max-height: calc(2.8em + 4px); gap: 3px 14px; }
.dash-ct-legend-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.dash-ct-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.dash-ct-legend-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--dash-card-text); }
.dash-ct-legend-value { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--dash-card-text); }
.dash-ct-note { flex-shrink: 0; font-size: 10.5px; line-height: 1.3; color: var(--dash-card-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-ct-msg, .dash-ct-empty, .dash-ct-error {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; font-size: 12px; line-height: 1.35; color: var(--dash-card-muted);
}
.dash-ct-empty { font-weight: 600; border-bottom: 1.5px dashed var(--dash-card-line); margin-bottom: 4px; }
.dash-ct-error strong { font-size: 12.5px; color: var(--dash-card-text); }
.dash-ct-error-detail { font-size: 11px; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* S: the first series as a sparkline with its value */
.dash-ct-s { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-ct-value { font-family: var(--ad-font-display); font-weight: 700; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--dash-card-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ct-spark { flex: 1 1 auto; width: 100%; min-height: 18px; overflow: visible; }
.dash-ct-spark path { fill: none; stroke: var(--ad-viz-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dash-ct-more { align-self: flex-start; flex-shrink: 0; font-size: 10px; font-weight: 700; line-height: 15px; padding: 0 6px; border-radius: 999px; color: var(--dash-card-muted); border: 1px solid var(--dash-card-line); }

/* ── the editor (kit Drawer, PR 1 layout .dash-te) ── */
.dash-ct-pv { position: relative; flex-shrink: 0; }
.dash-tile.dash-ct-pv-tile { position: absolute; left: 0; top: 0; transform-origin: 0 0; cursor: default; transition: none; }
.dash-tile.dash-ct-pv-tile:hover { filter: none; }
.dash-ct-srcs { display: flex; flex-direction: column; gap: 10px; }
.dash-ct-src-group { display: flex; flex-direction: column; gap: 2px; }
.dash-ct-src-group-name { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ad-text-subtle); padding: 4px 2px 2px; }
.dash-ct-src {
  display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; text-align: left; padding: 6px 8px; border-radius: 8px;
  border: 1.5px solid transparent; background: transparent; color: var(--ad-text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.dash-ct-src:hover { background: var(--ad-surface-inset); }
.dash-ct-src.is-on { border-color: var(--ad-accent-deep); background: var(--ad-surface-inset); }
.dash-ct-src.is-off { cursor: not-allowed; color: var(--ad-text-faint); }
.dash-ct-src.is-off:hover { background: transparent; }
.dash-ct-src:focus-visible { outline: 2px solid var(--ad-accent); outline-offset: 1px; }
.dash-ct-src-no {
  width: 18px; height: 18px; flex-shrink: 0; box-sizing: border-box; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; border: 1.5px solid var(--ad-border-strong);
}
.dash-ct-src.is-on .dash-ct-src-no { background: var(--ad-accent); border-color: var(--ad-accent-deep); color: var(--ad-on-accent); }
.dash-ct-src-ico { display: inline-flex; flex-shrink: 0; color: var(--ad-text-subtle); }
.dash-ct-src-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ct-src-reason { flex-shrink: 0; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--ad-neutral-bg); color: var(--ad-neutral-fg); }
.dash-ct-lg { display: flex; flex-direction: column; gap: 6px; }
.dash-ct-lg-row { display: flex; align-items: center; gap: 8px; }
.dash-ct-lg-row .dash-ct-dot { width: 10px; height: 10px; }

/* ── FND-1131: „Chart-Hintergrund transparent“ — the chart lies on the tile (its colour or image) like the chart layer of PR 8d: no card,
   the tile ink for text, axes, grid and legend (the engines read these tokens when they draw); a chosen label colour (PR 7) wins. Over an
   image every line and label gets a halo in the plate colour (the PR 1 plate, measured against the tile ink), so the axes stay readable
   on any photo while the photo stays visible. ── */
.dash-ct.is-clear { --dash-card: transparent; --dash-card-text: var(--tile-text); --dash-card-muted: var(--tile-muted); --dash-card-line: var(--tile-edge); }
:is(.dash-tile-bgwrap, .dash-tile-lbl)[data-label-color] .dash-ct.is-clear { --dash-card-text: var(--tile-label-text); --dash-card-muted: var(--tile-label-text); }
.dash-tile-bgwrap .dash-ct.is-clear :is(.dash-ct-canvas, .dash-ct-legend, .dash-ct-s, .dash-ct-note, .dash-ct-msg, .dash-ct-empty) {
  filter: drop-shadow(0 0 1px var(--tile-plate-solid)) drop-shadow(0 0 2.5px var(--tile-plate));
}

/* FND-1131 (Peter 2026-10-15: „super kompakt, wie ein kleines Programm“): rows = label left (110 px) + control right, 12–13 px type,
   collapsible groups; fits a 320-px sidebar. The kind picker is one select grouped by engine (disabled options name their reason). */
.dash-ct-rows, .dash-ct-props { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ad-text); }
.dash-ct-props { gap: 4px; max-width: 100%; }
.dash-ct-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 28px; }
.dash-ct-row-l { font-size: 12px; font-weight: 600; color: var(--ad-text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.dash-ct-row-c { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-ct-row[data-ct-row="legend"] { align-items: start; }
.dash-ct-row[data-ct-row="legend"] .dash-ct-row-l { padding-top: 6px; }
.dash-ct-row-note { font-size: 12px; color: var(--ad-text-subtle); }
.dash-ct-sel-wrap { position: relative; display: flex; min-width: 0; }
.dash-ct-sel {
  width: 100%; min-width: 0; box-sizing: border-box; appearance: none; -webkit-appearance: none; font: inherit; font-size: 12.5px; font-weight: 600;
  height: 28px; padding: 0 24px 0 8px; border-radius: var(--ad-radius-input, 8px); border: 1px solid var(--ad-border-strong); background: var(--ad-surface); color: var(--ad-text); cursor: pointer;
}
.dash-ct-sel:focus-visible { outline: 2px solid var(--ad-accent); outline-offset: 1px; }
.dash-ct-sel option, .dash-ct-sel optgroup { background: var(--ad-surface); color: var(--ad-text); }
.dash-ct-sel option:disabled { color: var(--ad-text-faint); }
.dash-ct-sel-chev { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); display: inline-flex; pointer-events: none; color: var(--ad-text-subtle); }
.dash-ct-grp { border-top: 1px solid var(--ad-border); }
.dash-ct-grp:first-child { border-top: none; }
.dash-ct-grp-h {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 7px 2px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ad-text-subtle);
}
.dash-ct-grp-h::-webkit-details-marker { display: none; }
.dash-ct-grp-h > svg { transition: transform 120ms; transform: rotate(-90deg); }
.dash-ct-grp[open] > .dash-ct-grp-h > svg { transform: none; }
.dash-ct-grp-b { display: flex; flex-direction: column; gap: 6px; padding: 0 2px 8px; }
.dash-ct-props .dash-ct-src { padding: 4px 6px; font-size: 12px; }
.dash-ct-clear-row { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ad-text); min-width: 0; }
.dash-ct-clear-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ct-lg { gap: 4px; }

/* ── FND-1137: the chosen sources as rows „Quelle · Reihentyp · Achse · Farbe · ✕“ + „Quelle hinzufügen“ ── */
.dash-ct-srows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.dash-ct-srow { display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 7px; border-radius: 8px; border: 1px solid var(--ad-border); background: var(--ad-surface); }
.dash-ct-srow-h { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ad-text); }
.dash-ct-srow-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ct-srow-c { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 4px; }
.dash-ct-srow-c .dash-ct-sel-wrap { min-width: 0; }
.dash-ct-sel-wrap.is-off { opacity: .55; }
.dash-ct-add { margin-top: 2px; }
.dash-ct-add-h { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; color: var(--ad-text);
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--ad-border-strong); background: var(--ad-surface); }
.dash-ct-add-h::-webkit-details-marker { display: none; }
.dash-ct-add-h:focus-visible { outline: 2px solid var(--ad-accent-deep); outline-offset: 1px; }
.dash-ct-add[open] > .dash-ct-add-h { margin-bottom: 6px; border-color: var(--ad-accent-deep); }

/* ── FND-1136: a header chart with tile fields (DashChartRichCard) — tile colour, transparent card, background image, legend line ── */
.dash-chart.is-rich.has-tone {
  background: linear-gradient(150deg, var(--tile-bg-a) 0%, var(--tile-bg-b) 100%);
  --dash-card-text: var(--tile-text); --dash-card-muted: var(--tile-muted); --dash-card-line: color-mix(in srgb, var(--tile-text) 24%, transparent);
}
.dash-chart.is-rich.is-clear:not(.has-tone):not(.has-bg) { background: transparent; box-shadow: none; outline: 1px dashed color-mix(in srgb, var(--dash-card-muted) 45%, transparent); outline-offset: -1px; }
.dash-chart.is-rich.has-bg { background: var(--dash-card); }
.dash-chart.is-rich.has-tone.has-bg { background: var(--tile-bg-a); }
.dash-chart.is-rich > .dash-chart-top, .dash-chart.is-rich > .dash-chart-head, .dash-chart.is-rich > .dash-chart-body { position: relative; z-index: 1; }
.dash-chart-bg { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 0; }
.dash-chart-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-user-drag: none; user-select: none; }
.dash-chart-bg-dim { position: absolute; inset: 0; background: linear-gradient(150deg, var(--tile-bg-a, var(--dash-card)) 0%, var(--tile-bg-b, var(--dash-card)) 100%); }
/* Over a photo the head keeps a readable plate; „transparent“ off adds the card under the chart as well. */
.dash-chart.is-rich.has-bg .dash-chart-top, .dash-chart.is-rich.has-bg > .dash-chart-head { background: color-mix(in srgb, var(--dash-card) 78%, transparent); border-radius: 7px; }
.dash-chart.is-rich.has-bg:not(.is-clear) .dash-chart-body { background: color-mix(in srgb, var(--dash-card) 82%, transparent); border-radius: 8px; }
.dash-chart.is-rich[data-label-color] .dash-chart-label { color: var(--tile-label-text); }
.dash-chart.is-rich[data-label-shadow] :is(.dash-chart-label, .dash-chart-val) { text-shadow: var(--tile-shadow); }
.dash-chart.is-rich[data-label-weight] .dash-chart-label { font-weight: var(--tile-weight); }
.dash-chart-body.has-legend .dash-chart-canvas-wrap { bottom: 13px; }
.dash-chart-legend { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; margin: 0; padding: 0; list-style: none; display: flex; gap: 8px; overflow: hidden;
  font-size: 9.5px; line-height: 12px; color: var(--dash-card-muted); white-space: nowrap; }
.dash-chart-legend li { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.dash-chart-legend .dash-ct-dot { width: 7px; height: 7px; flex: 0 0 7px; }
/* Over a photo the legend line gets the same readable plate as the head (only as wide as its entries). */
.dash-chart.is-rich.has-bg .dash-chart-legend { right: auto; max-width: 100%; padding: 0 5px; border-radius: 5px; background: color-mix(in srgb, var(--dash-card) 78%, transparent); }
.dash-cs-stripprev { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.dash-cs-stripprev-card { width: 268px; padding: 14px; border-radius: 16px; background: var(--dash-page, var(--ad-canvas)); }
.dash-cs-stripprev-card .dash-chart.is-preview { max-width: none; }

/* ── FND-1290: Kleinvielfache (trellis: one small chart per series) and „Legende filtert“ (highlight filter) ── */
.dash-ct-trellis { display: grid; gap: 6px; min-height: 0; height: 100%; grid-auto-rows: minmax(0, 1fr); }
.dash-ct-trellis-cell { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dash-ct-trellis-t { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dash-card-muted); }
.dash-ct-trellis-c { position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; }
.dash-ct-legend.is-filter .dash-ct-legend-item { cursor: pointer; border-radius: 6px; }
.dash-ct-legend.is-filter .dash-ct-legend-item:focus-visible { outline: 2px solid var(--ad-accent-deep, currentColor); outline-offset: 1px; }
.dash-ct-legend-item.is-dim { opacity: .45; }
.dash-ct-legend-item.is-focus { font-weight: 700; }
