/* Analysis extends Mizan's existing paper, ink, type and focus tokens. */
body[data-surface="analysis"] .page { width: 100%; max-width: 1160px; flex-basis: 1160px; padding-bottom: 24px; }
body[data-surface="analysis"] .roadmap { display: none; }
.analysis { padding-top: 14px; min-height: 320px; font-variant-numeric: tabular-nums; }
.analysis-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.analysis-heading h2 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.analysis-heading p, .analysis-section > p { margin: 0; color: var(--muted); }
.analysis-heading .btn { flex: none; }
.analysis-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.analysis label { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); }
.analysis select, .analysis input { max-width: 100%; min-width: 100px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background-color: var(--surface); font-size: 13px; }
.analysis select { padding-inline-end: 26px; }
.analysis-filters label { flex: 1 1 125px; min-width: 0; }
.analysis-filters label:has(select[name="route"]) { flex-basis: 210px; }
.analysis-filters select { width: 100%; text-overflow: ellipsis; }
.analysis-filters .btn { min-height: 38px; font-size: 12px; }
.analysis-status { min-height: 20px; margin: 12px 0 20px; color: var(--muted); font-size: 12px; }
.analysis-scope-note { margin: 12px 0 0; color: var(--ink-2); font-size: 12px; max-width: 85ch; }
.analysis-status.error { color: var(--danger); }
.analysis-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; margin: 0; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.analysis-summary dt { font-size: 13px; color: var(--ink-2); }
.analysis-summary dd { margin: 4px 0; font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
.analysis-summary small { color: var(--muted); font-size: 11px; }
.analysis-metric { display: flex; justify-content: end; margin-top: 18px; }
.analysis-metric label { display: flex; align-items: center; gap: 10px; }
.analysis-section { margin-top: 26px; min-width: 0; }
.analysis-section h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.analysis-section > p { font-size: 12px; max-width: 75ch; }
.analysis-chart { margin-top: 12px; }
.analysis-chart svg { display: block; width: 100%; overflow: visible; }
.analysis-chart text { fill: var(--muted); font: 12px var(--font-body); }
.analysis-gridline { stroke: var(--line); stroke-width: 1; }
.analysis-trend { stroke: var(--accent); stroke-width: 2; }
.analysis-trend.series-1 { stroke: var(--ok); }
.analysis-trend.series-2 { stroke: var(--gold); }
.analysis-trend.series-3 { stroke: var(--danger); }
.analysis-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; cursor: crosshair; }
.analysis-dot:focus { stroke: var(--ink); stroke-width: 3; outline: none; }
.analysis-dot:hover { stroke: var(--ink); stroke-width: 2; }
.analysis-dot.series-1 { fill: var(--ok); }
.analysis-dot.series-2 { fill: var(--gold); }
.analysis-dot.series-3 { fill: var(--danger); }
.analysis-point-note { font-size: 11px; color: var(--ink-2); min-height: 32px; margin: 5px 0 0; }
.analysis-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--accent); }
.analysis-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; margin-right: 6px; }
.analysis-legend .series-1 { color: var(--ok); }
.analysis-legend .series-2 { color: var(--gold); }
.analysis-legend .series-3 { color: var(--danger); }
.analysis-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 32px; border-top: 1px solid var(--line); margin-top: 10px; }
.analysis-stage { margin-top: 17px; }
.analysis-stage-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.analysis-stage-label span:last-child { color: var(--muted); text-align: end; }
.analysis-bar-track { background: var(--sunk); height: 7px; margin-top: 6px; border-radius: 2px; }
.analysis-bar { background: var(--accent); height: 100%; border-radius: 2px; }
#analysis-cohorts { overflow-x: auto; margin-top: 12px; scrollbar-color: var(--line) var(--surface); }
.analysis table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
.analysis th { color: var(--muted); font-weight: 500; text-align: end; font-size: 11px; }
.analysis th:first-child { text-align: start; }
.analysis th, .analysis td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.analysis td { text-align: end; }
.analysis td:first-child { text-align: start; padding-inline-start: 0; }
.analysis-cohort { border: 0; border-radius: 4px; background: transparent; padding: 4px; text-align: start; cursor: pointer; color: var(--ink-2); }
.analysis-cohort:hover { color: var(--accent); background: var(--accent-soft); }
.analysis-cohort strong, .analysis-cohort small { display: block; }
.analysis-cohort strong { font-weight: 500; }
.analysis-cohort small { color: var(--muted); margin-top: 3px; }
.analysis-notes { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 28px; color: var(--muted); font-size: 12px; }
.analysis-notes summary { cursor: pointer; color: var(--ink-2); }
.analysis-notes p { max-width: 75ch; margin: 12px 0; }
.analysis-notes label { max-width: 240px; }
.analysis input { caret-color: var(--accent); }
@media (max-width: 760px) {
  .analysis-pair { grid-template-columns: 1fr; gap: 0; }
  .analysis-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .analysis-heading h2 { font-size: 23px; }
  .analysis-filters { gap: 10px; }
  .analysis-filters label { flex-basis: calc(50% - 10px); }
  .analysis-filters label:has(select[name="route"]) { flex-basis: calc(50% - 10px); }
  .analysis-chart svg { min-height: 150px; }
  .analysis-metric { justify-content: start; }
}
