/* Dashboards: pinned visuals on a 12-column grid (positions are set inline by dashboard-view.js). */

/* The dashboard replaces the query workspace (and the explorer) while it is open. */
.dashboard-view { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.dashboard-view[hidden] { display: none; }
body.dash-open .workspace, body.dash-open .sidebar, body.dash-open .resizer[data-resize="sidebar"] { display: none; }

.dash-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-panel); min-height: 52px; flex-wrap: wrap; }
.dash-switch { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius); color: var(--text);
  font-size: 15px; font-weight: 600; max-width: 380px; }
.dash-switch:hover { background: var(--bg-hover); }
.dash-switch > .icon:first-child { color: var(--accent); }
.dash-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.dash-clock { display: none; font-size: 15px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dash-refresh { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.dash-refresh .select { height: 26px; font-size: 12px; }
.dash-switcher .menu-item.current { color: var(--accent); }
.dash-switcher kbd { margin-left: auto; }

.dash-scroll { flex: 1; min-height: 0; overflow: auto; padding: 16px; position: relative; }
.dash-grid { position: relative; min-height: 100%; isolation: isolate; } /* tiles' z-order (floating layers) stays inside */
.dash-empty { position: absolute; inset: 0; display: flex; }
.dash-empty[hidden] { display: none; }

/* Tiles */
.dtile { position: absolute; display: flex; flex-direction: column; border-radius: 0; border: 1px solid var(--border);
  background: var(--card-grad); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 18px rgba(0, 0, 0, 0.25);
  overflow: hidden; transition: left 0.18s ease, top 0.18s ease, width 0.18s ease, height 0.18s ease; }
.dtile.dragging { transition: none; z-index: 2000 !important; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); border-color: var(--accent); opacity: 0.94; }
.dtile.has-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.dtile-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px 14px; cursor: grab; user-select: none; min-height: 36px; }
body.dash-moving, body.dash-moving * { cursor: grabbing !important; user-select: none !important; }
body.dash-resizing, body.dash-resizing * { cursor: var(--dash-resize-cursor, nwse-resize) !important; }
.dtile-title { flex: 1; min-width: 0; font-size: var(--dh-size, 13px); font-weight: var(--dh-weight, 600); font-style: var(--dh-style, normal); color: var(--dh-color, var(--text));
  text-align: var(--dh-align, left); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtile > .dtile-head { background: var(--dh-bg, transparent); }
.dtile-status { display: inline-flex; align-items: center; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dtile-err { color: var(--danger); display: inline-flex; }
.dtile-stamp { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dtile-refresh-icon { width: 12px; height: 12px; flex: none; opacity: 0.85; }
body.dash-tv .dtile-stamp { font-size: 12px; } body.dash-tv .dtile-refresh-icon { width: 14px; height: 14px; }
.dtile-menu { opacity: 0; transition: opacity 0.12s; }
.dtile:hover .dtile-menu, .dtile-menu:focus-visible { opacity: 1; }
.dtile-body { flex: 1; min-height: 0; position: relative; container-type: size; }
.dtile-msg { position: absolute; inset: 0; display: flex; background: inherit; z-index: 1; }
.dtile-loading { margin: auto; }
.dtile .viz-state { padding: 10px; }
.dtile .viz-kpi { padding: 8px 12px; }
.dtile .kpi-value { font-size: var(--kpi-value-px, calc(clamp(26px, 30cqmin, 96px) * var(--kpi-scale, 1))); }
/* 8 resize handles: a strip along each side, a square on each corner (inside the tile - it clips what sticks out).
   Each shows a small mark while the pointer is on the tile: a bar mid-side, a bracket in the corner. */
.dtile-resize { position: absolute; z-index: 2; opacity: 0; transition: opacity 0.12s; }
.dtile:hover .dtile-resize, .dtile.resizing .dtile-resize { opacity: 0.85; }
.dtile-resize::after { content: ''; position: absolute; box-sizing: border-box; }
.dtile-resize-n, .dtile-resize-s { left: 0; right: 0; height: 6px; cursor: ns-resize; }
.dtile-resize-e, .dtile-resize-w { top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.dtile-resize-n { top: 0; } .dtile-resize-s { bottom: 0; } .dtile-resize-e { right: 0; } .dtile-resize-w { left: 0; }
.dtile-resize-n::after, .dtile-resize-s::after { left: calc(50% - 10px); width: 20px; height: 3px; background: var(--text-muted); }
.dtile-resize-e::after, .dtile-resize-w::after { top: calc(50% - 10px); height: 20px; width: 3px; background: var(--text-muted); }
.dtile-resize-n::after { top: 0; } .dtile-resize-s::after { bottom: 0; } .dtile-resize-e::after { right: 0; } .dtile-resize-w::after { left: 0; }
.dtile-resize-nw, .dtile-resize-ne, .dtile-resize-sw, .dtile-resize-se { width: 12px; height: 12px; }
.dtile-resize-nw, .dtile-resize-se { cursor: nwse-resize; } .dtile-resize-ne, .dtile-resize-sw { cursor: nesw-resize; }
.dtile-resize-nw { left: 0; top: 0; } .dtile-resize-ne { right: 0; top: 0; } .dtile-resize-sw { left: 0; bottom: 0; } .dtile-resize-se { right: 0; bottom: 0; }
.dtile-resize-nw::after, .dtile-resize-ne::after, .dtile-resize-sw::after, .dtile-resize-se::after { inset: 0; border: 0 solid var(--text-muted); }
.dtile-resize-nw::after { border-width: 3px 0 0 3px; } .dtile-resize-ne::after { border-width: 3px 3px 0 0; }
.dtile-resize-sw::after { border-width: 0 0 3px 3px; } .dtile-resize-se::after { border-width: 0 3px 3px 0; }
.dtile-resize:hover::after, .dtile.resizing .dtile-resize::after { border-color: var(--accent); }
.dtile-resize-n:hover::after, .dtile-resize-s:hover::after, .dtile-resize-e:hover::after, .dtile-resize-w:hover::after { background: var(--accent); }
.dtile-ghost { position: absolute; border-radius: 0; border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  background: var(--accent-soft); transition: left 0.12s, top 0.12s, width 0.12s, height 0.12s; pointer-events: none; z-index: 1999; }
.dash-mobile .dtile-head { cursor: default; }
.dash-mobile .dtile-resize { display: none; }

/* Query tab linked to a dashboard visual */
.tile-link-bar { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 14px; font-size: 12.5px; color: var(--text-secondary);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); border-bottom: 1px solid var(--border); }
.tile-link-bar[hidden] { display: none; }
.tlb-icon { color: var(--accent); display: inline-flex; }
.tlb-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlb-text b { color: var(--text); font-weight: 600; }
.tlb-state { font-size: 11px; padding: 1px 8px; border-radius: 10px; color: var(--success); background: var(--success-soft); white-space: nowrap; }
.tlb-state.dirty { color: var(--warning); background: var(--warning-soft); }

/* Shared badge (dashboard header) */
.dash-shared { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  color: var(--success); background: var(--success-soft); }
.dash-shared:hover { background: color-mix(in srgb, var(--success) 22%, transparent); }
body.dash-tv .dash-shared { display: none; }

/* Share dialog */
.share-modal .modal-body { gap: 12px; }
.share-lead { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.share-lead b { color: var(--text); }
.share-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.share-notes li { display: flex; gap: 8px; align-items: flex-start; }
.share-notes .icon { margin-top: 2px; flex: none; color: var(--text-muted); }
.share-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.share-on { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.share-on .icon { color: var(--success); }
.share-on b { color: var(--success); }
.share-links { display: flex; flex-direction: column; gap: 6px; }
.share-link { display: flex; gap: 6px; }
.share-link .input { flex: 1; min-width: 0; font-size: 12px; }
.share-hint { margin: -4px 0 0; font-size: 11.5px; color: var(--text-muted); }
.share-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.share-247 { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-sunken); }
.share-247 > .icon { color: var(--text-muted); margin-top: 2px; flex: none; }
.share-247.on { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.share-247.on > .icon { color: var(--success); }
.share-247 > div { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.share-247 b { color: var(--text); font-size: 13px; }
.share-247 .link-btn { align-self: flex-start; color: var(--danger); font-size: 12px; padding: 0; margin-top: 2px; }
.share-247 .link-btn:hover { text-decoration: underline; }
.switch { position: relative; width: 36px; height: 20px; flex: none; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--border-strong); transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shared dashboard page (share.html) */
body.share-page { height: 100vh; overflow: hidden; background: var(--bg-app); }
.share-view { height: 100vh; display: flex; flex-direction: column; }
.share-logo { width: 22px; height: 22px; }
.share-name { pointer-events: none; }
.share-notice { display: flex; align-items: center; gap: 14px; margin: 12px 16px 0; padding: 12px 16px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 10%, var(--bg-panel)); }
.share-notice[hidden] { display: none; }
.share-notice > .icon { color: var(--warning); flex: none; width: 26px; height: 26px; }
.share-notice.server, .share-notice.device { border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-panel)); }
.share-notice.server > .icon, .share-notice.device > .icon { color: var(--danger); }
.share-notice.ok { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 10%, var(--bg-panel)); }
.share-notice.ok > .icon { color: var(--success); }
.sn-body { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-secondary); }
.sn-body b { color: var(--text); font-size: 14.5px; }
.sn-body small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
body.dash-tv .share-notice { margin: 10px 22px 0; }
body.dash-tv .sn-body { font-size: 15px; } body.dash-tv .sn-body b { font-size: 18px; }
/* Last data while the dashboard can't be refreshed */
.share-stale .dtile { opacity: 0.55; filter: grayscale(0.6); transition: opacity 0.4s, filter 0.4s; }
.share-invalid { flex: 1; display: flex; min-height: 100vh; }
.share-view .dtile-head { cursor: default; }

/* Pin popover (Visualize toolbar) */
.pin-menu { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.pin-head { display: flex; align-items: center; gap: 7px; padding: 6px 8px 8px; font-size: 12px; color: var(--text-secondary); }
.pin-head b { color: var(--text); font-weight: 600; }
.pin-head .icon { color: var(--accent); flex: none; }
.pin-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pin-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; text-align: left; color: var(--text); font-size: 12.5px; }
.pin-item:hover { background: var(--bg-hover); }
.pin-item .icon { color: var(--text-secondary); flex: none; }
.pin-item span { display: flex; flex-direction: column; min-width: 0; }
.pin-item small { color: var(--text-muted); font-size: 11px; }
.pin-update .icon { color: var(--accent); }
.pin-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.pin-empty, .pin-note, .pin-loading { padding: 8px 10px; font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }
.pin-new { display: flex; gap: 6px; padding: 8px 4px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.pin-new .input { flex: 1; min-width: 0; }
.pin-done { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 13px; color: var(--text); }
.pin-done .icon { color: var(--success); }
.pin-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 4px; }

/* SQL for a visual */
.viz-sql-modal .modal-body { display: flex; flex-direction: column; gap: 8px; }
.viz-sql { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--bg-sunken); border: 1px solid var(--border); font-size: 12px;
  line-height: 1.55; color: var(--text); max-height: 52vh; overflow: auto; white-space: pre; user-select: text; }

