:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #d9dde3;
  --text: #1a1a1a;
  --muted: #66717f;
  --control-ink: #2563eb;
  --blue: #2563eb;
  --green: #087f5b;
  --amber: #b45309;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(26, 26, 26, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
}

button:hover {
  border-color: #aab5c4;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.primary {
  width: 100%;
  border-color: var(--control-ink);
  background: var(--control-ink);
  color: white;
  font-weight: 700;
}

button.primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

button.primary:disabled,
button.primary:disabled:hover {
  border-color: var(--border);
  background: #aab5c4;
}

button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-status {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: 174px;
  height: auto;
  flex: 0 0 auto;
  display: block;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scout-chat-widget {
  position: fixed;
  z-index: 18;
  right: 22px;
  bottom: 22px;
  pointer-events: none;
}

.scout-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.2), transparent 31%),
    linear-gradient(145deg, #2563eb 0%, #1d4ed8 50%, #172554 100%);
  color: #fff;
  box-shadow: 0 18px 38px rgba(30, 64, 175, 0.34), 0 5px 12px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.scout-chat-launcher:hover {
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 23px 46px rgba(30, 64, 175, 0.4), 0 7px 14px rgba(15, 23, 42, 0.22);
}

.scout-chat-launcher:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 4px;
}

.scout-bot-icon {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scout-chat-launcher .scout-bot-icon {
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.18));
}

.scout-chat-launcher-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #22c55e;
}

.scout-chat-launcher.has-update .scout-chat-launcher-dot {
  background: #f59e0b;
  animation: scout-chat-pulse 1.5s ease-in-out infinite;
}

.natural-search-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100dvh - 44px));
  min-height: 430px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26), 0 8px 20px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
  transform-origin: bottom right;
  animation: scout-chat-open 180ms ease-out;
}

.natural-search-heading {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(96, 165, 250, 0.32), transparent 48%),
    linear-gradient(135deg, #0f172a 0%, #172554 52%, #1d4ed8 130%);
  color: #fff;
}

.scout-chat-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.header-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.header-avatar .scout-bot-icon {
  width: 29px;
  height: 29px;
}

.natural-search-title {
  min-width: 0;
  flex: 1 1 auto;
}

.natural-search-title h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.natural-search-title p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
}

.scout-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

.natural-search-heading-actions {
  display: flex;
  gap: 5px;
}

.natural-search-icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
}

.natural-search-icon-button:hover,
.natural-search-icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.natural-search-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.natural-search-conversation {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 15px 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(219, 234, 254, 0.65), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%);
  scroll-behavior: smooth;
}

.natural-chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.natural-chat-message.user {
  justify-content: flex-end;
}

.natural-chat-message .scout-chat-avatar {
  width: 29px;
  height: 29px;
  border: 1px solid #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.natural-chat-message .scout-chat-avatar .scout-bot-icon {
  width: 20px;
  height: 20px;
}

.natural-chat-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 15px 15px 15px 4px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.06);
  font-size: 13px;
  line-height: 1.46;
}

