/* Report Generation (assets/reports.js). Chart colours are roles, not raw hex in the markup: series 1 blue and series 2
   orange (validated together for colour-vision separation), an ordinal blue ramp for the funnel, recessive grid and axes. */
.rp-page{
  --rp-s1:#2a78d6;--rp-s2:#eb6834;
  --rp-f1:#104281;--rp-f2:#1c5cab;--rp-f3:#2a78d6;--rp-f4:#5598e7;--rp-f5:#86b6ef;
  --rp-surface:#ffffff;--rp-grid:#eceef3;--rp-base:#cfd3df;--rp-axis:#7d8597;--rp-ink:#10233f;--rp-ink-2:#52607a;--rp-good:#006300;--rp-bad:#b42318;
  --rp-track:#eef2fb;
}

/* Report picker: one card per report, scrolls sideways on a narrow screen. */
.rp-types{display:grid;grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:10px;margin:0 0 16px}
.rp-type{display:flex;align-items:center;gap:10px;text-align:left;border:1px solid #e3e6f3;background:#fff;border-radius:14px;padding:11px 12px;color:var(--rp-ink);transition:border-color .15s,box-shadow .15s;min-width:0}
.rp-type:hover{border-color:#c9cdf2;box-shadow:0 6px 16px rgba(76,76,224,.08)}
.rp-type.on{border-color:#4c4ce0;background:#f5f5ff;box-shadow:0 0 0 2px rgba(76,76,224,.14)}
.rp-type-ico{flex:none;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#eef0ff;color:#4c4ce0}
.rp-type.on .rp-type-ico{background:#4c4ce0;color:#fff}
.rp-type strong{display:block;font-size:13px;line-height:1.25}
.rp-type small{display:block;font-size:11.5px;color:var(--rp-ink-2);line-height:1.35;margin-top:2px}

/* Filters: one row above everything they scope. */
.rp-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 12px;background:#fff;border:1px solid #e3e6f3;border-radius:16px;padding:12px 14px;margin:0 0 16px}
.rp-field{display:flex;flex-direction:column;gap:4px;min-width:140px;flex:0 1 180px}
.rp-field>span{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--rp-axis)}
.rp-field .input{margin:0;min-height:38px;height:38px;padding:0 10px;font-size:13px;border-radius:10px;width:100%}
.rp-compare{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--rp-ink-2);min-height:38px;cursor:pointer}
.rp-compare input{width:16px;height:16px;accent-color:#4c4ce0}
.rp-viewing,.rp-error,.rp-empty{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-radius:12px;padding:10px 14px;margin:0 0 14px;font-size:13px}
.rp-viewing{background:#eef4ff;color:#24477a;border:1px solid #d3e0fb}
.rp-error{background:#fef3f2;color:#912018;border:1px solid #fecdca}
.rp-empty{background:#f8f9fc;color:var(--rp-ink-2);border:1px dashed #d8dce8}

/* The report */
.rp-report{transition:opacity .2s}
.rp-report.is-loading{opacity:.55;pointer-events:none}
.rp-meta{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:0 0 12px}
.rp-meta h2{margin:0;font-size:19px;letter-spacing:-.3px;color:var(--rp-ink)}
.rp-meta p{margin:3px 0 0;font-size:13px;color:var(--rp-ink-2)}
.rp-chips{display:flex;flex-wrap:wrap;gap:6px}
.rp-chip{background:#eef0ff;color:#3434b8;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:600}
.rp-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}
.rp-kpi{background:#fff;border:1px solid #e3e6f3;border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;min-width:0}
.rp-kpi-label{font-size:12px;color:var(--rp-ink-2);display:flex;align-items:center;gap:4px}
.rp-hint{display:inline-grid;place-items:center;color:var(--rp-axis);cursor:help;font-style:normal}
.rp-kpi strong{font-size:26px;letter-spacing:-.5px;color:var(--rp-ink);line-height:1.2;overflow-wrap:anywhere}
.rp-kpi strong.is-text{font-size:18px;letter-spacing:-.2px}
.rp-kpi-sub{font-size:12px;color:var(--rp-ink-2)}
.rp-delta{font-size:12px;font-weight:600;display:flex;align-items:baseline;flex-wrap:wrap;gap:4px}
.rp-delta b{font-size:10px}
.rp-delta span{font-weight:400;color:var(--rp-axis)}
.rp-delta.good{color:var(--rp-good)}.rp-delta.bad{color:var(--rp-bad)}.rp-delta.flat{color:var(--rp-ink-2)}
.rp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 14px}
.rp-card{background:var(--rp-surface);border:1px solid #e3e6f3;border-radius:16px;padding:16px 18px;min-width:0;box-shadow:0 1px 2px rgba(9,29,66,.03)}
.rp-card.wide{grid-column:1/-1}
.rp-table-card,.rp-saved{margin:0 0 14px}
.rp-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 12px}
.rp-card-head h3{margin:0;font-size:14.5px;color:var(--rp-ink)}
.rp-card-head p{margin:3px 0 0;font-size:12px;color:var(--rp-ink-2);line-height:1.45}
.rp-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;color:var(--rp-ink-2)}
.rp-legend span{display:inline-flex;align-items:center;gap:6px}
.rp-swatch{width:10px;height:10px;border-radius:3px;display:inline-block}
.rp-swatch.s1,.rp-key.s1{background:var(--rp-s1)}.rp-swatch.s2,.rp-key.s2{background:var(--rp-s2)}

/* SVG columns and line */
.rp-chart{width:100%;min-height:240px;border-radius:8px;outline-offset:3px}
.rp-chart svg{display:block;max-width:100%;height:auto;overflow:visible;font-family:inherit}
.rp-chart .rp-gridline{stroke:var(--rp-grid);stroke-width:1}
.rp-chart .rp-base{stroke:var(--rp-base);stroke-width:1}
.rp-chart .rp-axis{fill:var(--rp-axis);font-size:11px;font-variant-numeric:tabular-nums}
.rp-col.s1{fill:var(--rp-s1)}.rp-col.s2{fill:var(--rp-s2)}
.rp-line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.rp-line.s1{stroke:var(--rp-s1)}.rp-line.s2{stroke:var(--rp-s2)}
.rp-area.s1{fill:var(--rp-s1);opacity:.1}
.rp-dot{stroke:var(--rp-surface);stroke-width:2}
.rp-dot.s1{fill:var(--rp-s1)}.rp-dot.s2{fill:var(--rp-s2)}
.rp-hit{fill:transparent;cursor:crosshair}
.rp-hit.on{fill:rgba(16,35,63,.05)}
.rp-cross{stroke:var(--rp-base);stroke-width:1}
.rp-chart-empty{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--rp-axis);font-size:13px;background:#fafbfd;border-radius:10px}

/* Horizontal bars and the funnel are plain HTML, so every label fits and wraps instead of being cut. */
.rp-bars{display:grid;gap:8px}
.rp-bar{display:grid;grid-template-columns:minmax(90px,34%) minmax(0,1fr) auto;align-items:center;gap:10px}
.rp-bar-label{font-size:12.5px;color:var(--rp-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-bar-track{display:block;height:16px;border-radius:0 4px 4px 0;background:transparent;position:relative}
.rp-bar-fill{display:block;height:100%;border-radius:0 4px 4px 0;background:var(--rp-s1)}
.rp-bar-value{font-size:12.5px;font-weight:650;color:var(--rp-ink);font-variant-numeric:tabular-nums;min-width:40px;text-align:right}
.rp-funnel{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.rp-funnel li{display:grid;gap:5px}
.rp-funnel-row{display:flex;justify-content:space-between;gap:10px;font-size:13px;color:var(--rp-ink)}
.rp-funnel-label{font-weight:600}
.rp-funnel-value{color:var(--rp-ink-2);font-variant-numeric:tabular-nums}
.rp-funnel-value strong{color:var(--rp-ink)}
.rp-funnel .rp-bar-track{height:22px;background:var(--rp-track);border-radius:0 6px 6px 0}
.rp-funnel .rp-bar-fill{border-radius:0 6px 6px 0}
.rp-bar-fill.f1{background:var(--rp-f1)}.rp-bar-fill.f2{background:var(--rp-f2)}.rp-bar-fill.f3{background:var(--rp-f3)}.rp-bar-fill.f4{background:var(--rp-f4)}.rp-bar-fill.f5{background:var(--rp-f5)}
.rp-step{font-size:11.5px;color:var(--rp-axis)}

/* Tables */
.rp-table-wrap{overflow-x:auto;border:1px solid #eef0f6;border-radius:12px}
.rp-table{width:100%;border-collapse:collapse;font-size:13px}
.rp-table th{background:#f8f9fc;text-align:left;font-size:11.5px;font-weight:700;color:var(--rp-ink-2);white-space:nowrap;padding:0;border-bottom:1px solid #eef0f6}
.rp-table th button{all:unset;display:flex;align-items:center;gap:4px;padding:9px 12px;cursor:pointer;width:100%;box-sizing:border-box}
.rp-table th:not(:has(button)){padding:9px 12px}
.rp-table th.num button{justify-content:flex-end}
.rp-table th button:focus-visible{outline:2px solid #4c4ce0;outline-offset:-2px}
.rp-table th b{font-size:9px;color:#4c4ce0}
.rp-table td{padding:9px 12px;border-bottom:1px solid #f2f3f8;color:var(--rp-ink);vertical-align:middle}
.rp-table td small{display:block;font-size:11.5px;color:var(--rp-axis)}
.rp-table tr:last-child td{border-bottom:0}
.rp-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.rp-table tbody tr:hover td{background:#fafbff}
.rp-more{margin-top:10px}
.rp-none{margin:0;color:var(--rp-ink-2);font-size:13px}
.rp-data{margin-top:10px}
.rp-data summary{cursor:pointer;font-size:12.5px;font-weight:600;color:#4c4ce0}
.rp-data .rp-table-wrap{margin-top:8px;max-height:280px;overflow:auto}
.rp-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px}
.rp-saved-open{font-weight:650;text-align:left}
.rp-foot{display:flex;align-items:flex-start;gap:6px;font-size:12px;color:var(--rp-axis);margin:4px 0 18px;line-height:1.5}
.rp-sk-chart{height:220px;border-radius:10px;background:linear-gradient(90deg,#f3f4f8,#f8f9fc,#f3f4f8);margin-top:12px}
.rp-save-form p{margin:0 0 12px;color:var(--rp-ink-2);font-size:13px;line-height:1.55}

/* Tooltip: the value leads, the series name follows. */
.rp-tip{position:absolute;z-index:80;pointer-events:none;min-width:130px;background:#0f1b2d;color:#fff;border-radius:10px;padding:8px 10px;font-size:12px;box-shadow:0 10px 24px rgba(9,29,66,.25)}
.rp-tip[hidden]{display:none}
.rp-tip-head{font-size:11.5px;color:#c3cbe0;margin-bottom:4px}
.rp-tip-row{display:flex;align-items:center;gap:7px;padding:1px 0}
.rp-tip-row strong{font-size:13px}
.rp-tip-row span{color:#c3cbe0}
.rp-key{width:12px;height:3px;border-radius:2px;display:inline-block}

@media (max-width:1100px){.rp-grid{grid-template-columns:minmax(0,1fr)}.rp-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:760px){
  .rp-types{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px}
  .rp-type{flex:0 0 220px;scroll-snap-align:start}
  .rp-field{flex:1 1 calc(50% - 12px);min-width:0}
  .rp-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rp-kpi strong{font-size:21px}
  .rp-bar{grid-template-columns:minmax(80px,38%) minmax(0,1fr) auto}
  .rp-card{padding:14px}
}
@media (prefers-reduced-motion:reduce){.rp-type,.rp-report{transition:none}}

/* Print / PDF: the report only — no menu, filters, buttons or saved list. */
@media print{
  .sidebar,.trial-bar,.topbar,.rp-types,.rp-filters,.rp-saved,.rp-viewing,.page-head .head-actions,.rp-card-head .btn,.rp-more,.ai-launcher,#assistantLauncher,.toast-stack{display:none!important}
  .app-shell,main{margin:0!important;padding:0!important}
  .page-head.ph{box-shadow:none;border-color:#ddd}
  .rp-card,.rp-kpi{break-inside:avoid;box-shadow:none}
  .rp-grid{grid-template-columns:minmax(0,1fr)}
  .rp-data summary{display:none}
  .rp-hit.on{fill:transparent}
}
