/* ── Trade Finder Panel ───────────────────────────────────────────────────── */
.tf-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    justify-content: flex-end;
    pointer-events: none; /* let backdrop handle click-through */
}

.tf-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    pointer-events: auto;
}

/* Left-edge resize grip — 8px wide, full height */
/* Left-edge resize grip — lives INSIDE .tf-content so it tracks the panel edge */
.tf-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    pointer-events: auto;
    background: transparent;
    transition: background 0.15s;
}
.tf-resize-handle:hover,
.tf-resize-handle:active { background: rgba(124, 58, 237, 0.35); }

.tf-content {
    position: relative;
    width: min(560px, 100vw);   /* wider default — trades need room */
    min-width: 320px;
    height: 100%;
    background: #111827;
    border-left: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
}

.tf-header {
    display: flex;
    flex-direction: column;         /* stack top-row + subtitle vertically */
    padding: 0.75rem 1rem 0.65rem;
    border-bottom: 1px solid #1f2937;
    flex-shrink: 0;
    gap: 0.3rem;
}
.tf-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-width: 0;
}
.tf-header-left  { flex: 1; min-width: 0; }

.tf-title {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    color: #f9fafb;
}

.tf-subtitle {
    font-size: 0.76rem;
    color: #9ca3af;
    line-height: 1.4;
    /* Full width now — no wrapping constraint */
}

