/* Tournament Summary - extracted from Views/TournamentSummary/Index.cshtml.
   Behaviour unchanged. Media queries that had to be escaped for Razor in
   the view are written normally here, as this is a real stylesheet. */

    /* ================================================================
       DESIGN TOKENS — Single source of truth for theming
       ================================================================ */
    :root {
        /* Surface colors */
        --ts-bg-primary: #ffffff;
        --ts-bg-secondary: #f8f9fa;
        --ts-bg-tertiary: #f1f3f5;
        --ts-bg-elevated: #ffffff;
        --ts-bg-inset: #f4f5f7;
        /* Border colors */
        --ts-border: #e2e5e9;
        --ts-border-subtle: #eef0f2;
        --ts-border-strong: #d1d5db;
        /* Text colors */
        --ts-text-primary: #111827;
        --ts-text-secondary: #6b7280;
        --ts-text-tertiary: #9ca3af;
        --ts-text-inverse: #ffffff;
        /* Accent — the FGB brand green, referenced from brand-colors.css so
           this section cannot drift from the rest of the site. */
        --ts-accent: var(--fgb-green, #16a34a);
        --ts-accent-hover: var(--fgb-green-dark, #15803d);
        --ts-accent-subtle: #f0fdf4;
        --ts-accent-muted: #dcfce7;
        /* Data colors */
        --ts-positive: #10b981;
        --ts-positive-bg: #ecfdf5;
        --ts-negative: #ef4444;
        --ts-negative-bg: #fef2f2;
        --ts-warning: #f59e0b;
        --ts-warning-bg: #fffbeb;
        /* Spacing */
        --ts-space-xs: 0.25rem;
        --ts-space-sm: 0.5rem;
        --ts-space-md: 1rem;
        --ts-space-lg: 1.5rem;
        --ts-space-xl: 2rem;
        --ts-space-2xl: 3rem;
        /* Radius */
        --ts-radius-sm: 4px;
        --ts-radius-md: 6px;
        --ts-radius-lg: 8px;
        --ts-radius-xl: 12px;
        /* Transitions */
        --ts-transition: 150ms ease;
        --ts-transition-slow: 250ms ease;
        /* Typography */
        --ts-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
        /* Golf scoring: red under par, plain over par, blue level */
        --tso-under: #d1242f;
        --tso-even: #2563eb;
    }

    [data-bs-theme="dark"] {
        --ts-bg-primary: #0d1117;
        --ts-bg-secondary: #161b22;
        --ts-bg-tertiary: #1c2128;
        --ts-bg-elevated: #1c2128;
        --ts-bg-inset: #0d1117;
        --ts-border: #30363d;
        --ts-border-subtle: #21262d;
        --ts-border-strong: #484f58;
        --ts-text-primary: #e6edf3;
        --ts-text-secondary: #8b949e;
        --ts-text-tertiary: #6e7681;
        --ts-text-inverse: #0d1117;
        /* the lighter brand green reads better on #0d1117 */
        --ts-accent: var(--fgb-green-light, #22c55e);
        --ts-accent-hover: #4ade80;
        --ts-accent-subtle: rgba(34, 197, 94, 0.10);
        --ts-accent-muted: rgba(34, 197, 94, 0.16);
        --ts-positive: #3fb950;
        --ts-positive-bg: rgba(63, 185, 80, 0.1);
        --ts-negative: #f85149;
        --ts-negative-bg: rgba(248, 81, 73, 0.1);
        --ts-warning: #d29922;
        --ts-warning-bg: rgba(210, 153, 34, 0.1);
        /* brighter on dark so red stays legible against #0d1117 */
        --tso-under: #ff7b72;
        --tso-even: #58a6ff;
    }

    /* ================================================================
       PAGE LAYOUT
       ================================================================ */
    .ts-page {
        max-width: 1400px;
        margin: 0 auto;
        padding: var(--ts-space-lg) var(--ts-space-lg) var(--ts-space-xl);
    }

    /* ================================================================
       TOURNAMENT HEADER
       ================================================================ */
    .ts-header {
        margin-bottom: var(--ts-space-lg);
    }

    .ts-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--ts-text-primary);
        letter-spacing: -0.025em;
        line-height: 1.3;
        margin: 0;
    }

    .ts-course-name {
        font-size: 0.875rem;
        font-weight: 400;
        color: var(--ts-text-secondary);
    }

        .ts-course-name a {
            color: inherit;
            text-decoration: none;
            transition: color var(--ts-transition);
        }

            .ts-course-name a:hover {
                color: var(--ts-accent);
                text-decoration: underline;
                text-underline-offset: 2px;
            }

    .ts-separator {
        margin: 0 0.625rem;
        color: var(--ts-text-tertiary);
        font-weight: 300;
    }

    /* ================================================================
       WINNERS CAROUSEL
       ================================================================ */
    .ts-winners {
        position: relative;
        margin-bottom: var(--ts-space-lg);
    }

    .ts-winners-track {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: var(--ts-space-xs) 36px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

        .ts-winners-track::-webkit-scrollbar {
            display: none;
        }

    .ts-winner-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.375rem 0.625rem;
        border-radius: var(--ts-radius-md);
        background: var(--ts-bg-secondary);
        border: 1px solid var(--ts-border-subtle);
        font-size: 0.8125rem;
        white-space: nowrap;
        flex-shrink: 0;
        text-decoration: none;
        color: var(--ts-text-primary);
        transition: all var(--ts-transition);
        cursor: pointer;
        line-height: 1.4;
    }

        .ts-winner-chip:hover {
            border-color: var(--ts-accent);
            background: var(--ts-accent-subtle);
            color: var(--ts-text-primary);
            text-decoration: none;
        }

        .ts-winner-chip.active {
            background: var(--ts-accent);
            color: var(--ts-text-inverse);
            border-color: var(--ts-accent);
        }

            .ts-winner-chip.active:hover {
                background: var(--ts-accent-hover);
                color: var(--ts-text-inverse);
            }

    .ts-winner-year {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .ts-winner-chip.active .ts-winner-year {
        color: inherit;
    }

    .ts-winner-name {
        font-weight: 500;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ts-winner-score {
        font-size: 0.75rem;
        font-weight: 500;
        opacity: 0.7;
    }

    .ts-winner-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 1px solid var(--ts-border);
        background: var(--ts-bg-elevated);
        color: var(--ts-text-secondary);
        cursor: pointer;
        z-index: 5;
        transition: all var(--ts-transition);
        padding: 0;
        font-size: 0.75rem;
    }

        .ts-winner-nav:hover {
            border-color: var(--ts-border-strong);
            color: var(--ts-text-primary);
        }

    .ts-winner-nav--prev {
        left: 0;
    }

    .ts-winner-nav--next {
        right: 0;
    }

    /* ================================================================
       COURSE STATISTICS PANEL
       ================================================================ */
    .ts-panel {
        background: var(--ts-bg-secondary);
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-lg);
        overflow: hidden;
        margin-bottom: var(--ts-space-lg);
    }

    .ts-metrics-row {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0;
    }

    .ts-metric {
        padding: var(--ts-space-md) var(--ts-space-lg);
        border-right: 1px solid var(--ts-border);
        position: relative;
    }

        .ts-metric:last-child {
            border-right: none;
        }

    .ts-metric-label {
        display: block;
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--ts-text-tertiary);
        font-weight: 500;
        margin-bottom: 0.375rem;
    }

    .ts-metric-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--ts-text-primary);
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }

    /* ================================================================
       EVENT SUB-STATS STRIP
       ================================================================ */
    .ts-substats {
        display: none;
        flex-wrap: wrap;
        gap: 0.5rem var(--ts-space-lg);
        padding: 0.625rem var(--ts-space-lg);
        border-top: 1px solid var(--ts-border);
        background: var(--ts-bg-inset);
    }

    .ts-substat {
        display: inline-flex;
        align-items: baseline;
        gap: 0.375rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .ts-substat-label {
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--ts-text-tertiary);
        font-weight: 500;
        font-size: 0.625rem;
    }

    .ts-substat-value {
        font-weight: 700;
        color: var(--ts-text-primary);
        font-variant-numeric: tabular-nums;
    }

    .ts-substat-note {
        font-weight: 500;
        color: var(--ts-text-secondary);
        font-size: 0.6875rem;
    }

    /* Golf convention (matches your leaderboard): red = under par */
    .ts-substat-under {
        color: var(--ts-negative);
        font-weight: 600;
    }

    .ts-substat-over {
        color: var(--ts-text-secondary);
        font-weight: 600;
    }

    /* ================================================================
       COLLAPSIBLE SECTIONS (Analytics & Weather)
       ================================================================ */
    .ts-collapsible {
        border-top: 1px solid var(--ts-border);
    }

    .ts-collapsible-trigger {
        width: 100%;
        background: transparent;
        border: none;
        padding: 0.875rem var(--ts-space-lg);
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        transition: background var(--ts-transition);
        color: var(--ts-text-secondary);
    }

        .ts-collapsible-trigger:hover {
            background: var(--ts-bg-tertiary);
        }

    .ts-collapsible-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
    }

        .ts-collapsible-title i {
            color: var(--ts-accent);
            font-size: 0.875rem;
        }

    .ts-collapsible-icon {
        transition: transform var(--ts-transition);
        font-size: 0.875rem;
    }

        .ts-collapsible-icon.expanded {
            transform: rotate(180deg);
        }

    .ts-collapsible-body {
        display: none;
        padding: 0 var(--ts-space-lg) var(--ts-space-lg);
    }

    /* ================================================================
       CHARTS
       ================================================================ */
    .ts-charts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--ts-space-md);
    }

    .ts-chart-card {
        background: var(--ts-bg-elevated);
        border-radius: var(--ts-radius-md);
        padding: var(--ts-space-md);
        border: 1px solid var(--ts-border);
    }

    .ts-chart-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--ts-text-secondary);
        font-weight: 600;
        margin-bottom: var(--ts-space-md);
    }

        .ts-chart-header i:first-child {
            color: var(--ts-accent);
        }

    .ts-chart-body {
        /* Chart.js responsive sizing needs a positioned parent with a
           definite height; min-height alone resolves height:100% against
           an auto box, which is how these ended up 124px wide and blank. */
        position: relative;
        height: 280px;
    }

    .ts-chart-info-btn {
        background: transparent;
        border: none;
        color: var(--ts-text-tertiary);
        font-size: 0.8125rem;
        padding: 0.125rem 0.375rem;
        cursor: pointer;
        transition: color var(--ts-transition);
        margin-left: auto;
        border-radius: var(--ts-radius-sm);
    }

        .ts-chart-info-btn:hover {
            color: var(--ts-text-primary);
            background: var(--ts-bg-tertiary);
        }

    .ts-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 260px;
        border: 1px dashed var(--ts-border);
        border-radius: var(--ts-radius-md);
        color: var(--ts-text-tertiary);
        text-align: center;
        gap: 0.5rem;
    }

    .ts-placeholder-icon {
        font-size: 2rem;
        opacity: 0.35;
    }

    .ts-placeholder-text {
        font-size: 0.8125rem;
        font-weight: 500;
    }

    .ts-placeholder-sub {
        font-size: 0.75rem;
        opacity: 0.6;
    }

    /* ================================================================
       "WHAT WON" INSIGHT CARD
       ================================================================ */
    .ts-insight-card {
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-lg);
        overflow: hidden;
        margin-bottom: var(--ts-space-lg);
        display: none;
    }

    .ts-insight-header {
        padding: var(--ts-space-md) var(--ts-space-lg);
        border-bottom: 1px solid var(--ts-border);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 700;
        font-size: 0.875rem;
        color: var(--ts-text-primary);
    }

        .ts-insight-header i {
            color: var(--ts-warning);
        }

    .ts-insight-body {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) 1fr;
        gap: 0;
    }

    .ts-insight-chart-wrap {
        padding: var(--ts-space-lg);
        border-right: 1px solid var(--ts-border);
        display: flex;
        flex-direction: column;
    }

    .ts-insight-chart-canvas-wrap {
        position: relative;
        flex: 1;
        min-height: 240px;
    }

    .ts-insight-radar-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--ts-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .ts-insight-legend {
        display: flex;
        gap: var(--ts-space-md);
        justify-content: center;
        margin-top: 0.75rem;
        font-size: 0.6875rem;
        color: var(--ts-text-secondary);
    }

    .ts-insight-legend-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
        margin-right: 4px;
        vertical-align: middle;
    }

    .ts-insight-callouts {
        padding: var(--ts-space-lg);
        display: flex;
        flex-direction: column;
        gap: var(--ts-space-md);
    }

    .ts-callout {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem var(--ts-space-md);
        background: var(--ts-bg-secondary);
        border-radius: var(--ts-radius-md);
        font-size: 0.8125rem;
        line-height: 1.5;
        color: var(--ts-text-primary);
    }

    .ts-callout-icon {
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        margin-top: 1px;
    }

    .ts-callout-icon--positive {
        background: var(--ts-positive-bg);
        color: var(--ts-positive);
    }

    .ts-callout-icon--negative {
        background: var(--ts-negative-bg);
        color: var(--ts-negative);
    }

    .ts-callout-icon--neutral {
        background: var(--ts-accent-subtle);
        color: var(--ts-accent);
    }

    .ts-callout-label {
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

    .ts-callout-label--positive {
        color: var(--ts-positive);
    }

    .ts-callout-label--negative {
        color: var(--ts-negative);
    }

    /* Round tabs — the leaderboard as it stood after each round. Replaced
       the bump chart, whose ten near-parallel lines mostly showed that
       players who finished in the top ten had been there all week. */
    .ts-rounds {
        display: inline-flex;
        gap: 2px;
        padding: 2px;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        background: var(--ts-bg-tertiary);
    }

    .ts-round-btn {
        border: 0;
        background: transparent;
        color: var(--ts-text-secondary);
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.3rem 0.7rem;
        border-radius: var(--ts-radius-sm);
        cursor: pointer;
        white-space: nowrap;
        transition: background var(--ts-transition), color var(--ts-transition);
    }

        .ts-round-btn:hover:not(.active) {
            background: var(--ts-bg-primary);
            color: var(--ts-text-primary);
        }

        .ts-round-btn.active {
            background: var(--ts-accent);
            color: var(--ts-text-inverse);
        }

        .ts-round-btn:focus-visible {
            outline: 2px solid var(--ts-accent);
            outline-offset: 1px;
        }

    .ts-round-note {
        font-size: 0.75rem;
        color: var(--ts-text-secondary);
        margin: 0 0 var(--ts-space-sm);
        min-height: 1rem;
    }

    /* Wave split additions */
    .ts-weather-value-group {
        display: flex;
        align-items: baseline;
        gap: 0.625rem;
    }

    .ts-weather-score {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--ts-text-secondary);
        font-variant-numeric: tabular-nums;
    }

    .ts-weather-subhead {
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--ts-text-tertiary);
        font-weight: 600;
        margin: -0.25rem 0 0.5rem;
    }

    .ts-weather-score.ts-wave-harder {
        color: var(--ts-warning);
        font-weight: 700;
    }

    .ts-weather-score.ts-wave-easier {
        color: var(--ts-positive);
        font-weight: 700;
    }

    .ts-weather-score.ts-wave-even {
        color: var(--ts-text-secondary);
    }

    .ts-weather-label .bi-sun-fill {
        color: #f5a623;
    }
    /* warm morning */
    .ts-weather-label .bi-moon-stars-fill {
        color: #6366f1;
    }
    /* cool afternoon */

    .ts-wave-diff {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        margin-top: 0.625rem;
        padding: 0.125rem 0.5rem;
        border-radius: var(--ts-radius-sm);
        font-size: 0.6875rem;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .ts-wave-diff--hard {
        background: var(--ts-warning-bg);
        color: var(--ts-warning);
    }

    .ts-wave-diff--even {
        background: var(--ts-bg-tertiary);
        color: var(--ts-text-tertiary);
    }

    @media (max-width: 768px) {
        .ts-insight-body {
            grid-template-columns: 1fr;
        }

        .ts-insight-chart-wrap {
            border-right: none;
            border-bottom: 1px solid var(--ts-border);
            padding: var(--ts-space-md);
        }

        .ts-insight-callouts {
            padding: var(--ts-space-md);
        }
    }

    /* ================================================================
       SHARE & TOAST
       ================================================================ */
    .ts-share-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        font-weight: 600;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        background: transparent;
        color: var(--ts-text-secondary);
        cursor: pointer;
        transition: all var(--ts-transition);
        white-space: nowrap;
    }

        .ts-share-btn:hover {
            border-color: var(--ts-accent);
            color: var(--ts-accent);
            background: var(--ts-accent-subtle);
        }

    .ts-share-btn--small {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }

    .ts-share-dropdown {
        display: inline-block;
    }

    /* Toast notification */
    .ts-toast {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        padding: 0.625rem 1.25rem;
        background: var(--ts-bg-elevated);
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--ts-text-primary);
        z-index: 9999;
        opacity: 0;
        transition: all 250ms ease;
        pointer-events: none;
    }

        .ts-toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

    /* Collapsible insight header */
    .ts-insight-header {
        cursor: pointer;
        user-select: none;
    }

        .ts-insight-header .ts-collapsible-icon {
            margin-left: auto;
            transition: transform 200ms ease;
        }

            .ts-insight-header .ts-collapsible-icon.expanded {
                transform: rotate(180deg);
            }

        .ts-insight-header .ts-share-dropdown {
            margin-left: auto;
        }

    /* ================================================================
       WEATHER CARDS
       ================================================================ */
    .ts-weather-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: var(--ts-space-md);
    }

    .ts-weather-card {
        background: var(--ts-bg-elevated);
        border-radius: var(--ts-radius-md);
        padding: var(--ts-space-md);
        border: 1px solid var(--ts-border);
    }

    .ts-weather-round {
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--ts-text-tertiary);
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .ts-weather-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }

        .ts-weather-row + .ts-weather-row {
            border-top: 1px solid var(--ts-border-subtle);
            margin-top: 0.25rem;
            padding-top: 0.5rem;
        }

    .ts-weather-label {
        font-size: 0.75rem;
        color: var(--ts-text-tertiary);
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .ts-weather-value {
        font-size: 1rem;
        font-weight: 700;
        color: var(--ts-text-primary);
        font-variant-numeric: tabular-nums;
    }

    .ts-weather-unit {
        font-size: 0.6875rem;
        color: var(--ts-text-tertiary);
        margin-left: 0.125rem;
        font-weight: 400;
    }

    /* ================================================================
       TOOLBAR (View Toggle + Search + Export)
       ================================================================ */
    .ts-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--ts-space-md);
        margin-bottom: var(--ts-space-md);
        flex-wrap: wrap;
    }

    .ts-view-group {
        display: inline-flex;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        overflow: hidden;
        background: var(--ts-bg-secondary);
    }

    .ts-view-btn {
        padding: 0.4375rem 0.875rem;
        font-size: 0.8125rem;
        font-weight: 500;
        border: none;
        background: transparent;
        color: var(--ts-text-secondary);
        cursor: pointer;
        transition: all var(--ts-transition);
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        position: relative;
    }

        .ts-view-btn + .ts-view-btn {
            border-left: 1px solid var(--ts-border);
        }

        .ts-view-btn:hover:not(.active) {
            background: var(--ts-bg-tertiary);
            color: var(--ts-text-primary);
        }

        .ts-view-btn.active {
            background: var(--ts-accent);
            color: var(--ts-text-inverse);
        }

    .ts-toolbar-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .ts-search-input {
        display: flex;
        align-items: center;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        background: var(--ts-bg-primary);
        padding: 0 0.75rem;
        transition: border-color var(--ts-transition);
        height: 34px;
    }

        .ts-search-input:focus-within {
            border-color: var(--ts-accent);
        }

        .ts-search-input i {
            color: var(--ts-text-tertiary);
            font-size: 0.8125rem;
        }

        .ts-search-input input {
            border: none;
            background: transparent;
            padding: 0.375rem 0.5rem;
            font-size: 0.8125rem;
            color: var(--ts-text-primary);
            outline: none;
            width: 180px;
        }

            .ts-search-input input::placeholder {
                color: var(--ts-text-tertiary);
            }

    .ts-icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        height: 34px;
        padding: 0 0.75rem;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        background: var(--ts-bg-primary);
        color: var(--ts-text-secondary);
        font-size: 0.8125rem;
        font-weight: 500;
        cursor: pointer;
        transition: all var(--ts-transition);
        white-space: nowrap;
    }

        .ts-icon-btn:hover {
            border-color: var(--ts-border-strong);
            color: var(--ts-text-primary);
            background: var(--ts-bg-secondary);
        }

        .ts-icon-btn.ts-icon-btn--success {
            border-color: var(--ts-positive);
            color: var(--ts-positive);
            background: var(--ts-positive-bg);
        }

    /* ================================================================
       AG-GRID CONTAINER
       ================================================================ */
    .ts-grid-wrap {
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-lg);
        overflow: hidden;
        margin-bottom: var(--ts-space-lg);
        position: relative;
    }

    #tournamentGrid {
        height: 620px;
        width: 100%;
    }

        /* ================================================================
       AG-GRID THEME OVERRIDES — Match page design tokens
       ================================================================ */
        #tournamentGrid.ag-theme-quartz,
        #tournamentGrid.ag-theme-quartz-dark {
            --ag-background-color: var(--ts-bg-primary);
            --ag-foreground-color: var(--ts-text-primary);
            --ag-header-background-color: var(--ts-bg-secondary);
            --ag-header-foreground-color: var(--ts-text-secondary);
            --ag-border-color: var(--ts-border);
            --ag-secondary-border-color: var(--ts-border-subtle);
            --ag-row-border-color: var(--ts-border-subtle);
            --ag-odd-row-background-color: transparent;
            --ag-row-hover-color: var(--ts-bg-tertiary);
            --ag-selected-row-background-color: transparent;
            --ag-range-selection-background-color: transparent;
            --ag-range-selection-border-color: transparent;
            --ag-header-cell-hover-background-color: var(--ts-bg-tertiary);
            --ag-font-size: 0.8125rem;
            --ag-grid-size: 4px;
            --ag-cell-horizontal-padding: 10px;
            --ag-header-column-separator-display: none;
            --ag-borders: none;
            --ag-wrapper-border-radius: 0;
            --ag-card-radius: 0;
        }

        /* Header styling */
        #tournamentGrid .ag-header {
            border-bottom: 1px solid var(--ts-border);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            font-size: 0.6875rem;
        }

        /* Row styling */
        #tournamentGrid .ag-row {
            border-bottom: 1px solid var(--ts-border-subtle);
            cursor: pointer;
            transition: background-color 100ms ease;
        }

            #tournamentGrid .ag-row:hover {
                background-color: var(--ts-bg-tertiary) !important;
            }

            /* Expanded parent row highlight */
            #tournamentGrid .ag-row.ts-row-expanded {
                background-color: var(--ts-accent-subtle) !important;
            }

        /* Pinned column separator */
        #tournamentGrid .ag-pinned-left-header,
        #tournamentGrid .ag-pinned-left-cols-container {
            border-right: 1px solid var(--ts-border);
        }

    /* Mobile grid: ensure horizontal scroll works smoothly */
    @media (max-width: 768px) {
        .ts-grid-wrap {
            border-radius: var(--ts-radius-md);
        }
        /* Make ag-grid scroll horizontally */
        #tournamentGrid .ag-body-horizontal-scroll {
            display: block !important;
        }

        #tournamentGrid .ag-root-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        /* Subtle scroll hint gradient on right edge */
        .ts-grid-wrap::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 24px;
            height: 100%;
            pointer-events: none;
            z-index: 2;
            background: linear-gradient(to right, transparent, var(--ts-bg-primary));
            opacity: 0.6;
            transition: opacity 0.3s ease;
        }

        .ts-grid-wrap.scrolled-right::after {
            opacity: 0;
        }
    }

    /* Compact cell font on mobile */
    @media (max-width: 768px) {
        #tournamentGrid .ag-cell {
            font-size: 0.8125rem;
            padding-left: 4px !important;
            padding-right: 4px !important;
        }

        #tournamentGrid .ag-header-cell-label {
            font-size: 0.6875rem;
        }
    }

    /* ================================================================
       PLAYER LINKS
       ================================================================ */
    .player-link {
        text-decoration: none;
        color: inherit;
        transition: color var(--ts-transition);
    }

        .player-link:hover {
            color: var(--ts-accent);
            text-decoration: underline;
            text-underline-offset: 2px;
        }

    /* ================================================================
       DFS OPTIMAL LINEUP
       ================================================================ */
    .ts-lineup-section {
        max-width: 480px;
        margin: 0 auto var(--ts-space-xl);
    }

    .ts-lineup-card {
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-lg);
        overflow: hidden;
        background: var(--ts-bg-primary);
    }

    .ts-lineup-header {
        padding: 0.875rem var(--ts-space-md);
        background: var(--ts-accent);
        color: var(--ts-text-inverse);
    }

        .ts-lineup-header h5 {
            margin: 0;
            font-size: 0.9375rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

    .ts-lineup-body .player-row {
        display: flex;
        align-items: center;
        padding: 0.75rem var(--ts-space-md);
        border-bottom: 1px solid var(--ts-border-subtle);
        transition: background var(--ts-transition);
    }

        .ts-lineup-body .player-row:last-child {
            border-bottom: none;
        }

        .ts-lineup-body .player-row:hover {
            background: var(--ts-bg-secondary);
        }

    .player-number {
        width: 22px;
        height: 22px;
        background: var(--ts-accent);
        color: var(--ts-text-inverse);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 0.75rem;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    .player-info {
        flex: 1;
        min-width: 0;
    }

    .player-name {
        font-weight: 600;
        font-size: 0.875rem;
        margin-bottom: 0.0625rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--ts-text-primary);
    }

    .player-finish {
        font-size: 0.75rem;
        color: var(--ts-text-secondary);
    }

    .winner-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        background: var(--ts-warning-bg);
        color: var(--ts-warning);
        padding: 0.0625rem 0.375rem;
        border-radius: var(--ts-radius-sm);
        font-size: 0.6875rem;
        font-weight: 600;
    }

    .finish-position {
        background: var(--ts-bg-tertiary);
        color: var(--ts-text-secondary);
        padding: 0.0625rem 0.375rem;
        border-radius: var(--ts-radius-sm);
        font-size: 0.6875rem;
        font-weight: 500;
    }

    .player-stats {
        text-align: right;
        flex-shrink: 0;
        margin-left: 0.75rem;
    }

    .player-salary {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--ts-positive);
        font-variant-numeric: tabular-nums;
    }

    .player-points {
        font-size: 0.75rem;
        color: var(--ts-text-secondary);
        font-variant-numeric: tabular-nums;
    }

    .ts-lineup-totals {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        border-top: 1px solid var(--ts-border);
        background: var(--ts-bg-secondary);
    }

    .ts-lineup-total {
        padding: 0.75rem var(--ts-space-md);
        text-align: center;
    }

        .ts-lineup-total + .ts-lineup-total {
            border-left: 1px solid var(--ts-border);
        }

    .total-label {
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--ts-text-tertiary);
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .total-value {
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--ts-text-primary);
        font-variant-numeric: tabular-nums;
    }

    .salary-remaining {
        color: var(--ts-positive);
    }

    .salary-over {
        color: var(--ts-negative);
    }

    /* ================================================================
       SCORECARD TABLE (used by inline detail)
       ================================================================ */
    .scorecard-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.8125rem;
        table-layout: fixed;
    }

        .scorecard-table th,
        .scorecard-table td {
            width: 48px;
            min-width: 48px;
            padding: 0.625rem 0.25rem;
            text-align: center;
            border: 1px solid var(--ts-border);
            font-weight: 600;
            font-variant-numeric: tabular-nums;
        }

            .scorecard-table th:first-child,
            .scorecard-table td:first-child {
                width: 70px;
                min-width: 70px;
                text-align: left;
                padding-left: 0.75rem;
                font-weight: 700;
                background: var(--ts-bg-secondary);
            }

            .scorecard-table th:last-child,
            .scorecard-table td:last-child {
                width: 56px;
                min-width: 56px;
                background: var(--ts-bg-secondary);
                font-weight: 700;
            }

        .scorecard-table th {
            background: var(--ts-bg-secondary);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 0.6875rem;
            letter-spacing: 0.03em;
            color: var(--ts-text-secondary);
        }

        .scorecard-table tbody tr:nth-child(even) {
            background: var(--ts-bg-secondary);
        }

    .scorecard-out-column,
    .scorecard-in-column {
        background: var(--ts-bg-secondary) !important;
        font-weight: 700;
    }

    .scorecard-score-birdie {
        border: 2px solid var(--ts-positive);
        border-radius: 50%;
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.8125rem;
    }

    .scorecard-score-eagle {
        border: 2px solid #059669;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.8125rem;
        box-shadow: 0 0 0 2px var(--ts-bg-primary), 0 0 0 4px #059669;
    }

    .scorecard-score-bogey {
        border: 2px solid var(--ts-warning);
        width: 26px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.8125rem;
    }

    .scorecard-score-double {
        border: 2px solid var(--ts-negative);
        width: 26px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.8125rem;
        box-shadow: 0 0 0 2px var(--ts-bg-primary), 0 0 0 4px var(--ts-negative);
    }

    .scorecard-score-par {
        font-weight: 600;
    }

    .scorecard-stat-yes {
        color: var(--ts-positive);
        font-weight: 600;
    }

    .scorecard-stat-no {
        color: var(--ts-text-tertiary);
    }

    /* ================================================================
       CLICKABLE ROUND SCORES IN GRID
       ================================================================ */
    .round-score-clickable {
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .round-score-info-icon {
        opacity: 0;
        transition: opacity var(--ts-transition);
        font-size: 0.75em;
        color: var(--ts-accent);
    }

    .ag-theme-quartz .ag-cell:hover .round-score-info-icon,
    .ag-theme-quartz-dark .ag-cell:hover .round-score-info-icon {
        opacity: 1;
    }

    .ag-theme-quartz .ag-cell:has(.round-score-clickable),
    .ag-theme-quartz-dark .ag-cell:has(.round-score-clickable) {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ================================================================
       INLINE SCORECARD DETAIL (fullWidthRow)
       ================================================================ */
    .ts-inline-detail {
        padding: var(--ts-space-md) var(--ts-space-lg);
        background: var(--ts-bg-secondary);
        border-top: 1px solid var(--ts-border);
        border-bottom: 1px solid var(--ts-border);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ts-inline-detail-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
        gap: var(--ts-space-md);
        flex-wrap: wrap;
    }

    .ts-inline-detail-left {
        display: flex;
        align-items: center;
        gap: var(--ts-space-md);
        flex-wrap: wrap;
    }

    .ts-inline-detail-player {
        font-weight: 700;
        font-size: 0.9375rem;
        color: var(--ts-text-primary);
    }

    .ts-inline-detail-tee {
        font-size: 0.8125rem;
        color: var(--ts-text-secondary);
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .ts-inline-round-toggle {
        display: inline-flex;
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-md);
        overflow: hidden;
    }

    .ts-inline-round-btn {
        padding: 0.25rem 0.625rem;
        font-size: 0.75rem;
        font-weight: 600;
        border: none;
        background: transparent;
        color: var(--ts-text-secondary);
        cursor: pointer;
        transition: all var(--ts-transition);
        min-width: 36px;
    }

        .ts-inline-round-btn + .ts-inline-round-btn {
            border-left: 1px solid var(--ts-border);
        }

        .ts-inline-round-btn:hover:not(.active) {
            background: var(--ts-bg-tertiary);
            color: var(--ts-text-primary);
        }

        .ts-inline-round-btn.active {
            background: var(--ts-accent);
            color: var(--ts-text-inverse);
        }

    .ts-inline-close-btn {
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--ts-radius-sm);
        border: 1px solid var(--ts-border);
        background: var(--ts-bg-primary);
        color: var(--ts-text-tertiary);
        cursor: pointer;
        transition: all var(--ts-transition);
        font-size: 1rem;
        line-height: 1;
        flex-shrink: 0;
    }

        .ts-inline-close-btn:hover {
            background: var(--ts-negative-bg);
            border-color: var(--ts-negative);
            color: var(--ts-negative);
        }

    .ts-inline-scorecard-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Force full-width row to span properly */
    .ag-full-width-row .ag-cell-wrapper {
        width: 100%;
    }

    .ag-full-width-row {
        overflow: visible !important;
    }

        .ag-full-width-row .ag-cell {
            overflow: visible !important;
        }

    @media (max-width: 768px) {
        .ts-inline-detail {
            padding: var(--ts-space-sm) var(--ts-space-md);
        }

        .ts-inline-detail-player {
            font-size: 0.8125rem;
        }
    }

    /* ================================================================
       LOADING STATES
       ================================================================ */
    .ts-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--ts-space-xl) 0;
        gap: 0.75rem;
        color: var(--ts-text-secondary);
        font-size: 0.875rem;
    }

        .ts-loading .spinner-border {
            width: 1.5rem;
            height: 1.5rem;
            border-width: 2px;
        }

    /* ================================================================
       RESPONSIVE — TABLET (≤1200px)
       ================================================================ */
    @media (max-width: 1200px) {
        .ts-metrics-row {
            grid-template-columns: repeat(3, 1fr);
        }

        .ts-metric:nth-child(3) {
            border-right: none;
        }

        .ts-metric:nth-child(n+4) {
            border-top: 1px solid var(--ts-border);
        }

        .ts-charts-grid {
            grid-template-columns: 1fr 1fr;
        }

            .ts-charts-grid > :last-child {
                grid-column: 1 / -1;
            }
    }

    /* ================================================================
       RESPONSIVE — MOBILE (≤768px)
       ================================================================ */
    @media (max-width: 768px) {
        .ts-page {
            padding: var(--ts-space-md) var(--ts-space-md) var(--ts-space-lg);
        }

        .ts-title {
            font-size: 1.25rem;
        }

        .ts-separator {
            display: none;
        }

        .ts-course-name {
            display: block;
            margin-top: 0.25rem;
        }
        /* Metrics: 2 columns on mobile */
        .ts-metrics-row {
            grid-template-columns: repeat(2, 1fr);
        }

        .ts-metric {
            padding: 0.75rem var(--ts-space-md);
        }

            .ts-metric:nth-child(3) {
                border-right: 1px solid var(--ts-border);
            }

            .ts-metric:nth-child(2n) {
                border-right: none;
            }

            .ts-metric:nth-child(n+3) {
                border-top: 1px solid var(--ts-border);
            }

        .ts-metric-value {
            font-size: 1.25rem;
        }
        /* Charts: single column */
        .ts-charts-grid {
            grid-template-columns: 1fr;
        }

            .ts-charts-grid > :last-child {
                grid-column: auto;
            }
        /* Winners */
        .ts-winners-track {
            padding: var(--ts-space-xs) var(--ts-space-sm);
        }

        .ts-winner-nav {
            display: none;
        }

        .ts-winner-chip {
            font-size: 0.75rem;
            padding: 0.375rem 0.5rem;
            min-height: 40px;
        }

        .ts-winner-name {
            max-width: 85px;
        }
        /* Toolbar */
        .ts-toolbar {
            flex-direction: column;
            align-items: stretch;
        }

        .ts-view-group {
            width: 100%;
        }

        .ts-view-btn {
            flex: 1;
            justify-content: center;
            padding: 0.5rem 0.5rem;
            font-size: 0.8125rem;
        }

        .ts-toolbar-actions {
            width: 100%;
        }

        .ts-search-input {
            flex: 1;
        }

            .ts-search-input input {
                width: 100%;
            }
        /* Grid */
        #tournamentGrid {
            height: 480px !important;
        }

        .ts-grid-wrap {
            border-radius: var(--ts-radius-md);
        }
        /* SG values hidden on mobile */
        .round-sg-value {
            display: none;
        }
        /* Scorecard table (inline detail) */
        .scorecard-table {
            font-size: 0.75rem;
        }

            .scorecard-table th,
            .scorecard-table td {
                padding: 0.5rem 0.125rem;
                min-width: 34px;
                width: 34px;
            }

                .scorecard-table th:first-child,
                .scorecard-table td:first-child {
                    width: 52px;
                    min-width: 52px;
                    padding-left: 0.5rem;
                    font-size: 0.6875rem;
                }

        .scorecard-score-birdie,
        .scorecard-score-eagle {
            width: 24px;
            height: 24px;
            font-size: 0.6875rem;
        }

        .scorecard-score-bogey,
        .scorecard-score-double {
            width: 22px;
            height: 22px;
            font-size: 0.6875rem;
        }
        /* Lineup */
        .ts-lineup-section {
            max-width: 100%;
            padding: 0 0;
        }
        /* Weather */
        .ts-weather-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        /* Touch targets */
        .ts-collapsible-trigger {
            min-height: 48px;
        }

        .ts-view-btn {
            min-height: 44px;
        }
    }

    /* ================================================================
       RESPONSIVE — SMALL MOBILE (≤480px)
       ================================================================ */
    @media (max-width: 480px) {
        .ts-page {
            padding: var(--ts-space-sm) var(--ts-space-sm) var(--ts-space-md);
        }

        .ts-title {
            font-size: 1.125rem;
        }

        .ts-metric-label {
            font-size: 0.625rem;
        }

        .ts-metric-value {
            font-size: 1.125rem;
        }

        .ts-chart-card {
            padding: 0.75rem;
        }

        .ts-weather-grid {
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
        }

        .ts-winner-year {
            font-size: 0.6875rem;
        }

        #tournamentGrid {
            height: 420px !important;
        }

        .ts-lineup-totals {
            grid-template-columns: 1fr;
        }

        .ts-lineup-total + .ts-lineup-total {
            border-left: none;
            border-top: 1px solid var(--ts-border);
        }

        .total-value {
            font-size: 1rem;
        }
    }

    /* Skeleton shimmer */
    .ts-skeleton {
        background: linear-gradient(90deg, var(--ts-bg-secondary) 25%, var(--ts-bg-tertiary) 50%, var(--ts-bg-secondary) 75%);
        background-size: 200% 100%;
        animation: ts-shimmer 1.5s ease-in-out infinite;
        border-radius: var(--ts-radius-sm);
    }

    @keyframes ts-shimmer {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }

    .ts-metric-value.ts-skeleton {
        width: 60%;
        height: 1.5rem;
        display: inline-block;
    }