/* TV mode: only the dashboard, bigger type, no editing */
.dash-tv-exit { display: none; }
body.dash-tv .topbar, body.dash-tv .activitybar, body.dash-tv .statusbar { display: none; }
body.dash-tv .dash-head { border-bottom: 0; background: transparent; padding: 14px 22px 4px; }
body.dash-tv .dash-head .btn, body.dash-tv .dash-head .icon-btn, body.dash-tv .dash-refresh, body.dash-tv .dash-switch > .icon:last-child { display: none; }
body.dash-tv .dash-switch { font-size: 22px; pointer-events: none; }
body.dash-tv .dash-clock { display: inline; font-size: 22px; }
body.dash-tv .dash-meta { font-size: 13px; }
body.dash-tv .dash-scroll { padding: 14px 22px 22px; }
body.dash-tv .dtile-head { cursor: default; }
body.dash-tv .dtile-title { font-size: var(--dh-size, 15px); }
body.dash-tv .dtile-menu, body.dash-tv .dtile-resize { display: none; }
body.dash-tv .dash-tv-exit { display: inline-flex; position: fixed; right: 14px; top: 12px; z-index: 50; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text-secondary); font-size: 12px;
  opacity: 0; transition: opacity 0.2s; }
body.dash-tv .dash-tv-exit:hover, body.dash-tv .dash-tv-exit:focus-visible { opacity: 1; }

