/* Rotation observation states stay fixed when the user's gain/loss palette flips. */
#rotation-root {
  --rot-leading: var(--blue);
  --rot-improving: var(--accent);
  --rot-weakening: var(--amber);
  --rot-lagging: var(--t3);
  --rot-unknown: var(--t3);
  min-width: 0;
  padding: var(--space-8) var(--space-9) var(--space-9);
  color: var(--t1);
  font-size: var(--text-md);
}
.rot-leading { --phase: var(--rot-leading); }
.rot-improving { --phase: var(--rot-improving); }
.rot-weakening { --phase: var(--rot-weakening); }
.rot-lagging { --phase: var(--rot-lagging); }
.rot-unknown { --phase: var(--rot-unknown); }
.rot-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-7); margin-bottom: var(--space-7); }
.rot-eyebrow { color: var(--t3); font-family: var(--mono); font-size: var(--text-xs); letter-spacing: .1em; }
.rot-header h2 { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-5); margin: var(--space-2) 0; font-size: var(--text-3xl); font-weight: 700; }
.rot-header h2 span { color: var(--t2); font-weight: 500; font-size: var(--text-base); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-4); }
.rot-header p { color: var(--t2); margin: 0; font-size: var(--text-md); }
.rot-button { padding: var(--space-3) var(--space-6); min-height: var(--ctrl-xl); white-space: nowrap; font-size: var(--text-md); }
.rot-market-strip { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; background: var(--bg2); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); font-size: var(--text-base); color: var(--t2); }
.rot-market-strip b { font-family: var(--mono); margin-left: var(--space-2); color: var(--t1); }
.rot-market-strip b.tg { color: var(--green); }
.rot-market-strip b.tr { color: var(--red); }
.rot-market-state { color: var(--t2); }
.rot-date { margin-left: auto; font-family: var(--mono); }
.rot-status { color: var(--t3); font-size: var(--text-base); min-height: 1.5em; margin: var(--space-3) 0 var(--space-7); overflow-wrap: anywhere; }
.rot-status.rot-error { color: var(--accent); }
.rot-summaries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin-bottom: var(--space-7); }
.btn.rot-summary { display: block; white-space: normal; height: auto; text-align: left; padding: var(--space-5) var(--space-6); border-radius: var(--radius-lg); border-top: 3px solid var(--phase); background: color-mix(in srgb, var(--phase) 4%, var(--bg1)); min-width: 0; }
.btn.rot-summary.is-active { outline: 2px solid var(--phase); outline-offset: 1px; }
.rot-summary-label { color: var(--phase); display: flex; align-items: baseline; justify-content: space-between; font-size: var(--text-lg); }
.rot-summary-label strong { font-family: var(--mono); font-size: var(--text-3xl); line-height: 1.1; }
.rot-summary-label small { color: var(--t3); margin-left: var(--space-2); font-size: var(--text-xs); font-weight: 400; }
.rot-summary-hint, .rot-summary-names { display: block; font-size: var(--text-base); font-weight: 400; margin-top: var(--space-3); }
.rot-summary-hint { color: var(--t2); }
.rot-summary-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t3); }
.rot-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-7); margin-bottom: var(--space-7); align-items: stretch; }
.rot-panel { min-width: 0; background: var(--glass-bg-strong); border: 1px solid var(--glass-brd-soft); border-radius: var(--radius-lg); padding: var(--space-7); box-shadow: var(--shadow-card); }
.rot-panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
#rotation-root h3 { margin: 0; font-size: var(--text-xl); font-weight: 650; }
.rot-detail h3 { margin-top: var(--space-2); }
.rot-note { font-size: var(--text-base); color: var(--t3); line-height: 1.6; margin: var(--space-3) 0 0; }
.rot-chart-wrap { position: relative; margin-top: var(--space-3); }
.rot-chart { display: block; width: 100%; overflow: visible; }
.rot-zone { fill: var(--phase); opacity: .055; }
.rot-axis { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.rot-axis-label { font: 11px var(--mono); fill: var(--t3); } /* SVG coordinates, not screen pixels. */
.rot-trail { fill: none; stroke: var(--phase); opacity: .25; stroke-width: 1.5; }
.rot-trail.is-selected { stroke-width: 3; opacity: .95; }
.rot-dot { cursor: pointer; color: var(--phase); outline: none; }
.rot-hit { fill: transparent; }
.rot-dot-mark { fill: currentColor; stroke: var(--bg1); stroke-width: 1.5; }
.rot-dot.is-selected .rot-dot-mark, .rot-dot:focus .rot-dot-mark { stroke: var(--t1); stroke-width: 2; }
.rot-dot:hover .rot-dot-mark { r: 8; }
.rot-dot.is-muted { opacity: .1; pointer-events: none; }
.rot-selection-label { font: 600 14px var(--sans); fill: var(--t1); paint-order: stroke; stroke: var(--bg1); stroke-width: 4; pointer-events: none; }
.rot-quadrant { position: absolute; color: var(--phase); font-weight: 650; font-size: var(--text-lg); pointer-events: none; }
.rot-quadrant span { display: block; margin-top: var(--space-1); font-size: var(--text-xs); font-weight: 400; color: var(--t3); }
.rot-quadrant.rot-improving { top: 10%; left: 7%; }
.rot-quadrant.rot-leading { top: 10%; right: 7%; text-align: right; }
.rot-quadrant.rot-lagging { bottom: 10%; left: 7%; }
.rot-quadrant.rot-weakening { bottom: 10%; right: 7%; text-align: right; }
.rot-chart-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); color: var(--t2); font-size: var(--text-base); padding: 0 var(--space-4); }
.rot-chart-caption b { font-weight: 600; padding: 0 var(--space-3); }
.rot-badge { display: inline-flex; align-items: center; color: var(--phase); background: color-mix(in srgb, var(--phase) 9%, transparent); border: 1px solid color-mix(in srgb, var(--phase) 20%, transparent); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); font-size: var(--text-base); white-space: nowrap; }
.rot-reading { color: var(--t2); font-size: var(--text-md); line-height: 1.75; margin: var(--space-5) 0; }
.rot-coverage { color: var(--t2); font-size: var(--text-base); padding: var(--space-3) var(--space-4); background: var(--bg2); border-radius: var(--radius-sm); }
.rot-coverage.rot-error { color: var(--accent); }
.rot-members em { font-style: normal; font-size: var(--text-xs); color: var(--t3); margin-left: var(--space-2); }
.rot-chain-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.btn.rot-chain-button { justify-content: flex-start; min-width: 0; height: auto; min-height: var(--ctrl-md); white-space: normal; text-align: left; font-size: var(--text-base); line-height: 1.5; padding: var(--space-2) var(--space-3); }
.rot-chain-button i { width: var(--space-3); height: var(--space-3); flex: 0 0 var(--space-3); border-radius: var(--radius-pill); background: var(--phase); }
.rot-chain-button.is-selected { border-color: var(--phase); background: color-mix(in srgb, var(--phase) 8%, var(--bg1)); }
.rot-detail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); border-bottom: 1px solid var(--line); padding-bottom: var(--space-5); }
.rot-detail-metrics span { display: block; color: var(--t3); font-size: var(--text-base); }
.rot-detail-metrics strong { display: block; font: 600 var(--text-3xl) var(--mono); margin-top: var(--space-2); }
.rot-compare-title { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-xs); color: var(--t3); margin-top: var(--space-5); align-items: center; }
.rot-compare-title span:last-child { margin-left: auto; }
.rot-sector-key, .rot-market-key { display: inline-block; width: var(--space-5); height: 2px; vertical-align: middle; margin-right: var(--space-2); background: var(--accent); }
.rot-market-key { background: var(--t3); }
.rot-comparison { width: 100%; display: block; }
.rot-sector-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.rot-benchmark-line { stroke: var(--t3); stroke-width: 1.5; fill: none; stroke-dasharray: 4 3; }
.rot-gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.rot-breadth-head { display: flex; align-items: baseline; gap: var(--space-3); margin-top: var(--space-5); font-size: var(--text-base); color: var(--t2); }
.rot-breadth-head strong { font: 600 var(--text-xl) var(--mono); margin-left: auto; color: var(--t1); }
.rot-breadth-head small { font-family: var(--mono); color: var(--t3); }
.rot-meter { height: var(--space-2); background: var(--bg3); border-radius: var(--radius-pill); margin-top: var(--space-3); overflow: hidden; }
.rot-meter span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.rot-members { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.rot-members summary { cursor: pointer; font-size: var(--text-base); color: var(--t2); }
.rot-members summary span { color: var(--t3); font-size: var(--text-xs); margin-left: var(--space-2); }
.rot-members ul { margin: var(--space-3) 0; padding: 0; list-style: none; }
.rot-members li { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: var(--text-base); }
.rot-members li b { font-family: var(--mono); font-weight: 500; color: var(--t3); }
.rot-members li strong { margin-left: auto; font-family: var(--mono); }
.rot-members li small { color: var(--t3); }
.rot-ranking { padding: 0; overflow: hidden; }
.rot-table-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-5); padding: var(--space-7); }
.rot-filters { display: flex; align-items: center; gap: var(--space-3); }
.rot-search, .rot-select { font: inherit; font-size: var(--text-base); min-height: var(--ctrl-lg); background: var(--bg1); color: var(--t1); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.rot-search { width: 10em; }
.rot-search:focus-visible, .rot-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rot-table-wrap { width: 100%; overflow-x: auto; }
.rot-mobile-hint { display: none; }
#rot-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); white-space: nowrap; font-variant-numeric: tabular-nums; }
#rot-table th, #rot-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); text-align: right; }
#rot-table thead th { background: var(--bg2); color: var(--t2); font-weight: 500; }
#rot-table th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--bg1); padding-left: var(--space-5); }
#rot-table thead th:first-child { background: var(--bg2); }
#rot-table tbody th { font-weight: 500; }
#rot-table td { font-family: var(--mono); }
#rot-table td:nth-child(2) { font-family: var(--sans); }
#rot-table tbody tr.is-selected { background: color-mix(in srgb, var(--accent) 5%, transparent); }
#rot-table tbody tr.is-selected th:first-child { box-shadow: inset 3px 0 var(--accent); background: var(--bg2); }
#rot-table tbody tr:hover { background: var(--bg-hover); }
.btn.rot-sort { padding: var(--space-2) 0; background: transparent; border: none; box-shadow: none; font-size: var(--text-base); white-space: nowrap; min-height: var(--ctrl-md); }
.btn.rot-name { display: flex; align-items: center; gap: var(--space-4); width: 100%; padding: var(--space-2) 0; background: transparent; border: none; box-shadow: none; font-size: var(--text-md); white-space: nowrap; min-height: var(--ctrl-md); text-align: left; }
.rot-rank { min-width: 2ch; color: var(--t3); font: 500 var(--text-base) var(--mono); text-align: right; }
.rot-score { display: inline-block; min-width: 4em; padding-bottom: var(--space-2); position: relative; }
.rot-score > span { position: absolute; height: 2px; bottom: 0; left: 0; background: var(--accent); opacity: .55; border-radius: var(--radius-pill); }
.rot-breadth-cell { display: inline-flex; flex-direction: column; gap: var(--space-1); }
.rot-breadth-cell small { font-size: var(--text-xs); color: var(--t3); }
.rot-no-results { text-align: center; padding: var(--space-9); color: var(--t3); }
.rot-methods { margin-top: var(--space-7); color: var(--t2); }
.rot-methods summary { cursor: pointer; font-size: var(--text-md); font-weight: 600; }
.rot-methods p { line-height: 1.8; font-size: var(--text-base); margin: var(--space-5) 0; }
.rot-methods a { color: var(--accent); }
.rot-empty { padding: var(--space-12); text-align: center; color: var(--t2); line-height: 1.8; }
#rotation-root .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
  .rot-overview { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .rot-summary-names { font-size: var(--text-xs); }
  .rot-detail-metrics strong { font-size: var(--text-2xl); }
}
@media (max-width: 768px) {
  #rotation-root { padding: var(--space-5) var(--space-4) var(--space-9); }
  .rot-header { align-items: flex-start; flex-wrap: wrap; gap: var(--space-4); }
  .rot-header h2 { font-size: var(--text-2xl); }
  .rot-summaries { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .rot-overview { grid-template-columns: minmax(0, 1fr); }
  .rot-market-strip { gap: var(--space-3) var(--space-5); }
  .rot-date { margin-left: 0; }
  .rot-detail-metrics strong { font-size: var(--text-3xl); }
  .rot-comparison { max-height: 10rem; }
  .rot-chart-caption { font-size: var(--text-sm); }
  .rot-table-head { align-items: flex-start; }
  .rot-filters { width: 100%; }
  .rot-mobile-hint { display: block; padding: 0 var(--space-5); margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--t3); }
  .rot-search { flex: 1; min-width: 0; }
  .rot-note { font-size: var(--text-base); }
  .btn.rot-name, .btn.rot-sort { min-height: var(--ctrl-xl); }
}
@media (max-width: 420px) {
  .rot-panel { padding: var(--space-5); }
  .rot-ranking { padding: 0; }
  .rot-table-head { padding: var(--space-5); }
  .rot-header h2 span { font-size: var(--text-xs); }
  .rot-quadrant { font-size: var(--text-base); }
  .rot-quadrant span { display: none; }
  .rot-header p { font-size: var(--text-base); }
  .rot-chart-caption { padding: 0; }
  .rot-summary-hint { font-size: var(--text-sm); }
}
