/* ─── Self-service BI: studio-paneel, widgets, drilldown ───────────────
   Hoort bij public/js/studio-runtime.js en studio-panel.js. Enkel de
   themavariabelen van style.css (--surface, --border, --text, --text-dim,
   --accent, --bg, --green, --red, --radius): licht en donker kloppen vanzelf. */

:root { --st-w: 420px; --st-accent2: #7c5cff; }

/* ── Widgets op de pagina ─────────────────────────────────────────── */
.df-hidden { display: none !important; }
.df-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.df-grid > .df-w { grid-column: span var(--df-span, 12); min-width: 0; }
.kpi-grid > .df-w.df-kpi { grid-column: auto; }
@media (max-width: 900px) { .df-grid > .df-w { grid-column: span 12; } .df-grid > .df-w.df-kpi { grid-column: span 6; } }
@media (max-width: 520px) { .df-grid > .df-w.df-kpi { grid-column: span 12; } }
.df-w { position: relative; }
.df-w .section-header { gap: 8px; }
.df-w-sub { color: var(--text-dim); font-size: 0.78rem; }
.df-w-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 20px 14px; margin-top: -6px; font-size: 0.7rem; color: var(--text-dim); }
.df-w-src { opacity: 0.85; }
.df-chart { padding: 14px 18px 18px; }
.df-kpi { cursor: pointer; transition: border-color .15s, transform .15s; }
.df-kpi:hover { border-color: var(--accent); }
.df-kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.df-kpi .kpi-delta { font-size: 0.78rem; margin-top: 8px; font-weight: 600; }
.df-kpi .kpi-delta.green { color: var(--green); }
.df-kpi .kpi-delta.red { color: var(--red); }
.df-kpi .kpi-delta-sub { color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.df-kpi-sub:not(.green):not(.red) { color: var(--text-dim); font-weight: 400; }
.df-loading { color: var(--text-dim); animation: dfPulse 1.2s ease-in-out infinite; }
@keyframes dfPulse { 50% { opacity: .45; } }
.df-empty { color: var(--text-dim); font-size: 0.85rem; padding: 40px 0; text-align: center; }
.df-err .df-w-foot { color: var(--red); }
.df-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.df-table td.df-num { position: relative; }
.df-cellbar { position: absolute; right: 16px; top: 50%; height: 20px; transform: translateY(-50%); border-radius: 4px; max-width: calc(100% - 32px); }
.df-cellval { position: relative; }
.df-row { cursor: pointer; }
.df-row:hover td { background: rgba(88, 166, 255, 0.07) !important; }
.df-row.is-static { cursor: default; }
.df-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.df-total td { font-weight: 700; border-top: 1px solid var(--border); }
.df-table-wrap { max-height: 460px; overflow: auto; }
/* Kolomkoppen blijven staan tijdens het scrollen, en lange koppen lopen door
   op een tweede regel i.p.v. de tabel te breed te maken (feedback Daan). */
.df-table-wrap .df-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); white-space: normal; vertical-align: bottom; }
.df-table-wrap .df-table tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--surface); }
.df-list td { vertical-align: top; }
.df-list td.td-name { white-space: nowrap; font-weight: 600; }
.df-nowrap { white-space: nowrap; }

