/* Read-only relation analysis uses the existing Studio palette and controls. */
html[data-theme="studio"] .relations-view {display:grid; gap:20px; min-width:0;}
html[data-theme="studio"] .relations-view > *,
html[data-theme="studio"] .relations-view :is(.relations-detail-bottom > *, .relations-stat-value) {min-width:0;}
html[data-theme="studio"] .relations-controls {display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end;}
html[data-theme="studio"] .relations-controls .field {display:flex; flex-direction:column; align-items:stretch; gap:6px; flex:1 1 150px; min-width:0; max-width:320px;}
html[data-theme="studio"] .relations-controls .field > span,
html[data-theme="studio"] .relations-list-filters .field > span {white-space:nowrap;}
html[data-theme="studio"] .relations-controls .field:first-child {flex-basis:220px;}
html[data-theme="studio"] .relations-view .field select {width:100%; min-width:0; max-width:100%;}
html[data-theme="studio"] .relations-baseline {display:grid; grid-template-columns:1.2fr repeat(4,minmax(0,1fr)); align-items:center; gap:18px; padding:22px 24px; border:1px solid var(--line); border-radius:10px; background:#fff;}
html[data-theme="studio"] .relations-baseline > div {display:flex; flex-direction:column; gap:5px; min-width:0;}
html[data-theme="studio"] .relations-baseline-title {align-items:flex-start; font-weight:600; font-size:14px;}
html[data-theme="studio"] .relations-baseline strong {font-size:20px; line-height:1.5; font-weight:650; font-variant-numeric:tabular-nums;}
html[data-theme="studio"] .relations-stat-label {color:var(--muted); font-size:12px;}
html[data-theme="studio"] .relations-small-sample {display:inline-flex; align-items:center; padding:2px 6px; border-radius:4px; color:#846329; background:#fcf4e6; font-size:10px; line-height:1.5; font-weight:500; white-space:nowrap;}
html[data-theme="studio"] .relations-roster-card {padding:0; overflow:hidden;}
html[data-theme="studio"] .relations-roster-tools {padding:18px 20px; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:18px; border-bottom:1px solid var(--line);}
html[data-theme="studio"] .relations-tabs {display:flex; flex-wrap:wrap; gap:5px; min-width:0;}
html[data-theme="studio"] .relations-tab {border:0; border-radius:6px; background:transparent; color:#61728d; font-size:13px; padding:10px 12px; min-height:40px; cursor:pointer; white-space:nowrap; font-weight:600;}
html[data-theme="studio"] .relations-tab:hover {background:#f5f7fb;}
html[data-theme="studio"] .relations-tab.active {background:var(--c-blue-soft); color:var(--c-blue);}
html[data-theme="studio"] .relations-list-filters {display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; min-width:0;}
html[data-theme="studio"] .relations-list-filters .field {display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:0;}
html[data-theme="studio"] .relations-search input {width:200px; max-width:100%; min-width:0; height:40px; padding:9px 12px;}
html[data-theme="studio"] .relations-roster-scroll {max-height:430px; overflow:auto;}
html[data-theme="studio"] .relations-roster-scroll table {min-width:740px; margin:0;}
html[data-theme="studio"] .relations-roster-scroll thead th {position:sticky; top:0; z-index:1;}
html[data-theme="studio"] .relations-roster-scroll td {padding-top:11px; padding-bottom:11px;}
html[data-theme="studio"] .relations-target-button {display:flex; align-items:center; flex-wrap:wrap; gap:9px; min-height:40px; border:0; background:transparent; color:inherit; text-align:left; padding:0; max-width:300px; font-weight:600; font-size:14px; cursor:pointer;}
html[data-theme="studio"] .relations-target-button:hover {color:var(--c-blue);}
html[data-theme="studio"] .relations-player-name {display:inline-flex; align-items:center; gap:9px; min-width:0; overflow-wrap:anywhere; white-space:normal;}
html[data-theme="studio"] .relations-player-name > [role="img"] {display:inline-flex; flex-shrink:0;}
html[data-theme="studio"] .relations-row-selected {background:#f0f5ff; box-shadow:inset 3px 0 var(--c-blue);}
html[data-theme="studio"] tbody .relations-row-selected:hover {background:#eaf1ff;}
html[data-theme="studio"] .relations-record, html[data-theme="studio"] .relations-stat-value {display:inline-flex; flex-direction:column; gap:3px; font-variant-numeric:tabular-nums;}
html[data-theme="studio"] .relations-sample {display:block; font-size:10px; font-weight:400; color:var(--muted); line-height:1.5;}
html[data-theme="studio"] .relations-roster-delta {color:#61728d;}
html[data-theme="studio"] .relations-detail {padding:24px;}
html[data-theme="studio"] .relations-detail-heading {display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:20px;}
html[data-theme="studio"] .relations-detail-heading h2 {font-size:18px; margin:0; overflow-wrap:anywhere; min-width:0;}
html[data-theme="studio"] .relations-detail-count {display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; flex-shrink:0; color:#536986; font-size:13px;}
html[data-theme="studio"] .relations-metrics-table {min-width:620px; margin:0; table-layout:fixed;}
html[data-theme="studio"] .relations-metrics-table th:first-child {width:34%;}
html[data-theme="studio"] .relations-metrics-table tbody th {font-size:13px; font-weight:500; background:#fff; color:#5b6c84; border-bottom:1px solid #eaf0f5; white-space:normal;}
html[data-theme="studio"] .relations-metrics-table td {padding-top:15px; padding-bottom:15px; vertical-align:top;}
html[data-theme="studio"] .relations-metric-condition {font-weight:650; color:var(--c-blue);}
html[data-theme="studio"] .relations-value-track {display:block; height:4px; background:#edf1f7; border-radius:5px; overflow:hidden; margin-top:7px;}
html[data-theme="studio"] .relations-value-fill {display:block; height:100%; border-radius:inherit;}
html[data-theme="studio"] .relations-fill-condition {background:#6086d6;}
html[data-theme="studio"] .relations-fill-baseline {background:#b9c5d9;}
html[data-theme="studio"] .relations-metric-delta {font-size:13px; font-weight:500;}
html[data-theme="studio"] .relations-metrics-table .relations-delta-favorable {color:#367463;}
html[data-theme="studio"] .relations-metrics-table .relations-delta-unfavorable {color:#9a6573;}
html[data-theme="studio"] .relations-detail > .copy-help {margin-top:12px;}
html[data-theme="studio"] .relations-detail-bottom {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:26px; margin-top:26px; padding-top:22px; border-top:1px solid var(--line);}
html[data-theme="studio"] .relations-section-heading {display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px;}
html[data-theme="studio"] .relations-section-heading h3 {font-size:14px; margin:0;}
html[data-theme="studio"] .relations-section-heading > span {font-size:11px; color:var(--muted);}
html[data-theme="studio"] .relations-cohorts table {min-width:340px; margin:0;}
html[data-theme="studio"] .relations-cohorts :is(th,td) {font-size:12px; padding:12px 10px;}
html[data-theme="studio"] .relations-match-list {list-style:none; padding:0; margin:0; max-height:360px; overflow:auto;}
html[data-theme="studio"] .relations-match-list li + li {border-top:1px solid #eaf0f5;}
html[data-theme="studio"] .relations-match-button {display:flex; align-items:center; gap:12px; width:100%; background:transparent; border:0; text-align:left; color:inherit; cursor:pointer; padding:12px 2px; font-size:12px;}
html[data-theme="studio"] .relations-match-button:hover {background:#f6f9ff;}
html[data-theme="studio"] .relations-match-main {display:flex; flex-direction:column; gap:8px; min-width:0; flex:1;}
html[data-theme="studio"] .relations-match-main strong {font-size:12px; font-weight:500; overflow-wrap:anywhere;}
html[data-theme="studio"] .relations-match-meta {display:flex; gap:12px; align-items:center; flex-wrap:wrap; color:var(--muted); font-size:11px;}
html[data-theme="studio"] .relations-match-result {font-size:12px; color:var(--muted);}
html[data-theme="studio"] .relations-match-result.is-win {color:#396ea8;}
html[data-theme="studio"] .relations-match-result.is-loss {color:#ac5e74;}
html[data-theme="studio"] .relations-warnings {color:#846329; font-size:12px; line-height:1.7;}
html[data-theme="studio"] .relations-warnings p {margin:0;}
html[data-theme="studio"] .relations-view :is(button, input, select, summary):focus-visible {outline:2px solid #6387cb; outline-offset:3px;}
@media (max-width:1100px) {
  html[data-theme="studio"] .relations-detail-bottom {grid-template-columns:minmax(0,1fr);}
}
@media (max-width:720px) {
  html[data-theme="studio"] .relations-view {gap:16px;}
  html[data-theme="studio"] .relations-controls {gap:10px;}
  html[data-theme="studio"] .relations-controls .field:first-child {flex-basis:100%; max-width:none;}
  html[data-theme="studio"] .relations-controls .field {flex-basis:calc(50% - 5px); max-width:none;}
  html[data-theme="studio"] .relations-baseline {grid-template-columns:repeat(2,minmax(0,1fr)); padding:17px; gap:15px;}
  html[data-theme="studio"] .relations-baseline .relations-baseline-title {grid-column:1/-1; flex-direction:row; align-items:center; gap:8px;}
  html[data-theme="studio"] .relations-baseline strong {font-size:18px;}
  html[data-theme="studio"] .relations-roster-tools {padding:13px; gap:12px;}
  html[data-theme="studio"] .relations-tabs {display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px;}
  html[data-theme="studio"] .relations-tab {font-size:12px; padding:10px 7px;}
  html[data-theme="studio"] .relations-list-filters {width:100%; gap:10px;}
  html[data-theme="studio"] .relations-list-filters .field {flex:1 1 120px;}
  html[data-theme="studio"] .relations-search input {width:100%;}
  html[data-theme="studio"] .relations-roster-scroll {max-height:360px;}
  html[data-theme="studio"] .relations-target-button {font-size:13px;}
  html[data-theme="studio"] .relations-detail {padding:16px;}
  html[data-theme="studio"] .relations-detail-heading {align-items:flex-start; gap:10px; margin-bottom:16px;}
  html[data-theme="studio"] .relations-detail-heading h2 {font-size:15px;}
  html[data-theme="studio"] .relations-detail-count {max-width:85px; font-size:12px;}
  html[data-theme="studio"] .relations-metrics-table {min-width:0; width:100%; table-layout:fixed;}
  html[data-theme="studio"] .relations-metrics-table th:first-child {width:29%;}
  html[data-theme="studio"] .relations-metrics-table thead th:not(:first-child) {width:23.6667%;}
  html[data-theme="studio"] .relations-metrics-table :is(th,td),
  html[data-theme="studio"] .relations-metrics-table tbody th {padding:11px 5px; font-size:12px; line-height:1.55; white-space:normal; overflow-wrap:anywhere;}
  html[data-theme="studio"] .relations-metrics-table th {word-break:keep-all; overflow-wrap:normal;}
  html[data-theme="studio"] .relations-metrics-table .relations-stat-value {max-width:100%;}
  html[data-theme="studio"] .relations-metrics-table .relations-sample {font-size:9px;}
  html[data-theme="studio"] .relations-detail-bottom {gap:22px; margin-top:20px; padding-top:20px;}
}
/* Keep avatar line boxes stable while their image fallback disappears after load. */
.relations-player-name > [role="img"] {display:inline-flex;flex-shrink:0;}