/* ============================================================
   EVENT VERDICT

   The page previously opened with six unanchored metrics and a
   winners carousel, with the actual analysis collapsed below the
   fold. This band answers "what happened here" before any click.
   ============================================================ */
.ts-verdict {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
    gap: var(--ts-space-lg);
    align-items: start;
    padding: 1.15rem 1.25rem;
    margin-bottom: var(--ts-space-md);
    background: var(--ts-bg-elevated);
    border: 1px solid var(--ts-border);
    border-left: 3px solid var(--ts-accent);
    border-radius: var(--ts-radius-lg);
}

.ts-verdict[hidden] {
    display: none;
}

@media (max-width: 860px) {
    .ts-verdict {
        grid-template-columns: 1fr;
    }
}

.ts-verdict-winner {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .5rem;
}

    .ts-verdict-winner i {
        color: var(--ts-accent);
    }

.ts-verdict-name {
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -.015em;
}

.ts-verdict-score,
.ts-verdict-margin {
    font-family: var(--ts-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: .9rem;
    font-weight: 700;
}

.ts-verdict-score {
    color: var(--ts-positive);
}

.ts-verdict-margin {
    color: var(--ts-text-secondary);
    font-weight: 600;
}

.ts-verdict-read {
    margin: 0;
    font-size: .95rem;
    line-height: 1.55;
    color: var(--ts-text-primary);
}

    .ts-verdict-read strong {
        font-weight: 700;
    }

/* right column: the ranked categories */
.ts-verdict-cats-title {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: var(--ts-text-secondary);
    margin-bottom: .45rem;
}

.ts-verdict-cat {
    display: grid;
    grid-template-columns: 42px 1fr 38px;
    align-items: center;
    gap: .5rem;
    padding: .16rem 0;
}

    .ts-verdict-cat.is-top .ts-verdict-cat-name,
    .ts-verdict-cat.is-top .ts-verdict-cat-r {
        color: var(--ts-accent);
        font-weight: 750;
    }

.ts-verdict-cat-name {
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .04em;
    color: var(--ts-text-secondary);
}

.ts-verdict-cat-bar {
    display: block;
    height: 7px;
    border-radius: 4px;
    background: var(--ts-bg-inset);
    overflow: hidden;
}

    .ts-verdict-cat-bar i {
        display: block;
        height: 100%;
        border-radius: 4px;
    }

        .ts-verdict-cat-bar i.is-pos {
            background: var(--ts-accent);
        }

        .ts-verdict-cat-bar i.is-neg {
            background: var(--ts-negative);
        }

.ts-verdict-cat-r {
    font-family: var(--ts-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: .74rem;
    text-align: right;
    color: var(--ts-text-secondary);
}

.ts-verdict-cats-note {
    font-size: .66rem;
    line-height: 1.4;
    color: var(--ts-text-secondary);
    margin-top: .5rem;
    padding-top: .45rem;
    border-top: 1px solid var(--ts-border-subtle);
}

/* ============================================================
   TOURNAMENT OVERVIEW  (/tournament-summary/{tour}/{event})

   Every year of one event side by side. The spine is comparability:
   contiguous same-setup years read as a block, and a break row is
   drawn wherever the venue, par or yardage moved — because a winning
   score means nothing across those boundaries.
   ============================================================ */
.tso-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--ts-space-sm);
    margin-bottom: var(--ts-space-md);
}