/* Voorbeeld: wat de agent veranderde. */
.df-changed { position: relative; overflow: visible !important; outline: 2px solid rgba(124, 92, 255, 0.55); outline-offset: 2px; }
.df-changed.is-new { outline-color: rgba(63, 185, 80, 0.65); }
.df-badge {
  position: absolute; top: -11px; right: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 4px 3px 9px; border-radius: 999px; color: #fff; background: var(--st-accent2);
  box-shadow: 0 2px 8px rgba(0,0,0,.18); pointer-events: none;
}
.df-badge-x {
  pointer-events: auto; cursor: pointer; border: 0; width: 18px; height: 18px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 800; line-height: 1;
  color: #fff; background: #d1242f; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85);
}
.df-badge-x:hover, .df-badge-x:focus-visible { background: #a40e26; transform: scale(1.12); outline: none; }
.df-badge-x:disabled { opacity: .5; cursor: wait; }
.df-changed.is-hidden-prev > .df-badge { background: #6e7781; }
.df-changed.is-new > .df-badge { background: #2da44e; }
.df-flash { animation: dfFlash 1.6s ease-out 1; }
@keyframes dfFlash { 0% { box-shadow: 0 0 0 0 rgba(124, 92, 255, .55); } 100% { box-shadow: 0 0 0 18px rgba(124, 92, 255, 0); } }
.df-ghost { opacity: .38; filter: grayscale(.8); position: relative; }
.df-ghost::after {
  content: attr(data-df-ghost); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--text); background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(127,127,127,.12) 10px 20px);
  border-radius: var(--radius);
}

/* ── Drilldown-venster ────────────────────────────────────────────── */
.df-modal-overlay { z-index: 900; }
.df-modal { width: min(960px, 100%); }
.df-modal .modal-head { gap: 12px; }
.df-crumbs { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.df-crumb { color: var(--text-dim); }
.df-crumb.is-last { color: var(--text); font-weight: 600; }
.df-crumb-sep { color: var(--text-dim); opacity: .6; }
.df-back { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: .8rem; }
.df-back:hover { border-color: var(--accent); }
.df-drill-sum { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 10px; }
.df-drill-big { font-size: 1.6rem; font-weight: 700; }
.df-drill-meta { color: var(--text-dim); font-size: .8rem; }
.df-search { width: 100%; margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: .85rem; }
.df-records td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.df-loading-line { color: var(--text-dim); padding: 20px 0; }
.df-error { color: var(--red); padding: 12px 0; }
.df-doc-title { font-size: 1.1rem; margin: 14px 0 2px; }
.df-doc-sub { color: var(--text-dim); font-size: .85rem; margin-bottom: 12px; }
.df-doc-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.df-doc-field { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.df-doc-k { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.df-doc-v { font-weight: 600; font-size: .9rem; }

/* ── Eigen dashboards ─────────────────────────────────────────────── */
.df-dash-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); border: 2px dashed var(--border); border-radius: var(--radius); }
.df-dash-empty h2 { color: var(--text); font-size: 1.1rem; margin-bottom: 6px; }
.df-dash-empty button { margin-top: 14px; }
.df-dash-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--st-accent2); background: rgba(124,92,255,.1); border: 1px solid rgba(124,92,255,.25); padding: 3px 9px; border-radius: 999px; }
.nav-studio-new { color: var(--st-accent2) !important; font-weight: 600; }

/* ── Het studio-paneel ────────────────────────────────────────────── */
.st-ui, .st-ui * { box-sizing: border-box; }
.st-ui { font-family: 'Inter', system-ui, sans-serif; }
.st-ui [hidden] { display: none !important; }
.st-i { width: 1rem; height: 1rem; flex: none; }
@media (min-width: 1180px) {
  body.st-open:not(.st-min) .main { margin-right: var(--st-w); transition: margin-right .2s; }
  body.st-open:not(.st-min) .cr-fab, body.st-open:not(.st-min) .chat-fab { right: calc(var(--st-w) + 1rem); }
  body.st-open:not(.st-min) .chat-fab-full { right: calc(var(--st-w) + 4.5rem); }
}
.st-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--st-w); max-width: 100vw; z-index: 800;
  display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0,0,0,.14);
  animation: stIn .22s ease-out;
}
@keyframes stIn { from { transform: translateX(24px); opacity: 0; } }
.st-panel.is-min { top: auto; bottom: 8.25rem; right: 1rem; width: auto; background: none; border: 0; box-shadow: none; animation: none; }
.st-pill {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem;
  padding: 10px 16px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9);
  box-shadow: 0 10px 24px rgba(37, 99, 201, .35);
}
.st-pill:hover { filter: brightness(1.06); }

.st-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--border); }
.st-logo { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); flex: none; }
.st-logo .st-i { width: 18px; height: 18px; }
.st-head-text { flex: 1; min-width: 0; }
.st-title { font-weight: 700; font-size: 1rem; }
.st-sub { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-dim); }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: #d29922; flex: none; }
.st-dot.is-on { background: #2da44e; box-shadow: 0 0 0 3px rgba(45,164,78,.18); }
.st-head-btns { display: flex; gap: 2px; }

.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; cursor: pointer; border-radius: 8px; transition: background .15s, border-color .15s, opacity .15s; }
.st-btn:disabled { opacity: .5; cursor: default; }
.st-icon { width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-dim); }
.st-icon:hover:not(:disabled) { background: rgba(127,127,127,.14); color: var(--text); }
.st-icon.is-on { color: var(--st-accent2); background: rgba(124,92,255,.12); }
.st-icon-sm { width: 26px; height: 26px; }
.st-btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); padding: 9px 14px; font-weight: 600; font-size: .84rem; }
.st-btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.st-btn-ghost { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 12px; font-size: .82rem; font-weight: 500; }
.st-btn-ghost:hover:not(:disabled) { border-color: var(--text-dim); }
.st-btn-ghost.is-armed, .st-btn-sm.is-armed { border-color: var(--red); color: var(--red); }
.st-btn-danger { color: var(--red); }
.st-btn-sm { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 5px 10px; font-size: .76rem; font-weight: 500; white-space: nowrap; }
.st-btn-sm:hover { border-color: var(--accent); }