.natural-chat-message.user .natural-chat-bubble {
  border-color: #2563eb;
  border-radius: 15px 15px 4px 15px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.natural-chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.natural-chat-message.error .natural-chat-bubble {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.natural-chat-message.loading .natural-chat-bubble {
  color: var(--muted);
}

.natural-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.natural-chat-suggestion {
  padding: 6px 9px;
  border-color: #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 750;
}

.natural-chat-suggestion:hover {
  border-color: #60a5fa;
  background: #dbeafe;
}

.natural-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.natural-search-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}

.natural-search-chip.assumption {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.natural-search-chip.unsupported {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.natural-search-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 7px;
  vertical-align: middle;
}

.natural-search-typing i,
.natural-search-send-loader i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  animation: scout-typing 1s ease-in-out infinite;
}

.natural-search-typing i:nth-child(2),
.natural-search-send-loader i:nth-child(2) {
  animation-delay: 120ms;
}

.natural-search-typing i:nth-child(3),
.natural-search-send-loader i:nth-child(3) {
  animation-delay: 240ms;
}

.natural-search-form {
  padding: 12px 13px 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.natural-search-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 5px 5px 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.natural-search-row:focus-within {
  border-color: #60a5fa;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.natural-search-row textarea {
  min-width: 0;
  min-height: 34px;
  max-height: 104px;
  flex: 1 1 auto;
  resize: none;
  overflow-y: auto;
  padding: 8px 0 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.natural-search-row textarea::placeholder {
  color: #7c8796;
}

.natural-search-send {
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: #2563eb;
  border-radius: 11px;
  background: #2563eb;
  color: #fff;
}

.natural-search-send:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.natural-search-send:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.natural-search-send svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.natural-search-send-loader {
  display: none;
  align-items: center;
  gap: 3px;
}

.natural-search-send.is-loading .natural-search-send-icon {
  display: none;
}

.natural-search-send.is-loading .natural-search-send-loader {
  display: flex;
}

.natural-search-input-hint {
  margin: 6px 2px 0;
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
}

@keyframes scout-chat-open {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scout-chat-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0.18);
  }
}

@keyframes scout-typing {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .natural-search-panel,
  .scout-chat-launcher,
  .natural-search-typing i,
  .natural-search-send-loader i,
  .scout-chat-launcher.has-update .scout-chat-launcher-dot {
    animation: none;
    scroll-behavior: auto;
    transition: none;
  }
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-menu-trigger {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-2);
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  border-color: var(--blue);
  background: #eef6ff;
  color: var(--blue);
}

.user-menu-trigger svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-menu-popover {
  position: absolute;
  z-index: 15;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu-popover button {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  text-align: left;
}

.user-menu-popover button:hover,
.user-menu-popover button:focus-visible {
  background: var(--surface-2);
}

.user-menu-separator {
  height: 1px;
  margin: 3px 5px;
  background: var(--border);
}

.user-menu-popover .user-menu-logout {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-form {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(520px, 1fr) minmax(310px, 410px);
  gap: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.filters,
.results-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-field {
  display: grid;
  gap: 5px;
}

.player-team-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.player-team-search-row .primary {
  width: auto;
  min-width: 48px;
  padding-inline: 12px;
}

.filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.league-select-row {
  display: grid;
  gap: 6px;
}

.league-select-row button {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  white-space: nowrap;
}

.selected-leagues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.league-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.league-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-chip button {
  width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.trait-header,
.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trait-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trait-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.trait-actions button {
  padding: 5px 8px;
  font-size: 12px;
}

.trait-actions button.primary {
  width: auto;
  min-width: 72px;
}

.trait-controls {
  display: grid;
  gap: 8px;
}

.trait-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.trait-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.trait-row input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

.trait-row input[type="number"] {
  min-height: 30px;
  padding: 4px 6px;
}

.trait-percent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  gap: 4px;
  align-items: center;
}

.trait-percent input {
  text-align: right;
}

.trait-percent span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trait-percent input:disabled {
  background: #eef2f6;
  color: var(--muted);
}

.results-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.result-toolbar {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.result-toolbar strong {
  display: block;
  font-size: 15px;
}

.result-toolbar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.result-toolbar label {
  width: 150px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #eef6ff;
}

.top-explanation-cell {
  max-width: 330px;
}

.top-explanation-text {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.player-name {
  font-weight: 800;
}

.player-cell,
.detail-player,
.team-cell,
.entity-line,
.entity-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-cell {
  gap: 8px;
}

.player-copy {
  min-width: 0;
}

.player-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #e8f5ef;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.player-avatar.large {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 16px;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.asset-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.asset-icon.flag {
  width: 22px;
  height: 16px;
  flex-basis: 22px;
  border-radius: 3px;
}

.asset-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.score-pill {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f5ef;
  color: var(--green);
  font-weight: 800;
}

.score-pill.relative {
  background: #eef6ff;
  color: #2563eb;
}

.score-pill.global {
  background: #eef2f7;
  color: #334155;
}

.lookup-unranked {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.rating-cell,
.detail-rating {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.detail-rating {
  justify-content: flex-end;
}

#detailTrend:empty {
  display: none;
}

.rating-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.rating-trend.up {
  background: #e8f5ef;
  color: var(--green);
}

.rating-trend.down {
  background: #fff0ef;
  color: var(--danger);
}

.trend-symbol {
  line-height: 1;
}

.detail-panel {
  min-width: 0;
  padding: 14px;
  overflow: auto;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
}

.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.detail-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-actions button {
  flex: 1 1 110px;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.detail-actions button.primary {
  width: auto;
  min-width: 82px;
}

.detail-action-status {
  min-height: 17px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.detail-action-status.error {
  color: var(--danger);
}

.compare-status {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compare-status.error {
  color: var(--danger);
}

.compare-tray {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.compare-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.compare-tray-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-tray-actions button {
  min-height: 30px;
  width: auto;
  min-width: 82px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.compare-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.compare-chip {
  display: inline-grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  max-width: 100%;
  gap: 7px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.compare-chip .player-avatar {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 10px;
}

.compare-chip span:not(.player-avatar) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip button {
  width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.detail-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.detail-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-sections {
  display: grid;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.event-profile {
  display: grid;
  padding-top: 12px;
}

.event-profile:empty {
  display: none;
}

.event-profile-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe0d8;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdfc, #f4f9f6);
}

.event-profile-card.compact {
  gap: 7px;
}

.event-profile-heading,
.event-network-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.event-profile-heading h3,
.event-network-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.event-profile-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-coverage {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8f5ef;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.event-coverage.limited,
.event-coverage.low {
  background: #fff7ed;
  color: var(--amber);
}

.event-coverage.unavailable {
  background: var(--surface-2);
  color: var(--muted);
}

.event-profile-note,
.event-network-heading span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.event-network-heading {
  align-items: baseline;
  margin-top: 3px;
}

.event-profile-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.event-profile-tabs button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.event-profile-tabs button.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.event-profile-visual {
  overflow: hidden;
  border: 1px solid #b9d2c6;
  border-radius: 8px;
  background: #eaf4ef;
}

.event-pitch {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
}

.event-pitch-base {
  fill: #e8f3ed;
}

.event-pitch-cell.band-1 {
  fill: #d5eee3;
}

.event-pitch-cell.band-2 {
  fill: #a9dac4;
}

.event-pitch-cell.band-3 {
  fill: #6dbb98;
}

.event-pitch-cell.band-4 {
  fill: #2f946e;
}

.event-pitch-cell.band-5 {
  fill: #096746;
}

.event-pitch-markings {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
}

.event-pitch-spot {
  fill: rgba(255, 255, 255, 0.9);
  stroke: none;
}

.event-network-edge {
  stroke: #64748b;
  stroke-linecap: round;
  opacity: 0.7;
}

.event-network-edge.completion-very_high,
.event-network-edge.completion-high {
  stroke: var(--green);
}

.event-network-edge.completion-moderate {
  stroke: var(--blue);
}

.event-network-node circle {
  fill: var(--blue);
  stroke: white;
  stroke-width: 3;
}

.event-network-node.selected circle {
  fill: var(--green);
  stroke-width: 5;
}

.event-network-node text {
  fill: #172033;
  font-size: 17px;
  font-weight: 850;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.info-section {
  display: grid;
  gap: 9px;
}

.info-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.fact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.fact-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 26px;
  font-size: 12px;
}

.fact-row > span {
  color: var(--muted);
  font-weight: 700;
}

.fact-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.entity-stack,
.transfer-list {
  display: grid;
  gap: 7px;
}

.entity-line > span:last-child {
  display: grid;
  gap: 1px;
  min-width: 0;
  font-size: 12px;
}

.entity-line strong {
  overflow-wrap: anywhere;
}

.entity-line span span {
  color: var(--muted);
}

.entity-inline {
  gap: 6px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8f5ef;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.status-chip.warning {
  background: #fff7ed;
  color: var(--amber);
}

.status-chip.danger {
  background: #fef3f2;
  color: var(--danger);
}

.transfer-row {
  display: grid;
  gap: 3px;
  padding: 7px 0;
  border-bottom: 1px solid var(--surface-2);
}

.transfer-row:last-child {
  border-bottom: 0;
}

.transfer-teams {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 24px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.transfer-teams .asset-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.transfer-teams span:not(.asset-icon):not(.transfer-arrow) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-arrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trait-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.trait-block:last-child {
  border-bottom: 0;
}

.trait-block h3 {
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
}

.metric-list {
  display: grid;
  gap: 7px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 8px;
  align-items: center;
}

.metric-label {
  min-width: 0;
}

.metric-label strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.metric-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.sample-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
}

.sample-chip.low {
  background: #fef3f2;
  color: var(--danger);
}

.sample-chip.limited {
  background: #fff7ed;
  color: var(--amber);
}

.sample-chip.muted {
  background: var(--surface-2);
  color: var(--muted);
}

.bar {
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.metric-value {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.trait-accordion {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.trait-accordion-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.trait-accordion-item .trait-block {
  padding: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.trait-accordion-item .trait-block h3 {
  display: none;
}

.trait-accordion-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}

.trait-accordion-trigger:hover {
  background: var(--surface-2);
}

.trait-accordion-item.expanded .trait-accordion-trigger {
  background: var(--surface-2);
}

.trait-accordion-label {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.trait-accordion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.trait-accordion-chevron {
  width: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: transform 0.15s ease;
}

.trait-accordion-item.expanded .trait-accordion-chevron {
  transform: rotate(180deg);
}

.compare-backdrop {
  align-items: stretch;
  justify-items: center;
  overflow: auto;
}

.compare-modal {
  width: min(1180px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  margin: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compare-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.compare-modal-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.compare-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compare-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--bg);
}

.shortlist-backdrop {
  align-items: stretch;
  justify-items: center;
  overflow: auto;
}

.save-shortlist-modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.save-shortlist-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--bg);
}

.save-shortlist-options {
  display: grid;
  gap: 8px;
}

.save-shortlist-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.save-shortlist-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.save-shortlist-option-copy strong,
.save-shortlist-option-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-shortlist-option-copy span {
  color: var(--muted);
  font-size: 12px;
}

.save-shortlist-option button {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.save-shortlist-option button.primary {
  width: auto;
}

.save-shortlist-empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.save-shortlist-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.save-shortlist-create button.primary {
  width: auto;
  min-height: 38px;
  white-space: nowrap;
}

.shortlist-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  margin: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shortlist-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.shortlist-modal-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.shortlist-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shortlist-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--bg);
}

.shortlist-manager-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.shortlist-list-panel,
.shortlist-detail-pane {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.shortlist-list-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.shortlist-list-heading,
.shortlist-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.shortlist-list-heading h3,
.shortlist-detail-heading h3 {
  margin: 0;
  font-size: 16px;
}

.shortlist-list-heading span,
.shortlist-detail-heading > div > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.shortlist-list-panel > button.primary {
  width: 100%;
}

.manager-create-shortlist {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f5f9ff;
}

.manager-create-shortlist-actions {
  display: flex;
  gap: 6px;
}

.manager-create-shortlist-actions button {
  flex: 1;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
}

.shortlist-list {
  display: grid;
  gap: 7px;
  max-height: min(440px, 54vh);
  overflow: auto;
}

.shortlist-list-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  border-color: var(--border);
  background: var(--surface);
  text-align: left;
}

.shortlist-list-item span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortlist-list-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.shortlist-list-item.selected {
  border-color: var(--blue);
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.shortlist-list-item.selected span {
  color: #1d4ed8;
}

.shortlist-list-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.shortlist-detail-pane {
  min-width: 0;
  padding: 13px;
}

.shortlist-detail-empty {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.shortlist-detail-heading {
  margin-bottom: 12px;
}

.shortlist-detail-heading > div {
  min-width: 0;
}

.shortlist-detail-heading h3 {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortlist-detail-heading button.primary {
  width: auto;
  min-width: 160px;
  flex: 0 0 auto;
}

.shortlist-name-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.shortlist-name-actions,
.shortlist-member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortlist-name-actions button,
.shortlist-member-actions button {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.shortlist-name-actions button.primary {
  width: auto;
}

.shortlists-status {
  min-height: 18px;
  margin: 10px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shortlists-status.error {
  color: var(--danger);
}

.shortlist-baseline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.shortlist-baseline button {
  min-height: 30px;
  padding: 5px 8px;
  background: var(--surface);
  font-size: 12px;
}

.shortlist-members {
  display: grid;
  gap: 8px;
}

.shortlist-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.shortlist-member-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.shortlist-player-link {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.shortlist-player-link:hover:not(:disabled) strong {
  color: var(--blue);
  text-decoration: underline;
}

.shortlist-player-link strong,
.shortlist-player-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortlist-player-link span {
  color: var(--muted);
  font-size: 12px;
}

.baseline-badge,
.unavailable-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 7px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unavailable-badge {
  background: var(--surface-2);
  color: var(--muted);
}

.shortlist-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.shortlist-comparison-backdrop {
  align-items: stretch;
  justify-items: center;
  overflow: auto;
}

.shortlist-comparison-modal {
  width: min(1280px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  margin: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shortlist-comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.shortlist-comparison-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.shortlist-comparison-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shortlist-comparison-header-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.shortlist-comparison-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--bg);
}

.shortlist-comparison-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.shortlist-comparison-state.compact {
  min-height: 80px;
  margin-top: 10px;
}

.shortlist-comparison-state.error {
  color: var(--danger);
}

.shortlist-comparison-notice {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shortlist-comparison-notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.shortlist-comparison-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.shortlist-comparison-table {
  --comparison-metric-width: 170px;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.shortlist-comparison-table tr {
  cursor: default;
}

.shortlist-comparison-table th,
.shortlist-comparison-table td {
  padding: 11px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  vertical-align: middle;
  text-transform: none;
}

.shortlist-comparison-table tr:last-child th,
.shortlist-comparison-table tr:last-child td {
  border-bottom: 0;
}

.shortlist-comparison-table th:last-child,
.shortlist-comparison-table td:last-child {
  border-right: 0;
}

.shortlist-comparison-metric-column {
  position: sticky;
  left: 0;
  z-index: 3;
  width: var(--comparison-metric-width);
  min-width: var(--comparison-metric-width);
  max-width: var(--comparison-metric-width);
  color: var(--text);
  text-align: left;
  font-size: 12px;
  box-shadow: 1px 0 0 var(--border);
}

.shortlist-comparison-table thead .shortlist-comparison-metric-column {
  z-index: 5;
  background: #f8fafc;
}

.shortlist-comparison-metric-column strong,
.shortlist-comparison-metric-column span {
  display: block;
}

.shortlist-comparison-metric-column span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.shortlist-comparison-player-column {
  min-width: 190px;
  background: #f8fafc !important;
}

.shortlist-comparison-player {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.shortlist-comparison-player .player-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 11px;
}

.shortlist-comparison-player strong,
.shortlist-comparison-player span:not(.player-avatar) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortlist-comparison-player > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.shortlist-comparison-player .baseline-badge,
.shortlist-comparison-player .unavailable-badge {
  grid-column: 1 / -1;
  justify-self: start;
}

.shortlist-comparison-baseline-action {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 28px;
  padding: 4px 9px;
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.shortlist-comparison-baseline-action:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #dbeafe;
}

.shortlist-comparison-baseline-action.remove {
  border-color: #cbd5e1;
  background: var(--surface);
  color: var(--muted);
}

.shortlist-comparison-score {
  min-width: 190px;
  text-align: center;
}

.shortlist-comparison-score > strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.shortlist-comparison-delta,
.shortlist-comparison-reference,
.shortlist-comparison-na {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.shortlist-comparison-delta.positive {
  color: var(--green);
}

.shortlist-comparison-delta.negative {
  color: var(--danger);
}

.shortlist-comparison-reference {
  color: #1d4ed8;
}

.shortlist-baseline-column {
  position: sticky;
  left: var(--comparison-metric-width);
  z-index: 2;
  background: #eef6ff !important;
  box-shadow: 1px 0 0 #bfdbfe, -1px 0 0 #bfdbfe;
}

.shortlist-comparison-table thead .shortlist-baseline-column {
  z-index: 4;
}

.shortlist-comparison-global-row th,
.shortlist-comparison-global-row td {
  background: #fbfdff;
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(430px, 1fr);
  gap: 14px;
  align-items: start;
}

.compare-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
}

.compare-panel h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.compare-wide {
  grid-column: 1 / -1;
}

.compare-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.compare-player-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  border-top: 4px solid var(--compare-color, var(--blue));
}

.compare-player-card strong,
.compare-player-card span {
  min-width: 0;
}

.compare-player-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.compare-card-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.compare-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.compare-stat-chip {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.radar-wrap {
  display: grid;
  justify-items: center;
}

.compare-radar {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: #d8dde5;
  stroke-width: 1;
}

.radar-axis {
  stroke: #c8d0db;
  stroke-width: 1;
}

.radar-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.radar-shape {
  fill: var(--compare-color);
  fill-opacity: 0.12;
  stroke: var(--compare-color);
  stroke-width: 2.5;
}

.radar-dot {
  fill: var(--surface);
  stroke: var(--compare-color);
  stroke-width: 2;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.compare-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--compare-color);
}

.compare-bars {
  display: grid;
  gap: 12px;
}

.compare-bar-row {
  display: grid;
  gap: 6px;
}

.compare-bar-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compare-bar-group {
  display: grid;
  gap: 5px;
}

.compare-bar-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 42px;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.compare-bar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.compare-bar-fill {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--compare-color, var(--blue));
}

.compare-insights {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare-insights li {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}

.compare-insights li:last-child {
  border-bottom: 0;
}

.compare-insights strong {
  color: var(--text);
  font-size: 13px;
}

.compare-insights span {
  color: var(--muted);
  font-size: 12px;
}

.heatmap-wrap {
  overflow: auto;
}

.compare-heatmap {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
}

.compare-heatmap th,
.compare-heatmap td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  vertical-align: middle;
}

.compare-heatmap th {
  position: static;
  background: var(--surface);
  color: var(--muted);
  text-transform: none;
}

.heatmap-signal {
  min-width: 190px;
}

.heatmap-trait {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.heatmap-cell {
  min-width: 96px;
  border-radius: 6px;
  text-align: center;
  font-weight: 900;
}

.heatmap-cell.high {
  background: #e8f5ef;
  color: var(--green);
}

.heatmap-cell.mid {
  background: #fff7ed;
  color: var(--amber);
}

.heatmap-cell.low {
  background: #fef3f2;
  color: var(--danger);
}

.heatmap-cell.empty {
  background: var(--surface-2);
  color: var(--muted);
}

.heatmap-cell span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
}

.error {
  color: var(--danger);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 246, 248, 0.92)),
    var(--bg);
}

.login-shell {
  width: min(100%, 420px);
  padding: 20px;
}

.login-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-logo {
  width: min(230px, 100%);
  height: auto;
  display: block;
  margin-bottom: 22px;
}

.login-panel h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.15;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  justify-self: center;
  padding: 0;
  text-decoration: none;
}

.text-button:hover {
  text-decoration: underline;
}

.link-button {
  display: inline-block;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 250px 1fr;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .natural-search-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: min(620px, calc(100dvh - 20px));
    min-height: min(430px, calc(100dvh - 20px));
    border-radius: 18px;
  }

  .scout-chat-launcher {
    right: 14px;
    bottom: 14px;
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: min(190px, 72vw);
  }

  .topbar-actions {
    align-items: stretch;
  }

  .topbar-actions button {
    flex: 1;
  }

  .topbar-actions .user-menu-trigger {
    width: 40px;
    flex: 0 0 40px;
  }

  .user-menu-popover button {
    flex: none;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-toolbar label {
    width: 100%;
  }

  .detail-heading {
    flex-direction: column;
  }

  .detail-side {
    width: 100%;
    justify-items: stretch;
  }

  .detail-actions {
    align-items: stretch;
  }

  .detail-actions button {
    flex: 1;
  }

  .compare-modal {
    max-height: calc(100vh - 20px);
  }

  .shortlist-modal {
    max-height: calc(100vh - 20px);
  }

  .shortlist-comparison-modal {
    max-height: calc(100vh - 20px);
  }

  .shortlist-comparison-header {
    align-items: stretch;
    flex-direction: column;
  }

  .shortlist-comparison-header-actions {
    align-items: stretch;
  }

  .shortlist-comparison-header-actions button {
    flex: 1;
  }

  .shortlist-comparison-body {
    padding: 10px;
  }

  .shortlist-comparison-table {
    --comparison-metric-width: 132px;
  }

  .shortlist-comparison-player-column,
  .shortlist-comparison-score {
    min-width: 165px;
  }

  .shortlist-modal-body {
    padding: 10px;
  }

  .shortlist-manager-layout,
  .shortlist-name-controls,
  .shortlist-member,
  .save-shortlist-create {
    grid-template-columns: 1fr;
  }

  .shortlist-list {
    max-height: 250px;
  }

  .shortlist-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .shortlist-detail-heading button.primary {
    width: 100%;
  }

  .save-shortlist-create button.primary {
    width: 100%;
  }

  .shortlist-name-actions,
  .shortlist-member-actions {
    align-items: stretch;
  }

  .shortlist-name-actions button,
  .shortlist-member-actions button {
    flex: 1;
  }

  .shortlist-member-summary {
    flex-wrap: wrap;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-modal-body {
    padding: 10px;
  }

  .compare-bar-item {
    grid-template-columns: 86px minmax(0, 1fr) 38px;
  }
}
