/* The free trade analyzer (js/trade-analyzer.js), on the site's tokens (tokens.css): light by default, dark with the
   system or data-theme. Every class starts .ta so the page's own styles are left alone. Targets are 44px or more. */

.ta { --ta-gap: 16px; display: grid; gap: var(--ta-gap); margin-top: 20px; font-family: var(--font-body); color: var(--text); min-width: 0; }
.ta *, .ta *::before, .ta *::after { box-sizing: border-box; }
.ta-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ta :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── The two sides ───────────────────────────────────────────────────── */
.ta-trade { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.ta-swap { align-self: center; font-size: 22px; color: var(--faint); padding-top: 28px; }
.ta-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; box-shadow: var(--shadow-card); min-width: 0; }
.ta-side-title { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; line-height: 1.1; }
.ta-give .ta-side-title { color: var(--stop-text); }
.ta-get .ta-side-title { color: var(--go-text); }
.ta-picked { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ta-picked:not(:empty) { margin-bottom: 10px; }
.ta-player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 4px 6px 8px; border-radius: var(--r-control); background: var(--surface-2); }
.ta-avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); color: var(--dim); border: 1px solid var(--line-strong); font: 700 13px/1 var(--font-body); letter-spacing: .02em; }
.ta-player-text { display: grid; min-width: 0; }
.ta-player-name { font-weight: 650; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.ta-player-line { font-size: 12.5px; color: var(--dim); line-height: 1.35; font-variant-numeric: tabular-nums; }
.ta-team { display: inline-block; margin-left: 4px; padding: 2px 5px; border-radius: var(--r-sticker); border: 1px solid var(--line-strong); font: 700 11px/1.2 var(--font-mono); letter-spacing: .04em; color: var(--dim); text-decoration: none; vertical-align: 1px; }
.ta-remove { width: 44px; height: 44px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--dim); font-size: 24px; line-height: 1; cursor: pointer; }
.ta-remove:hover { background: var(--track); color: var(--text); }

/* The search: an ARIA combobox with its listbox below. */
.ta-combo { position: relative; }
.ta-input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--bg); color: var(--text); font: 16px/1.3 var(--font-body); }
.ta-input::placeholder { color: var(--faint); opacity: 1; }
.ta-input:disabled { opacity: .7; }
.ta-options { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 340px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control); box-shadow: var(--shadow-pop); }
.ta-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: var(--r-control); cursor: pointer; }
.ta-option .ta-avatar { width: 30px; height: 30px; font-size: 11.5px; }
.ta-option-name { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.ta-option[aria-selected='true'], .ta-option:hover { background: var(--accent-tint); }
.ta-option[aria-selected='true'] { outline: 2px solid var(--accent); outline-offset: -2px; }
.ta-none { color: var(--dim); cursor: default; }

/* ── The one league it weighs for: said, never set ───────────────────── */
.ta-standard { margin: -4px 0 0; font-size: 14.5px; color: var(--dim); }

/* ── The verdict ─────────────────────────────────────────────────────── */
.ta-result { padding: 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); min-width: 0; }
.ta-verdict { margin: 0; font-family: var(--font-brand); font-weight: 800; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
.ta-detail, .ta-overall, .ta-hint { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--dim); }
.ta-overall { color: var(--text); font-weight: 600; }
.ta-verdict.ta-win { color: var(--go-text); }
.ta-verdict.ta-lose { color: var(--stop-text); }
.ta-hint + .ta-button { margin-top: 14px; }
.ta-stamp { margin: 0; color: var(--dim); }
.ta-stamp .ta-button { margin-left: 8px; }

.ta-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ta-table caption { text-align: left; padding: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.ta-table th, .ta-table td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ta-table thead th { border-top: 0; padding-top: 0; font-size: 12.5px; font-weight: 700; color: var(--dim); }
.ta-table tbody th { font: 800 16px/1.2 var(--font-display); letter-spacing: .05em; width: 64px; }
.ta-table abbr { text-decoration: none; }
.ta-change { font-weight: 700; font-size: 16px; white-space: nowrap; width: 1%; }
.ta-change small { display: block; font-weight: 500; font-size: 12px; color: var(--dim); }
.ta-effect { font-weight: 700; font-size: 14.5px; width: 1%; white-space: nowrap; text-align: right; }
.ta-table thead th:last-child { text-align: right; }
.ta-win .ta-change, .ta-win .ta-effect { color: var(--go-text); }
.ta-lose .ta-change, .ta-lose .ta-effect { color: var(--stop-text); }
.ta-even .ta-effect { color: var(--dim); }
.ta-win .ta-effect::before { content: '▲ '; }
.ta-lose .ta-effect::before { content: '▼ '; }
/* A bar from the middle: right for a gain, left for a loss, its length the category score's change. */
.ta-bar { position: relative; display: block; height: 10px; border-radius: 5px; background: var(--track); }
.ta-bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.ta-fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.ta-up { left: 50%; background: var(--go); }
.ta-down { right: 50%; background: var(--stop); }

.ta-note { margin: 12px 0 0; font-size: 14px; color: var(--dim); }
.ta-how { margin-top: 14px; border-top: 1px dotted var(--line-strong); padding-top: 4px; }
.ta-how summary { display: flex; align-items: center; min-height: 44px; font-weight: 650; cursor: pointer; }
.ta-how p { margin: 6px 0 10px; font-size: 14.5px; line-height: 1.55; color: var(--dim); max-width: 60em; }
.ta-share { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 14px; }
.ta-labels { margin: 12px 0 0; font-size: 13.5px; color: var(--dim); }
.ta-share .ta-labels { margin: 0; flex: 1 1 260px; }
.ta-link { flex: 1 1 100%; }

/* ── Buttons and the call to action ──────────────────────────────────── */
.ta-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--text); border-radius: var(--r-control); background: transparent; color: var(--text); font: 700 15px/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.ta-button:hover { background: var(--track); }
.ta-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ta-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ta-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; border-radius: var(--r-card); background: var(--accent-tint); border: 1px solid var(--line); }
.ta-cta p { margin: 0; flex: 1 1 280px; font-size: 16.5px; line-height: 1.45; }

/* ── Phones ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .ta-trade { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ta-swap { justify-self: center; padding: 0; transform: rotate(90deg); }
}
@media (max-width: 420px) {
  .ta-side { padding: 12px; }
  .ta-result { padding: 14px 12px; }
  .ta-table th, .ta-table td { padding: 8px 4px; }
  .ta-table tbody th { width: 48px; font-size: 15px; }
  .ta-cta .ta-button { flex: 1 1 100%; }
}
