/* Dynamic organiser-only Q/SF/F performance analysis */

.performance-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}
.performance-summary-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 8px 0 16px;
  padding: 13px 16px;
  border: 1px solid #dedede;
  border-radius: 14px;
  background: #fff;
}
.performance-summary-strip > div:first-child { display: grid; gap: 2px; }
.performance-summary-strip span, .performance-summary-strip small { color: #6b6b6b; }
.performance-alerts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.performance-alert {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #f7f7f7;
  color: #383838 !important;
  font-size: 11px;
  letter-spacing: .02em;
}
.performance-alert.red { border-color: #f0b9b9; background: #fff0f0; color: #8c2020 !important; }
.performance-alert.yellow { border-color: #ead17f; background: #fff8db; color: #705800 !important; }
.performance-alert.info { border-color: #b9d4ee; background: #eef7ff; color: #245477 !important; }
.performance-no-alerts { font-size: 12px; }
.performance-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.performance-hero-card {
  display: grid;
  gap: 5px;
  min-height: 145px;
  padding: 18px;
  border: 1px solid #dedede;
  border-radius: 16px;
  background: #fff;
}
.performance-hero-card h3 { margin: 3px 0 2px; font-size: 22px; }
.performance-hero-card strong { font-size: 28px; line-height: 1; }
.performance-hero-card small { color: #6e6e6e; }
.performance-table-card {
  border: 1px solid #ddd;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.performance-table-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid #eee;
}
.performance-table-head h2 { margin: 3px 0 0; }
.performance-table-head small { color: #777; }
.performance-table td small { display: block; margin-top: 2px; color: #777; }
.performance-kart-table > tbody > tr:not(.performance-detail-row) > td { vertical-align: top; }
.performance-kart-name { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.performance-kart-name > b { font-size: 17px; }
.performance-status,
.performance-mini-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  background: #f4f4f4;
  padding: 4px 8px;
  color: #444;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1;
  white-space: nowrap;
}
.performance-status.fast, .performance-mini-badge.fast { border-color: #acd8c1; background: #edf9f2; color: #17623b; }
.performance-status.slow, .performance-mini-badge.slow { border-color: #efbcbc; background: #fff0f0; color: #8e2525; }
.performance-status.normal, .performance-mini-badge.neutral { border-color: #d7d7d7; background: #f4f4f4; color: #555; }
.performance-trend { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.performance-trend b { font-size: 17px; line-height: .8; }
.performance-trend.red { color: #a82020; }
.performance-trend.yellow { color: #806200; }
.performance-exclude { max-width: 190px; white-space: normal; line-height: 1.2; }
.performance-exclude.btn.danger { border-color: #efc6c6; background: #fff3f3; color: #8f2e2e; }
.performance-exclusion-reason { max-width: 190px; margin-top: 6px !important; font-style: italic; }
.performance-excluded-row:not(.performance-detail-row) { background: #f8f8f8; opacity: .78; }
.performance-positive { font-weight: 900; }
.performance-negative { font-weight: 800; opacity: .78; }
.performance-detail-row > td { padding: 0 !important; border-top: 0 !important; }
.performance-run-details { padding: 8px 18px 12px; background: #fafafa; }
.performance-run-details summary { cursor: pointer; font-weight: 700; color: #555; }
.performance-run-details .table-wrap { margin-top: 10px; }
.performance-run-details table { background: #fff; }
.performance-detail-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 0; color: #666; font-size: 11px; }
.performance-kart-details td { vertical-align: top; }
.performance-kart-details td small { white-space: nowrap; }
.performance-method {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f5f5f5;
}
.performance-method span, .performance-method small { color: #666; }
.performance-empty {
  display: grid;
  gap: 5px;
  padding: 22px;
  border: 1px dashed #ccc;
  border-radius: 14px;
  background: #fff;
}
.performance-empty span { color: #777; }

@media (max-width: 1000px) {
  .performance-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {

  .performance-summary-strip, .performance-table-head { align-items: flex-start; flex-direction: column; }
  .performance-alerts { justify-content: flex-start; }
  .performance-tabs .btn { flex: 1; }
}

.performance-rank-cell{width:58px;text-align:center;font-size:18px;font-variant-numeric:tabular-nums}
.performance-rank-top:not(.performance-detail-row){background:#fffdf1}
.performance-status.nodata{border-color:#ddd;background:#f5f5f5;color:#888}


/* Alpha 12.108 — use the ordinary analysis surface. */
#module-performance, #module-performance *{font-family:var(--ui-font)}
.performance-shell .performance-tabs{margin:0 0 20px;gap:0;width:fit-content}
.performance-shell .race-karts-summary{width:100%;margin:0 0 20px;box-sizing:border-box}
.performance-shell .performance-table-card{width:100%;min-height:0;border-color:var(--line);border-radius:var(--radius);box-sizing:border-box}
.performance-shell .performance-summary-strip{margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:#fafaf9}
.performance-shell .performance-kart-table > tbody > tr:not(.performance-detail-row) > td{vertical-align:middle}
.performance-shell .performance-kart-row:hover{background:#fafafa}
.performance-shell .performance-exclude{display:inline-flex;align-items:center;justify-content:center;max-width:none}
.performance-shell .performance-detail-summary{padding:12px 18px;margin:0}
.performance-shell .performance-detail-row[hidden]{display:none}
.performance-details-toggle{border:1px solid var(--line);border-radius:4px;background:#fff;color:var(--text);padding:4px 6px;font-size:11px;cursor:pointer}
.performance-details-toggle:hover,.performance-details-toggle[aria-expanded="true"]{background:#f1f1ef}
.performance-shell button:focus-visible,.performance-shell summary:focus-visible{outline:2px solid var(--ok-red);outline-offset:3px}
.performance-shell .performance-method{display:block;border-radius:var(--radius);margin-top:20px}
.performance-method summary{cursor:pointer;font-weight:800}
.performance-method > span,.performance-method > small{display:block;margin-top:8px}
.performance-shell .performance-hero-card{min-height:0;border-radius:var(--radius);gap:4px;padding:14px 16px}
.performance-shell .performance-hero-card h3{font-size:17px}
.performance-shell .performance-hero-card strong{font-size:20px}
.performance-hero-label{font-size:11px;font-weight:800}
@media(max-width:700px){.performance-shell .rank-table table{min-width:620px}.performance-shell .performance-tabs{width:100%}.performance-shell .performance-tabs button{flex:1}.performance-shell .table-wrap{touch-action:pan-x pan-y}}