/* Dashboard files: not-connected banner, snapshot badge, drop target, dialogs ----------------------------------------- */
.dash-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  color: var(--text-secondary); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 9%, var(--bg-panel)); }
.dash-banner[hidden] { display: none; }
.dash-banner > .icon { color: var(--warning); flex: none; }
.dash-banner span { flex: 1; } .dash-banner b { color: var(--text); }
.dtile-snap { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 8px; color: var(--warning); background: var(--warning-soft); }
.dashboard-view.dash-drop .dash-scroll { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }
.dfile-modal .modal-body { gap: 12px; }
.dfile-data { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-sunken); cursor: pointer; }
.dfile-data input { margin-top: 3px; }
.dfile-data span { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text); }
.dfile-data small { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.dfile-summary { display: flex; gap: 12px; align-items: center; }
.dfile-summary > .icon { color: var(--accent); flex: none; width: 28px; height: 28px; }
.dfile-summary div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-secondary); }
.dfile-summary b { color: var(--text); font-size: 14px; }
.dfile-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.dfile-sources { display: flex; flex-direction: column; gap: 8px; }
.dfile-source { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-sunken); }
.dfile-src-info { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.dfile-src-info > .icon { color: var(--text-muted); margin-top: 2px; flex: none; }
.dfile-src-info div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text); min-width: 0; }
.dfile-src-info small { color: var(--text-secondary); font-size: 11.5px; }
.dfile-src-pick { display: flex; gap: 6px; align-items: center; }
.dfile-src-pick .select { min-width: 180px; }
.dfile-modes { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); }
.dfile-modes label { display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* Text boxes ----------------------------------------------------------------------------------------------------- */
.dtile.dtile-textbox { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.dtext-host { position: absolute; inset: 0; }
.dashboard-view .dtile-textbox .dtext-host { cursor: grab; }
.dashboard-view .dtile-textbox:hover .dtext { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
body.dash-tv .dtile-textbox:hover .dtext, .share-view .dtile-textbox:hover .dtext { outline: 0; }
.dtile-menu-float { position: absolute; top: 6px; right: 6px; z-index: 2; background: var(--bg-elevated); border: 1px solid var(--border-strong); }
.dtext { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 10px 16px; border-radius: 0; overflow: auto;
  color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
/* Vertical position with auto margins: when the text is taller than the box it scrolls from the top instead of being cut off */
.dtext.valign-middle .dtext-inner { margin: auto 0; } .dtext.valign-bottom .dtext-inner { margin-top: auto; }
.dtext.align-left { text-align: left; } .dtext.align-center { text-align: center; } .dtext.align-right { text-align: right; }
.dtext.size-s { font-size: 13px; } .dtext.size-m { font-size: 16px; } .dtext.size-l { font-size: 22px; }
.dtext.size-xl { font-size: 32px; } .dtext.size-xxl { font-size: 48px; }
.dtext.color-muted { color: var(--text-secondary); } .dtext.color-accent { color: var(--accent); } .dtext.color-success { color: var(--success); }
.dtext.color-warning { color: var(--warning); } .dtext.color-danger { color: var(--danger); }
.dtext.bg-card { background: var(--card-grad); }
.dtext.bg-accent { background: var(--accent-soft); } .dtext.bg-success { background: var(--success-soft); }
.dtext.bg-warning { background: var(--warning-soft); } .dtext.bg-danger { background: var(--danger-soft); }
.dtext.bordered { border: 1px solid var(--border); }
.dtext.bordered.bg-accent { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.dtext.bordered.bg-success { border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.dtext.bordered.bg-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.dtext.bordered.bg-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.dtext-inner > :first-child { margin-top: 0; } .dtext-inner > :last-child { margin-bottom: 0; }
.dtext h1, .dtext h2, .dtext h3 { margin: 0.2em 0 0.3em; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; color: inherit; }
.dtext h1 { font-size: 1.9em; } .dtext h2 { font-size: 1.45em; } .dtext h3 { font-size: 1.15em; }
.dtext p { margin: 0 0 0.6em; }
.dtext ul, .dtext ol { margin: 0 0 0.6em; padding-left: 1.3em; text-align: left; }
.dtext.align-center ul, .dtext.align-center ol { display: inline-block; }
.dtext li { margin: 0.15em 0; }
.dtext hr { border: 0; border-top: 1px solid var(--border-strong); margin: 0.6em 0; }
.dtext code { font-family: var(--mono); font-size: 0.9em; padding: 0.05em 0.35em; border-radius: 4px; background: var(--bg-sunken); }
.dtext a { color: var(--accent); }
.dtext strong { font-weight: 700; }
.dtext-placeholder { color: var(--text-muted); font-style: italic; }

/* Pictures */
.dimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 0; overflow: hidden; }
.dimg img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.dimg.fit-contain img { object-fit: contain; } .dimg.fit-cover img { object-fit: cover; } .dimg.fit-fill img { object-fit: fill; }
.dimg.bg-card { background: var(--card-grad); }
.dimg.bg-card.fit-contain img { padding: 8px; box-sizing: border-box; }
.dimg.bordered { border: 1px solid var(--border); }
.dimg-empty { color: var(--text-muted); font-size: 12px; }
.dashboard-view .dtile-image:hover .dimg { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
body.dash-tv .dtile-image:hover .dimg { outline: 0; }

/* Picture dialog */
.ie-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.ie-preview { position: relative; min-height: 280px; border-radius: 12px; background: var(--bg-app); border: 1px solid var(--border);
  background-image: linear-gradient(45deg, var(--checker) 25%, transparent 25%), linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, var(--checker) 75%), linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.ie-preview .dimg { inset: 10px; }
.ie-drop { position: absolute; inset: 10px; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  border: 2px dashed var(--border-strong); border-radius: 10px; color: var(--text-secondary); font-size: 13px; }
.ie-drop:hover { border-color: var(--accent); color: var(--text); }
.ie-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ie-hint { font-size: 11.5px; color: var(--text-muted); margin-top: -6px; }
.ie-opt > span { min-width: 74px; }
.ie-side .field { width: 100%; }
@media (max-width: 720px) { .ie-grid { grid-template-columns: 1fr; } }

/* Text box editor */
.text-editor-modal .modal-body { gap: 14px; }
.te-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.te-edit { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.te-tools { display: flex; flex-wrap: wrap; gap: 3px; }
.te-tool { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); font-size: 12.5px; font-weight: 600; }
.te-tool:hover { background: var(--bg-hover); }
.te-italic { font-style: italic; } .te-strike { text-decoration: line-through; }
.te-text { height: 240px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; padding: 10px; }
.te-help { font-size: 11px; color: var(--text-muted); } .te-help code { font-size: 10.5px; }
.te-preview-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.te-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); height: 28px; display: flex; align-items: flex-end; }
.te-preview { position: relative; flex: 1; min-height: 240px; border-radius: 12px; background: var(--bg-app); border: 1px solid var(--border); padding: 10px; }
.te-preview .dtext { inset: 10px; }
.te-options { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; padding-top: 4px; border-top: 1px solid var(--border); }
.te-opt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.te-seg button { height: 26px; padding: 0 9px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.te-seg button .icon { display: none; }
.te-swatches { display: flex; gap: 5px; }
.te-swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-strong); font-weight: 700; font-size: 12px; background: var(--bg-elevated); }
.te-swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.te-swatch.text-default { color: var(--text); } .te-swatch.text-muted { color: var(--text-secondary); } .te-swatch.text-accent { color: var(--accent); }
.te-swatch.text-success { color: var(--success); } .te-swatch.text-warning { color: var(--warning); } .te-swatch.text-danger { color: var(--danger); }
.te-swatch.bgs-none { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--border) 4px 5px); }
.te-swatch.bgs-card { background: var(--card-solid); } .te-swatch.bgs-accent { background: var(--accent-soft); } .te-swatch.bgs-success { background: var(--success-soft); }
.te-swatch.bgs-warning { background: var(--warning-soft); } .te-swatch.bgs-danger { background: var(--danger-soft); }
.te-check { cursor: pointer; }
@media (max-width: 760px) { .te-grid { grid-template-columns: 1fr; } }

/* Dashboard filters (slicers) */
.dtile-filter .dtile-head { padding: 6px 6px 2px 12px; min-height: 32px; }
.dtile-filter-icon { display: inline-flex; color: var(--text-muted); }
.dtile-filter.slc-active .dtile-filter-icon { color: var(--accent); }
.dtile-filter.slc-active { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.slc-clear { opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.dtile-filter.slc-active .slc-clear { opacity: 1; pointer-events: auto; }
.slc-host { container-type: normal; }
.slc { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 10px 10px; min-height: 0; font-size: 12.5px; }
.slc-search { position: relative; flex: none; }
.slc-search .icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.slc-search .input { width: 100%; padding-left: 26px; height: 28px; }
.slc-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; }
.slc-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--text); line-height: 1.3; }
.slc-item:hover { background: var(--bg-hover); }
.slc-item input { flex: none; accent-color: var(--accent); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.slc-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slc-all { color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; margin-bottom: 2px; }
.slc-blank span { font-style: italic; color: var(--text-secondary); }
.slc-gone { opacity: 0.5; }
.slc-note { font-size: 11px; color: var(--text-muted); padding: 2px 0; }
.slc-missing { display: flex; gap: 6px; align-items: flex-start; color: var(--warning); line-height: 1.4; }
.slc-dd { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text); font-size: 13px; text-align: left; }
.slc-dd span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slc-dd:hover { border-color: var(--accent); }
.slc-dd.active { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); background: var(--accent-soft); }
.slc-popover { padding: 8px; }
.slc-pop { position: static; padding: 0; max-height: 340px; }
.slc-pop .slc-list { max-height: 280px; margin: 4px 0 0; }
.slc-buttons { display: flex; flex-wrap: wrap; gap: 6px; overflow: auto; align-content: flex-start; min-height: 0; }
.slc-chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text);
  font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slc-chip:hover { border-color: var(--accent); }
.slc-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slc-range, .slc-dates { display: flex; flex-direction: column; gap: 6px; }
.slc-range-inputs { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.slc-range-inputs .input { flex: 1; min-width: 0; height: 30px; }
.slc-dates .select { height: 30px; }
.slc-dates input[type="date"] { color-scheme: dark; }
.slc-slider { position: relative; height: 22px; }
.slc-slider input[type="range"] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px; }
.slc-slider input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--border-strong); }
.slc-slider input[type="range"]:last-child::-webkit-slider-runnable-track { background: transparent; }
.slc-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: pointer; }
.dtile-filtered { display: inline-flex; color: var(--accent); margin-right: 6px; cursor: help; }
.dash-clear-filters { color: var(--accent); }

