/* Matchup and map state controls. Navigation owns the shared sticky offset. */
.team-tab-tools > .tabs-matchup-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: stretch;
  gap: 7px;
  height: 100%;
}

.tabs-matchup-switcher__versus {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tabs-matchup-native { display: block; }
.tabs-matchup-native > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.tabs-matchup-native select {
  width: clamp(132px, 16vw, 210px);
  height: 30px;
  min-width: 0;
  padding: 0 26px 0 8px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  color: var(--ink-hi);
  background: var(--panel-2);
  font: inherit;
  font-size: 11px;
}

.tabs-matchup-native select:hover { border-color: var(--ink-3); }
.tabs-matchup-native select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tabs-matchup-native select:disabled { opacity: .65; cursor: wait; }

.tabs-matchup-custom { display: none; position: relative; align-items: stretch; height: 100%; }
.tabs-matchup-switcher.is-enhanced .tabs-matchup-native { display: none; }
.tabs-matchup-switcher.is-enhanced .tabs-matchup-custom { display: flex; }

.tabs-matchup-current {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 72px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid var(--accent);
  color: var(--ink-hi);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font: inherit;
  font-size: 12px;
  letter-spacing: .05em;
  white-space: nowrap;
  cursor: pointer;
}

.tabs-matchup-current i {
  width: 4px;
  height: 18px;
  border-radius: 2px;
}

.tabs-matchup-current b { font-weight: 750; }

.tabs-matchup-current svg {
  width: 15px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.tabs-matchup-current:hover,
.tabs-matchup-current[aria-expanded="true"] {
  background: color-mix(in srgb, var(--accent) 17%, transparent);
}

.tabs-matchup-current:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tabs-matchup-search-button {
  display: grid;
  width: 34px;
  height: 100%;
  place-items: center;
  border-bottom: 2px solid transparent;
  color: var(--ink-hi);
  background: color-mix(in srgb, var(--ink-hi) 7%, transparent);
}

.tabs-matchup-search-button:hover,
.tabs-matchup-search-button[aria-expanded="true"] {
  border-bottom-color: var(--accent);
  background: color-mix(in srgb, var(--ink-hi) 13%, transparent);
}

.tabs-matchup-search-button svg,
.tabs-matchup-search-field svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.tabs-matchup-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 48;
  width: min(350px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid var(--hair);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--r) var(--r);
  background: var(--raise);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .58);
}

.tabs-matchup-search-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--ink-3);
  border-radius: 3px;
  padding: 0 8px;
  color: var(--ink-2);
  background: var(--panel-2);
}

.tabs-matchup-search-field:focus-within { border-color: var(--accent); }
.tabs-matchup-search-field input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  outline: 0;
  color: var(--ink-hi);
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.tabs-matchup-options {
  display: grid;
  gap: 2px;
  max-height: min(56vh, 430px);
  margin-top: 7px;
  overflow-y: auto;
}

.tabs-matchup-options a {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--ink-2);
  text-transform: none;
}

.tabs-matchup-options a[hidden],
.tabs-matchup-empty[hidden] { display: none; }

.tabs-matchup-options a:hover,
.tabs-matchup-options a:focus-visible {
  border-color: var(--hair);
  color: var(--ink-hi);
  background: var(--panel-2);
}

.tabs-matchup-options a[aria-selected="true"] {
  color: var(--ink-hi);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
}