.tf-header-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* Strategy dropdown in Trade Finder header */
.tf-strategy-select {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tf-strategy-select:hover { border-color: #6366f1; }
.tf-strategy-select:focus { outline: none; border-color: #6366f1; }

/* Toggle pills — shared base */
.tf-stack-toggle,
.tf-activity-toggle {
    padding: 0.28rem 0.55rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

/* 🔗 Keep Stacks — green when active */
.tf-stack-toggle:hover  { border-color: #10b981; color: #34d399; }
.tf-stack-toggle.active { background: #064e3b; border-color: #10b981; color: #6ee7b7; font-weight: 600; }

/* 🎲 Activity — amber when active */
.tf-activity-toggle:hover  { border-color: #f59e0b; color: #fbbf24; }
.tf-activity-toggle.active { background: #78350f; border-color: #f59e0b; color: #fde68a; font-weight: 600; }

/* Win-Now sub-option row — slides in below header when Win-Now is active */
.tf-winnow-suboption {
    padding: 0.25rem 0 0.1rem;
    animation: tf-fadein 0.15s ease;
}
@keyframes tf-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tf-winnow-suboption-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #fbbf24;
    cursor: pointer;
    user-select: none;
}
.tf-winnow-suboption-label:hover { color: #fde68a; }
.tf-winnow-checkbox {
    width: 13px;
    height: 13px;
    accent-color: #f59e0b;
    cursor: pointer;
    flex-shrink: 0;
}

/* ▼ Minimize button */
.tf-minimize-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    line-height: 1;
    transition: color 0.15s;
}
.tf-minimize-btn:hover { color: #d1d5db; }

.tf-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    line-height: 1;
}
.tf-close-btn:hover { color: #f9fafb; }

/* ── Status bar ─────────────────────────────────────────────────────────── */
.tf-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: #1f2937;
    border-bottom: 1px solid #374151;
    flex-shrink: 0;
}

.tf-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tf-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #374151;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes tf-spin { to { transform: rotate(360deg); } }

#tfStatusMsg {
    font-size: 0.8rem;
    color: #d1d5db;
}

.tf-progress-bar {
    height: 3px;
    background: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.tf-progress-fill {
    height: 100%;
    background: #7c3aed;
    transition: width 0.4s ease;
}

/* ── Sort toolbar ────────────────────────────────────────────────────────── */
.tf-sort-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #1a2234;
    border-bottom: 1px solid #1f2937;
    flex-shrink: 0;
    flex-wrap: wrap;            /* allow sort bar to wrap rather than clip at narrow widths */
    row-gap: 0.35rem;           /* tighter vertical gap when wrapped */
}

.tf-sort-label {
    font-size: 0.72rem;
    color: #6b7280;
    margin-right: 0.1rem;
}

.tf-sort-btn {
    padding: 0.2rem 0.6rem;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 12px;
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}
.tf-sort-btn:hover  { border-color: #7c3aed; color: #a78bfa; }
.tf-sort-btn.active { background: #312e81; border-color: #4338ca; color: #c7d2fe; font-weight: 600; }

.tf-result-count {
    font-size: 0.7rem;
    color: #6b7280;
    /* margin-left: auto now lives on .tf-sort-right, not here */
}

/* Right-side group — Max selector + count + Ask Jerry, all pushed to far edge */
.tf-sort-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;          /* single auto-margin pushes entire group right */
    flex-wrap: wrap;            /* allow chips to wrap onto a second row when panel is narrow */
    row-gap: 0.3rem;
    justify-content: flex-end;  /* chips stay right-aligned on all rows when wrapped */
}

/* Max results selector in sort bar */
.tf-max-label {
    font-size: 0.7rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.tf-max-select {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 10px;
    color: #9ca3af;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.tf-max-select:hover,
.tf-max-select:focus {
    border-color: #7c3aed;
    color: #a78bfa;
}

/* ── Split body — wraps results pane + advisor pane side by side ─────────── */
.tf-split-body {
    display: flex;
    flex: 1;
    overflow: hidden;           /* children manage their own scroll */
    min-height: 0;              /* required for flex children to shrink */
}

/* Results pane scrolls independently within the split */
.tf-split-body .tf-results {
    flex: 1;
    min-width: 260px;           /* never collapse below readability */
    border-right: 1px solid #1f2937; /* separator when advisor is open */
}

/* Advisor pane — right column, fixed width, independent scroll */
.tf-advisor-pane {
    width: 340px;
    min-width: 280px;
    max-width: 420px;
    border-left: 1px solid #374151;
    background: #0f172a;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Ask Jerry button on each card footer — indigo tint, distinct from save/evaluate */
.tf-ask-btn {
    padding: 0.28rem 0.45rem;
    background: #1e1b4b;
    border: 1px solid #3730a3;
    color: #a5b4fc;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tf-ask-btn:hover    { background: #312e81; color: #e0e7ff; border-color: #4f46e5; }
.tf-ask-btn:disabled { opacity: 0.5; cursor: default; }

/* Ask Jerry toggle in sort bar — pill style, clearly distinct from sort bar bg */
.tf-advisor-toggle {
    padding: 0.2rem 0.6rem;
    background: #312e81;        /* visible indigo — not the dark navy of the bar bg */
    border: 1px solid #4338ca;
    color: #c7d2fe;
    border-radius: 12px;        /* pill, matches sort buttons */
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    -webkit-appearance: none;   /* kills Safari/iOS native button chrome */
    appearance: none;
    font-family: inherit;
    /* margin-left removed — .tf-sort-right group handles the push */
}
.tf-advisor-toggle:hover  { background: #3730a3; color: #e0e7ff; border-color: #4f46e5; }
.tf-advisor-toggle.active { background: #4f46e5; color: #fff; border-color: #6366f1; }

/* Active card — the one currently loaded in the advisor pane */
.tf-card.tf-card-advisor-active {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

/* ── Results list ───────────────────────────────────────────────────────── */
.tf-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tf-empty, .tf-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1.6;
}
.tf-error { color: #f87171; }

/* ── Zero-result contextual explanation card ────────────────────────────── */
.tf-zero-explain {
    margin: 1rem 0.65rem;
    padding: 1.25rem 1.25rem 1rem;
    background: #1a2234;
    border: 1px solid #2d3f55;
    border-radius: 10px;
    font-size: 0.83rem;
    line-height: 1.55;
    color: #cbd5e1;
}
.tf-zero-icon     { font-size: 1.8rem; margin-bottom: 0.5rem; }
.tf-zero-headline { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.55rem; }
.tf-zero-body     { color: #94a3b8; margin-bottom: 0.75rem; }
.tf-zero-body strong { color: #e2e8f0; }
.tf-zero-body em     { color: #a5b4fc; font-style: normal; }
.tf-zero-tip {
    background: #1e3a2e;
    border-left: 3px solid #34d399;
    border-radius: 0 6px 6px 0;
    padding: 0.55rem 0.75rem;
    color: #a7f3d0;
    font-size: 0.78rem;
}
.tf-zero-tip strong { color: #6ee7b7; }
.tf-zero-tip em     { color: #6ee7b7; font-style: normal; font-weight: 600; }

/* Inline Broaden Search button — inside zero-explain card (fairness-gated case) */
.tf-broaden-inline-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #312e81;
    border: 1px solid #4338ca;
    border-radius: 8px;
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s, border-color 0.15s;
}
.tf-broaden-inline-btn:hover { background: #3730a3; border-color: #4f46e5; color: #e0e7ff; }
.tf-zero-broaden-hint {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: #6b7280;
    text-align: center;
}
.tf-zero-details { margin-top: 0.75rem; font-size: 0.75rem; }
.tf-zero-details summary {
    cursor: pointer; color: #6b7280; padding: 0.3rem 0; user-select: none;
}
.tf-zero-details summary:hover { color: #9ca3af; }
.tf-zero-protected-list {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin-top: 0.45rem; padding: 0.5rem;
    background: #111827; border-radius: 6px;
}
.tf-zero-player {
    background: #1f2937; border: 1px solid #374151; border-radius: 4px;
    padding: 0.15rem 0.4rem; color: #d1d5db; white-space: nowrap;
}
.tf-zero-player em { color: #6b7280; font-style: normal; margin-left: 3px; }
.tf-zero-names     { color: #c7d2fe; font-style: italic; }

/* ── Trade card ─────────────────────────────────────────────────────────── */
.tf-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative; /* needed for .tf-whatif-tag absolute positioning */
}
.tf-card:hover { border-color: #7c3aed; }

/* Give/Get sides — stack vertically so long names never get clipped */
.tf-card-sides {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Row to hold the two sides + arrow */
.tf-card-sides-row {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
}

.tf-card-side {
    flex: 1;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    background: #111827;
    min-width: 0; /* allow flex children to shrink */
}

.tf-give { border-left: 3px solid #f97316; }
.tf-get  { border-left: 3px solid #10b981; }

.tf-side-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tf-player-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f9fafb;
    /* Allow wrapping for long multi-player names */
    word-break: break-word;
    line-height: 1.3;
}

.tf-player-meta {
    font-size: 0.73rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

.tf-card-arrow {
    font-size: 0.9rem;
    color: #6b7280;
    flex-shrink: 0;
    align-self: center;
    padding: 0 0.1rem;
}

.tf-card-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.73rem;
    flex-wrap: wrap;
}

.tf-opp-name  { color: #9ca3af; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Surplus position warning chip — shown when acquiring a position with no deficit */
.tf-surplus-chip {
    padding: 0.18rem 0.45rem;
    background: #1c1917;        /* warm brown-black — distinct from the purple/green fairness chips */
    border: 1px solid #57534e;
    color: #a8a29e;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
}

.tf-fairness  { padding: 0.18rem 0.45rem; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.tf-fair-high { background: #064e3b; color: #34d399; }
.tf-fair-mid  { background: #451a03; color: #fb923c; }
.tf-fair-low  { background: #450a0a; color: #f87171; }

.tf-benefit {
    color: #a78bfa;
    font-weight: 600;
    white-space: nowrap;
}

.tf-evaluate-btn {
    padding: 0.28rem 0.6rem;
    background: #7c3aed;
    border: none;
    color: white;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    margin-left: auto;
}
.tf-evaluate-btn:hover { background: #6d28d9; }

/* Save icon button — sits left of Evaluate, no margin-left:auto */
.tf-save-btn {
    padding: 0.28rem 0.45rem;
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tf-save-btn:hover { background: #374151; color: #e2e8f0; }
.tf-save-btn:disabled { opacity: 0.6; cursor: default; }

/* ── Multi-select toolbar ───────────────────────────────────────── */
.tf-multiselect-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: #1e1b4b;
    border-bottom: 1px solid #312e81;
    font-size: 0.75rem;
    color: #a5b4fc;
    flex-shrink: 0;
    animation: tf-slide-down 0.15s ease;
}
@keyframes tf-slide-down {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.tf-ms-label { color: #818cf8; }
.tf-ms-label strong { color: #c7d2fe; font-weight: 700; }
.tf-ms-actions { display: flex; gap: 0.35rem; margin-left: auto; }
.tf-ms-btn {
    padding: 0.25rem 0.6rem;
    border: none;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tf-ms-save    { background: #1d4ed8; color: white; }
.tf-ms-save:hover    { background: #1e40af; }
.tf-ms-compare { background: #0f766e; color: white; }
.tf-ms-compare:hover { background: #0d6b63; }
.tf-ms-clear   { background: #374151; color: #9ca3af; }
.tf-ms-clear:hover   { background: #4b5563; color: #e2e8f0; }

/* Card checkbox in footer */
.tf-card-select {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #818cf8;
    z-index: 2;
}

/* Selected card visual state */
.tf-card.tf-card-selected {
    border-color: #818cf8;
    background: #1e1b4b;
    box-shadow: 0 0 0 1px #312e81 inset;
}

/* Structure badge (2-for-1, 1-for-2) */
.tf-structure-badge {
    display: inline-block;
    padding: 0.08rem 0.35rem;
    background: #312e81;
    border: 1px solid #4338ca;
    border-radius: 4px;
    font-size: 0.62rem;
    color: #a5b4fc;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* Trade rationale */
.tf-rationale {
    font-size: 0.74rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
}

/* Panel header tint when activity mode is active */
.tf-panel:has(.tf-activity-toggle.active) .tf-header {
    background: rgba(120, 53, 15, 0.15);
    border-bottom-color: #92400e;
}

/* Color classes for details drawer multipliers */
.tf-detail-up   { color: #34d399 !important; }
.tf-detail-down { color: #f87171 !important; }

/* ── Minimize badge ──────────────────────────────────────────────────────── */
/* Floating pill shown when panel is collapsed */
.tf-badge {
    position: fixed;
    bottom: 1.25rem;
    /* CENTER instead of right-anchored */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: #1f2937;
    border: 1px solid #7c3aed;
    border-radius: 24px;
    color: #d1d5db;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 1200;
    pointer-events: auto;
    cursor: grab;           /* draggable hint */
    user-select: none;      /* prevent text selection during drag */
}
.tf-badge.tf-badge--dragging { cursor: grabbing; }

/* Pulse animation — plays when Find Trades is clicked while minimized */
@keyframes tf-badge-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(124,58,237,0.35), 0 4px 16px rgba(0,0,0,0.5);
                border-color: #a78bfa; }
}
.tf-badge--pulse { animation: tf-badge-pulse 0.5s ease 2; }

.tf-badge-restore {
    background: #7c3aed;
    border: none;
    color: white;
    border-radius: 12px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.tf-badge-restore:hover { background: #6d28d9; }

/* ── Expandable details drawer ───────────────────────────────────────────── */
.tf-details { margin-top: 0.2rem; }

.tf-details-toggle {
    font-size: 0.7rem;
    color: #6b7280;
    cursor: pointer;
    list-style: none;
    padding: 0.15rem 0;
    user-select: none;
}
.tf-details-toggle:hover { color: #a78bfa; }
.tf-details-toggle::marker,
.tf-details-toggle::-webkit-details-marker { display: none; }
.tf-details-toggle::before { content: '▸ '; }
details[open] .tf-details-toggle::before { content: '▾ '; }

.tf-details-body {
    margin-top: 0.35rem;
    padding: 0.55rem;
    background: #0f172a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.tf-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.7rem;
    color: #9ca3af;
    gap: 0.5rem;
}
.tf-detail-row span:first-child { flex: 1; }
.tf-detail-row span:last-child  { color: #d1d5db; font-weight: 500; text-align: right; flex-shrink: 0; }

.tf-detail-warn {
    font-size: 0.7rem;
    color: #fbbf24;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #374151;
}

/* Phase 2 mutual surplus — bilateral context note in the details drawer */
.tf-detail-bilateral {
    font-size: 0.7rem;
    color: #818cf8;  /* indigo — distinct from warnings (yellow) and values (green) */
    margin-top: 0.25rem;
    font-style: italic;
    line-height: 1.4;
}

/* ── Acquiring mode — grouped results ──────────────────────────────────── */

/* Wrapper for one target-player group (header + cards) */
.tf-acq-group {
    margin-bottom: 0.75rem;
}

/* Group header — shows targeted player name, position, value, package count */
.tf-acq-group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    background: #1a2538;
    border: 1px solid #2d3f55;
    border-radius: 8px 8px 0 0;
    font-size: 0.8rem;
    color: #e2e8f0;
    flex-wrap: wrap;
}
.tf-acq-target-icon { font-size: 0.9rem; flex-shrink: 0; }
.tf-acq-target-info { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.tf-acq-target-name { font-weight: 700; color: #f9fafb; white-space: nowrap; }
.tf-acq-target-pos  {
    background: #374151; color: #9ca3af;
    font-size: 0.7rem; padding: 1px 5px;
    border-radius: 3px; white-space: nowrap;
}
.tf-acq-target-val  { color: #a78bfa; font-weight: 600; white-space: nowrap; }
.tf-acq-target-sep  { color: #4b5563; }

/* Package count badge — right-aligned */
.tf-acq-count {
    margin-left: auto;
    color: #6b7280;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Cards container within a group — open bottom corners to connect to header */
.tf-acq-cards {
    border: 1px solid #2d3f55;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #0f1923;
}

/* Cards inside groups get tighter border radius */
.tf-acq-cards .tf-card {
    border-radius: 4px;
    border-color: #2d3f55;
}
.tf-acq-cards .tf-card:hover { border-color: #4b5563; }

/* ── Franchise Picker (standalone modal) ─────────────────────────── */
#tfFranchisePicker {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-fp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.tf-fp-container {
    position: relative;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    width: min(400px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tf-fp-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid #374151;
}

.tf-fp-header h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    color: #f9fafb;
}

.tf-fp-header p {
    margin: 0;
    font-size: 0.78rem;
    color: #9ca3af;
}

.tf-fp-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tf-fp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.tf-fp-row:hover {
    background: #111827;
    border-color: #7c3aed;
}

.tf-fp-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tf-fp-icon-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #374151;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tf-fp-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.tf-fp-team {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-fp-owner {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tf-fp-save-row {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #374151;
    font-size: 0.78rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tf-fp-save-row input { cursor: pointer; }

/* ── Mobile: bottom sheet ────────────────────────────────────────────────── */
/* On small screens the panel slides up from the bottom as a sheet.
   Height is capped at 85vh so the board is still visible behind it. */
@media (max-width: 640px) {
    .tf-panel {
        justify-content: flex-start;
        align-items: flex-end;
    }

    .tf-backdrop { background: rgba(0,0,0,0.4); }

    .tf-resize-handle { display: none; } /* no resize on mobile */

    .tf-content {
        width: 100vw !important; /* override any JS-set width */
        height: auto;
        max-height: 85vh;
        border-left: none;
        border-top: 1px solid #374151;
        border-radius: 16px 16px 0 0;
        /* slide up animation */
        animation: tf-slide-up 0.25s ease;
    }

    @keyframes tf-slide-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* Drag indicator notch at top of sheet */
    .tf-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #374151;
        border-radius: 2px;
        margin: 0 auto 0.5rem;
        position: absolute;
        top: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .tf-header { padding-top: 1.5rem; position: relative; }

    /* Smaller toggles on narrow screens */
    .tf-stack-toggle,
    .tf-activity-toggle { font-size: 0.65rem; padding: 0.22rem 0.45rem; }

}

.tf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid #1f2937;
    flex-shrink: 0;
    gap: 0.75rem;
}

.tf-header-left  { flex: 1; min-width: 0; }
.tf-header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* 🎲 Activity mode toggle pill */
.tf-activity-toggle {
    padding: 0.3rem 0.65rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #9ca3af;
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.tf-activity-toggle:hover {
    border-color: #f59e0b;
    color: #fbbf24;
}
.tf-activity-toggle.active {
    background: #78350f;
    border-color: #f59e0b;
    color: #fde68a;
    font-weight: 600;
}

/* 🔗 Keep Stacks toggle pill — green when active (protection on) */
.tf-stack-toggle {
    padding: 0.3rem 0.65rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #9ca3af;
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.tf-stack-toggle:hover {
    border-color: #10b981;
    color: #34d399;
}
/* Active = protection ON = green (safe) */
.tf-stack-toggle.active {
    background: #064e3b;
    border-color: #10b981;
    color: #6ee7b7;
    font-weight: 600;
}

/* Color classes for details drawer multipliers */
.tf-detail-up   { color: #34d399; }
.tf-detail-down { color: #f87171; }

.tf-title {
    margin: 0 0 0.2rem;
    font-size: 1.1rem;
    color: #f9fafb;
}

.tf-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.4;
}

.tf-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.tf-close-btn:hover { color: #f9fafb; }

/* ── Status bar ─────────────────────────────────────────────────────────── */
.tf-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #1f2937;
    border-bottom: 1px solid #374151;
    flex-shrink: 0;
}

.tf-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #374151;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: tf-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes tf-spin { to { transform: rotate(360deg); } }

#tfStatusMsg {
    font-size: 0.82rem;
    color: #d1d5db;
}

.tf-progress-bar {
    height: 3px;
    background: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.tf-progress-fill {
    height: 100%;
    background: #7c3aed;
    transition: width 0.4s ease;
}

/* ── Results list ───────────────────────────────────────────────────────── */
.tf-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tf-empty, .tf-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1.6;
}
.tf-error { color: #f87171; }

/* ── Trade card ─────────────────────────────────────────────────────────── */
.tf-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 0.8rem 0.8rem 0.8rem 2rem; /* left padding makes room for the checkbox */
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
}

.tf-card:hover {
    border-color: #7c3aed;
}

.tf-card-sides {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tf-card-side {
    flex: 1;
    padding: 0.6rem;
    border-radius: 6px;
    background: #111827;
}

.tf-give { border-left: 3px solid #f97316; }
.tf-get  { border-left: 3px solid #10b981; }

.tf-side-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.2rem;
}

/* .tf-player-name is defined earlier in this file with word-break: break-word */

.tf-player-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.tf-card-arrow {
    font-size: 1.1rem;
    color: #6b7280;
    flex-shrink: 0;
}

.tf-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.tf-opp-name  { color: #9ca3af; flex: 1; }
.tf-fairness  { padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.tf-fair-high { background: #064e3b; color: #34d399; }
.tf-fair-mid  { background: #451a03; color: #fb923c; }
.tf-fair-low  { background: #450a0a; color: #f87171; }

.tf-benefit {
    color: #a78bfa;
    font-weight: 600;
    min-width: 2.5rem;
    text-align: right;
}

.tf-evaluate-btn {
    padding: 0.3rem 0.7rem;
    background: #7c3aed;
    border: none;
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.tf-evaluate-btn:hover { background: #6d28d9; }

/* Structure badge (2-for-1, 1-for-2) */
.tf-structure-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #312e81;
    border: 1px solid #4338ca;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #a5b4fc;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.3rem;
}

/* Trade rationale string — one-line explanation under the players */
.tf-rationale {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    padding: 0 0.1rem;
    line-height: 1.4;
}

/* Panel header tint when activity mode is active */
.tf-panel:has(.tf-activity-toggle.active) .tf-header {
    background: rgba(120, 53, 15, 0.15);
    border-bottom-color: #92400e;
}

/* Mobile */
@media (max-width: 500px) {
    .tf-content { width: 100vw; }
    .tf-card-sides { flex-direction: column; }
    .tf-card-arrow { transform: rotate(90deg); align-self: center; }
    /* On mobile the split stacks vertically — advisor below results */
    .tf-split-body    { flex-direction: column; }
    .tf-advisor-pane  { width: 100%; max-width: 100%; border-left: none; border-top: 1px solid #374151; }
}

/* ── Franchise Picker (standalone modal) ─────────────────────────── */
#tfFranchisePicker {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-fp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.tf-fp-container {
    position: relative;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    width: min(400px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tf-fp-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid #374151;
}

.tf-fp-header h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    color: #f9fafb;
}

.tf-fp-header p {
    margin: 0;
    font-size: 0.78rem;
    color: #9ca3af;
}

.tf-fp-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tf-fp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.tf-fp-row:hover {
    background: #111827;
    border-color: #7c3aed;
}

.tf-fp-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tf-fp-icon-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #374151;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tf-fp-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.tf-fp-team {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-fp-owner {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tf-fp-save-row {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #374151;
    font-size: 0.78rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tf-fp-save-row input { cursor: pointer; }

/* Expandable details drawer */
.tf-details { margin-top: 0.25rem; }

.tf-details-toggle {
    font-size: 0.72rem;
    color: #6b7280;
    cursor: pointer;
    list-style: none;
    padding: 0.2rem 0;
    user-select: none;
}
.tf-details-toggle:hover { color: #a78bfa; }
.tf-details-toggle::marker,
.tf-details-toggle::-webkit-details-marker { display: none; }
.tf-details-toggle::before { content: '▸ '; }
details[open] .tf-details-toggle::before { content: '▾ '; }

.tf-details-body {
    margin-top: 0.4rem;
    padding: 0.6rem;
    background: #0f172a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tf-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #9ca3af;
}
.tf-detail-row span:last-child { color: #d1d5db; font-weight: 500; }

.tf-detail-warn {
    font-size: 0.72rem;
    color: #fbbf24;
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #374151;
}
/* ── Filter tabs (appear in broaden mode when recommended/all mix exists) ─── */
.tf-filter-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.6rem;
    padding-left: 0.6rem;
    border-left: 1px solid #2d3748;
}

.tf-filter-btn {
    padding: 0.2rem 0.6rem;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 12px;
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tf-filter-btn:hover  { border-color: #06b6d4; color: #67e8f9; }
.tf-filter-btn.active { background: #0c4a6e; border-color: #0284c7; color: #bae6fd; font-weight: 600; }

/* ── Broaden Search suggestion banner ────────────────────────────────────── */
.tf-broaden-banner {
    margin: 0.75rem 1rem 0.5rem;
    border-radius: 10px;
    background: #1a1f2e;
    border: 1px dashed #4338ca;
    overflow: hidden;
}

.tf-broaden-inner {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
}

.tf-broaden-msg {
    font-size: 0.8rem;
    color: #c7d2fe;
    font-weight: 500;
}

.tf-broaden-btn {
    align-self: flex-start;
    padding: 0.35rem 0.9rem;
    background: #312e81;
    border: 1px solid #4338ca;
    border-radius: 20px;
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tf-broaden-btn:hover {
    background: #3730a3;
    border-color: #6366f1;
    color: #c7d2fe;
}

.tf-broaden-hint {
    font-size: 0.68rem;
    color: #6b7280;
    line-height: 1.35;
}

/* ── Trade Structure checkboxes in setup modal ───────────────────────────── */
.tsm-structure-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #1f2937;
}
.tsm-structure-row:last-child { border-bottom: none; }


/* ── What-if mode toggle group in sort bar ─────────────────────────────── */
.tf-whatif-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #111827;
    border: 1px solid #1c2a3e;
    border-radius: 8px;
    padding: 2px;
}
.tf-whatif-mode-btn {
    padding: 2px 9px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
}
.tf-whatif-mode-btn.active {
    background: #1c1500;
    color: #d97706;
    border: 1px solid rgba(217,119,6,.4);
}
.tf-whatif-mode-btn:hover:not(.active) { color: #9ca3af; }

/* ── What-if corner tag on trade cards ─────────────────────────────────── */
.tf-whatif-tag {
    position: absolute;
    top: -1px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    background: #d97706;
    color: #fff;
    padding: 1px 8px;
    border-radius: 0 0 6px 6px;
    letter-spacing: .02em;
    pointer-events: none;
}

/* What-if card: amber border + subtle tint.
   Using both :has() (modern) and direct class (legacy Safari / older Chrome) */
.tf-card:has(.tf-whatif-tag),
.tf-card--whatif {
    border-color: #d97706;
    background: #1c1500;
}

/* ── What-if summary panel ──────────────────────────────────────────────── */
.tf-whatif-summary {
    margin: 0 0 10px;
    padding: 9px 12px;
    background: #1a1200;
    border: 1px solid #92400e;
    border-radius: 8px;
    font-size: 0.78rem;
}
.tf-wi-sum-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d97706;
    font-weight: 600;
    margin-bottom: 7px;
}
.tf-wi-sum-title { color: #d97706; }
.tf-wi-sum-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tf-wi-sum-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.tf-wi-sum-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}
.tf-wi-sum-val--new { color: #4ade80; }
.tf-wi-sum-lbl {
    font-size: 0.65rem;
    color: #6b7280;
    white-space: nowrap;
}
.tf-wi-sum-arrow { color: #374151; font-size: 0.9rem; }
.tf-wi-sum-delta {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4ade80;
    background: #0f2d1a;
    border: 1px solid #14532d;
    border-radius: 20px;
    padding: 2px 9px;
    white-space: nowrap;
}

/* Mobile: stack summary stats vertically */
@media (max-width: 500px) {
    .tf-wi-sum-stats { gap: 6px; }
    .tf-wi-sum-arrow { transform: rotate(90deg); }
}

/* What-if summary explanatory note */
.tf-wi-sum-note {
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
    border-top: 1px solid #1f2937;
    padding-top: 5px;
}
.tf-wi-sum-note strong { color: #9ca3af; }

/* ── Feature 2: Acceptance likelihood meter ─────────────────────────────── */
/* Thin bar shown between rationale and card footer */
.tf-accept-meter {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    margin: 0.1rem 0 0.05rem;
}
.tf-accept-label {
    color: #6b7280;
    flex-shrink: 0;
    min-width: 5.5rem;
}
.tf-accept-bar-wrap {
    flex: 1;
    height: 5px;
    background: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}
.tf-accept-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.tf-accept-bar-fill.tf-accept-high { background: #10b981; }
.tf-accept-bar-fill.tf-accept-mid  { background: #f59e0b; }
.tf-accept-bar-fill.tf-accept-low  { background: #ef4444; }
.tf-accept-pct {
    flex-shrink: 0;
    font-weight: 600;
    min-width: 5.5rem;
    text-align: right;
}
.tf-accept-pct.tf-accept-high { color: #34d399; }
.tf-accept-pct.tf-accept-mid  { color: #fbbf24; }
.tf-accept-pct.tf-accept-low  { color: #f87171; }

/* ── Feature 1: Trade Partner Intelligence accordion ────────────────────── */
/* Sits below the "Why this trade?" details drawer on each card */
.tf-partner-intel {
    margin-top: 0.15rem;
}
/* Toggle row — same visual language as tf-details-toggle */
.tf-pi-toggle {
    font-size: 0.7rem;
    color: #6b7280;
    cursor: pointer;
    list-style: none;
    padding: 0.15rem 0;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tf-pi-toggle:hover { color: #a78bfa; }
.tf-pi-toggle::marker,
.tf-pi-toggle::-webkit-details-marker { display: none; }
.tf-pi-toggle::before { content: '▸ '; }
details[open].tf-partner-intel .tf-pi-toggle::before { content: '▾ '; }

/* Activity category badge next to toggle */
.tf-pi-cat-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.tf-pi-cat-high { background: #064e3b; color: #6ee7b7; border: 1px solid #10b981; }
.tf-pi-cat-mid  { background: #451a03; color: #fcd34d; border: 1px solid #f59e0b; }
.tf-pi-cat-low  { background: #1e1b4b; color: #a5b4fc; border: 1px solid #4338ca; }

/* Body panel */
.tf-pi-body {
    margin-top: 0.3rem;
    padding: 0.5rem 0.6rem;
    background: #0c1220;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: #9ca3af;
}
/* Key/value row */
.tf-pi-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tf-pi-row-label {
    color: #6b7280;
    min-width: 6rem;
    flex-shrink: 0;
    font-style: italic;
}
/* Position affinity chips */
.tf-pi-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tf-pi-pos-chip {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.68rem;
    color: #d1d5db;
    font-weight: 600;
}
.tf-pi-pos-wt {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.62rem;
}
/* Yearly volume chips */
.tf-pi-years  { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tf-pi-year   { color: #9ca3af; }
.tf-pi-year strong { color: #d1d5db; }
/* Divider between volume info and acceptance factors */
.tf-pi-divider {
    border: none;
    border-top: 1px solid #1f2937;
    margin: 0.1rem 0;
}
/* Acceptance factor rows */
.tf-pi-factors { display: flex; flex-direction: column; gap: 0.2rem; }
.tf-pi-factor {
    font-size: 0.68rem;
    padding: 0.1rem 0;
}
.tf-pi-factor-up      { color: #34d399; }
.tf-pi-factor-neutral { color: #9ca3af; }
.tf-pi-factor-down    { color: #f87171; }
/* Accept row label */
.tf-pi-accept-row { align-items: flex-start; }
.tf-pi-accept-row .tf-pi-row-label { padding-top: 0.1rem; }

/* ── Exclude player filter ───────────────────────────────────────────────── */

/* "✕ Exclude Player" trigger button in sort bar */
.tf-exclude-add-btn {
    background: transparent;
    border: 1px solid #374151;
    border-radius: 999px;
    color: #9ca3af;
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.tf-exclude-add-btn:hover { border-color: #f87171; color: #f87171; }

/* Chip group (Excluding: [chip] [chip]) */
.tf-exclude-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    max-width: 100%;            /* don't overflow parent */
}
.tf-exclude-chips {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    max-width: 100%;
}
.tf-exclude-chip {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 999px;
    color: #f87171;
    font-size: 0.68rem;
    padding: 0.15rem 0.55rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.tf-exclude-chip:hover { background: rgba(248, 113, 113, 0.25); }

/* Inline picker that drops below the sort bar */
.tf-exclude-picker {
    position: relative;
    padding: 6px 12px 4px;
    background: #111827;
    border-bottom: 1px solid #1f2937;
}
.tf-exclude-input {
    width: 100%;
    max-width: 260px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    outline: none;
    box-sizing: border-box;
}
.tf-exclude-input:focus { border-color: #6366f1; }
.tf-exclude-suggestions {
    position: absolute;
    top: 100%;
    left: 12px;
    width: 260px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    z-index: 999;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.tf-exclude-suggestion {
    padding: 7px 12px;
    font-size: 0.78rem;
    color: #cbd5e1;
    cursor: pointer;
    border-bottom: 1px solid #1e293b;
}
.tf-exclude-suggestion:hover { background: #273344; color: #f1f5f9; }

/* ── Player profile link — clickable name indicator ───────────────────────── */
/* Matches the .ldm-profile-link / .wpl-profile-link pattern in styles_v4.css  */
.tf-profile-link {
    cursor: pointer;
    transition: color 0.15s;
}
.tf-profile-link:hover {
    color: #60a5fa;           /* blue-400 — consistent with other profile links */
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Per-player contract chip on trade cards ───────────────────────────────── */
.tf-contract-chip {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
    cursor: default;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.25);
}
/* 1yr remaining — amber warning */
.tf-contract-chip.tf-contract-warn {
    background: rgba(245,158,11,0.15);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.25);
}
/* Expired */
.tf-contract-chip.tf-contract-exp {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.25);
}
