/* ==========================================
   OPPONENT-CONDITIONED PATH ANALYSIS
========================================== */

.path-team-cell {
    position: sticky;
    padding-right: 34px !important;
}

.path-team-cell .team-name-wrapper {
    max-width: calc(100% - 22px);
}

.path-toggle-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 1px solid rgba(85, 84, 93, 0.18);
    border-radius: 999px;
    background: #fff;
    color: #55545d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.path-toggle-btn:hover,
.path-toggle-btn:focus-visible {
    background: rgba(0, 119, 204, 0.08);
    border-color: rgba(0, 119, 204, 0.35);
    outline: none;
}

.path-toggle-icon {
    display: inline-block;
    font-size: 18px;
    font-weight: 800;
    transform: translateY(-1px);
    transition: transform 0.18s ease;
}

.team-data-row.path-open .path-toggle-icon {
    transform: rotate(90deg) translateX(-1px);
}

.path-focus-cell {
    cursor: pointer;
    position: relative;
}

.path-focus-cell:hover {
    outline: 2px solid rgba(0, 119, 204, 0.35);
    outline-offset: -2px;
}

.path-focus-cell.path-cell-focused {
    outline: 2px solid rgba(0, 119, 204, 0.75);
    outline-offset: -2px;
}

.path-analysis-row[hidden] {
    display: none !important;
}

.path-analysis-row td.path-analysis-cell {
    padding: 10px 12px 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb;
    text-align: left !important;
}

.path-drawer-shell {
    position: sticky;
    left: 0;
    width: 100%;
    max-width: calc(100vw - 28px);
    z-index: 3;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.18s ease,
        opacity 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
    .path-drawer-shell {
        transition: none;
    }
}

.path-analysis-row.path-expanded .path-drawer-shell {
    max-height: var(--path-drawer-height, 1200px);
    opacity: 1;
}

.path-drawer-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 16px;
}

.path-drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.path-drawer-title {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.01em;
}

.path-drawer-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.35;
}

.path-drawer-close {
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.path-drawer-close:hover,
.path-drawer-close:focus-visible {
    background: #f8fafc;
    color: #111827;
    outline: none;
}

.path-transition-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.path-transition-chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.path-transition-chip:hover,
.path-transition-chip:focus-visible {
    border-color: rgba(0, 119, 204, 0.45);
    color: #0f172a;
    outline: none;
}

.path-transition-chip.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.path-transition-panel {
    display: none;
}

.path-transition-panel.active {
    display: block;
}

.path-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.path-summary-card {
    border: 1px solid #edf2f7;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
}

.path-summary-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    line-height: 1.25;
}

.path-summary-card strong {
    display: block;
    color: #111827;
    font-size: 22px;
    font-weight: 850;
    margin-top: 4px;
    letter-spacing: -0.03em;
}

.path-opponents-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    color: #111827;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 6px 0 8px;
}

.path-opponents-header-meta {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.path-opponent-list {
    display: grid;
    gap: 7px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.path-opponent-row {
    display: grid;
    grid-template-columns: minmax(110px, 1.1fr) minmax(140px, 2fr) minmax(92px, auto);
    gap: 10px;
    align-items: center;
    padding: 7px 8px;
    border-radius: 10px;
    background: #f8fafc;
}

.path-opponent-name {
    font-size: 13px;
    font-weight: 750;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.path-share-track {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.path-share-bar {
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
    background: #111827;
}

.path-opponent-numbers {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    white-space: nowrap;
}

.path-opponent-numbers span:first-child {
    color: #111827;
}

.path-opponent-numbers span:last-child {
    color: #0077cc;
}

.path-footnote {
    margin-top: 10px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

@media screen and (max-width: 768px) {
    .path-team-cell {
        padding-right: 30px !important;
    }

    .path-toggle-btn {
        right: 5px;
        width: 20px;
        height: 20px;
    }

    .forecast-table .path-analysis-row:not([hidden]) {
        display: block;
    }

    .forecast-table .path-analysis-row td.path-analysis-cell {
        display: block;
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        padding: 8px 6px 12px !important;
        overflow: visible;
    }

    .forecast-table .path-drawer-shell {
        position: relative;
        left: auto;
        width: 100%;
        max-width: 100%;
    }

    .path-drawer-card {
        border-radius: 12px;
        padding: 12px;
    }

    .path-drawer-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .path-drawer-title {
        font-size: 14px;
    }

    .path-drawer-subtitle {
        font-size: 11px;
    }

    .path-transition-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 3px;
    }

    .path-transition-chip {
        font-size: 10px;
        padding: 5px 9px;
    }

    .path-summary-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .path-summary-card {
        padding: 8px 10px;
    }

    .path-summary-card strong {
        font-size: 19px;
    }

    .path-opponents-header {
        display: block;
        font-size: 11px;
    }

    .path-opponents-header-meta {
        display: block;
        margin-top: 2px;
    }

    .path-opponent-row {
        grid-template-columns: minmax(88px, 1fr) minmax(80px, 1.3fr) minmax(76px, auto);
        gap: 7px;
        padding: 7px;
    }

    .path-opponent-name {
        font-size: 12px;
    }

    .path-opponent-numbers {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1px;
        text-align: right;
        font-size: 11px;
    }

    .path-footnote {
        font-size: 10px;
    }
}