.tso-stat {
    background: var(--ts-bg-secondary);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    padding: 0.6rem 0.75rem;
    text-align: center;
}

    .tso-stat b {
        display: block;
        font-size: 1.15rem;
        font-weight: 750;
        line-height: 1.2;
        font-variant-numeric: tabular-nums;
        color: var(--ts-text-primary);
    }

    .tso-stat span {
        display: block;
        margin-top: 0.15rem;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 650;
        color: var(--ts-text-secondary);
    }

.tso-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: var(--ts-space-md);
    font-size: 0.82rem;
    line-height: 1.5;
    border-radius: var(--ts-radius-md);
    border: 1px solid var(--ts-border);
    border-left: 3px solid var(--ts-accent);
    background: var(--ts-accent-subtle);
    color: var(--ts-text-primary);
}

    .tso-callout[hidden] { display: none; }
    .tso-callout i { color: var(--ts-accent); margin-top: 2px; }

.tso-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.72rem;
    color: var(--ts-text-secondary);
}

.tso-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }

.tso-swatch {
    width: 18px;
    height: 2px;
    display: inline-block;
    background: var(--ts-border-strong);
}

/* Wide table scrolls inside its own box rather than the page */
.tso-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-primary);
}

.tso-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    /* A global rule in theme.min.css puts a 1px grey border on every side of
       every cell, which read as a spreadsheet grid. Horizontal rules alone
       are enough to track a row; kill the rest explicitly. */
    .tso-table th,
    .tso-table td {
        border: 0;
        border-bottom: 1px solid var(--ts-border-subtle);
    }

    .tso-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--ts-bg-secondary);
        font-size: 0.66rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 700;
        color: var(--ts-text-tertiary);
        text-align: left;
        padding: 0.7rem;
        border-bottom: 1px solid var(--ts-border);
        white-space: nowrap;
    }

    .tso-table td {
        padding: 0.65rem 0.7rem;
        vertical-align: middle;
    }

    .tso-table tbody tr:last-child td { border-bottom: 0; }

    .tso-row:hover td { background: var(--ts-accent-subtle); }