/* Filter settings dialog */
.slicer-editor .se-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.slicer-editor .se-row > label:first-child { width: 72px; flex: none; padding-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.slicer-editor .se-row > .input, .slicer-editor .se-row > .select { flex: 1; }
.se-fields { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 200px; overflow: auto; padding: 2px; }
.se-fields.se-need { outline: 1px solid var(--danger); border-radius: 8px; }
.se-field { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); font-size: 12.5px; text-align: left; min-width: 0; }
.se-field span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-field small { color: var(--text-muted); font-size: 10.5px; }
.se-field:hover { border-color: var(--accent); }
.se-field.on { border-color: var(--accent); background: var(--accent-soft); }
.se-field .icon { color: var(--text-muted); flex: none; }
.se-checks > div { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.se-note { display: flex; gap: 6px; font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 4px 0 0; }
.se-note .icon { flex: none; margin-top: 3px; }

/* Shared queries: each visual's corner shows its query (one colour per query); a legend lists them with Copy */
.dash-qcount { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.dash-qcount:hover { color: var(--accent); }
.dash-head .btn.active { color: var(--accent); background: var(--accent-soft); }
.dash-show-queries .dtile[data-q] { border-color: color-mix(in srgb, var(--q) 55%, var(--border)); }
.dash-show-queries .dtile[data-q] .dtile-head { padding-left: 50px; }
.dtile-qmark { display: none; position: absolute; left: 0; top: 0; z-index: 3; padding: 4px 10px 4px 9px; border-bottom-right-radius: 10px;
  background: var(--q); color: #0b0d12; font-size: 11px; font-weight: 800; letter-spacing: 0.02em; line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.dash-show-queries .dtile-qmark { display: block; }
.dtile-qmark:hover { filter: brightness(1.12); }
.dash-qlegend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-panel); }
.dash-qlegend[hidden] { display: none; }
.dql-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-right: 4px; }
.dql-chip { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--q) 50%, var(--border));
  background: color-mix(in srgb, var(--q) 12%, transparent); overflow: hidden; }
