/* Shared instrument visuals; colors identify audible pulse groups and hits. */
body.rv-page {
    --rv-ground: #0d1013;
    --rv-surface: #151a1e;
    --rv-well: #101519;
    --rv-line: #303a3f;
    --rv-ink: #f0f3ee;
    --rv-muted: #b3bfc3;
    --rv-a: #c4f878;
    --rv-b: #87d5df;
    --rv-font: 'Space Grotesk', sans-serif;
    --label-font: var(--rv-font);
    --pulse-a: var(--rv-a);
    --pulse-b: var(--rv-b);
    --orange: var(--rv-ink);
    --yellow: var(--rv-ink);
    font-variant-numeric: tabular-nums;
}
.rv-page .pf-intro { text-align: left; padding: 28px 0 24px; }
.rv-page .pf-intro h1 { font-size: 30px; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.04em; }
.rv-page .pf-intro > p { font-size: 16px; color: var(--rv-muted); }
.rv-page .pf-rhythm { border-color: var(--rv-line); border-radius: 12px; }
.rv-page .pf-rhythm .visual-panel { padding: 28px; gap: 22px; }
.rv-page .pf-rhythm :is(.hero-ratio,.pattern-badge) { font-family: var(--rv-font); color: var(--rv-ink); font-size: 32px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.rv-page .preset-row { gap: 8px; }
.rv-page .preset-row .preset-btn { min-height: 44px; min-width: 64px; padding: 10px 16px; font: 500 14px/1.2 var(--rv-font); border: 1px solid var(--rv-line); background: var(--rv-well); color: var(--rv-ink); border-radius: 6px; white-space: nowrap; }
.rv-page .preset-row .preset-btn.active { border-color: var(--rv-a) !important; color: var(--rv-a) !important; background: var(--rv-well) !important; }
.rv-page .pf-rhythm .pf-rhythm-stage { width: 100%; grid-template-columns: minmax(0,1fr) 150px; gap: 32px; align-items: center; }
.rv-page .pf-rhythm .pf-launch { box-shadow: none; border: 0; font-size: 14px; background: var(--rv-a); }
.rv-page .pf-rhythm .pf-launch:hover { box-shadow: none; }
.rv-page .pf-rhythm .player-status { font-size: 14px; line-height: 1.5; min-height: 24px; }
.rv-page :is(.panel-label,.control-label,.metric-label,.ph-ad-label) { text-transform: none; font-family: var(--rv-font) !important; letter-spacing: 0; font-size: 13px; color: var(--rv-muted); }
.rv-page .ph-ad-label { line-height: 1.5; }
.rv-page .pf-rhythm .metric strong { font-size: 20px; font-weight: 500; }
.rv-page .pf-details > summary { font-size: 14px; }
.rv-page .control-output { font: 500 16px var(--rv-font); }
.rv-page .pf-rhythm .metrics { order: 0; border: 0; padding: 0; gap: 24px; max-width: 560px; text-align: center; }
.rv-page .pf-rhythm .timeline { overflow: visible; padding: 0; min-width: 0; }
.rv-plot-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--rv-muted); padding: 0 0 24px; }
.rv-page .pf-rhythm .lane { margin: 0 0 24px; }
.rv-page .pf-rhythm .lane-header { margin-bottom: 12px; align-items: baseline; }
.rv-page .lane-name { font: 500 16px var(--rv-font); text-transform: none; letter-spacing: 0; }
.rv-page .lane-name small { font: 400 13px var(--rv-font); color: var(--rv-muted); margin-left: 10px; }
.rv-page .lane-count { font: 500 14px var(--rv-font); color: var(--rv-ink); }
.rv-page .beat-lane { --lane-color: var(--rv-a); position: relative; display: block; height: 92px; min-height: 92px; margin: 0 18px; padding: 0; border: 0; background: var(--rv-well); background-image: none; border-radius: 6px; }
.rv-page #laneB { --lane-color: var(--rv-b); }
.rv-page .beat-lane::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: var(--rv-line); }
.rv-grid-tick { position: absolute; top: 12px; bottom: 12px; width: 1px; background: var(--rv-line); opacity: .55; }
.rv-grid-tick.is-shared { width: 3px; opacity: 1; background: var(--rv-muted); }
.rv-page .beat-dot { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--lane-color); border-radius: 50%; background: var(--rv-well); color: var(--lane-color); font: 500 13px var(--rv-font); transform: translate(-50%,-50%); transition: none; }
.rv-page #laneB .beat-dot { color: var(--lane-color); }
.rv-page .beat-dot.accent-beat { border-width: 3px; }
.rv-page .beat-dot.active { color: var(--rv-ground) !important; background: var(--lane-color); transform: translate(-50%,-50%); }
.rv-lane-cursor { position: absolute; top: 8px; bottom: 8px; left: var(--cycle-progress,0%); width: 2px; background: var(--rv-ink); z-index: 2; opacity: 0; }
.rv-page .timeline[data-playing='true'] .rv-lane-cursor { opacity: .8; }
.rv-page .lane[data-muted='true'] .beat-lane { --lane-color: var(--rv-muted); }
.rv-page .lane[data-muted='true'] .lane-name { color: var(--rv-muted); }
.rv-ruler { position: relative; height: 18px; margin: 0 18px; }
.rv-ruler i { position: absolute; height: 6px; width: 1px; top: 0; background: var(--rv-muted); }
.rv-cycle-track { height: 4px; background: var(--rv-line); margin-inline: 18px; overflow: hidden; border-radius: 2px; }
.rv-cycle-progress { height: 100%; width: 100%; background: var(--rv-ink); transform: scaleX(0); transform-origin: left; }
.rv-cycle-ends { display: flex; justify-content: space-between; gap: 16px; margin: 10px 18px 0; font-size: 13px; color: var(--rv-muted); }
.rv-page .rv-finding { font-size: 14px; color: var(--rv-muted); text-align: center; line-height: 1.5; margin: 0; max-width: 60ch; }
.rv-page .lane-actions .lane-btn { border: 1px solid var(--rv-line); color: var(--rv-ink); background: var(--rv-well); min-height: 44px; font-size: 14px; border-radius: 6px; }
.rv-page .lane-actions .lane-btn[aria-pressed='true'] { border-style: dashed; color: var(--rv-muted); }
.rv-page .pf-rhythm .dial-wrap { min-height: 0; }
.rv-page .pf-rhythm .rhythm-dial { width: min(100%,400px); height: auto; aspect-ratio: 1; background: none; border: 0; border-radius: 0; }
.rv-page .rhythm-dial::after { display: none; }
.rv-dial { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--rv-font); }
.rv-dial .rv-orbit { fill: none; stroke: var(--rv-line); stroke-width: 2; }
.rv-dial .rv-hit-shape { fill: var(--rv-b); fill-opacity: .07; stroke: var(--rv-b); stroke-opacity: .65; stroke-width: 1.5; stroke-linejoin: round; }
.rv-dial .rv-radial-tick { stroke: var(--rv-line); stroke-width: 2; }
.rv-dial .rv-sweep { stroke: var(--rv-a); stroke-width: 2; opacity: .8; }
.rv-dial .rv-sweep[hidden] { display: none; }
.rv-dial .rv-step-dot { fill: var(--rv-well); stroke: var(--rv-muted); stroke-width: 2; }
.rv-dial .rv-step.active .rv-step-dot { fill: var(--rv-b); stroke: var(--rv-b); }
.rv-dial .rv-accent-ring { fill: none; stroke: var(--rv-ink); stroke-width: 1.5; }
.rv-dial .rv-step.current .rv-step-dot { fill: var(--rv-a); stroke: var(--rv-a); stroke-width: 4; }
.rv-dial .rv-step-number { fill: var(--rv-muted); text-anchor: middle; dominant-baseline: middle; font-size: 13px; }
.rv-dial .rv-step.current .rv-step-number { fill: var(--rv-a); font-weight: 600; }
.rv-dial .rv-center-ground { fill: var(--rv-surface); }
.rv-dial .rv-center-value { fill: var(--rv-ink); text-anchor: middle; font-size: 42px; font-weight: 500; letter-spacing: -.04em; }
.rv-dial .rv-center-label { fill: var(--rv-muted); text-anchor: middle; font-size: 14px; }
.rv-dial .rv-cycle-origin { fill: var(--rv-muted); text-anchor: middle; font-size: 12px; }
.rv-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 24px; font-size: 13px; color: var(--rv-muted); width: 100%; }
.rv-legend span { display: inline-flex; align-items: center; gap: 8px; }
.rv-legend i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.rv-key-hit { background: var(--rv-b); }
.rv-key-rest { border: 2px solid var(--rv-muted); }
.rv-key-current { background: var(--rv-a); }
.rv-page .linear-pattern { display: grid; grid-template-columns: repeat(var(--pattern-columns),minmax(0,1fr)); gap: 6px; padding: 0; overflow: visible; }
.rv-page .linear-step { position: relative; min-width: 0; min-height: 44px; padding: 6px 0; border: 1px solid var(--rv-line); border-radius: 4px; background: var(--rv-well); color: var(--rv-muted); font: 500 13px var(--rv-font); }
.rv-page .linear-step::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; border: 1px solid currentColor; }
.rv-page .linear-step.active { color: var(--rv-ground); background: var(--rv-b); border-color: var(--rv-b); }
.rv-page .linear-step.active::before { background: currentColor; }
.rv-page .linear-step.current { color: var(--rv-ground); background: var(--rv-a); border-color: var(--rv-a); }
.rv-page .linear-step.current::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 3px; transform: translateX(-50%); background: var(--rv-a); }
.rv-page .pf-rhythm .explanation { display: block; margin: 0; max-width: 72ch; color: var(--rv-muted); font-size: 14px; line-height: 1.5; text-align: center; }
@media(max-width:700px) {
    .rv-page .page { width: calc(100% - 40px); }
    .rv-page .pf-intro h1 { font-size: 24px; }
    .rv-page .pf-intro > p { font-size: 14px; }
    .rv-page .pf-rhythm .visual-panel { padding: 20px 16px; gap: 20px; }
    .rv-page .pf-rhythm .pf-rhythm-stage { display: flex; flex-direction: column; gap: 24px; }
    .rv-page .pf-rhythm .pf-rhythm-play { width: auto; height: auto; min-height: 48px; aspect-ratio: auto; flex-direction: row; border-radius: 6px; padding: 14px 24px; align-self: stretch; }
    .rv-page .pf-rhythm .pf-launch::before { width: 12px; height: 15px; }
    .rv-page .preset-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: 100%; gap: 6px; }
    .rv-page .preset-row .preset-btn { min-width: 0; padding-inline: 5px; font-size: 13px; }
    .rv-page .beat-lane { margin-inline: 12px; height: 72px; min-height: 72px; }
    .rv-page .beat-dot { width: 24px; height: 24px; font-size: 11px; }
    .rv-page .beat-lane[data-dense='true'] .beat-dot { width: 20px; height: 20px; font-size: 11px; }
    .rv-page .lane-name { font-size: 14px; }
    .rv-page .lane-name small { font-size: 12px; margin-left: 6px; }
    .rv-page .lane-count { font-size: 13px; }
    .rv-plot-heading { font-size: 13px; padding-bottom: 20px; }
    .rv-page .pf-rhythm .lane { margin-bottom: 20px; }
    .rv-page .pf-rhythm .rhythm-dial { width: min(100%,340px); }
    .rv-page .linear-pattern { grid-template-columns: repeat(var(--mobile-columns),minmax(0,1fr)); }
    .rv-page .linear-step { min-height: 42px; }
    .rv-page .pf-rhythm .metrics { gap: 12px; }
    .rv-page .pf-rhythm .metric strong { font-size: 18px; }
    .rv-legend { gap: 10px 16px; }
    .rv-legend span:last-child { flex-basis: 100%; justify-content: center; }
    .rv-cycle-ends { margin-inline: 12px; }
    .rv-ruler,.rv-cycle-track { margin-inline: 12px; }
}
@media(prefers-reduced-motion:reduce) {
    .rv-page .rv-lane-cursor,.rv-page .rv-sweep,.rv-page .rv-cycle-progress { display: none; }
}
/* Keep the instrument in view; explanations remain available below the plot. */
.rv-page .pf-rhythm .visual-panel { gap: 20px; }
.rv-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; gap: 16px; }
.rv-page .rv-toolbar .preset-row { flex-wrap: nowrap; }
.rv-page[data-tool='euclidean-rhythm-generator'] .pf-rhythm-stage { max-width: 680px; gap: 48px; }
.rv-page .pf-rhythm .rhythm-dial { width: min(100%,360px); }
.rv-page .pf-rhythm .lane { margin-bottom: 20px; }
.rv-page .beat-lane { height: 80px; min-height: 80px; }
.rv-plot-heading { padding-bottom: 18px; }
.rv-page .lane-actions { display: flex; gap: 10px; }
.rv-page .rv-pattern-details .explanation { border: 0; background: none; padding: 0 0 24px; margin: 0; color: var(--rv-muted); font-size: 14px; line-height: 1.6; }
.rv-dial .rv-step-number { font-size: 16px; }
.rv-dial .rv-center-label { font-size: 16px; }
.rv-dial .rv-cycle-origin { font-size: 16px; }
@media(max-width:700px) {
    .rv-toolbar { flex-direction: column; align-items: stretch; }
    .rv-page .rv-toolbar :is(.hero-ratio,.pattern-badge) { align-self: center; }
    .rv-page[data-tool='euclidean-rhythm-generator'] .pf-rhythm-stage { gap: 20px; }
    .rv-page .beat-lane { height: 72px; min-height: 72px; }
    .rv-page .pf-rhythm .rhythm-dial { width: min(100%,340px); }
    .rv-page .lane-actions { align-self: stretch; }
    .rv-page .lane-actions .lane-btn { width: auto; min-width: 0; }
}
@media(max-width:700px) {
    .rv-page .beat-lane[data-dense='true'] .beat-dot { width: 18px; height: 18px; }
    .rv-dial .rv-step-number,.rv-dial .rv-center-label,.rv-dial .rv-cycle-origin { font-size: 18px; }
}
.rv-page .rv-toolbar :is(.hero-ratio,.pattern-badge) { min-width: 0; margin: 0; text-align: left; }
.rv-page .lane-actions { flex-direction: row; flex-wrap: nowrap; }
.rv-page .lane-actions .lane-btn { flex: 1 1 0; }
@media(max-width:700px) {
    .rv-page .pf-rhythm .pf-rhythm-stage { flex-direction: column-reverse; }
}