.st-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 16px; background: linear-gradient(90deg, rgba(124,92,255,.12), rgba(37,99,201,.08)); border-bottom: 1px solid var(--border); }
.st-banner.is-off { background: rgba(127,127,127,.08); }
.st-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .76rem; color: var(--text-dim); }
.st-banner-text strong { color: var(--text); font-size: .82rem; }

.st-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.st-welcome { text-align: center; padding: 18px 8px 4px; }
.st-welcome-ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; color: var(--st-accent2); background: rgba(124,92,255,.12); }
.st-welcome-ic .st-i { width: 26px; height: 26px; }
.st-welcome h3 { font-size: 1.02rem; margin-bottom: 6px; }
.st-welcome p { font-size: .82rem; color: var(--text-dim); line-height: 1.5; }
.st-suggest { display: flex; flex-direction: column; gap: 8px; }
.st-chip-sug { text-align: left; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: .8rem; cursor: pointer; line-height: 1.35; transition: border-color .15s, transform .15s; }
.st-chip-sug:hover { border-color: var(--st-accent2); transform: translateX(2px); }

.st-msg { display: flex; gap: 10px; }
.st-msg.is-user { flex-direction: column; align-items: flex-end; }
.st-msg.is-user .st-bubble { background: linear-gradient(135deg, var(--st-accent2), #2563c9); color: #fff; border-radius: 14px 14px 4px 14px; padding: 9px 13px; max-width: 88%; font-size: .85rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-msg-marked { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-top: 4px; max-width: 88%; }
.st-avatar { width: 28px; height: 28px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); }
.st-avatar .st-i { width: 15px; height: 15px; }
.st-avatar.is-busy { animation: stGlow 1.4s ease-in-out infinite; }
@keyframes stGlow { 50% { box-shadow: 0 0 0 6px rgba(124,92,255,.18); } }
.st-agent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.st-msg.is-agent .st-bubble { background: var(--bg); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 10px 13px; font-size: .85rem; line-height: 1.5; }
.st-msg.is-error .st-bubble { border-color: rgba(248,81,73,.45); }
.st-md p + p, .st-md p + ul, .st-md ul + p { margin-top: 6px; }
.st-md-list { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.st-meta { font-size: .68rem; color: var(--text-dim); }
.st-done { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border-radius: 10px; background: rgba(45,164,78,.08); border: 1px solid rgba(45,164,78,.25); }
.st-done-row { display: flex; gap: 7px; font-size: .79rem; align-items: flex-start; line-height: 1.35; }
.st-ok { color: #2da44e; margin-top: 1px; }
.st-bad { color: var(--red); }
.st-sys { align-self: center; font-size: .72rem; color: var(--text-dim); background: rgba(127,127,127,.1); padding: 4px 10px; border-radius: 999px; text-align: center; }
.st-sys.is-error { color: var(--red); background: rgba(248,81,73,.1); border-radius: 8px; }

.st-steps { display: flex; flex-direction: column; gap: 5px; padding: 9px 11px; border: 1px dashed var(--border); border-radius: 10px; }
.st-step { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-dim); flex-wrap: wrap; }
.st-step.is-run { color: var(--text); }
.st-step strong { font-weight: 600; color: var(--text); }
.st-step-detail { color: var(--text-dim); }
.st-step-text { flex: 1; min-width: 0; }
.st-ms { font-size: .66rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.st-step-err { flex-basis: 100%; padding-left: 24px; color: #d29922; font-size: .7rem; }
.st-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(124,92,255,.25); border-top-color: var(--st-accent2); animation: stSpin .7s linear infinite; flex: none; }
@keyframes stSpin { to { transform: rotate(360deg); } }
.st-thought { font-size: .74rem; color: var(--text-dim); font-style: italic; line-height: 1.45; padding: 0 4px; max-height: 5.8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }

.st-question { border: 1px solid rgba(124,92,255,.35); background: rgba(124,92,255,.05); border-radius: 12px; padding: 12px; }
.st-q-text { font-weight: 600; font-size: .86rem; margin-bottom: 10px; }
.st-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-options:not(.has-preview) { grid-template-columns: 1fr; }
.st-option { text-align: left; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.st-option:hover:not(:disabled) { border-color: var(--st-accent2); box-shadow: 0 6px 18px rgba(124,92,255,.15); transform: translateY(-1px); }
.st-option:disabled { cursor: default; opacity: .55; }
.st-option.is-chosen { opacity: 1; border-color: var(--st-accent2); box-shadow: 0 0 0 2px rgba(124,92,255,.3); }
.st-option-label { font-weight: 600; font-size: .82rem; }
.st-option-desc { font-size: .74rem; color: var(--text-dim); line-height: 1.35; }
.st-option-preview { pointer-events: none; margin-bottom: 4px; }
.st-option-preview .df-w { border-radius: 8px; }
.st-option-preview .section-header { padding: 6px 8px; }
.st-option-preview .section-title { font-size: .68rem; }
.st-option-preview .info-tip, .st-option-preview .df-w-foot, .st-option-preview .df-w-sub { display: none; }
.st-option-preview .df-chart { padding: 6px; }
.st-option-preview .kpi-card { padding: 10px; }
.st-option-preview .kpi-value { font-size: 1.15rem; }
.st-option-preview .df-table-wrap { max-height: 150px; font-size: .7rem; }
.st-option-preview .data-table td, .st-option-preview .data-table th { padding: 4px 6px; }

/* Wijzigingen in dit voorbeeld: bovenaan, meteen onder de kop (feedback Daan). */
.st-changes { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(124,92,255,.10), rgba(124,92,255,.03)); padding: 10px 12px 8px 16px; }
.st-changes.is-off { background: rgba(127,127,127,.07); }
.st-changes-head { display: flex; align-items: center; gap: 10px; }
.st-changes-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .74rem; color: var(--text-dim); }
.st-changes-title strong { color: var(--text); font-size: .86rem; }
.st-change-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.st-change { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 8px; font-size: .78rem; background: var(--bg); border: 1px solid var(--border); }
.st-change.is-failed { opacity: .6; }
.st-change-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.st-change-go:hover .st-change-sum { text-decoration: underline; }
.st-change-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-change-where { font-size: .68rem; color: var(--accent); }
.st-sticker { flex: none; font-size: .6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--st-accent2); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.st-sticker.is-new { background: #2da44e; }
.st-sticker.is-hidden { background: #6e7781; }
.st-x { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #d1242f; background: rgba(209,36,47,.1); font-size: .8rem; font-weight: 800; }
.st-x:hover, .st-x:focus-visible { color: #fff; background: #d1242f; outline: none; }
.st-x:disabled { opacity: .5; cursor: wait; }
.st-changes-hint { margin: 6px 0 0; font-size: .68rem; color: var(--text-dim); }
.st-changes-hint b { color: #d1242f; }

.st-composer { padding: 10px 16px 6px; border-top: 1px solid var(--border); }
.st-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.st-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: rgba(124,92,255,.12); color: var(--st-accent2); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tag.is-current { background: rgba(45,164,78,.14); color: #2da44e; }
.st-tag-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: .9rem; line-height: 1; padding: 0 0 0 2px; }
.st-input-row { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 12px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.st-input-row:focus-within { border-color: var(--st-accent2); box-shadow: 0 0 0 3px rgba(124,92,255,.14); }
.st-input { flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: .86rem; line-height: 1.45; padding: 4px 0; min-height: 24px; }
.st-input-box { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); margin-top: 10px; }
.st-input-tools { display: flex; gap: 2px; }
.st-send { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); }
.st-hint { font-size: .68rem; color: var(--text-dim); margin-top: 5px; line-height: 1.4; }
.st-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 10px 16px 14px; }
.st-foot-note { flex: 1; font-size: .7rem; color: var(--text-dim); }
.st-foot .st-btn-primary { flex: 1 1 100%; order: 3; padding: 11px 14px; }

.st-history, .st-sendbox { flex: 1; overflow-y: auto; padding: 16px; }
.st-sec-title { font-size: .95rem; margin-bottom: 4px; }
.st-version-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.st-version { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.st-version.is-current { border-color: rgba(45,164,78,.5); }
.st-version-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .84rem; }
.st-version-sum { font-size: .78rem; color: var(--text-dim); line-height: 1.4; }
.st-empty { color: var(--text-dim); font-size: .82rem; }

.st-hoverbox { position: fixed; z-index: 790; pointer-events: none; border: 2px solid var(--st-accent2); background: rgba(124,92,255,.08); border-radius: 10px; transition: all .08s; }
.st-hoverbox-tip { position: absolute; top: -26px; left: 0; background: var(--st-accent2); color: #fff; font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
body.st-picking .main { cursor: crosshair; }
.st-hoverbox-open { position: absolute; right: 6px; bottom: 6px; pointer-events: auto; cursor: pointer !important; background: #fff; color: #1f2328; border: 1px solid var(--st-accent2); border-radius: 9999px; font-size: .72rem; font-weight: 600; padding: 3px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.st-hoverbox-open:hover { background: var(--st-accent2); color: #fff; }
.st-hoverbox-open[hidden] { display: none; }
body.st-picking :is(.modal, .drill-modal, .x-modal, .venster) { cursor: crosshair; }
body.st-picking :is(.modal-overlay, .drill-overlay, .x-overlay, .venster-laag, .modal-bg):not(.st-ui) { z-index: 780 !important; }
body.st-picking .main * { cursor: crosshair !important; }

.st-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .84rem; box-shadow: 0 12px 30px rgba(0,0,0,.3); max-width: min(560px, calc(100vw - 32px)); animation: stToast .25s ease-out; transition: opacity .4s, transform .4s; }
.st-toast.is-bad { background: #b42318; }
.st-toast.is-out { opacity: 0; transform: translate(-50%, 8px); }
@keyframes stToast { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 1179px) {
  .st-panel:not(.is-min) { width: min(var(--st-w), 100vw); }
}
@media (max-width: 560px) {
  .st-panel:not(.is-min) { width: 100vw; }
  .st-options.has-preview { grid-template-columns: 1fr; }
}

/* ── Keuze in de helm: agent of DecisionFlow ─────────────────────── */
.cr-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
@media (max-width: 560px) { .cr-choice { grid-template-columns: 1fr; } }
.cr-choice-card { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cr-choice-card:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.08); border-color: var(--text-dim); }
.cr-choice-card.is-ai { border-color: rgba(124,92,255,.5); background: linear-gradient(160deg, rgba(124,92,255,.10), rgba(37,99,201,.05)); }
.cr-choice-card.is-ai:hover:not(:disabled) { border-color: var(--st-accent2); box-shadow: 0 10px 26px rgba(124,92,255,.2); }
.cr-choice-card:disabled { opacity: .6; cursor: default; }
.cr-choice-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.cr-choice-title svg { width: 18px; height: 18px; }
.cr-choice-card.is-ai .cr-choice-title { color: var(--st-accent2); }
.cr-choice-desc { font-size: .78rem; color: var(--text-dim); line-height: 1.45; }
.cr-choice-tag { align-self: flex-start; font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--st-accent2); color: #fff; }
.cr-btn.is-ai { background: linear-gradient(135deg, var(--st-accent2), #2563c9); border-color: transparent; color: #fff; }
.cr-btn.is-ai:hover:not(:disabled) { filter: brightness(1.07); }

/* Met het paneel open is de inhoud smaller: KPI-getallen niet midden in een
   bedrag laten afbreken. */
body.st-open:not(.st-min) .kpi-value { font-size: clamp(1.15rem, 0.7rem + 1vw, 1.65rem); overflow-wrap: normal; word-break: keep-all; }
.st-md-h { font-weight: 700; margin-top: 8px; }

/* Toepassen voor iedereen (met uitleg) + melding voor logins zonder rechten */
.st-save { flex: 1 1 100%; order: -1; }
.st-save-q { font-size: .78rem; font-weight: 600; margin-bottom: 6px; }
.st-save-btn { width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 0; border-radius: 10px; padding: 10px 12px; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); cursor: pointer; font: inherit; transition: box-shadow .15s; }
.st-save-btn:hover { box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.st-save-btn:disabled { opacity: .6; cursor: default; }
.st-save-btn.is-armed { box-shadow: 0 0 0 3px rgba(229,83,75,.4); }
.st-save-e { font-size: 1.1rem; line-height: 1.2; }
.st-save-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-save-l { font-size: .86rem; }
.st-save-t small { font-size: .7rem; line-height: 1.35; color: rgba(255,255,255,.88); }
.st-noedit { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid #d29922; border-radius: 10px; background: rgba(210,153,34,.08); font-size: .8rem; line-height: 1.45; }
.st-noedit strong { display: block; margin-bottom: 4px; }
/* Interne links in Bob's antwoorden ([Overzicht](/overview)). */
.st-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.st-link:hover { text-decoration-thickness: 2px; }

/* ── Filterbalk boven een grafiek (chart option filterBar) ─────────── */
.df-fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--bg); font-size: 0.78rem; }
.df-fbar-lbl { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; font-size: 0.7rem; }
.df-fbar-pills, .df-fbar-series { display: flex; flex-wrap: wrap; gap: 6px; }
.df-fbar-pill, .df-fbar-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 11px; font: inherit; cursor: pointer; line-height: 1.3; transition: border-color .15s, background .15s; }
.df-fbar-pill:hover, .df-fbar-chip:hover { border-color: var(--accent); }
.df-fbar-pill.is-on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.df-fbar-pill:focus-visible, .df-fbar-chip:focus-visible, .df-fbar-sel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.df-fbar-custom { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.df-fbar-sel { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 6px; font: inherit; }
.df-fbar-series { margin-left: auto; }
.df-fbar-chip { display: inline-flex; align-items: center; gap: 6px; }
.df-fbar-chip.is-off { opacity: .45; text-decoration: line-through; }
.df-fbar-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (max-width: 640px) { .df-fbar-series { margin-left: 0; } .df-fbar-custom { width: 100%; } }

/* ─── Startscherm: grote "Selecteer wat je wilt aanpassen" + ⓘ-uitleg ─── */
.st-title-row { display: flex; align-items: center; gap: 6px; }
.st-info-btn { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.st-info-btn .st-i { width: 17px; height: 17px; }
.st-info-btn:hover, .st-info-btn.is-on { color: var(--st-accent2); background: rgba(124,92,255,.12); }
.st-about { margin: 0 16px 6px; padding: 12px 14px; border: 1px solid rgba(124,92,255,.3); border-radius: 12px; background: rgba(124,92,255,.06); font-size: .8rem; line-height: 1.5; color: var(--text); }
.st-about strong { display: block; font-size: .88rem; margin-bottom: 4px; }
.st-about p { margin: 0 0 6px; color: var(--text-dim); }
.st-about ul { margin: 0; padding-left: 18px; color: var(--text-dim); }
.st-about li { margin: 2px 0; }
.st-about-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

.st-welcome { padding: 22px 4px 6px; }
.st-pick-big {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 26px 18px 22px; cursor: pointer;
  border: 2px dashed var(--st-accent2); border-radius: 18px; background: rgba(124,92,255,.07); color: var(--text); font: inherit;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.st-pick-big:hover { background: rgba(124,92,255,.13); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(124,92,255,.18); }
.st-pick-big:focus-visible { outline: 3px solid rgba(124,92,255,.4); outline-offset: 2px; }
.st-pick-big-ic { width: 64px; height: 64px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--st-accent2), #2563c9); box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.st-pick-big-ic .st-i { width: 34px; height: 34px; }
.st-pick-big-l { font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.st-pick-big-h { font-size: .78rem; color: var(--text-dim); line-height: 1.4; max-width: 30ch; }
.st-pick-big.is-on { border-style: solid; background: rgba(124,92,255,.16); }
.st-pick-big.is-on .st-pick-big-ic { animation: st-pick-pulse 1.3s ease-out infinite; }
@keyframes st-pick-pulse { 0% { box-shadow: 0 0 0 0 rgba(124,92,255,.55); } 100% { box-shadow: 0 0 0 16px rgba(124,92,255,0); } }
.st-welcome-or { text-align: center; font-size: .76rem; color: var(--text-dim); margin: 16px 0 8px; }

/* Kleine aanduidknop in de invoer: met tekst, in de accentkleur. */
.st-pick-sm { height: 34px; padding: 0 10px; gap: 5px; border-radius: 9px; border: 1px solid rgba(124,92,255,.45); background: rgba(124,92,255,.1); color: var(--st-accent2); font-weight: 600; font-size: .76rem; white-space: nowrap; }
.st-pick-sm .st-i { width: 17px; height: 17px; }
.st-pick-sm:hover { background: rgba(124,92,255,.18); }
.st-pick-sm.is-on { color: #fff; background: var(--st-accent2); border-color: var(--st-accent2); }
.st-input-tools { gap: 6px; align-items: center; }
@media (prefers-reduced-motion: reduce) { .st-pick-big, .st-pick-big.is-on .st-pick-big-ic { animation: none; transition: none; } }
