/* Chart primitives retained from the original renderer. */
.research-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}
.research-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}
.research-chart-grid-line {
    stroke: var(--line);
    stroke-width: 1;
    shape-rendering: crispEdges;
}
.research-chart-axis-y,
.research-chart-axis-x {
    fill: var(--muted);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}
.research-chart-dot {
    fill: rgba(var(--brand-accent-strong-rgb), 1);
    stroke: var(--metric-bg);
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.1s ease;
}
.research-chart-dot:hover {
    r: 6;
}
.research-chart-point-value {
    fill: var(--text);
    font-size: var(--text-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.research-chart-area-series {
    fill-opacity: 0.16;
    stroke: none;
}
.research-chart-line-series {
    fill: none;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.research-chart-line-series.dashed {
    stroke-dasharray: 6 4;
    stroke-width: 2;
}
.research-chart-dot.sm {
    stroke-width: 1.5;
}
.research-chart-hit {
    fill: transparent;
    cursor: pointer;
}
.research-chart-hit:hover {
    fill: rgba(var(--brand-accent-rgb), 0.07);
}
.research-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
}
.research-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--muted);
}
.research-legend-swatch {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex: 0 0 auto;
}
.research-legend-swatch.dashed {
    opacity: 0.7;
}
.research-chart-viewport {
    position: relative;
}
.research-chart-crosshair {
    stroke: var(--muted);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: 0.6;
    pointer-events: none;
}
.research-chart-cursor-dot {
    stroke: var(--metric-bg);
    stroke-width: 2;
    pointer-events: none;
}
.research-chart-overlay-line {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 5 4;
    stroke-linecap: round;
    opacity: 0.9;
    pointer-events: none;
}
.research-chart-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 130px;
    max-width: 260px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-solid, var(--glass-surface-1-bg));
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    font-size: var(--text-sm);
}
.research-tooltip-head {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.research-tooltip-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 1px 0;
    color: var(--muted);
}
.research-tooltip-row.is-total {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-weight: 600;
}
.research-tooltip-swatch {
    width: 12px;
    height: 4px;
    border-radius: 2px;
}
.research-tooltip-swatch.dashed {
    opacity: 0.7;
}
.research-tooltip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.research-tooltip-val {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.research-chart-bar {
    stroke: var(--metric-bg);
    stroke-width: 0.5;
}
.research-chart-forecast-band {
    fill-opacity: 0.12;
    stroke: none;
    pointer-events: none;
}
.research-chart-forecast-line {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 4 4;
    stroke-linecap: round;
    opacity: 0.85;
    pointer-events: none;
}
.research-chart-axis-x.forecast {
    fill: var(--muted);
    font-style: italic;
    opacity: 0.8;
}
.research-chart-anomaly {
    fill: none;
    stroke: var(--danger, #c0392b);
    stroke-width: 2;
    pointer-events: none;
}
.research-tooltip-anomaly .research-tooltip-label {
    color: var(--danger, #c0392b);
    font-weight: 600;
}

/* Analytics workspace uses the application palette in every theme. */
.ra-workspace { max-width: 1500px; margin: auto; color: var(--text); min-width: 0; }
.ra-workspace [hidden] { display: none !important; }
.ra-workspace button, .ra-workspace select, .ra-workspace input { font: inherit; }
.ra-workspace button { cursor: pointer; }
.ra-workspace button:disabled { cursor: default; opacity: .5; }
.ra-workspace button[aria-disabled=true] { cursor: default; opacity: .5; }
.ra-workspace button:focus-visible, .ra-workspace select:focus-visible, .ra-workspace summary:focus-visible, .ra-workspace input:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.ra-heading, .ra-actions, .ra-controls, .ra-summary, .ra-view-head, .ra-viewbar { display: flex; align-items: center; gap: 16px; }
.ra-heading { justify-content: space-between; margin: 4px 0 22px; }
.ra-heading h1 { margin: 0 0 8px; font-size: 29px; letter-spacing: -.7px; font-weight: 650; }
.ra-heading p:last-child { margin: 0; font-size: 13px; }
.ra-eyebrow { margin: 0 0 8px; text-transform: uppercase; color: var(--text-accent-strong); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.ra-actions { gap: 8px; flex-wrap: wrap; }
.ra-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 12px !important; white-space: nowrap; }
.ra-button:hover { background: var(--tab-pill-hover-bg); }
.ra-button.ra-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.ra-button.ra-primary { background: var(--brand-accent-soft); border-color: var(--brand-accent-border-strong); color: var(--text); }
.ra-measures { display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--ops-panel-bg); }
.ra-measures button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 5px; padding: 9px 16px; font-size: 13px; }
.ra-measures button[aria-pressed=true] { color: var(--text); background: var(--brand-accent-soft); border-color: var(--brand-accent-border-strong); box-shadow: inset 0 -2px var(--brand-accent); }
.ra-controls { align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.ra-controls > .ra-actions { margin-left: auto; }
.ra-field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; min-width: 0; }
.ra-field select { color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 26px 8px 10px; min-height: 35px; max-width: 100%; background: var(--panel); font-size: 12px; }
.ra-scope { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 38px; padding-top: 10px; font-size: 12px; color: var(--muted); }
.ra-chip { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); padding: 3px 6px 3px 9px; border-radius: 5px; }
.ra-chip button { background: transparent; border: 0; color: var(--muted); }
.ra-feedback { min-height: 26px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ra-feedback .ra-button { min-height: 24px; padding: 2px 8px; }
.ra-summary { flex-wrap: wrap; gap: 34px; margin: 0 0 24px; }
.ra-total { font-size: 46px; font-weight: 620; letter-spacing: -1.5px; line-height: 1.15; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
#research-kpi-total-label { font-size: 14px; }
#research-summary-dates { margin: 7px 0 0; font-size: 11px; }
.ra-secondary { display: flex; align-items: center; gap: 28px; padding-left: 30px; border-left: 1px solid var(--line); }
.ra-secondary strong { display: block; font-size: 24px; font-weight: 550; font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.ra-secondary span { font-size: 11px; color: var(--muted); }
.ra-coverage { margin-left: auto; text-align: left; font-size: 11px !important; line-height: 1.9; padding: 11px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--ops-panel-bg); color: var(--muted); }
.ra-coverage strong { color: var(--text); font-weight: 550; }
.ra-coverage span, .ra-coverage strong { display: block; }
.ra-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--ops-panel-bg); overflow: hidden; }
.ra-card::before { content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--brand-accent); opacity: 0; pointer-events: none; }
.ra-card.is-updating::before { opacity: 1; animation: ra-progress 1.2s ease-in-out infinite; }
@keyframes ra-progress { 0%, 100% { transform: scaleX(.25); transform-origin: left; } 50% { transform: scaleX(.75); } }
@media (prefers-reduced-motion: reduce) { .ra-card.is-updating::before { animation: none; } }
.ra-viewbar { justify-content: space-between; margin: 0 22px; border-bottom: 1px solid var(--profile-inner-border); }
.ra-viewbar .entity-detail-tabs { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; flex-wrap: nowrap; }
#research-analytics-generated-at { font-size: 10px; white-space: nowrap; }
.ra-view { padding: 22px; min-width: 0; }
.ra-view-head { justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.ra-view h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ra-view h3 { margin: 0; font-size: 13px; }
.ra-view-head p { margin: 0; font-size: 11px; max-width: 640px; line-height: 1.6; }
.ra-segment { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: var(--panel); }
.ra-segment button { font-size: 11px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; padding: 6px 10px; }
.ra-segment button[aria-pressed=true] { color: var(--text); background: var(--brand-accent-soft); }
#research-lp-joins-chart { width: 100%; min-width: 0; min-height: 300px; }
.ra-workspace .research-chart-svg { width: 100%; height: 300px; display: block; }
.ra-workspace .research-chart-axis-x, .ra-workspace .research-chart-axis-y, .ra-workspace .research-chart-point-value { font-size: 11px; fill: var(--muted); }
.ra-workspace .research-chart-point-value { fill: var(--text); }
.ra-workspace .research-chart-hit:focus { outline: none; stroke: var(--brand-accent); stroke-width: 2px; }
.ra-workspace .research-chart-hit[aria-disabled=true] { cursor: progress; }
.ra-workspace .research-chart-bar { fill-opacity: .75; }
.ra-chart-partial { stroke: var(--brand-accent); stroke-width: 1px; stroke-dasharray: 4 4; fill: none; opacity: .55; pointer-events: none; }
.ra-chart-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; min-height: 24px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.ra-period-values { margin-top: 12px; font-size: 12px; color: var(--muted); }
.ra-period-values summary { cursor: pointer; width: fit-content; }
.ra-value-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; padding-top: 14px; }
.ra-value-controls output { align-self: center; }
.ra-selection { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; padding: 8px 22px; background: var(--brand-accent-soft); border-bottom: 1px solid var(--line); }
.ra-empty { min-height: 180px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; text-align: center; }
.ra-record-note { font-size: 11px; line-height: 1.7; margin-bottom: 18px; max-width: 850px; }
.ra-footnote { padding: 15px 0; font-size: 10px; color: var(--muted); }
.ra-pivot-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; padding: 0 0 18px; }
.ra-pivot-controls > span { align-self: center; font-size: 12px; margin-left: auto; }
.ra-table-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 42px; font-size: 12px; color: var(--muted); }
.ra-pivot-cell { background: transparent; color: var(--text); border: 0; padding: 0; text-align: inherit; max-width: 100%; font-variant-numeric: tabular-nums; }
.ra-pivot-cell:hover { color: var(--text-accent-strong); text-decoration: underline; }
.ra-pivot-total { font-weight: 600; }
.ra-pivot-total td { border-top: 1px solid var(--line); }
.ra-record-identity { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ra-record-identity > .dt-value { min-width: 0; flex: 1; }
.ra-record-identity > button { flex-shrink: 0; }
.ra-dialog { width: min(470px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 24px; background: var(--settings-modal-bg); color: var(--text); border: 1px solid var(--settings-modal-border); border-radius: 12px; box-shadow: var(--settings-modal-shadow); overflow: auto; }
.ra-dialog::backdrop { background: var(--settings-modal-backdrop-bg); }
.ra-dialog header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ra-dialog h2 { font-size: 20px; margin: 0; }
.ra-dialog h3 { font-size: 13px; margin: 20px 0 8px; }
.ra-dialog p { font-size: 12px; line-height: 1.8; }
.ra-dialog .ra-field { margin: 18px 0; }
.ra-checkbox { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 18px 0; }
.ra-checkbox input { accent-color: var(--brand-accent); }
.ra-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
@media (max-width: 1080px) { .ra-summary { gap: 24px; } .ra-secondary { padding-left: 24px; gap: 20px; } }
@media (max-width: 780px) { .ra-heading { align-items: flex-start; } .ra-heading > .ra-actions { justify-content: flex-end; } .ra-coverage { margin-left: 0; } .ra-view-head { align-items: flex-start; } .ra-view { padding: 18px; } .ra-controls > .ra-actions { margin-left: 0; } }
@media (max-width: 520px) { .ra-heading { flex-wrap: wrap; } .ra-heading h1 { font-size: 26px; } .ra-measures { width: 100%; } .ra-measures button { flex: 1; padding: 8px 7px; font-size: 11px; } .ra-total { font-size: 38px; } .ra-secondary { padding-left: 16px; gap: 16px; } .ra-secondary strong { font-size: 20px; } .ra-coverage { width: 100%; } .ra-view { padding: 16px 12px; } .ra-viewbar { margin: 0 12px; flex-wrap: wrap; gap: 0; } #research-analytics-generated-at { margin-bottom: 10px; } .ra-selection { padding: 8px 12px; flex-wrap: wrap; } }
.ra-comparison { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:12px 0; }
.ra-comparison-scope { display:flex; flex:1 1 360px; align-items:center; gap:10px; min-width:0; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.ra-comparison-scope > span { flex:1; overflow-wrap:anywhere; }
.ra-comparison-scope [aria-pressed="true"] { color:var(--brand-accent); border-color:var(--brand-accent); }
.ra-ytd-remainder { stroke-width:1; }
.research-legend-swatch.ra-hatched { border:1px solid var(--series-color); }
