/* Strategy Research Lab — dashboard styles. Uses VOLURR design tokens so both
   light and dark themes + RTL/LTR work automatically. No emoji, no fake charts. */

/* ── Section chrome: remove the global market-price ticker INSIDE this section
   only and reclaim the 34px it occupied — same owner pattern as gold/market/agi.
   Every rule is scoped to body[data-view="strategylab"], which shell.js stamps
   on entry and clears on exit, so the ticker returns automatically on every
   other VOLURR page. The section carries its own integrated header (.srl-head),
   so the topbar's DUPLICATE page-title + market-status are hidden; the global
   utility controls (search / bell / mail / menu / language) stay. ── */
html:not(.wco-on) body[data-view="strategylab"] .ticker { display: none; }
html:not(.wco-on) body[data-view="strategylab"] .app { padding-top: 0; }
html:not(.wco-on) body[data-view="strategylab"] .side { top: 0; }
html:not(.wco-on) body[data-view="strategylab"] .topbar { top: 0; }

/* ── ONE merged institutional bar ──────────────────────────────────────────
   The section's own header row (.srl-head) is hidden; its identity + actions
   are injected into the persistent global topbar by strategylab.js
   (srlDecorateTopbar), so there is exactly ONE header line inside this section:
     [flask] Strategy Research Lab / subtitle → Market Status → Next Session →
     Search · Notifications · Messages · Theme · Language · Fullscreen →
     Lab Settings → Create Test
   The topbar's own title (.hdrL) and market block (.hdr-status) are shown as
   normal (no longer hidden). All injected nodes carry .srl-injected and are
   removed on leaving the section, so every other VOLURR page is untouched. */
body[data-view="strategylab"] .srl-head { display: none; }