.tso-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tso-table th.tso-num { text-align: right; }

.tso-year {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ts-accent);
    text-decoration: none;
}

    .tso-year:hover { text-decoration: underline; }

.tso-next {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ts-text-tertiary);
}

.tso-row--upcoming { opacity: 0.72; }

.tso-col-venue { min-width: 170px; }
.tso-col-winner { min-width: 140px; font-weight: 600; }
.tso-setup { color: var(--ts-text-secondary); font-size: 0.8rem; }
.tso-muted { color: var(--ts-text-tertiary); }

/* Winning score: to par headline, raw strokes beneath */
.tso-score b { font-weight: 750; }

.tso-score small {
    display: block;
    font-size: 0.68rem;
    color: var(--ts-text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* ---- Scoring colours ----------------------------------------------------
   Golf's own convention, which every player already reads without thinking:
   RED is under par, plain text is over par. Applied to every score column
   (Score, T10, Scoring) and to vs Field as well — in all four, a negative
   number means the same thing, so using one colour rule keeps the row
   internally consistent rather than mixing "golf red" with "traffic-light
   green" in the same table.
   Even par gets its own colour so it is not mistaken for over par. */
.tso-under { color: var(--tso-under); font-weight: 700; }
.tso-even  { color: var(--tso-even);  font-weight: 650; }
.tso-over  { color: var(--ts-text-primary); }

.tso-good { color: var(--tso-under); font-weight: 650; }
.tso-bad { color: var(--ts-text-primary); }

.tso-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: var(--ts-radius-sm);
    background: var(--ts-bg-tertiary);
    border: 1px solid var(--ts-border);
    font-size: 0.7rem;
    font-weight: 650;
    white-space: nowrap;
}

.tso-badge--playoff {
    background: var(--ts-warning-bg);
    border-color: var(--ts-warning);
    color: var(--ts-warning);
}

.tso-badge--warn {
    background: var(--ts-warning-bg);
    border-color: var(--ts-warning);
    color: var(--ts-warning);
    font-size: 0.65rem;
}

/* The break row: this is the whole point of the page */
.tso-break td {
    padding: 0.3rem 0.7rem;
    background: var(--ts-bg-secondary);
    border-bottom: 1px solid var(--ts-border-subtle);
}

.tso-break-line {
    display: inline-block;
    height: 1px;
    background: var(--ts-border-strong);
    vertical-align: middle;
    width: 12px;
}

.tso-break-text {
    display: inline-block;
    margin: 0 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 650;
    color: var(--ts-text-secondary);
}

.tso-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--ts-text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .tso-summary { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
    .tso-stat b { font-size: 1rem; }
    .tso-table { font-size: 0.8rem; }
}

/* ---- Overview: next edition, sorting, field shading ---------------- */
.tso-next-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    margin-bottom: var(--ts-space-md);
    font-size: 0.82rem;
    border-radius: var(--ts-radius-md);
    border: 1px dashed var(--ts-border-strong);
    background: var(--ts-bg-secondary);
    color: var(--ts-text-secondary);
}

    .tso-next-banner[hidden] { display: none; }
    .tso-next-banner i { color: var(--ts-accent); }
    .tso-next-banner b { color: var(--ts-text-primary); }