.tabs-matchup-options a > i { width: 4px; height: 24px; border-radius: 2px; }
.tabs-matchup-options a > span { display: grid; min-width: 0; }
.tabs-matchup-options a b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tabs-matchup-options a small { color: var(--ink-3); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.tabs-matchup-options a em {
  color: var(--ink-3);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tabs-matchup-empty { margin: 10px 4px 4px; color: var(--ink-3); font-size: 11px; }

.matchup-native-fallback {
  display: flex;
  align-items: end;
  gap: 8px;
}

.matchup-native-fallback label { display: grid; gap: 3px; color: var(--ink-3); font-size: 10px; }
.matchup-native-fallback select,
.matchup-native-fallback button {
  min-height: 32px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 5px 9px;
  color: var(--ink-hi);
  background: var(--panel-2);
  font: inherit;
  font-size: 11px;
}

.comparison-enhanced .matchup-native-fallback { display: none; }

.maps-native-fallback { display: flex; gap: 8px; margin: 12px 0; }
.maps-enhanced .maps-native-fallback { display: none; }
.team-tab-tools > .tabs-map-switcher {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}
.maps-native-fallback label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.maps-native-fallback select, .maps-native-fallback button {
  min-height: 36px;
  color: var(--ink-hi);
  background: var(--panel);
  border: 1px solid var(--hair);
}
.tabs-map-menu { position: relative; height: 100%; }
.tabs-map-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  min-width: 118px;
  padding: 0 10px;
  color: var(--ink-hi);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
  border-bottom: 2px solid var(--accent);
  transition: background 140ms ease;
}
.tabs-map-menu summary::-webkit-details-marker { display: none; }
.tabs-map-menu summary:hover, .tabs-map-menu[open] summary { background: color-mix(in srgb, var(--ink-hi) 6%, transparent); }
.tabs-map-menu svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tabs-map-menu .map-symbol { width: 16px; color: var(--accent); }
.tabs-map-menu .map-chevron { width: 13px; margin-left: auto; color: var(--ink-3); }
.tabs-map-menu[open] .map-chevron { transform: rotate(180deg); }
.tabs-map-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 272px;
  max-width: calc(100vw - 24px);
  padding: 7px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--raise);
  box-shadow: 0 12px 32px #0007;
}
.tabs-map-option { padding: 11px 10px; border-radius: 3px; color: var(--ink-2); font-size: 12px; }
.tabs-map-option:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--hair); border-radius: 0; }
.tabs-map-option:hover { background: var(--panel-2); color: var(--ink-hi); }
.tabs-map-option[aria-current] { color: var(--ink-hi); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tabs-map-option[aria-current]::after { content: "✓"; float: right; color: var(--accent); }
.tabs-map-sides { display: flex; align-items: center; gap: 2px; border-left: 1px solid var(--hair); padding-left: 12px; }
.tabs-map-side-label { color: var(--ink-3); font-size: 10px; margin-right: 5px; }
.tabs-map-sides a { padding: 6px 8px; border-radius: 3px; font-size: 11px; color: var(--ink-3); }
.tabs-map-sides a:hover { color: var(--ink-hi); background: var(--panel-2); }
.tabs-map-sides a[aria-current] { color: var(--ink-hi); background: color-mix(in srgb, var(--ink-hi) 10%, transparent); }
.tabs-map-menu summary:focus-visible, .tabs-map-option:focus-visible, .tabs-map-sides a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 760px) {
  .maps-enhanced { --team-tabs-height: 86px; }
  .maps-enhanced .team-tabs-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px 44px; }
  .maps-enhanced .team-tabs-wrap .tabs { justify-content: space-between; }
  .maps-enhanced .team-tabs-wrap .tabs a { padding-inline: 9px; font-size: 10px; }
  .maps-enhanced .team-tab-tools { padding-left: 0; border-top: 1px solid var(--hair); }
  .team-tab-tools > .tabs-map-switcher { width: 100%; justify-content: space-between; gap: 8px; }
  .tabs-map-menu summary { padding-left: 8px; }
  .tabs-map-options { left: 0; right: auto; }
  .tabs-map-sides { padding-left: 8px; }
  .tabs-map-sides a { padding: 8px; }
}

.opponent-directory { margin-top: 0; }
.opponent-directory > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  color: var(--ink-hi);
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.opponent-directory > summary::-webkit-details-marker { display: none; }
.opponent-directory > summary::before {
  content: "+";
  width: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.opponent-directory[open] > summary::before { content: "−"; }
.opponent-directory > .collide-pick { margin: 10px 0 0; }

.estimate-details {
  margin-top: 9px;
  border-top: 1px solid var(--hair);
  padding-top: 7px;
  color: var(--ink-3);
  font-size: 11px;
}

.estimate-details > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-underline-offset: 3px;
}

.estimate-details__rows {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  max-width: 58ch;
}

.estimate-details__rows > span {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 12px;
}

.estimate-details__rows b { color: var(--ink-2); font-weight: 600; }

#matchup-state .pp .pressure .ci { display: none; }
.pressure-legend { margin-top: 9px; }

[data-matchup-section],
#opponent-list {
  scroll-margin-top: calc(var(--sticky-context-offset, 90px) + 18px);
}

[data-map-section] {
  scroll-margin-top: calc(var(--sticky-context-offset, 90px) + 18px);
}

/* Values stay at their final geometry; only the marks enter. */
.comparison-enter .endbar .seg,
.comparison-enter .onedim .f,
.comparison-enter .ladder .pair i,
.comparison-enter .mapchip .f {
  animation: comparison-bar-in 440ms cubic-bezier(.2, .75, .25, 1) both;
  transform-origin: left center;
}

.comparison-enter .ladder .ba i { transform-origin: right center; }
.comparison-enter .pd,
.comparison-enter .srcdot {
  animation: comparison-mark-in 360ms ease-out both;
}

@keyframes comparison-bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes comparison-mark-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 720px) {
  .tabs-matchup-switcher__versus { display: none; }
  .tabs-matchup-native select { width: 142px; }
  .tabs-matchup-current { min-width: 64px; padding-inline: 7px; }


}

@media (max-width: 430px) {
  .tabs-matchup-native select { width: 128px; }
  .tabs-matchup-current { min-width: 58px; }
  .opponent-directory > summary { align-items: flex-start; flex-wrap: wrap; }
  .opponent-directory > summary .hint { flex-basis: calc(100% - 24px); margin-left: 24px; }
  .estimate-details__rows > span { grid-template-columns: minmax(0, 1fr); gap: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .comparison-enter .endbar .seg,
  .comparison-enter .onedim .f,
  .comparison-enter .ladder .pair i,
  .comparison-enter .mapchip .f,
  .comparison-enter .pd,
  .comparison-enter .srcdot {
    animation: none;
  }
}