/* red flask chip injected just before the topbar title block */
.topbar > .srl-tb-ic { width: 34px; height: 34px; flex: none; border-radius: var(--rad-md, 9px);
  display: inline-flex; align-items: center; justify-content: center; background: var(--crimson, #e5484d);
  box-shadow: 0 2px 9px color-mix(in srgb, var(--crimson, #e5484d) 40%, transparent); }
.topbar > .srl-tb-ic .srl-ic { width: 18px; height: 18px; color: #fff; }

/* Lab Settings + Create Test injected into the topbar action cluster */
.hdr-acts .srl-tb-actions { display: inline-flex; align-items: center; gap: 8px; }
.hdr-acts .srl-tb-btn { padding: 8px 13px; font-size: 12.5px; white-space: nowrap; }
.hdr-acts .srl-tb-btn .srl-ic { width: 15px; height: 15px; }
@media (max-width: 820px) { .hdr-acts .srl-tb-btn .srl-tb-btxt, .hdr-acts .srl-tb-btn .srl-btn-caret { display: none; } .hdr-acts .srl-tb-btn { padding: 8px 10px; } }

/* Mobile: the primary section actions collapse out of the crowded top bar into a
   prominent in-content bar (Create Test is never hidden). */
.srl-mobile-actions { display: none; }
@media (max-width: 700px) {
  .hdr-acts .srl-tb-actions { display: none; }
  .srl-mobile-actions { display: flex; gap: 8px; }
  .srl-mobile-actions .srl-btn { flex: 1 1 auto; justify-content: center; }
}

.srl { display: flex; flex-direction: column; gap: 14px; padding: 2px 2px 40px; }

/* Base icon size — WITHOUT this, inline SVGs with a viewBox but no width/height
   render oversized (they inherit huge intrinsic sizes). Context rules below
   (title/btn/strip/action) are more specific and still win. */
.srl-ic { width: 16px; height: 16px; flex: none; }
.srl-card-h .srl-ic { width: 16px; height: 16px; color: var(--txt2, #9aa7b4); }
.srl-kpi .k .srl-ic { width: 16px; height: 16px; }

/* Header */
.srl-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.srl-head .srl-titlewrap { flex: 1; min-width: 200px; }
.srl-title-ic { width: 38px; height: 38px; flex: none; border-radius: var(--rad-md, 10px); display: flex; align-items: center; justify-content: center;
  background: var(--crimson, #e5484d); box-shadow: 0 2px 10px color-mix(in srgb, var(--crimson, #e5484d) 40%, transparent); }
.srl-title-ic .srl-ic { width: 21px; height: 21px; color: #fff; }
.srl-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; }
.srl-title-star .srl-ic { width: 15px; height: 15px; color: var(--muted, #7c8894); }
.srl-sub { color: var(--txt2, #9aa7b4); font-size: 12.5px; margin-top: 2px; max-width: 640px; }
.srl-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.srl-btn-caret { font-size: 10px; margin-inline-start: 2px; opacity: .85; }

.srl-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--rad-md, 9px);
  border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d); color: var(--txt, #e6edf3);
  font-weight: 600; font-size: 13px; cursor: pointer; }
.srl-btn:hover { border-color: var(--txt2, #9aa7b4); }
.srl-btn .srl-ic { width: 15px; height: 15px; }
.srl-btn-primary { background: var(--crimson, #e5484d); border-color: var(--crimson, #e5484d); color: #fff; }
.srl-btn-primary:hover { filter: brightness(1.06); }
.srl-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Status strip — five compact cells in one row on desktop */
.srl-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  background: var(--card, #161b22); border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 10px); padding: 0; overflow: hidden; }
.srl-strip-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-inline-start: 1px solid var(--line, #2a323c); }
.srl-strip-item:first-child { border-inline-start: 0; }
.srl-strip-item .srl-ic { width: 17px; height: 17px; color: var(--txt2, #9aa7b4); flex: none; }
.srl-strip-k { color: var(--txt2, #9aa7b4); font-size: 11.5px; }
.srl-strip-v { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }

.srl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted, #7c8894); flex: none; }
.srl-dot.on { background: var(--up, #3fb950); } .srl-dot.off { background: var(--down, #f85149); }
.srl-dot.warn { background: var(--amber, #d29922); }

/* Body: main + right rail */
.srl-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.srl-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.srl-rail { display: flex; flex-direction: column; gap: 14px; }

/* Cards — compact, fine border, premium dark surface */
.srl-card { background: var(--card, #161b22); border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 10px); padding: 13px 15px; min-width: 0; }
/* grid children must be allowed to shrink below content width (prevents page overflow) */
.srl-body > *, .srl-two > *, .srl-three > *, .srl-main > * { min-width: 0; }
.srl-scroll { max-width: 100%; }
.srl-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.srl-card-h .t { font-weight: 700; font-size: 14px; }
.srl-card-h .a { color: var(--crimson, #e5484d); font-size: 12px; cursor: pointer; }

/* KPI cards — six across on desktop, dense, icon in a top-right chip */
.srl-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.srl-kpi { background: var(--card, #161b22); border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 10px); padding: 12px 13px; min-width: 0; }
.srl-kpi .khead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.srl-kpi .k { color: var(--txt2, #9aa7b4); font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; letter-spacing: .01em; }
.srl-kpi .kico { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  background: color-mix(in srgb, var(--crimson, #e5484d) 12%, transparent); color: var(--crimson, #e5484d); }
.srl-kpi .kico .srl-ic { width: 15px; height: 15px; }
.srl-kpi .v { font-size: 24px; font-weight: 800; margin-top: 8px; letter-spacing: -.6px; line-height: 1.1; }
.srl-kpi .sub { font-size: 11px; margin-top: 4px; color: var(--txt2, #9aa7b4); display: flex; align-items: center; gap: 5px; }
.srl-kpi .sub .up { color: var(--up, #3fb950); font-weight: 700; }
.srl-kpi .sub .down { color: var(--down, #f85149); font-weight: 700; }

/* Unavailable state — honest, never a fake number */
.srl-na { display: inline-flex; align-items: center; gap: 5px; color: var(--txt2, #9aa7b4); font-weight: 600; font-size: 13px;
  border: 1px dashed var(--line, #2a323c); border-radius: 999px; padding: 2px 10px; }
.srl-na .v { font-size: 13px; font-weight: 600; }
.srl-empty { color: var(--txt2, #9aa7b4); font-size: 12.5px; text-align: center; padding: 14px 10px; }

/* ── Compact premium empty state (icon + title + exact reason + real action) ── */
.srl-es { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px 12px; }
.srl-es-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--txt2, #9aa7b4) 12%, transparent); color: var(--txt2, #9aa7b4); }
.srl-es-ic .srl-ic { width: 18px; height: 18px; }
.srl-es-t { font-weight: 700; font-size: 12.5px; color: var(--txt, #e6edf3); }
.srl-es-r { font-size: 11.5px; color: var(--txt2, #9aa7b4); max-width: 300px; line-height: 1.45; }
.srl-es-btn { margin-top: 3px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; max-width: 100%; white-space: normal;
  border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d); color: var(--txt, #e6edf3); font-weight: 600; font-size: 12px; cursor: pointer; }
.srl-es-btn:hover { border-color: var(--crimson, #e5484d); color: var(--crimson, #e5484d); }

/* chart-overlay inner stack (equity / validation empty states keep the chart) */
.srl-co-in { display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: auto; max-width: 92%;
  background: color-mix(in srgb, var(--bg2, #0d1117) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--txt2, #9aa7b4) 22%, var(--line, #2a323c));
  border-radius: var(--rad-md, 10px); padding: 10px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); backdrop-filter: blur(2px); }
.srl-co-in .srl-ic { width: 22px; height: 22px; color: var(--txt2, #9aa7b4); }
.srl-co-in .srl-na { border: 0; background: transparent; padding: 0; font-weight: 600; white-space: normal; text-align: center; }
.srl-vd-note .srl-na { white-space: normal; text-align: center; }

/* disabled workflow step — honest, not a dead control (states the exact reason) */
.srl-wf-step.dis { opacity: .5; cursor: not-allowed; }
.srl-wf-step.dis:hover { border-color: var(--line, #2a323c); }

/* compute cluster admin-only note */
.srl-cc-note { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11px; color: var(--txt2, #9aa7b4); }
.srl-cc-note .srl-ic { width: 13px; height: 13px; flex: none; }

/* notification row */
.srl-notif { font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--line, #2a323c); color: var(--txt, #e6edf3); }
.srl-notif:last-child { border-bottom: 0; }

/* honest reason toast */
.srl-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(8px); z-index: 60;
  background: var(--card, #161b22); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c); border-radius: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 28px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: min(90vw, 460px); text-align: center; }
.srl-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Section Settings view */
.srl-set-head { display: flex; align-items: center; gap: 14px; }
.srl-set-title { font-size: 18px; }
.srl-set-title .srl-ic { width: 18px; height: 18px; color: var(--crimson, #e5484d); }

/* Quick actions — six across on desktop */
.srl-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.srl-action { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: var(--rad-md, 9px);
  border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d); color: var(--txt, #e6edf3); cursor: pointer; font-weight: 600; font-size: 13px; }
.srl-action:hover { border-color: var(--crimson, #e5484d); }
.srl-action[disabled], .srl-action.dis { opacity: .5; cursor: not-allowed; }
.srl-action .srl-ic { width: 18px; height: 18px; color: var(--crimson, #e5484d); flex: none; }

/* Research workflow — six steps in one row on desktop */
.srl-workflow { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; }
.srl-wf-step { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px;
  border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 9px); background: var(--card2, #1c232d); cursor: pointer; }
.srl-wf-step:hover { border-color: var(--crimson, #e5484d); }
.srl-wf-num { width: 21px; height: 21px; border-radius: 50%; background: var(--bg2, #0e1116); border: 1px solid var(--line, #2a323c);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.srl-wf-t { font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srl-wf-s { color: var(--txt2, #9aa7b4); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srl-wf-arrow { color: var(--txt2, #9aa7b4); align-self: center; flex: none; font-size: 12px; }

/* Tables */
.srl-scroll { overflow-x: auto; }
.srl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.srl-table th, .srl-table td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line, #2a323c); white-space: nowrap; }
.srl-table th { color: var(--txt2, #9aa7b4); font-weight: 600; }
.srl-table td code { font-size: 11.5px; color: var(--txt2, #9aa7b4); }

/* status pill */
.srl-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line, #2a323c); color: var(--txt2, #9aa7b4); }
.srl-pill.ok { color: var(--up, #3fb950); border-color: color-mix(in srgb, var(--up, #3fb950) 45%, transparent); }
.srl-pill.run { color: var(--info, #4c8dff); }
.srl-pill.bad { color: var(--down, #f85149); }
.srl-pill.synth { color: var(--amber, #d29922); border-color: color-mix(in srgb, var(--amber, #d29922) 45%, transparent); }

/* 2 / 3 column layouts — Recent Runs wider than Top Strategies (reference) */
.srl-two { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
/* Reference proportions: Equity noticeably wider than Coverage / Validation.
   Cards are equal-height (stretch) like the reference; each card is a container
   so its INTERNAL layout (chart-left/stats-right vs stacked) follows the card's
   own width, never the viewport. Footers anchor to the bottom so shorter
   content never leaves a dead gap. */
.srl-three { display: grid; grid-template-columns: 1.35fr 0.93fr 1fr; gap: 14px; }
.srl-three > .srl-card { display: flex; flex-direction: column; container-type: inline-size; padding: 16px 18px; }
.srl-three .srl-cov-body { flex: 1; }
.srl-three .srl-cov-foot { margin-top: auto; padding-top: 10px; }

/* rail key/value */
.srl-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; font-size: 12.5px; }
.srl-kv .k { color: var(--txt2, #9aa7b4); } .srl-kv .v { font-weight: 700; text-align: end; }

/* coverage bars */
.srl-bar { height: 8px; border-radius: 4px; background: var(--line, #2a323c); overflow: hidden; }
.srl-bar > i { display: block; height: 100%; background: var(--crimson, #e5484d); }

/* ── Premium depth: fine surfaces + subtle luminous glow in dark mode ─────── */
.srl-card, .srl-kpi, .srl-strip { box-shadow: 0 1px 2px rgba(10, 14, 22, .04); }
[data-theme="dark"] .srl-card, [data-theme="dark"] .srl-kpi, [data-theme="dark"] .srl-strip { box-shadow: 0 2px 16px rgba(0, 0, 0, .34); }
.srl-kpi { transition: border-color .15s, box-shadow .15s; }
.srl-kpi:hover { border-color: color-mix(in srgb, var(--crimson, #e5484d) 42%, var(--line, #2a323c)); }
[data-theme="dark"] .srl-kpi:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--crimson, #e5484d) 22%, transparent), 0 6px 20px rgba(0, 0, 0, .4); }

/* ── Equity Curve Preview — reference anatomy: legend above the chart inside
   the chart column, chart fills, 126px stat rail of label-over-bold-value ── */
.srl-eq-legend { display: flex; gap: 18px; margin-bottom: 4px; font-size: 11.5px; font-weight: 500; color: var(--txt2, #9aa7b4); }
.srl-eq-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.srl-lg-line { width: 15px; height: 2px; display: inline-block; }
.srl-lg-line.is { background: var(--txt2, #9aa7b4); }
.srl-lg-line.oos { background: var(--crimson, #e5484d); }
.srl-eq-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.srl-eq-chart { width: 100%; min-width: 0; }
.srl-eq-plot { position: relative; height: 128px; }
.srl-eq-svg { width: 100%; height: 100%; display: block; }
.srl-eq-grid { stroke: color-mix(in srgb, var(--txt2, #9aa7b4) 16%, var(--line, #2a323c)); stroke-width: 1; }
.srl-eq-tick { fill: var(--muted, #7c8894); font-size: 13px; font-weight: 500; }
.srl-eq-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.srl-eq-line.is { stroke: var(--txt2, #9aa7b4); stroke-width: 1.5; opacity: .9; }
.srl-eq-line.oos { stroke: var(--crimson, #e5484d); stroke-width: 1.6; }
.srl-eq-dot { fill: var(--crimson, #e5484d); }
.srl-chart-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; padding: 6px; text-align: center; }
.srl-chart-overlay .srl-na { font-size: 12px; }
.srl-eq-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
/* reference metric stat: 11px label over a bold 15px value; honest state is
   plain muted text in the value slot — never a pill box */
.srl-ms .k { color: var(--txt2, #9aa7b4); font-size: 11px; font-weight: 500; letter-spacing: .1px; }
.srl-ms .v { margin-top: 3px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.srl-ms .v .pos { color: var(--up, #3fb950); }
.srl-ms .v .neg { color: var(--down, #f85149); }
.srl-ms .v .den { color: var(--muted, #7c8894); font-size: 11px; font-weight: 400; }
.srl-ms .v .na { color: var(--muted, #7c8894); font-size: 12px; font-weight: 600; }

/* ── Datasets Coverage — real donut + legend + honest footer ──────────────── */
.srl-mut { color: var(--txt2, #9aa7b4); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.srl-cov-body { display: flex; align-items: center; gap: 20px; }
.srl-cov-donut { flex: 0 0 128px; }
.srl-donut { width: 128px; height: 128px; display: block; }
.srl-donut-track { stroke: var(--line, #2a323c); }
.srl-donut-num { fill: var(--txt, #e6edf3); font-size: 19px; font-weight: 700; letter-spacing: -.5px; }
.srl-donut-lab { fill: var(--txt2, #9aa7b4); font-size: 7px; font-weight: 500; letter-spacing: .3px; }
.srl-cov-legend { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.srl-lg-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 500; }
.srl-lg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.srl-lg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt2, #cfd3d7); }
.srl-lg-count { color: var(--txt, #eaeaea); font-weight: 600; }
.srl-lg-pct { color: var(--muted, #7f868d); min-width: 46px; text-align: end; }
/* reference footer: single-line baseline "label value" pairs over a hairline */
.srl-cov-foot { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line, #2a323c); }
.srl-cov-foot > div { display: flex; align-items: baseline; gap: 8px; }
.srl-cov-foot .k { color: var(--txt2, #9aa7b4); font-size: 11px; font-weight: 500; }
.srl-cov-foot .v { font-weight: 600; font-size: 13px; }
.srl-cov-foot .v.okv { color: var(--up, #3fb950); } .srl-cov-foot .v.warnv { color: var(--amber, #d29922); }
.srl-cov-foot .v .fna { color: var(--muted, #7c8894); font-size: 11.5px; font-weight: 500; }
.srl-cov-note { margin-top: 8px; font-size: 11px; color: var(--amber, #d29922); }
.srl-cov-note.mut { color: var(--txt2, #9aa7b4); }

/* donut + legend palette (bound to tokens so both themes work) */
.srl-donut-seg.s0 { stroke: var(--info, #58a6ff); } .srl-lg-dot.s0 { background: var(--info, #58a6ff); }
.srl-donut-seg.s1 { stroke: var(--up, #3fb950); }   .srl-lg-dot.s1 { background: var(--up, #3fb950); }
.srl-donut-seg.s2 { stroke: var(--crimson, #e5484d); } .srl-lg-dot.s2 { background: var(--crimson, #e5484d); }
.srl-donut-seg.s3 { stroke: var(--amber, #d29922); } .srl-lg-dot.s3 { background: var(--amber, #d29922); }
.srl-donut-seg.s4 { stroke: #a371f7; } .srl-lg-dot.s4 { background: #a371f7; }
.srl-donut-seg.s5 { stroke: var(--muted, #7c8894); } .srl-lg-dot.s5 { background: var(--muted, #7c8894); }

/* ── Validation & Evidence — real radar + honest stats ────────────────────── */
.srl-vd-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex: 1; }
/* labels live INSIDE the radar viewBox (-20 -4 260 214) — they scale with the
   svg and can never clip a card edge at any width */
.srl-vd-chart { position: relative; width: 172px; max-width: 100%; margin-inline: auto; }
.srl-radar { width: 100%; height: auto; display: block; }
.srl-radar-grid { fill: none; stroke: color-mix(in srgb, var(--txt2, #9aa7b4) 26%, var(--line, #2a323c)); stroke-width: 1; }
.srl-radar-fill { fill: color-mix(in srgb, var(--crimson, #e5484d) 16%, transparent); stroke: var(--crimson, #e5484d); stroke-width: 1.6; stroke-linejoin: round; }
.srl-radar-dot { fill: var(--crimson, #e5484d); }
.srl-radar-lab { fill: var(--txt2, #9aa7b4); font-size: 8.5px; font-weight: 500; }
.srl-vs-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; align-content: center; }
/* honest reason + real action UNDER the radar — never covering the web */
.srl-vd-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 9px auto 0; flex-wrap: wrap;
  width: fit-content; max-width: 100%; padding: 6px 12px; border-radius: var(--rad-md, 10px);
  background: color-mix(in srgb, var(--bg2, #0d1117) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--txt2, #9aa7b4) 22%, var(--line, #2a323c)); }
.srl-vd-note .srl-na { border: 0; background: transparent; padding: 0; }
.srl-vd-note .srl-es-btn { margin-top: 0; padding: 4px 11px; font-size: 11px; }

/* ── Compute Cluster — utilization ring + honest rows ─────────────────────── */
.srl-cc-body { display: flex; align-items: center; gap: 12px; }
.srl-cc-ring { flex: 0 0 92px; }
.srl-ring { width: 92px; height: 92px; display: block; }
.srl-ring-track { stroke: var(--line, #2a323c); }
.srl-ring-prog { stroke: var(--crimson, #e5484d); }
.srl-ring-num { fill: var(--txt, #e6edf3); font-size: 18px; font-weight: 800; }
.srl-ring-lab { fill: var(--txt2, #9aa7b4); font-size: 7.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.srl-cc-rows { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.srl-cc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.srl-cc-row .k { color: var(--txt2, #9aa7b4); } .srl-cc-row .v { font-weight: 700; }

/* Top Strategies ranking table */
.srl-ts-table th, .srl-ts-table td { padding: 7px 8px; }
.srl-ts-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.srl-ts-name .srl-ic { width: 15px; height: 15px; color: var(--crimson, #e5484d); flex: none; }
.srl-ts-name span { overflow: hidden; text-overflow: ellipsis; }

/* compact honest pills inside dense chart panels */
.srl-eq-stat .srl-na, .srl-vs-stat .srl-na, .srl-cc-row .srl-na, .srl-cov-foot .srl-na { font-size: 10.5px; padding: 1px 8px; font-weight: 600; }

/* Ultra-narrow safety: chart SVGs scale to their container and stats collapse to
   a single column, so the analytics cards never spill even in a very narrow
   container (e.g. before the global sidebar has collapsed on a small viewport). */
.srl-donut, .srl-radar, .srl-ring { max-width: 100%; height: auto; }
.srl-cov-donut, .srl-vd-chart, .srl-cc-ring { max-width: 100%; }
@media (max-width: 560px) {
  .srl-eq-stats, .srl-vs-stats { grid-template-columns: 1fr; }
  .srl-cov-body { flex-wrap: wrap; row-gap: 10px; }
  .srl-cov-donut { margin-inline: auto; }
}

/* ── Reference arrangement, container-driven ──────────────────────────────
   When the CARD itself is wide enough: equity chart LEFT + stat rail RIGHT,
   validation radar LEFT + stats RIGHT (the approved reference). When the card
   is narrow (rail beside it at mid widths, tiny phones) they stack instead —
   the chart never collapses to a sliver. Depends on card width, not viewport. */
@container (min-width: 290px) {
  .srl-eq-body { flex-direction: row; align-items: stretch; gap: 20px; }
  /* the chart column stretches with the card, so the grid always fills the
     available height (reference look) instead of floating as a small box */
  .srl-eq-chart { flex: 1 1 auto; width: auto; display: flex; flex-direction: column; }
  .srl-eq-plot { flex: 1 1 auto; height: auto; min-height: 150px; }
  .srl-eq-stats { flex: 0 0 126px; width: 126px; display: flex; flex-direction: column; gap: 11px; justify-content: center; }
}
@container (min-width: 205px) {
  .srl-vd-body { flex-direction: row; justify-content: center; gap: 16px; }
  .srl-vd-chart { width: 128px; margin-inline: 0; }
  .srl-vs-stats { flex: 1 1 auto; width: auto; min-width: 0; grid-template-columns: 1fr; gap: 13px; }
}
/* wide validation card → the reference's full 172px radar beside the stats */
@container (min-width: 330px) {
  .srl-vd-chart { width: 172px; }
}

/* ── Create-Test wizard ─────────────────────────────────────────────────── */
.srl-stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.srl-step { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--rad-md, 9px);
  border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d); color: var(--txt2, #9aa7b4); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.srl-step.on { border-color: var(--crimson, #e5484d); color: var(--txt, #e6edf3); }
.srl-step.done { color: var(--up, #3fb950); }
.srl-step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--bg2, #0e1116); border: 1px solid var(--line, #2a323c);
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.srl-step.on .n { background: var(--crimson, #e5484d); color: #fff; border-color: var(--crimson, #e5484d); }

.srl-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.srl-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.srl-field > label { color: var(--txt2, #9aa7b4); font-size: 12px; }
.srl-field .hint { color: var(--txt2, #9aa7b4); font-size: 11px; }
.srl-input, .srl-select { background: var(--card2, #1c232d); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c);
  border-radius: var(--rad-sm, 7px); padding: 8px 10px; font-size: 13px; font-family: inherit; width: 100%; box-sizing: border-box; }
.srl-input:focus, .srl-select:focus { outline: 2px solid var(--crimson, #e5484d); outline-offset: 0; border-color: var(--crimson, #e5484d); }
.srl-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.srl-check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--crimson, #e5484d); }

.srl-ds-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.srl-ds { border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 9px); padding: 12px; cursor: pointer; background: var(--card2, #1c232d); }
.srl-ds.sel { border-color: var(--crimson, #e5484d); box-shadow: 0 0 0 1px var(--crimson, #e5484d) inset; }
.srl-ds .n { font-weight: 700; font-size: 13px; }

.srl-footer { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.srl-footer .spacer { flex: 1; }

.srl-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--line, #2a323c); }
.srl-sev { font-weight: 700; padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.srl-sev.PASS { color: var(--up, #3fb950); } .srl-sev.WARNING { color: var(--amber, #d29922); } .srl-sev.FAIL { color: var(--down, #f85149); }

.srl-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.srl-result-grid .m { border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 9px); padding: 12px; }
.srl-result-grid .m .k { color: var(--txt2, #9aa7b4); font-size: 11.5px; }
.srl-result-grid .m .v { font-size: 20px; font-weight: 800; margin-top: 4px; }
.srl-result-grid .m .v.pos { color: var(--up, #3fb950); } .srl-result-grid .m .v.neg { color: var(--down, #f85149); }
.srl-prog { height: 10px; border-radius: 5px; background: var(--line, #2a323c); overflow: hidden; }
.srl-prog > i { display: block; height: 100%; background: var(--crimson, #e5484d); transition: width .25s; }
.srl-review-kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 12.5px; }
.srl-review-kv .k { color: var(--txt2, #9aa7b4); }

@media (max-width: 560px) { .srl-review-kv { grid-template-columns: 1fr; } .srl-review-kv .k { margin-top: 6px; } }

/* ── Runs Console + Results workspace (Phase C) ─────────────────────────── */
.srl-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.srl-filter { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d);
  color: var(--txt2, #9aa7b4); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.srl-filter.on { border-color: var(--crimson, #e5484d); color: var(--txt, #e6edf3); }
.srl-mini { padding: 3px 8px; font-size: 11px; }

.srl-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line, #2a323c); margin-bottom: 12px; }
.srl-rtab { padding: 8px 12px; border: none; background: none; color: var(--txt2, #9aa7b4); font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.srl-rtab.on { color: var(--txt, #e6edf3); border-bottom-color: var(--crimson, #e5484d); }

.srl-hash { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.srl-copy { border: 1px solid var(--line, #2a323c); background: var(--card2, #1c232d); color: var(--txt2, #9aa7b4);
  border-radius: 6px; padding: 2px 5px; cursor: pointer; margin-inline-start: 6px; vertical-align: middle; }
.srl-copy svg { width: 12px; height: 12px; display: block; }
.srl-copy.done { color: var(--up, #3fb950); border-color: var(--up, #3fb950); }
code, .srl-hash, .srl-table td code { direction: ltr; unicode-bidi: isolate; }

.srl-svg { width: 100%; height: 200px; display: block; }
.srl-svg .line { fill: none; stroke: var(--crimson, #e5484d); stroke-width: 1.6; }
.srl-svg .line.eq { stroke: var(--up, #3fb950); }
.srl-svg .area { fill: color-mix(in srgb, var(--crimson, #e5484d) 16%, transparent); stroke: none; }
.srl-svg .axis { stroke: var(--line, #2a323c); stroke-width: 1; }

.srl-tree { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; }
.srl-tree .pass { color: var(--up, #3fb950); } .srl-tree .fail { color: var(--down, #f85149); }

.srl-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 12px; color: var(--txt2, #9aa7b4); }

/* ── Responsive (target: 1440 desktop → down to 360, up to 4K) ───────────── */
/* Ultra-wide (1920 / 3840): keep the institutional layout centred, not stretched. */
@media (min-width: 1720px) { .srl { max-width: 1660px; margin-inline: auto; width: 100%; } }

/* Laptop / tablet-landscape: rail drops under the main column. */
@media (max-width: 1180px) {
  .srl-body { grid-template-columns: 1fr; }
  .srl-rail { flex-direction: row; flex-wrap: wrap; }
  .srl-rail > .srl-card { flex: 1 1 260px; }
}
/* 1024: six KPIs get tight → three across. */
@media (max-width: 1024px) {
  .srl-kpis { grid-template-columns: repeat(3, 1fr); }
  .srl-actions { grid-template-columns: repeat(3, 1fr); }
}
/* Mid band (rail beside the main column, or narrow laptop): three-across would
   crush the analytics cards (<200px each) — go 2-up instead: equity full-width,
   coverage + validation side by side. Cards stay wide → reference row layouts. */
@media (max-width: 1719px) and (min-width: 901px) {
  .srl-three { grid-template-columns: 1fr 1fr; }
  .srl-three > .srl-card:first-child { grid-column: 1 / -1; }
}
/* 900 (768 tablet): stack the two/three column rows; strip becomes a gapped grid. */
@media (max-width: 900px) {
  .srl-three, .srl-two { grid-template-columns: 1fr; }
  .srl-workflow { gap: 6px; }
  .srl-strip { grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line, #2a323c); }
  .srl-strip-item { border: 0; background: var(--card, #161b22); }
}
/* 640 (430/390 large phone): two-up cards, full-width header actions. */
@media (max-width: 640px) {
  .srl-title { font-size: 20px; }
  .srl-head { align-items: center; }
  .srl-head-actions { width: 100%; }
  .srl-btn { flex: 1 1 auto; justify-content: center; }
  .srl-kpis { grid-template-columns: repeat(2, 1fr); }
  .srl-actions { grid-template-columns: repeat(2, 1fr); }
  .srl-strip { grid-template-columns: repeat(2, 1fr); }
  .srl-wf-arrow { display: none; }
  .srl-wf-step { flex: 1 1 100%; }
  .srl-rail > .srl-card { flex: 1 1 100%; }
  /* chart panels stack/unstack via container queries (card width), not viewport */
}
/* 400 (360 small phone): keep KPIs two-up (readable), strip single column. */
@media (max-width: 400px) {
  .srl-title { font-size: 18px; }
  .srl-kpi .v { font-size: 21px; }
  .srl-strip { grid-template-columns: 1fr; }
}

/* ─── Universal Strategy Builder (Phase D / D2) ──────────────────────────── */
.srl-builder { position: relative; }
.srl-b-grid { display: grid; grid-template-columns: 240px 1fr 380px; gap: 12px; align-items: start; }
.srl-b-left, .srl-b-right { position: sticky; top: 8px; }
.srl-b-palette .srl-b-pallist { max-height: 62vh; overflow: auto; }
.srl-b-palcat-h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt2, #9aa7b4); margin: 10px 0 4px; }
.srl-b-node { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--line, #2a323c); border-radius: var(--rad-sm, 8px);
  background: var(--card2, #161b22); margin-bottom: 5px; font-size: 12px; }
.srl-b-node .nt { font-family: var(--font-mono, monospace); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.srl-b-node.off { opacity: .55; }

/* live graph */
.srl-b-graph { display: block; min-width: 640px; }
.srl-b-edge { fill: none; stroke: var(--line, #39424e); stroke-width: 1.6; opacity: .8; }
.srl-b-gnode rect { fill: var(--card2, #161b22); stroke: var(--line, #2a323c); stroke-width: 1.3; }
.srl-b-gnode text { fill: var(--txt, #e6edf3); font-size: 11.5px; font-family: var(--font-mono, monospace); }
.srl-b-gnode.ind rect { stroke: var(--info, #58a6ff); }
.srl-b-gnode.cond rect { stroke: var(--amber, #d29922); }
.srl-b-gnode.buy rect { stroke: var(--up, #3fb950); }
.srl-b-gnode.sell rect { stroke: var(--down, #f85149); }
.srl-b-gnode.off rect { stroke-dasharray: 4 3; opacity: .6; }

/* definition editor */
.srl-b-def { max-height: 74vh; overflow: auto; }
.srl-b-lbl { display: block; font-size: 11.5px; color: var(--txt2, #9aa7b4); margin: 4px 0 3px; }
.srl-b-in { width: 100%; box-sizing: border-box; background: var(--bg2, #0d1117); color: var(--txt, #e6edf3);
  border: 1px solid var(--line, #2a323c); border-radius: 7px; padding: 6px 8px; font-size: 12.5px; }
.srl-b-in.id { max-width: 96px; font-family: var(--font-mono, monospace); }
.srl-b-in.num { max-width: 74px; }
.srl-b-sel { background: var(--bg2, #0d1117); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c);
  border-radius: 7px; padding: 5px 6px; font-size: 12.5px; max-width: 130px; }
.srl-b-sec { border-top: 1px solid var(--line, #2a323c); margin-top: 10px; padding-top: 8px; }
.srl-b-sec-h { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.srl-b-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.srl-b-cond { border: 1px solid var(--line, #2a323c); border-radius: 8px; padding: 7px; margin-bottom: 7px; background: var(--card2, #161b22); }
.srl-b-when { font-size: 11.5px; color: var(--txt2, #9aa7b4); }
.srl-b-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; margin-right: 12px; }
.srl-b-mini { display: inline-flex; align-items: center; gap: 4px; background: var(--card2, #161b22); color: var(--txt, #e6edf3);
  border: 1px solid var(--line, #2a323c); border-radius: 7px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.srl-b-mini:hover { border-color: var(--txt2, #9aa7b4); }
.srl-b-mini.danger:hover { border-color: var(--down, #f85149); color: var(--down, #f85149); }
.srl-b-mini .srl-ic { width: 14px; height: 14px; }

/* validation panel */
.srl-b-valid { margin-top: 12px; }
.srl-b-valid-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.srl-b-valid.ok .srl-b-valid-h { color: var(--up, #3fb950); }
.srl-b-valid.warn .srl-b-valid-h { color: var(--amber, #d29922); }
.srl-b-valid.bad .srl-b-valid-h { color: var(--down, #f85149); }
.srl-b-issue { font-size: 12px; padding: 5px 8px; border-radius: 7px; margin-top: 6px; background: var(--card2, #161b22); border: 1px solid var(--line, #2a323c); }
.srl-b-issue.err { border-left: 3px solid var(--down, #f85149); }
.srl-b-issue.warn { border-left: 3px solid var(--amber, #d29922); }
.srl-b-issue code { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--txt2, #9aa7b4); margin-right: 6px; }
.srl-b-actions { display: flex; gap: 8px; margin: 10px 0 6px; }
.srl-b-flash { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--card, #1c2128); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c);
  border-radius: 10px; padding: 10px 16px; font-size: 13px; opacity: 0; transition: opacity .25s; box-shadow: 0 6px 24px rgba(0,0,0,.4); }

@media (max-width: 1180px) { .srl-b-grid { grid-template-columns: 1fr; } .srl-b-left, .srl-b-right { position: static; } }

/* Strategy Script view (Phase D / D7) */
.srl-b-script { width: 100%; box-sizing: border-box; min-height: 340px; resize: vertical;
  background: var(--bg2, #0d1117); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c);
  border-radius: 8px; padding: 10px 12px; font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12.5px; line-height: 1.55; white-space: pre; tab-size: 2; direction: ltr; text-align: left; }

/* Natural-language conversion (Phase D / D8) */
.srl-b-nl-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.srl-b-nl-block { margin-top: 10px; }
.srl-b-nl-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt2, #9aa7b4); margin-bottom: 4px; }
.srl-b-nl-item { font-size: 12.5px; padding: 5px 8px; border-radius: 7px; margin-bottom: 5px; background: var(--card2, #161b22); border: 1px solid var(--line, #2a323c); }
.srl-b-nl-item.warn { border-left: 3px solid var(--amber, #d29922); }
.srl-b-nl-item.bad { border-left: 3px solid var(--down, #f85149); }

/* ─── Interactive strategy canvas (Phase D / D11) ────────────────────────── */
.srl-c-card { }
.srl-c-toolbar { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.srl-c-tb { min-width: 30px; height: 28px; padding: 0 8px; background: var(--card2, #161b22); color: var(--txt, #e6edf3);
  border: 1px solid var(--line, #2a323c); border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; }
.srl-c-tb:hover { border-color: var(--txt2, #9aa7b4); }
.srl-c-tb[disabled] { opacity: .4; cursor: default; }
.srl-c-tb.danger:hover { border-color: var(--down, #f85149); color: var(--down, #f85149); }
.srl-c-tb .srl-ic { width: 15px; height: 15px; vertical-align: -2px; }
.srl-c-hint { margin-inline-start: auto; }
.srl-c-wrap { position: relative; border: 1px solid var(--line, #2a323c); border-radius: 10px; overflow: hidden; background: var(--bg2, #0d1117);
  background-image: radial-gradient(var(--line, #222b36) 1px, transparent 1px); background-size: 22px 22px; }
.srl-c-svg { display: block; width: 100%; height: 460px; touch-action: none; cursor: default; }
.srl-cnode rect { fill: var(--card2, #161b22); stroke: var(--line, #2a323c); stroke-width: 1.4; cursor: grab; }
.srl-cnode text { fill: var(--txt, #e6edf3); font-size: 11.5px; font-family: var(--font-mono, ui-monospace, monospace); pointer-events: none; }
.srl-cnode.ind rect { stroke: var(--info, #58a6ff); }
.srl-cnode.cond rect { stroke: var(--amber, #d29922); }
.srl-cnode.pat rect { stroke: #a371f7; }
.srl-cnode.buy rect { stroke: var(--up, #3fb950); }
.srl-cnode.sell rect { stroke: var(--down, #f85149); }
.srl-cnode.off rect { stroke-dasharray: 4 3; opacity: .6; }
.srl-cnode.sel rect { stroke: var(--crimson, #e23b3b); stroke-width: 2.4; filter: drop-shadow(0 0 5px rgba(226,59,59,.5)); }
.srl-c-port { fill: var(--bg2, #0d1117); stroke: var(--txt2, #9aa7b4); stroke-width: 1.4; cursor: crosshair; }
.srl-c-port:hover { fill: var(--info, #58a6ff); stroke: var(--info, #58a6ff); r: 6; }
.srl-c-port.active { fill: var(--crimson, #e23b3b); stroke: var(--crimson, #e23b3b); }
.srl-c-band { fill: color-mix(in srgb, var(--info, #58a6ff) 14%, transparent); stroke: var(--info, #58a6ff); stroke-width: 1; stroke-dasharray: 4 3; }
.srl-c-minimap { position: absolute; right: 8px; bottom: 8px; width: 150px; height: 96px; background: color-mix(in srgb, var(--bg2, #0d1117) 82%, transparent);
  border: 1px solid var(--line, #2a323c); border-radius: 7px; }
.srl-mm-node { fill: var(--txt2, #9aa7b4); opacity: .8; }
@media (max-width: 560px) { .srl-c-svg { height: 320px; } .srl-c-hint { display: none; } }

/* ─── Historical Data Library (customer sub-view) — NEW SECTION ────────────
   All classes are prefixed srl-dl- and bound to VOLURR design tokens only, so
   both themes + RTL/LTR follow automatically (logical properties throughout).
   Dense institutional layout: 11-13px text, 1px hairlines, honest na pills. */
.srl-dl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.srl-dl-title { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; letter-spacing: -.2px; flex: 1; min-width: 200px; color: var(--txt, #e6edf3); }
.srl-dl-title .srl-ic { width: 19px; height: 19px; color: var(--crimson, #e5484d); flex: none; }
.srl-dl-actions { display: flex; gap: 8px; align-items: center; }
/* honest boundary note — the requested project range is a limit, not coverage */
.srl-dl-note { font-size: 11.5px; color: var(--txt2, #9aa7b4); line-height: 1.5; }
.srl-dl-note.top { margin-top: -8px; }
.srl-dl-list { display: flex; flex-direction: column; gap: 14px; }
.srl-dl-card { display: flex; flex-direction: column; gap: 11px; }
.srl-dl-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line, #2a323c); padding-bottom: 9px; }
.srl-dl-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.srl-dl-name .srl-ic { width: 15px; height: 15px; color: var(--crimson, #e5484d); flex: none; }
.srl-dl-name .n { font-weight: 700; font-size: 13.5px; color: var(--txt, #e6edf3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srl-dl-name .id { color: var(--muted, #7c8894); font-size: 11px; }
.srl-dl-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* dense field grid: 11px label over a 12.5px value; honest na pill fits inline */
.srl-dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px 16px; }
.srl-dl-f { min-width: 0; }
.srl-dl-f .k { color: var(--txt2, #9aa7b4); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.srl-dl-f .v { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--txt, #e6edf3); overflow-wrap: anywhere; }
.srl-dl-f .v .srl-na { font-size: 11px; padding: 1px 8px; font-weight: 600; }
.srl-dl-f .v .srl-hash { font-size: 11.5px; }
/* missing-interval expander: real count in amber; expands to the engine's list */
.srl-dl-miss { display: inline-block; }
.srl-dl-miss summary { cursor: pointer; color: var(--amber, #d29922); font-weight: 700; }
.srl-dl-misslist { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; max-height: 130px; overflow: auto;
  padding: 6px 8px; border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 8px); background: var(--bg2, #0d1117); }
/* honest certification blocker text (e.g. synthetic-only) */
.srl-dl-block { color: var(--amber, #d29922); font-size: 11.5px; font-weight: 600; }
@media (max-width: 560px) { .srl-dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .srl-dl-grid { grid-template-columns: 1fr; } }

/* ─── AI Strategy Architect (spec AI-18) — NEW SECTION ─────────────────────
   All classes are prefixed srl-ai- and bound to VOLURR design tokens (with
   fallbacks) only, so both themes + RTL/LTR follow automatically (logical
   properties throughout). Dense institutional layout: 12-13px text, 1px
   hairlines, honest srl-na pills. Reuses srl-card / srl-btn / srl-pill /
   srl-tabs / srl-review-kv / srl-hash / srl-scroll from the section base. */

/* own visible header (the shared .srl-head is hidden inside this section) */
.srl-ai-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srl-ai-titlewrap { flex: 1; min-width: 200px; }
.srl-ai-title { font-size: 18px; font-weight: 800; letter-spacing: -.2px; color: var(--txt, #e6edf3); }
.srl-ai-prov { margin-top: 3px; font-size: 11.5px; color: var(--txt2, #9aa7b4); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.srl-ai-provnote { color: var(--txt2, #9aa7b4); font-size: 11px; }

/* responsive 3-column workspace: left 280px | center flex | right 300px */
.srl-ai-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.srl-ai-grid > * { min-width: 0; }
.srl-ai-left, .srl-ai-center, .srl-ai-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1100px) { .srl-ai-grid { grid-template-columns: 1fr; } }

/* idea textarea — natural direction (users type EN/AR/KU), NOT mono/LTR */
.srl-ai-ta { width: 100%; box-sizing: border-box; min-height: 130px; resize: vertical;
  background: var(--bg2, #0d1117); color: var(--txt, #e6edf3); border: 1px solid var(--line, #2a323c);
  border-radius: 8px; padding: 9px 10px; font-size: 12.5px; font-family: inherit; line-height: 1.55; }
.srl-ai-ta:focus { outline: 2px solid var(--crimson, #e5484d); outline-offset: 0; border-color: var(--crimson, #e5484d); }

/* idea-starter chips (label = clipped starter; full sentence in the tooltip) */
.srl-ai-tpls { display: flex; flex-wrap: wrap; gap: 6px; }
.srl-ai-tpl { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line, #2a323c);
  background: var(--card2, #1c232d); color: var(--txt2, #9aa7b4); font-size: 11.5px; font-weight: 600;
  cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srl-ai-tpl:hover { border-color: var(--crimson, #e5484d); color: var(--txt, #e6edf3); }

/* saved ideas list */
.srl-ai-ideas { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.srl-ai-idea { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line, #2a323c);
  border-radius: 8px; cursor: pointer; font-size: 12px; background: var(--card2, #1c232d); }
.srl-ai-idea:hover { border-color: var(--txt2, #9aa7b4); }
.srl-ai-idea.on { border-color: var(--crimson, #e5484d); }
.srl-ai-idea .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* interpreted rules + market/timeframe/direction chips (absent → honest na) */
.srl-ai-hpills { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.srl-ai-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.srl-ai-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; }
.srl-ai-chip .k { color: var(--txt2, #9aa7b4); font-family: var(--font-mono, ui-monospace, monospace); font-size: 10.5px; }
.srl-ai-chip .srl-na { font-size: 11px; padding: 1px 8px; }
.srl-ai-rule { font-size: 12.5px; padding: 6px 9px; border: 1px solid var(--line, #2a323c); border-radius: 7px;
  background: var(--card2, #1c232d); margin-bottom: 5px; line-height: 1.45; }

/* missing-information questions */
.srl-ai-qrow { margin-bottom: 8px; }
.srl-ai-qrow label { display: block; font-size: 12px; color: var(--txt2, #9aa7b4); margin-bottom: 4px; line-height: 1.4; }

/* compact strategy graph (indicators → conditions/patterns → entry/exit) */
.srl-ai-graphwrap { overflow-x: auto; direction: ltr; }
.srl-ai-graph { display: block; min-width: 480px; width: 100%; height: auto; max-height: 320px; }
.srl-ai-edge { fill: none; stroke: var(--line, #39424e); stroke-width: 1.4; opacity: .85; }
.srl-ai-node rect { fill: var(--card2, #161b22); stroke: var(--line, #2a323c); stroke-width: 1.3; }
.srl-ai-node text { fill: var(--txt, #e6edf3); font-size: 10.5px; font-family: var(--font-mono, ui-monospace, monospace); }
.srl-ai-node.ind rect { stroke: var(--info, #58a6ff); }
.srl-ai-node.cond rect { stroke: var(--amber, #d29922); }
.srl-ai-node.pat rect { stroke: #a371f7; }
.srl-ai-node.rule rect { stroke: var(--up, #3fb950); }

/* assumptions / data-requirement rows — state pill + text, prominent when red */
.srl-ai-arow { display: flex; align-items: flex-start; gap: 7px; padding: 6px 0;
  border-bottom: 1px solid var(--line, #2a323c); font-size: 12px; line-height: 1.45; }
.srl-ai-arow:last-child { border-bottom: 0; }
.srl-ai-arow .srl-pill { flex: none; margin-top: 1px; }
.srl-ai-arow .x { min-width: 0; overflow-wrap: anywhere; }
.srl-ai-det { display: block; color: var(--txt2, #9aa7b4); font-size: 11px; margin-top: 2px; }

/* readiness banner — computed ONLY from the last backend validate response */
.srl-ai-ready { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; padding: 8px 11px;
  border-radius: 9px; border: 1px solid var(--line, #2a323c); font-size: 12.5px; font-weight: 700; }
.srl-ai-ready.ok { color: var(--up, #3fb950); border-color: color-mix(in srgb, var(--up, #3fb950) 45%, transparent);
  background: color-mix(in srgb, var(--up, #3fb950) 8%, transparent); }
.srl-ai-ready.bad { color: var(--down, #f85149); border-color: color-mix(in srgb, var(--down, #f85149) 45%, transparent);
  background: color-mix(in srgb, var(--down, #f85149) 7%, transparent); }
.srl-ai-ready .bl { font-weight: 500; font-size: 11.5px; color: var(--txt, #e6edf3); overflow-wrap: anywhere; }
.srl-ai-ready .srl-na { font-size: 11px; }

/* error banner — real backend error code + detail + items; 429 is a calm note */
.srl-ai-err { border: 1px solid color-mix(in srgb, var(--down, #f85149) 50%, transparent);
  background: color-mix(in srgb, var(--down, #f85149) 7%, transparent); color: var(--txt, #e6edf3);
  border-radius: 9px; padding: 8px 11px; font-size: 12px; line-height: 1.5; }
.srl-ai-err code { color: var(--down, #f85149); font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px; margin-inline-end: 7px; direction: ltr; unicode-bidi: isolate; }
.srl-ai-err.warn { border-color: color-mix(in srgb, var(--amber, #d29922) 50%, transparent);
  background: color-mix(in srgb, var(--amber, #d29922) 8%, transparent); }
.srl-ai-err.warn code { color: var(--amber, #d29922); }
.srl-ai-err .bl { font-size: 11.5px; margin-top: 3px; overflow-wrap: anywhere; }

/* bottom panel: pretty-printed IR / script (LTR, scrollable) + action bar */
.srl-ai-pre { max-height: 320px; overflow: auto; background: var(--bg2, #0d1117); color: var(--txt, #e6edf3);
  border: 1px solid var(--line, #2a323c); border-radius: 8px; padding: 10px 12px; margin: 0;
  font-size: 11.5px; line-height: 1.5; white-space: pre; text-align: left; display: block; width: auto; }
.srl-ai-ver { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.srl-ai-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line, #2a323c); margin-top: 12px; padding-top: 11px; }
.srl-ai-actions .srl-b-sel { max-width: 190px; }
.srl-ai-ack { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt, #e6edf3); }
.srl-ai-ack input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--crimson, #e5484d); flex: none; }
.srl-ai-ack.drop { color: var(--down, #f85149); font-weight: 600; }

/* per-action loading spinner (buttons are disabled while a request is pending) */
.srl-ai-spin { width: 12px; height: 12px; flex: none; display: inline-block; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor;
  animation: srlAiSpin .7s linear infinite; vertical-align: -2px; margin-inline-end: 2px; }
@keyframes srlAiSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .srl-ai-actions { align-items: stretch; flex-direction: column; }
  .srl-ai-actions .srl-b-sel { max-width: none; }
  .srl-ai-graph { min-width: 420px; }
}

/* ─── SRL U2-U4: builder bar · palette taxonomy · tabbed right panel ───────
   Additive only. VOLURR tokens, logical properties (RTL-safe), 12-13px. */

/* U2 top builder bar — the ONE visible command row of the builder view (the
   legacy .srl-head row stays hidden inside this section by design). */
.srl-bb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 6;
  background: var(--card, #161b22); border: 1px solid var(--line, #2a323c); border-radius: var(--rad-md, 10px); padding: 8px 10px; }
.srl-bb .srl-btn { padding: 6px 11px; font-size: 12px; }
.srl-bb-name { flex: 0 1 210px; min-width: 110px; font-weight: 600; }
.srl-bb .srl-pill { flex: none; }
.srl-bb .srl-pill .srl-hash { font-size: 10.5px; }
.srl-bb-src { color: var(--txt2, #9aa7b4); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srl-bb-spacer { flex: 1 1 auto; }
.srl-bb .srl-dot { flex: none; }
.srl-bb .srl-dot.warn { box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber, #d29922) 22%, transparent); }
.srl-bb-sec { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.srl-bb-sec .srl-b-sel { max-width: 150px; }
.srl-bb-more { display: none; position: relative; }
.srl-bb-menu { display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px;
  background: var(--card, #161b22); border: 1px solid var(--line, #2a323c); border-radius: 10px; padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38); flex-direction: column; gap: 6px; }
.srl-bb-more.open .srl-bb-menu { display: flex; }
.srl-bb-menu .srl-btn { width: 100%; justify-content: flex-start; }
.srl-bb-menu .srl-b-sel { width: 100%; max-width: none; }
@media (max-width: 1100px) { .srl-bb-sec { display: none; } .srl-bb-more { display: inline-flex; } }
@media (max-width: 640px) { .srl-bb-name { flex: 1 1 140px; } }

/* U3 palette: search + runnable-only + honest empty categories + (i) docs */
.srl-b-palq { margin-bottom: 6px; }
.srl-b-palrun { display: flex; margin: 0 0 6px; color: var(--txt2, #9aa7b4); }
.srl-b-palcat-h { display: flex; align-items: baseline; gap: 6px; }
.srl-b-palcat-h .c { color: var(--muted, #7c8894); font-weight: 600; }
.srl-b-palempty { font-size: 11px; color: var(--muted, #7c8894); line-height: 1.4; margin: 0 0 6px; padding: 5px 8px;
  border: 1px dashed var(--line, #2a323c); border-radius: 7px; }
.srl-b-info { flex: none; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line, #2a323c);
  color: var(--txt2, #9aa7b4); font-size: 10px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  cursor: help; font-family: var(--font-mono, ui-monospace, monospace); }
.srl-b-info:hover { border-color: var(--info, #58a6ff); color: var(--info, #58a6ff); }
.srl-b-node .nt { flex: 1 1 auto; min-width: 0; }

/* U4 right panel tabs (reuses .srl-rtab) — only the ACTIVE tab is in the DOM */
.srl-b-tabs { margin: -2px 0 10px; flex-wrap: wrap; }
.srl-b-tabs .srl-rtab { padding: 6px 8px; font-size: 12px; }
.srl-b-def .srl-b-valid { margin-top: 0; }
.srl-b-ir { max-height: 46vh; }

/* canvas: snap pressed state · section comments (layout-only, never in the IR) */
.srl-c-tb.on { border-color: var(--crimson, #e5484d); color: var(--crimson, #e5484d); }
.srl-c-cmtin { max-width: 170px; }
.srl-cnode.cmt rect { stroke: var(--amber, #d29922); stroke-dasharray: 5 4; fill: color-mix(in srgb, var(--amber, #d29922) 7%, transparent); }
.srl-cnode.cmt text { fill: var(--amber, #d29922); font-family: inherit; }

/* ── Parameter Optimization (O2) — one axis row, range inputs, progress, best ── */
.srl-optaxis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line, #2a323c); }
.srl-optaxis:last-child { border-bottom: 0; }
.srl-optaxis > .srl-input, .srl-optaxis > .srl-select { width: auto; min-width: 130px; }
.srl-optrange { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.srl-optrange label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--txt2, #9aa7b4); }
.srl-input.srl-num { width: 74px; min-width: 74px; }
.srl-progressbar { height: 6px; border-radius: 999px; background: var(--card2, #1c232d);
  border: 1px solid var(--line, #2a323c); overflow: hidden; }
.srl-progressfill { height: 100%; background: var(--crimson, #e5484d); transition: width .3s ease; }
.srl-table tr.srl-best > td { background: color-mix(in srgb, var(--up, #3fb950) 12%, transparent); }

/* ── U-deep bottom docked workspace drawer (validation/data-req/script/AI) ──── */
/* A fixed drawer pinned to the builder's bottom edge. It respects the app
   sidebar (208/62/0px) so it never underlaps the nav, docks (pushes content up)
   when open on desktop, and overlays on mobile. Tokens only, RTL via logical
   properties, dark/light aware. */
.srl-builder { padding-bottom: 46px; }               /* clearance for the collapsed bar */
.srl-builder.dock-open { padding-bottom: 344px; }     /* desktop: OPEN drawer docks */
.srl-dock { position: fixed; bottom: 0; inset-inline-start: 208px; inset-inline-end: 0; z-index: 40;
  background: var(--card, #161b22); border-top: 1px solid var(--line, #2a323c);
  box-shadow: 0 -2px 14px rgba(10, 14, 22, .10); display: flex; flex-direction: column; }
[data-theme="dark"] .srl-dock { box-shadow: 0 -6px 26px rgba(0, 0, 0, .5); }
body.sidecollapsed .srl-dock { inset-inline-start: 62px; }
body.sidehidden .srl-dock { inset-inline-start: 0; }
.srl-dock-bar { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; flex-wrap: wrap; }
.srl-dock-toggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: none;
  color: var(--txt, #e6edf3); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 8px 4px; }
.srl-dock-toggle:hover { color: var(--crimson, #e5484d); }
.srl-dock-toggle .srl-ic { width: 16px; height: 16px; color: var(--txt2, #9aa7b4); }
.srl-dock-title { letter-spacing: .01em; }
.srl-dock-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; margin-inline-start: 6px;
  background: color-mix(in srgb, var(--amber, #d29922) 22%, transparent); color: var(--amber, #d29922); }
.srl-dock-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-start: 6px; }
.srl-dock-tab { position: relative; padding: 8px 11px; border: none; background: none; cursor: pointer;
  color: var(--txt2, #9aa7b4); font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; }
.srl-dock-tab:hover { color: var(--txt, #e6edf3); }
.srl-dock-tab.on { color: var(--txt, #e6edf3); border-bottom-color: var(--crimson, #e5484d); }
.srl-dock-tab .srl-dock-badge { margin-inline-start: 5px; }
.srl-dock-body { max-height: 300px; overflow: auto; padding: 10px 14px 16px; border-top: 1px solid var(--line, #2a323c); }
.srl-dock-empty { color: var(--txt2, #9aa7b4); font-size: 12.5px; padding: 16px 2px; }
.srl-dock-hint { color: var(--muted, #6e7681); font-size: 11.5px; margin-bottom: 8px; }
.srl-dock-issue { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: start;
  font-size: 12px; padding: 6px 9px; border-radius: 7px; margin-top: 6px; cursor: pointer;
  background: var(--card2, #1c232d); border: 1px solid var(--line, #2a323c);
  border-inline-start: 3px solid var(--line, #2a323c); color: var(--txt, #e6edf3); }
.srl-dock-issue.err { border-inline-start-color: var(--down, #f85149); }
.srl-dock-issue.warn { border-inline-start-color: var(--amber, #d29922); }
.srl-dock-issue:hover { background: color-mix(in srgb, var(--crimson, #e5484d) 8%, var(--card2, #1c232d)); }
.srl-dock-issue code { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--txt2, #9aa7b4); flex: none; }
.srl-dock-issue-msg { flex: 1 1 auto; min-width: 0; }
.srl-dock-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.srl-dock-script { max-height: 232px; margin: 0; }
.srl-dock .srl-review-kv { margin-top: 4px; }
@media (max-width: 900px) {
  .srl-dock { inset-inline-start: 0; }
  .srl-builder.dock-open { padding-bottom: 46px; }    /* mobile: drawer OVERLAYS */
  .srl-dock-body { max-height: 52vh; }
}