.tso-sort { cursor: pointer; user-select: none; }

    .tso-sort:hover { color: var(--ts-accent); }

    .tso-sort::after {
        content: '';
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 0.3rem;
        vertical-align: middle;
        opacity: 0;
    }

    .tso-sort.is-asc::after,
    .tso-sort.is-desc::after {
        opacity: 1;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
    }

    .tso-sort.is-asc::after { border-bottom: 5px solid var(--ts-accent); }
    .tso-sort.is-desc::after { border-top: 5px solid var(--ts-accent); }

.tso-chrono { color: var(--ts-accent); }

/* Field strength has no zero a reader can anchor to, so shade it against
   the range this event has actually produced. --t runs 0 (weakest) to 1. */
.tso-field {
    display: inline-block;
    min-width: 3.1em;
    padding: 0.05rem 0.3rem;
    border-radius: var(--ts-radius-sm);
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--ts-accent) calc(var(--t, 0) * 22%), transparent);
}

.tso-flag {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.02rem 0.28rem;
    border-radius: 3px;
    background: var(--ts-bg-tertiary);
    border: 1px solid var(--ts-border-subtle);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ts-text-secondary);
    vertical-align: middle;
}

/* ---- Back link from a year page up to the event overview ---------- */
.ts-backlink {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--ts-text-secondary);
    text-decoration: none;
}

    .ts-backlink:hover {
        color: var(--ts-accent);
        text-decoration: none;
    }

