#panel-player-performance {
  --performance-control-height: 36px;
  min-width: 0;
}
.performance-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.performance-fields label,
.performance-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: #475467;
  font-size: 13px;
}
.performance-fields input,
.performance-fields select,
.performance-field button,
.performance-actions button {
  box-sizing: border-box;
  height: var(--performance-control-height);
  min-width: 0;
  margin: 0;
  font-size: 13px;
}
.performance-fields input,
.performance-fields select {
  width: 100%;
  padding: 4px 8px;
  color: #182230;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
}
.performance-field button {
  width: 100%;
  padding-inline: 8px;
  border-color: #d0d5dd;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.performance-field button::after { content: '▾'; }
.performance-field button.performance-has-selection { border-color: #a8c4f1; color: #1749a6; }
.performance-field button span { display: block; overflow: hidden; text-overflow: ellipsis; }
.performance-bases { margin-top: 12px; }
.performance-bases[hidden] { display: none; }
.performance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.performance-actions button[type=submit] { width: 96px; }
.performance-actions [aria-pressed=true] { background: #e9f0ff; color: #1749a6; }
.performance-status {
  min-height: 24px;
  padding-top: 6px;
  font-size: 13px;
  color: #475467;
}
.performance-status[data-state=error] { color: #a3241c; }
.performance-scope { margin-bottom: 8px; color: #475467; font-size: 13px; }
.performance-coverage { margin-bottom: 10px; color: #475467; font-size: 13px; }
.performance-coverage ul { padding-left: 20px; margin-top: 6px; }
.performance-cp { margin-top: 18px; min-width: 0; }
.performance-cp + .performance-cp { padding-top: 14px; border-top: 1px solid #e4e7ec; }
.performance-cp h2 { margin: 0 0 3px; font-size: 15px; overflow-wrap: anywhere; }
.performance-cp-scope { margin: 0 0 7px; color: #475467; font-size: 12px; }
.performance-scroll { max-width: 100%; overflow: auto; }
.performance-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.performance-table th,
.performance-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eaecf0;
  text-align: left;
  overflow-wrap: anywhere;
}
.performance-table thead { background: #f7f9fc; color: #344054; }
.performance-table thead th { font-size: 13px; }
.performance-table .performance-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.performance-table thead .performance-number {
  min-width: 65px;
  white-space: normal;
}
.performance-table thead th:first-child { min-width: 30px; }
.performance-table thead th:nth-child(2) { min-width: 80px; }
.performance-table .performance-summary {
  background: #fbfcfe;
  color: #475467;
}
.performance-summary th, .performance-summary td { padding-block: 5px; font-size: 11px; }
.performance-summary th { font-weight: 500; }
.performance-good, .performance-bad {
  text-decoration: underline dashed;
  text-underline-offset: 3px;
}
.performance-good { color: #14744a; }
.performance-bad { color: #b42318; }
.performance-picker {
  width: min(440px, calc(100vw - 32px));
  max-height: min(540px, calc(100dvh - 32px));
  box-sizing: border-box;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 0;
  background: #fff;
  color: #182230;
  box-shadow: 0 16px 40px #18223028;
}
.performance-picker[open] { display: flex; flex-direction: column; }
.performance-picker::backdrop { background: #18223055; }
.performance-picker-head, .performance-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
}
.performance-picker-head { justify-content: space-between; border-bottom: 1px solid #eaecf0; }
.performance-picker-head h2 { margin: 0; font-size: 15px; }
.performance-picker-actions { justify-content: flex-end; border-top: 1px solid #eaecf0; }
.performance-picker-head button, .performance-picker-actions button { min-height: var(--performance-control-height); }
.performance-picker-list { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px 16px; }
.performance-picker-option {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 4px 6px;
  margin: 0;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.performance-picker-option:hover, .performance-picker-option:focus-within { background: #f4f7fb; }
.performance-picker-option input[type=checkbox] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}
.performance-picker-option input[type=checkbox]:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
.performance-picker-option span { min-width: 0; }
.performance-metric-picker {
  width: max-content;
  max-width: min(1200px, calc(100% - 32px));
}
.performance-metric-picker .performance-picker-list {
  padding: 0;
  scroll-padding-inline-start: 160px;
}
.performance-metric-matrix {
  width: calc(160px + 132px * var(--performance-metric-count));
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.performance-metric-matrix th,
.performance-metric-matrix td {
  border-right: 1px solid #eaecf0;
  border-bottom: 1px solid #eaecf0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.performance-metric-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
  background: #f7f9fc;
}
.performance-metric-matrix th:first-child {
  position: sticky;
  left: 0;
  text-align: left;
}
.performance-metric-matrix thead th:first-child { width: 160px; padding: 8px 10px; z-index: 3; }
.performance-metric-matrix tbody th {
  z-index: 1;
  padding: 8px 10px;
  font-weight: 500;
  background: #fff;
}
.performance-metric-matrix .performance-picker-option { padding-inline: 10px; }
.performance-metric-matrix .performance-metric-cell { justify-content: center; }
.performance-metric-unavailable { color: #667085; background: #f7f9fc; }
@media (max-width: 800px) {
  .performance-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #panel-player-performance { padding: 14px 12px; }
  #panel-player-performance > .card { padding: 12px; }
  .performance-fields { grid-template-columns: minmax(0, 1fr); }
}
#gads-player-performance-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}
#gads-player-performance-tab.active { border-bottom-color: #1a73e8; }