.dql-name { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; font-size: 12px; font-weight: 700; color: var(--text); }
.dql-name i { width: 9px; height: 9px; border-radius: 50%; background: var(--q); }
.dql-name small { font-weight: 500; color: var(--text-secondary); font-size: 11.5px; }
.dql-copy { display: inline-flex; padding: 5px 9px 5px 6px; color: var(--text-secondary); }
.dql-copy:hover, .dql-name:hover { color: var(--q); }
.dq-popover { padding: 0; overflow: hidden; }
.dq-pop { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 3px solid var(--q); }
.dq-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dq-badge { padding: 2px 8px; border-radius: 6px; background: var(--q); color: #0b0d12; font-size: 11px; font-weight: 800; }
.dq-meta { font-size: 11.5px; color: var(--text-muted); }
.dq-visuals { display: flex; flex-wrap: wrap; gap: 4px; }
.dq-visual { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 11.5px; max-width: 100%; }
.dq-visual span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dq-visual:hover { border-color: var(--q); }
.dq-sql { margin: 0; max-height: 260px; overflow: auto; padding: 10px; border-radius: 8px; background: var(--bg-app); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.dq-actions { display: flex; justify-content: flex-end; }
.dtile.dq-flash { box-shadow: 0 0 0 3px var(--q), 0 6px 18px rgba(0, 0, 0, 0.25); }
body.dash-tv .dtile-qmark, body.dash-tv .dash-qlegend { display: none !important; }
body.dash-tv .dash-show-queries .dtile[data-q] .dtile-head { padding-left: 14px; }
body.dash-tv .dash-show-queries .dtile[data-q] { border-color: var(--border); }

/* Pages (tabs) */
.dtile[hidden] { display: none; }
.dash-tabs { display: flex; align-items: flex-end; gap: 6px; padding: 6px 16px 0; border-bottom: 1px solid var(--border); background: var(--bg-panel); min-height: 40px; }
.dash-tabs[hidden] { display: none; }
.dash-tablist { display: flex; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.dash-tab { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 7px 8px 8px 14px; border-radius: 8px 8px 0 0;
  border: 1px solid transparent; border-bottom: 0; color: var(--text-secondary); font-size: 13px; font-weight: 500; white-space: nowrap; margin-bottom: -1px; }
.dash-tab > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.dash-tab:hover { color: var(--text); background: var(--bg-hover); }
.dash-tab.active { color: var(--text); background: var(--bg-app); border-color: var(--border); font-weight: 600; }
.dash-tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.dash-tab.dragging { opacity: 0.5; }
.dash-tab-menu { display: inline-flex; padding: 2px; border-radius: 4px; opacity: 0; color: var(--text-muted); }
.dash-tab:hover .dash-tab-menu, .dash-tab.active .dash-tab-menu { opacity: 1; }
.dash-tab-menu:hover { background: var(--bg-elevated); color: var(--text); }
.dash-tab-add { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-bottom: 4px; border-radius: 8px; color: var(--text-secondary); }
.dash-tab-add:hover { background: var(--bg-hover); color: var(--accent); }
.dash-rotate { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.dash-rotate .select { height: 26px; font-size: 12px; }
body.dash-tv .dash-tabs { padding-top: 4px; min-height: 34px; }
body.dash-tv .dash-tab { font-size: 14px; padding: 6px 16px 7px; }
.pin-pages { display: flex; flex-direction: column; gap: 1px; margin: -2px 0 4px 26px; padding-left: 8px; border-left: 1px solid var(--border); }
.pin-page { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); text-align: left; }
.pin-page:hover { background: var(--bg-hover); color: var(--text); }
.pin-page span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Converted dashboards (QuantySight BI Studio): review banner + report */
.dash-origin > .icon { color: var(--accent); }
.dash-origin { background: color-mix(in srgb, var(--accent) 10%, var(--bg-panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.dash-origin > span { flex: 1; min-width: 0; }
.origin-report .or-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); }
.or-group { margin-bottom: 14px; }
.or-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; }
.or-group h4 small { color: var(--text-muted); font-weight: 500; }
.or-unsupported h4 .icon { color: var(--danger); }
.or-approximated h4 .icon { color: var(--warning); }
.or-info h4 .icon { color: var(--text-muted); }
.or-group ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.or-group li { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 8px; background: var(--bg-elevated); font-size: 12.5px; }
.or-group li b { font-weight: 600; color: var(--text); }
.or-group li span { color: var(--text-secondary); }

/* Floating tiles (tile menu › Float): placed freely, may overlap; z-order set inline from their layer */
.dtile.dtile-floating:not(.dtile-textbox) { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 14px 34px rgba(0, 0, 0, 0.45); }
body:not(.dash-tv) .dashboard-view .dtile.dtile-floating:hover { outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* Filters pane (dashboard filters) */
.dash-body { flex: 1; min-height: 0; display: flex; }
.dash-body > .dash-scroll { min-width: 0; }
.dash-fpane { width: 280px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--bg-panel); min-height: 0; }
.dash-fpane[hidden] { display: none; }
/* Size and position: the page stays as it is behind the box - not dimmed, not blurred - so the object can be seen */
.modal-backdrop:has(.tile-size-dialog) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: flex-end; padding-right: 24px; }
.tile-size-dialog { box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
/* The Format pane: a visual's formatting, on the dashboard (the visual editor's Format panel) */
.dash-vpane { width: 300px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--bg-panel); min-height: 0; overflow: auto; }
.dash-vpane[hidden] { display: none; }
.vpane-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 9px 8px 9px 12px; border-bottom: 1px solid var(--border); background: var(--bg-panel); }
.vpane-head > .icon { color: var(--accent); flex: none; }
.vpane-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vpane-titles span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.vpane-titles b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpane-hint { padding: 18px 14px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.vpane-hint[hidden], .vpane-body[hidden] { display: none; }
.vpane-body { padding-top: 12px; }
@media (max-width: 720px) { .dash-vpane { display: none; } }
.dfp-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dfp-head > .icon { color: var(--accent); }
.dfp-count { font-size: 11px; color: var(--text-muted); }
.dfp-list { flex: 1; min-height: 0; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.dfp-foot { padding: 10px; border-top: 1px solid var(--border); }
.dfp-foot[hidden] { display: none; }
.dfp-add { width: 100%; justify-content: center; }
.dfp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 10px; text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.dfp-empty p { margin: 0; }
.dfp-card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.dfp-card.dfp-active { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.dfp-card-head { display: flex; align-items: center; gap: 2px; padding: 4px 4px 0 6px; }
.dfp-card-head .icon-btn { width: 24px; height: 24px; opacity: 0.6; }
.dfp-card-head .icon-btn:hover { opacity: 1; }
.dfp-card:not(.dfp-active) .dfp-reset { visibility: hidden; }
.dfp-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px; text-align: left; color: var(--text); font-weight: 600; font-size: 12.5px; }
.dfp-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dfp-name small { margin-left: auto; font-weight: 400; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.dfp-card.dfp-active .dfp-name small { color: var(--accent); }
.dfp-name .icon { flex: none; color: var(--text-muted); transition: transform 0.12s; }
.dfp-collapsed .dfp-name .icon { transform: rotate(-90deg); }
.dfp-scope { display: flex; align-items: center; gap: 5px; padding: 0 10px 6px 30px; font-size: 11px; color: var(--text-muted); }
.dfp-body { padding: 0 8px 10px; }
.dfp-collapsed .dfp-body, .dfp-collapsed .dfp-scope { display: none; }
.dfp-readonly [data-dfp="edit"], .dfp-readonly [data-dfp="remove"] { display: none; }
.dash-fcount { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10.5px; font-weight: 600; display: inline-flex;
  align-items: center; justify-content: center; background: var(--bg-hover); color: var(--text-secondary); }
.dash-filters-on .dash-fcount { background: var(--accent); color: #fff; }
.dash-mobile ~ .dash-fpane, .dash-body:has(.dash-mobile) .dash-fpane { width: 240px; }
@media (max-width: 720px) { .dash-fpane { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4); }
  .dash-body { position: relative; } }

/* Dashboard filter editor: scope */
.dfe-scope { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dfe-scope .segmented button { display: inline-flex; align-items: center; gap: 5px; }
.dfe-visuals { width: 100%; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.dfe-visuals[hidden] { display: none; }
.dfe-visuals.se-need { border-color: var(--danger); }
.dfe-vtools { display: flex; gap: 4px; margin-bottom: 2px; }
.dfe-vpage { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 6px; }
.dfe-visual { font-size: 12.5px; }
.dfe-visual small { color: var(--warning); font-size: 10.5px; }
.dfe-visual.dfe-nofield span { color: var(--text-muted); }
/* In the pane the control flows with its card (in a tile it fills the tile body) */
.dfp-body .slc { position: static; padding: 0 2px; }
.dfp-body .slc-list { max-height: 210px; flex: none; }

/* Floating tiles: placed to the pixel (no easing while they move), selected one, position read-out */
.dtile.dtile-floating { transition: none; }
body:not(.dash-tv) .dashboard-view .dtile.dtile-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.dtile-pos { position: absolute; left: 6px; bottom: 6px; z-index: 6; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.75); color: #fff; pointer-events: none; white-space: nowrap; }

/* Title + subtitle in a tile's title bar */
.dtile-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dtile-titles .dtile-title { flex: none; }
.dtile-sub { font-size: var(--dh-sub-size, 11.5px); color: var(--dh-sub-color, var(--text-muted)); text-align: var(--dh-align, left); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.dtile-sub[hidden] { display: none; }

/* Undo / redo */
.dash-undo { display: inline-flex; gap: 2px; }
.dash-undo .icon-btn[disabled] { opacity: 0.35; cursor: default; }
body.dash-tv .dash-undo { display: none; }

/* Visual options dialog */
.to-sub { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.to-sub .segmented { align-self: flex-start; }
.to-sub [hidden] { display: none !important; }
.to-tokens { display: flex; flex-wrap: wrap; gap: 4px; max-height: 140px; overflow: auto; }
.to-hint { width: 100%; font-size: 11.5px; color: var(--text-muted); }
.to-token { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); }
.to-token:hover { border-color: var(--accent); color: var(--text); }
.to-preview { font-size: 12.5px; color: var(--text); padding: 6px 10px; border-radius: 8px; background: var(--bg-panel); border: 1px dashed var(--border); }
.to-preview span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 6px; }

/* A required filter (always one value): no clear button */
.dtile-filter.slc-required .slc-clear { display: none; }

/* Header off (Visual options / tile menu): just the visual - no title bar, not even on hover. Right-click the tile for its
   menu, Alt + drag to move it. */
.dtile.dtile-noheader > .dtile-head, .dtile.dtile-noheader-view > .dtile-head { display: none; }
body.dash-moving .dtile, body.dash-moving .dtile * { cursor: grabbing; }

/* Page size: a fixed page (W x H) drawn at its own size and scaled to the window */
.dash-canvas { position: relative; }
.dash-fixed .dash-canvas { margin: 0 auto; background: color-mix(in srgb, var(--bg-panel) 55%, transparent); border-radius: 6px;
  box-shadow: 0 0 0 1px var(--border); }
.dash-fixed .dash-grid { position: absolute; left: 0; top: 0; transform-origin: 0 0; min-height: 0; }
.dash-page-edge { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  pointer-events: none; z-index: 1; }
.dash-page-edge span { position: absolute; right: 6px; top: 2px; font-size: 10.5px; color: var(--text-muted); }
body.dash-tv .dash-page-edge { display: none; }

/* Page size dialog */
.ps-modes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ps-mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.ps-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ps-mode span { display: flex; flex-direction: column; gap: 2px; }
.ps-mode small { color: var(--text-muted); font-size: 12px; }
.ps-fixed.ps-off { opacity: 0.45; }
.page-size .se-row .input[type="number"] { width: 100px; flex: none; }
.ps-x, .ps-unit { padding-top: 6px; color: var(--text-muted); }

/* Border & background off (tile menu / Visual options): no card - the tile blends into the dashboard's background */
.dtile.dtile-noborder, .dtile.dtile-noborder.dtile-floating:not(.dtile-textbox) { background: transparent; border-color: transparent; box-shadow: none; }
.dtile.dtile-nobg, .dtile.dtile-nobg.dtile-floating:not(.dtile-textbox) { background: transparent; box-shadow: none; }
.dtile.dtile-nobg .dtile-head { background: transparent; }
.dtile.dtile-noborder.slc-active { border-color: transparent; }
.dtile.dtile-noborder .dtile-head { background: transparent; }
body:not(.dash-tv) .dashboard-view .dtile.dtile-noborder:hover { outline: 1px dashed color-mix(in srgb, var(--border-strong) 70%, transparent); outline-offset: -1px; }

/* The tile clicked last (what Ctrl+C copies) */
body:not(.dash-tv) .dashboard-view .dtile.dtile-picked:not(.dtile-selected):not(.dtile-noborder) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 6px 18px rgba(0, 0, 0, 0.25); }

/* A picture's colour: all of it in one colour (its shape filled), or inverted */
.dimg-tint { width: 100%; height: 100%; display: block; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.dimg.fit-contain .dimg-tint { -webkit-mask-size: contain; mask-size: contain; } .dimg.fit-cover .dimg-tint { -webkit-mask-size: cover; mask-size: cover; }
.dimg.fit-fill .dimg-tint { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.dimg.bg-card.fit-contain .dimg-tint { width: calc(100% - 16px); height: calc(100% - 16px); }
.dimg.color-invert img { filter: invert(1) hue-rotate(180deg); }
.ie-color { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.ie-color.active { background: var(--accent-soft); color: var(--text); }
.ie-color input { width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.ie-preview { background-image: linear-gradient(45deg, rgba(127,127,127,.16) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.16) 75%), linear-gradient(45deg, rgba(127,127,127,.16) 25%, transparent 25%, transparent 75%, rgba(127,127,127,.16) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; }

/* Layout containers: a box the tiles are dropped in (they line up in a row / column and fill it). Its tab - grab it to
   move the container, its menu - shows above it while the pointer is on the container or on a tile in it. */
.dtile.dtile-container { overflow: visible; background: color-mix(in srgb, var(--bg-elevated) 55%, transparent); box-shadow: none; }
.dtile.dtile-container.dtile-floating { box-shadow: none; }
.dtile.dtile-container.dtile-noborder, .dtile.dtile-container.dtile-nobg { background: transparent; }
.dcont-body { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: grab; overflow: hidden; }
.dcont-hint { padding: 8px 12px; font-size: 12px; line-height: 1.4; color: var(--text-muted); text-align: center; pointer-events: none; }
.dtile-container.dcont-filled .dcont-hint { display: none; }
.dcont-tab { position: absolute; left: -1px; bottom: 100%; z-index: 3; display: none; align-items: center; gap: 5px; height: 20px; padding: 0 2px 0 7px;
  font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; user-select: none; cursor: grab;
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border)); border-bottom: 0; }
.dcont-tab .icon-btn { width: 18px; height: 18px; padding: 0; opacity: 1; }
body:not(.dash-tv) .dashboard-view .dtile-container:hover > .dcont-tab,
body:not(.dash-tv) .dashboard-view .dtile-container.dcont-hot > .dcont-tab { display: flex; }
body:not(.dash-tv) .dashboard-view .dtile-container:hover,
body:not(.dash-tv) .dashboard-view .dtile-container.dcont-hot { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); outline: none; }
body:not(.dash-tv) .dashboard-view .dtile-container.dcont-hot .dtile-resize { opacity: 0.85; }
body:not(.dash-tv) .dashboard-view .dtile-container.dcont-drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
body.dash-tv .dcont-hint, .dash-exporting .dcont-hint, .dash-exporting .dcont-tab, .share-view .dcont-hint { display: none; }
body.dash-tv .dcont-body, .share-view .dcont-body { cursor: default; }
.dash-mobile .dtile-container { display: none; }

/* The container bar: the containers around the pointer, outermost first (a chip moves its container, ⋯ is its menu) */
.dcont-bar { position: absolute; z-index: 3000; display: flex; align-items: center; gap: 2px; height: 20px; white-space: nowrap; user-select: none; }
.dcont-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 2px 0 7px; font-size: 11px; font-weight: 600; color: var(--text); cursor: grab;
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border)); }
.dcont-chip.active { background: color-mix(in srgb, var(--accent) 45%, var(--bg-elevated)); color: var(--text-strong, #fff); }
.dcont-chip .icon-btn { width: 18px; height: 18px; padding: 0; }
.dcont-sep { display: inline-flex; color: var(--text-muted); }
body.dash-tv .dcont-bar, .dash-exporting .dcont-bar, .dash-mobile .dcont-bar { display: none; }
/* The frame of a container that holds tiles (they cover its own handles): drawn over everything, just around it. Only
   its sides and corners take the pointer - what is inside stays clickable. */
.dcont-frame { position: absolute; z-index: 2999; pointer-events: none; border-radius: 10px; border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent); }
.dcont-frame.picked { border-style: solid; border-color: var(--accent); }
.dcont-frame .dtile-resize { pointer-events: auto; opacity: 0.95; }
.dcont-frame .dtile-resize-n, .dcont-frame .dtile-resize-s { height: 8px; } .dcont-frame .dtile-resize-e, .dcont-frame .dtile-resize-w { width: 8px; }
.dcont-frame .dtile-resize-nw, .dcont-frame .dtile-resize-ne, .dcont-frame .dtile-resize-sw, .dcont-frame .dtile-resize-se { width: 14px; height: 14px; z-index: 3; }
.dcont-frame .dtile-resize::after { border-color: var(--accent); }
.dcont-frame .dtile-resize-n::after, .dcont-frame .dtile-resize-s::after { background: var(--accent); width: 28px; left: calc(50% - 14px); height: 4px; border-radius: 2px; }
.dcont-frame .dtile-resize-e::after, .dcont-frame .dtile-resize-w::after { background: var(--accent); height: 28px; top: calc(50% - 14px); width: 4px; border-radius: 2px; }
body.dash-tv .dcont-frame, .dash-exporting .dcont-frame, .dash-mobile .dcont-frame, .share-view .dcont-frame { display: none; }

/* The Objects pane: everything on the page as a list (click: select it on the page) */
.dash-opane { width: 250px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--bg-panel); }
.dash-opane[hidden] { display: none; }
.dop-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 8px 14px; font-size: 13px; }
.dop-head > .icon { color: var(--accent); }
.dop-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dop-find { padding: 0 10px 8px; border-bottom: 1px solid var(--border); }
.dop-find .input { width: 100%; }
.dop-list { flex: 1; min-height: 0; overflow: auto; padding: 6px 4px 10px; }
.dop-row { display: flex; align-items: center; gap: 7px; height: 28px; padding-right: 2px; border-radius: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.dop-row:hover { background: var(--bg-hover); }
.dop-row.active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.dop-row > .icon { flex: none; color: var(--text-muted); }
.dop-row.active > .icon { color: var(--accent); }
.dop-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dop-row small { flex: none; max-width: 45%; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dop-row .icon-btn { flex: none; width: 22px; height: 22px; opacity: 0; }
.dop-row:hover .icon-btn, .dop-row.active .icon-btn { opacity: 0.8; }
.dop-empty { padding: 20px 10px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
body:not(.dash-tv) .dashboard-view .dtile.dtile-pointed { outline: 2px dashed var(--accent); outline-offset: 2px; }
body:not(.dash-tv) .dashboard-view .dtile.dtile-picked.dtile-found { outline: 2px solid var(--accent); outline-offset: 2px; animation: dtile-found 0.9s ease-out 2; }
@keyframes dtile-found { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.dash-exporting .dtile.dtile-found, .dash-exporting .dtile.dtile-pointed { outline: none !important; animation: none; }

/* Objects pane: rows can be dragged (into a container, before / after another row, out), the pane's edge too */
.dash-opane { position: relative; }
.dop-edge { position: absolute; top: 0; right: -3px; bottom: 0; width: 6px; cursor: ew-resize; z-index: 5; }
.dop-edge:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.dop-foot { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.dop-row { position: relative; touch-action: none; }
.dop-row.dragging { opacity: 0.45; }
.dop-row.drop-into { background: color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.dop-row.drop-before::before, .dop-row.drop-after::after { content: ''; position: absolute; left: 4px; right: 4px; height: 2px; background: var(--accent); border-radius: 1px; }
.dop-row.drop-before::before { top: -1px; }
.dop-row.drop-after::after { bottom: -1px; }
.dop-list.drop-out { box-shadow: inset 0 -3px 0 var(--accent); }
.dop-drag { position: fixed; z-index: 5000; display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 10px; border-radius: 6px; pointer-events: none;
  font-size: 12px; color: #fff; background: color-mix(in srgb, var(--accent) 80%, #000); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Header & options dialog: the header's own style */
.to-head { display: flex; flex-direction: column; gap: 8px; }
.to-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.to-head-row > span:first-child { width: 62px; color: var(--text-muted); }
.to-num { width: 64px; }
.to-px { color: var(--text-muted); margin-left: -4px; }
.to-tog { min-width: 30px; justify-content: center; }
.to-tog.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.to-color { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.to-color input[type="color"] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--border-strong); border-radius: 4px; background: none; cursor: pointer; }
.to-head-sample { position: static; margin-top: 2px; border-radius: 0; }
.to-head-sample .dtile-head { cursor: default; }

/* "Use this query for other visuals…" */
.share-query .sq-intro { margin: 0 0 10px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.45; }
.sq-sql { margin: 0 0 12px; padding: 8px 10px; max-height: 96px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-app); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-secondary); }
.sq-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; } .sq-count { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.sq-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.sq-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.sq-item:hover { background: var(--bg-hover); } .sq-item.sq-same { opacity: .65; cursor: default; }
.sq-item input { margin-top: 3px; flex: none; }
.sq-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; } .sq-main small { color: var(--text-muted); font-size: 11.5px; }
.sq-note { font-size: 11.5px; color: var(--text-secondary); } .sq-note.sq-warn { color: var(--warning); display: flex; gap: 5px; align-items: flex-start; overflow-wrap: anywhere; } .sq-note .icon { flex: none; margin-top: 1px; }
/* The Model view: a dashboard's queries and the relationships between them (model-view.js) */
.mv-dialog .modal-body { padding: 0; }
.mv { display: flex; flex-direction: column; min-height: 0; }
.mv-layers { display: flex; align-items: stretch; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-panel); }
.mv-layer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sunken); }
.mv-layer > .icon { color: var(--accent); flex: none; }
.mv-layer b { display: block; font-size: 12px; } .mv-layer small { display: block; color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.mv-arrow { display: flex; align-items: center; color: var(--text-muted); }
.mv-canvas-wrap { height: 318px; overflow: auto; background: var(--bg-app); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; border-bottom: 1px solid var(--border); }
.mv-canvas { position: relative; min-height: 100%; }
.mv-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.mv-line { pointer-events: auto; cursor: pointer; }
.mv-line line { stroke: var(--accent); stroke-width: 1.6; }
.mv-line .mv-hit { stroke: transparent; stroke-width: 14; }
.mv-line circle { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 1.2; }
.mv-line text { fill: var(--text); font-size: 11px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.mv-line.is-off line:not(.mv-hit) { stroke-dasharray: 5 4; stroke: var(--text-muted); } .mv-line.is-off circle { stroke: var(--text-muted); }
.mv-line.is-bad line:not(.mv-hit), .mv-line.is-bad circle { stroke: var(--danger); }
.mv-line.is-sel line:not(.mv-hit) { stroke-width: 2.6; }
.mv-card { position: absolute; display: flex; flex-direction: column; max-height: 236px; border: 1px solid var(--border-strong, var(--border)); border-radius: 9px; background: var(--bg-elevated); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.mv-card.is-focus { border-color: var(--accent); }
.mv-card-head { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 9px; border-bottom: 1px solid var(--border); cursor: grab; user-select: none; font-size: 12.5px; touch-action: none; }
.mv-card-head:active { cursor: grabbing; }
.mv-card-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-card-head > .icon { color: var(--accent); flex: none; }
.mv-tag { color: var(--text-muted); font-size: 10.5px; white-space: nowrap; }
.mv-card-body { overflow: auto; padding: 4px; min-height: 40px; }
.mv-card-msg { display: flex; align-items: center; gap: 6px; padding: 10px 8px; color: var(--text-secondary); font-size: 12px; } .mv-card-msg.bad { color: var(--danger); }
.mv-field { display: flex; align-items: center; gap: 7px; height: 25px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; cursor: grab; }
.mv-field span:not(.vf-type) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-field:hover { background: var(--bg-hover); }
.mv-field.is-key { background: var(--accent-soft); } .mv-field.is-key > .icon { color: var(--accent); flex: none; }
.mv-field.is-calc { cursor: default; font-style: italic; }
.mv-field.drop, .mv-canvas.is-relating .mv-field[data-field]:hover { border-color: var(--accent); background: var(--accent-soft); }
.mv-sub { padding: 6px 6px 2px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.mv-rels { padding: 12px 16px 14px; max-height: 250px; overflow: auto; }
.mv-rels-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; } .mv-rels-head span { flex: 1; font-size: 12px; }
.mv-rel { border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; margin-bottom: 7px; background: var(--bg-sunken); }
.mv-rel.is-sel { border-color: var(--accent); } .mv-rel.error { border-color: var(--danger); } .mv-rel.is-off { opacity: .78; }
.mv-rel-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mv-rel-row .select { flex: 1 1 110px; min-width: 96px; max-width: 190px; } .mv-rel-row .mv-card-sel { flex: 0 1 150px; }
.mv-rel-more { margin-top: 6px; } .mv-and { width: 30px; text-align: right; color: var(--text-muted); font-size: 11.5px; }
.mv-to { display: flex; color: var(--text-muted); }
.mv-active { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; cursor: pointer; } .mv-active input { accent-color: var(--accent); margin: 0; }
.mv-issue { display: flex; gap: 6px; margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: var(--text-secondary); } .mv-issue .icon { flex: none; margin-top: 2px; }
.mv-issue.error { color: var(--danger); } .mv-issue.warning { color: var(--warning); }
.mv-state { font-size: 12px; color: var(--text-secondary); margin-right: 4px; }
.mv-add .mv-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; } .mv-add .mv-row > span { color: var(--text-secondary); font-weight: 600; }
.mv-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mv-sql textarea { height: 170px; resize: vertical; font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: 12.5px; line-height: 1.45; padding: 8px 10px; white-space: pre; }
.mv-add-note { min-height: 16px; font-size: 12px; color: var(--text-secondary); } .mv-add-note.bad { color: var(--danger); }

/* A filter with nothing chosen that the other filters narrow: "Plant 1" / "Multiple items (3)" (slicer.js implied) */
.slc-implied { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 4px 8px; border-radius: 6px; font-size: 12px;
  color: var(--accent); background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.slc-implied span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.slc-dd.implied { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.slc-dd.implied span { color: var(--accent); font-weight: 600; }

/* View mode (dashboard-view.js editing): nothing to grab or resize until Edit is clicked */
.dash-viewing .dtile-resize, .dash-viewing .dash-page-edge, .dash-viewing .dcont-bar, .dash-viewing .dcont-frame, .dash-viewing .dcont-hint { display: none !important; }
.dash-viewing .dtile-head, .dash-viewing .dcont-body { cursor: default; }
.dash-viewing .dtile-textbox:hover .dtext, .dash-viewing .dtile-image:hover .dimg { outline: 0; }
.dash-edit-btn { margin-left: 4px; }
.dash-editing .dash-head { box-shadow: inset 0 -2px 0 var(--accent); }
body.dash-tv .dash-edit-btn { display: none; }

/* Parameter controls (page-params.js): a filter tile that sets a parameter of every visual on its page */
.slc-host [hidden] { display: none !important; }
.dtile-pctl .dtile-filter-icon { color: var(--accent); }
.ppc-box { position: absolute; inset: 0; display: flex; align-items: flex-start; padding: 2px 10px 10px; }
.ppc-box.param-controls { background: none; border: 0; margin: 0; }
.ppc-box .pc-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ppc-box .pc-name { display: none; } /* the tile's title names it */
.ppc-box .pc-input { flex: 1; min-width: 0; height: 30px; }
.ppc-box .pc-range { flex: 1; min-width: 0; accent-color: var(--accent); }
.ppc-box .pc-num { flex: 0 0 84px; }
.dtile-pctl .slc-buttons { flex-wrap: nowrap; }
.dtile-pctl .slc-chip { flex: 1 1 0; min-width: 0; text-align: center; }

/* Dashboard theme (lib/dashboard-theme.js, theme-editor.js): the page area of a dashboard with a theme carries the
   theme's values of the app's tokens (--bg-panel, --text, --border, --accent, --grid-*…) and its own --dt-* variables.
   Without a theme none of this applies (the rules are scoped to .dash-themed and fall back to the app's look). */
.dash-scroll.dash-themed { background: var(--dt-page-bg, var(--bg-app)); color: var(--text); font-family: var(--dt-font, var(--font)); }
.dash-themed.dash-theme-dark { color-scheme: dark; }
.dash-themed.dash-theme-light { color-scheme: light; }
.dash-themed :where(.dtile) { border-radius: var(--dt-radius, 0); }
.dash-themed :where(.dtile:not(.dtile-textbox):not(.dtile-container):not(.dtile-noborder)) { border-color: var(--dt-tile-border, var(--border)); }
.dash-themed :where(.dtile:not(.dtile-textbox):not(.dtile-container):not(.dtile-noborder):not(.dtile-nobg)) {
  box-shadow: var(--dt-shadow, 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 18px rgba(0, 0, 0, 0.25)); }
.dash-themed .dtile-title { color: var(--dh-color, var(--dt-title-color, var(--text))); font-size: var(--dh-size, var(--dt-title-size, 13px));
  font-weight: var(--dh-weight, var(--dt-title-weight, 600)); }
body.dash-tv .dash-themed .dtile-title { font-size: var(--dh-size, var(--dt-title-size, 15px)); }
.dash-themed .dtext { border-radius: var(--dt-radius, 0); }
.dash-themed .dtext.bordered { border-color: var(--dt-tile-border, var(--border)); }
.dash-themed .viz-kpi:not(.kpi-solid) .kpi-value { background-image: var(--dt-kpi-fill, linear-gradient(120deg, #22d3ee, #4f8cff 45%, #a78bfa)); }
/* section panels: containers in the theme's panel colours */
.dash-themed .dtile.dtile-container:where(:not(.dtile-nobg):not(.dtile-noborder)) { background: var(--dt-panel-bg, color-mix(in srgb, var(--bg-elevated) 55%, transparent)); }
.dash-themed .dtile.dtile-container:where(:not(.dtile-noborder)) { border-color: var(--dt-panel-border, var(--border)); }
.dash-theme-dark .dtile.dtile-container:where(:not(.dtile-nobg):not(.dtile-noborder)) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
/* display mode: the header over the page in the page's colours */
body.dash-tv .dash-view-themed { background: var(--dt-view-bg, var(--bg-app)); }
body.dash-tv .dash-view-themed .dash-head, body.dash-tv .dash-view-themed .dash-tabs { --text: var(--dt-view-text); --text-secondary: var(--dt-view-muted); --text-muted: var(--dt-view-dim); background: transparent; }

/* A container as a titled section panel (container.show_title): its title bar across the top, its tiles under it */
.dcont-head { position: absolute; left: 0; right: 0; top: 0; z-index: 1; display: flex; align-items: center; gap: 9px; padding: 0 14px; pointer-events: none; min-width: 0; }
.dcont-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dt-title-color, var(--text));
  font-size: calc(var(--dt-title-size, 14px) + 2px); font-weight: var(--dt-title-weight, 700); letter-spacing: -0.005em; }
.dcont-icon { display: inline-flex; flex: none; color: var(--dcont-accent, var(--accent)); }
.dcont-icon .icon { width: 20px; height: 20px; }
.dcont-mark { display: inline-block; width: 4px; height: 18px; flex: none; border-radius: 2px; background: var(--dcont-accent, var(--accent)); }
.dash-theme-dark .dcont-icon { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--dcont-accent, var(--accent)) 55%, transparent)); }
.dash-theme-dark .dcont-mark { box-shadow: 0 0 8px color-mix(in srgb, var(--dcont-accent, var(--accent)) 60%, transparent); }
.dtile-container.dcont-titled .dcont-hint { padding-top: 40px; }

/* The theme editor: beside the dashboard (no dimming - what changes shows on it at once) */
.modal-backdrop:has(> .modal.theme-editor) { background: transparent; backdrop-filter: none; justify-content: flex-end; align-items: stretch; padding: 64px 16px 16px; pointer-events: none; }
.modal.theme-editor { pointer-events: auto; max-height: none; height: 100%; }
.modal.theme-editor .modal-body { padding: 12px 14px; overflow: auto; }
.modal.theme-editor .modal-footer { gap: 6px; }
.dth-body { display: flex; flex-direction: column; gap: 12px; }
.dth-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.dth-preset { display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-sunken); text-align: left; }
.dth-preset:hover { border-color: var(--border-strong); }
.dth-preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dth-pname { font-size: 11.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dth-preview { display: flex; height: 44px; padding: 7px; border-radius: 5px; border: 1px solid var(--border); }
.dth-card { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 5px 6px; border: 1px solid; }
.dth-card i { display: block; width: 55%; height: 3px; border-radius: 2px; opacity: 0.9; }
.dth-card b { display: flex; gap: 2px; }
.dth-card em { flex: 1; height: 6px; border-radius: 1px; }
.dth-note { font-size: 11.5px; color: var(--text-secondary); line-height: 1.45; }
.dth-note b { color: var(--text); font-weight: 600; }
.dth-warn { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--warning-text); background: var(--warning-soft); padding: 5px 8px; border-radius: 6px; }
.dth-group { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.dth-gname { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.dth-hint { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.dth-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); min-height: 28px; }
.dth-row input[type="color"] { width: 100%; height: 26px; padding: 1px 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-sunken); cursor: pointer; }
.dth-row input[type="color"].dth-unset { opacity: 0.55; }
.dth-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.dth-row .select { width: 100%; }
.dth-row .segmented { justify-self: start; }
.dth-val { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dth-on { justify-self: center; }
.dth-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dth-pc { position: relative; display: inline-flex; }
.dth-pc input[type="color"] { width: 30px; height: 30px; padding: 1px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-sunken); cursor: pointer; }
.dth-pc-x { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; display: none; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.dth-pc-x .icon { width: 10px; height: 10px; }
.dth-pc:hover .dth-pc-x { display: inline-flex; }
.dth-pc-add { width: 30px; height: 30px; border: 1px dashed var(--border-strong); border-radius: 7px; }
.dth-reset { align-self: flex-start; }
.dth-import { position: relative; cursor: pointer; }
.dth-icons { display: flex; flex-wrap: wrap; gap: 4px; }
.dth-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border); color: var(--text-secondary); }
.dth-icon:hover { color: var(--text); border-color: var(--border-strong); }
.dth-icon.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dth-inline { display: flex; align-items: center; gap: 10px; }
.dth-inline input[type="color"] { width: 44px; height: 26px; padding: 1px 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-sunken); }
.section-title-dlg .modal-body { gap: 12px; }

/* Narrow tiles: the refresh stamp shrinks to its icon so the title keeps the room (the time is in its tooltip) */
.dtile-head { container-type: inline-size; }
@container (max-width: 340px) { .dtile-stamp-text { display: none; } }

/* The Parameters pane (edit mode, page-params.js): the dashboard's parameters - value, usage, "Add to page" */
.dash-ppane { width: 280px; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--bg-panel); }
.dash-ppane[hidden] { display: none; }
.pp-list { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pp-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pp-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pp-badge { flex: none; min-width: 26px; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 700; text-align: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pp-name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-add { flex: none; }
.pp-value { display: flex; align-items: baseline; gap: 8px; font-size: 12px; min-width: 0; }
.pp-value > span, .pp-used > span { color: var(--text-muted); font-size: 11px; }
.pp-value b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-value small { color: var(--accent); font-size: 10.5px; }
.pp-where { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; font-size: 11px; color: var(--text-secondary);
  border: 1px solid var(--border); background: transparent; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.pp-chip { cursor: pointer; }
.pp-chip.pp-here { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pp-chip.pp-here:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pp-none { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); font-style: italic; }
.pp-used { display: flex; flex-direction: column; gap: 1px; }
.pp-visual { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px; border: 0; border-radius: 5px; background: transparent; color: var(--text);
  font-size: 12px; text-align: left; cursor: pointer; min-width: 0; }
.pp-visual:hover { background: var(--bg-hover); }
.pp-visual > .icon { flex: none; color: var(--text-muted); }
.pp-visual > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-item.pp-unused .pp-name, .pp-item.pp-unused .pp-badge { opacity: 0.6; }
.pp-visual > small { flex: none; max-width: 40%; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .dash-ppane { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4); } }

/* HTML visual filling its page (dashboard-view.js fillTileOf): no tile chrome; its menu shows on hover --------------- */
.dtile.dtile-fill { border: 0; border-radius: 0; box-shadow: none; background: transparent; transition: none; }
.dtile.dtile-fill > .dtile-head { position: absolute; top: 6px; right: 6px; left: auto; width: max-content; container-type: normal; z-index: 5; min-height: 0; padding: 2px 4px; gap: 4px; border-radius: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow); opacity: 0; transition: opacity .15s; cursor: default; }
.dtile.dtile-fill:hover > .dtile-head, .dtile.dtile-fill > .dtile-head:focus-within { opacity: 1; }
.dtile.dtile-fill > .dtile-head .dtile-titles, .dtile.dtile-fill > .dtile-head .dtile-status { display: none; }
.dtile.dtile-fill > .dtile-head .dtile-menu { opacity: 1; }
.dtile.dtile-fill .dtile-resize { display: none; }
.dtile.dtile-fill .dtile-body { padding: 0; }
body.dash-tv .dtile.dtile-fill > .dtile-head { display: none; }

/* Partial data (lib/data-cut.js): the visual's numbers come from rows cut by the max-rows setting */
.dtile-cut { position: absolute; right: 6px; bottom: 6px; z-index: 4; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  color: var(--warning); background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); cursor: help; pointer-events: auto; }

/* Page tabs hidden for viewers (⋯ › Hide page tabs): a note while editing */
.dash-tabs-off { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; color: var(--text-muted); background: var(--surface-3, rgba(127,127,127,.12)); white-space: nowrap; }

/* Model view: Check model */
.mv-check { margin: 8px 0 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2, transparent); }
.mv-check-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mv-check-head .icon-btn { margin-left: auto; }
.mv-check-sec { display: flex; flex-direction: column; gap: 4px; }
.mv-check-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 4px; }
.mv-check .mv-issue { align-items: center; }
.mv-check .mv-issue > span { flex: 1; }
.mv-issue.ok { color: var(--success, #30a46c); }