/* ============================================================
   Open-by-default collapsibles. These sections hold the actual
   analysis; hiding them behind a click was the same hierarchy
   problem the verdict band fixed at the top of the page.
   ============================================================ */
.ts-collapsible-body.is-open { display: block; }

/* ---- Top-20 strokes gained heatmap -------------------------------
   Replaced the tee-to-green vs putting scatter. Built from HTML rather
   than a canvas: sharp when screenshotted, selectable text, and immune
   to the hidden-container sizing trap that blanked the old charts. */
/* ==================================================================
   SG QUADRANT
   Square SVG in a fixed-height box, matching .ts-chart-body so the
   three chart cards line up on one row.
   ================================================================== */
.ts-quad {
    position: relative;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ts-quad-svg {
    flex: 1 1 auto;
    width: 100%;
    max-width: 280px;
    min-height: 0;
    overflow: visible;
}

.ts-quad-ring {
    fill: none;
    stroke: var(--ts-border);
    stroke-width: 0.7;
}

.ts-quad-axis {
    stroke: var(--ts-border-strong, var(--ts-border));
    stroke-width: 0.9;
}

.ts-quad-axis-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    fill: var(--ts-text-secondary);
}

.ts-quad-dot {
    fill: var(--ts-accent);
    fill-opacity: 0.55;
    stroke: var(--ts-accent);
    stroke-width: 0.7;
}

    .ts-quad-dot.is-winner {
        fill: #eab308;
        fill-opacity: 0.95;
        stroke: #a16207;
        stroke-width: 1;
    }

.ts-quad-label {
    font-size: 7.5px;
    font-weight: 600;
    fill: var(--ts-text-primary);
    paint-order: stroke;
    stroke: var(--ts-bg-elevated);
    stroke-width: 2.5px;
    stroke-linejoin: round;
}

.ts-quad .ts-heat-note {
    flex: 0 0 auto;
    margin-top: 0.25rem;
}



.ts-heat-note,
.ts-heat-empty {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    line-height: 1.45;
    color: var(--ts-text-secondary);
}

.ts-heat-empty { text-align: center; padding: 1.25rem; }

@media (max-width: 640px) {
}

/* ---- Where the course bit (hole difficulty) ---------------------- */
.ts-holes { padding: 0 var(--ts-space-lg) var(--ts-space-lg); }

.ts-hole-strip {
    display: flex;
    gap: 2px;
    margin-bottom: var(--ts-space-md);
}

.ts-hole-tick {
    flex: 1;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 650;
    padding: 0.35rem 0;
    border-radius: 3px;
    color: var(--ts-text-secondary);
    cursor: default;
}

    .ts-hole-tick.is-hard {
        background: color-mix(in srgb, var(--ts-negative) calc(var(--t, 0) * 55%), transparent);
    }

    .ts-hole-tick.is-easy {
        background: color-mix(in srgb, var(--ts-positive) calc(var(--t, 0) * 55%), transparent);
    }

.ts-hole-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--ts-space-md);
}

.ts-hole-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--ts-text-tertiary);
    margin-bottom: 0.35rem;
}

.ts-hole-row {
    display: grid;
    grid-template-columns: 30px 96px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--ts-border-subtle);
}

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

.ts-hole-num {
    font-size: 0.85rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.ts-hole-par {
    font-size: 0.68rem;
    color: var(--ts-text-secondary);
    white-space: nowrap;
}

.ts-hole-bar {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: var(--ts-bg-inset);
    overflow: hidden;
}

    .ts-hole-bar i { display: block; height: 100%; border-radius: 3px; }
    .ts-hole-bar i.is-hard { background: var(--ts-negative); }
    .ts-hole-bar i.is-easy { background: var(--ts-positive); }

.ts-hole-rtp {
    text-align: right;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

    .ts-hole-rtp.is-hard { color: var(--ts-negative); }
    .ts-hole-rtp.is-easy { color: var(--ts-positive); }
