/* Reset and base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors - Pine & Slate */
    --color-bg: #141816;
    --color-surface: #1e2422;
    --color-border: #2a302e;
    --color-text: #e0e4e2;
    --color-text-muted: #9fa7a3;
    --color-primary: #5d8a66;
    --color-primary-hover: #6fa078;
    --color-accent: #7a8fa3;
    --color-success: #7acc85;
    /* Color opacity variants */
    --color-accent-10: rgba(122, 143, 163, 0.1);
    --color-accent-15: rgba(122, 143, 163, 0.15);
    --color-primary-10: rgba(93, 138, 102, 0.1);
    --color-primary-15: rgba(93, 138, 102, 0.15);
    --color-success-10: rgba(122, 204, 133, 0.1);
    --color-success-15: rgba(122, 204, 133, 0.15);
    /* Typography */
    --font-mono:
        ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    --font-sans: system-ui, -apple-system, sans-serif;
    /* Spacing scale */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    /* Layout */
    --navbar-height: 87px;
    /* Border radius */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    /* Focus ring for accessibility */
    --focus-ring: 2px solid var(--color-accent);
    --focus-ring-offset: 2px;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

/* Navbar */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.75rem;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-links a.active {
    color: var(--color-primary);
    font-weight: bold;
}

/* Hamburger menu button - hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    transition:
        transform 0.2s,
        opacity 0.2s;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.container.wide {
    max-width: 100%;
    width: 100%;
    padding: 2rem 4rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

/* Gradient text headers - shared gradient effect */
.hero h1,
.show-header h1,
.chat-welcome h1,
.history-header h1 {
    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-accent)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.tabs button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.tabs button:hover {
    color: var(--color-text);
    background-color: var(--color-surface);
}

.tabs button.active {
    color: var(--color-primary);
    background-color: var(--color-surface);
}

.tab-content {
    min-height: 200px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--color-primary-hover);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background-color: transparent;
}

/* Icon button base - for buttons containing only icons */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    line-height: 1;
    border-radius: var(--border-radius-sm);
    transition:
        color 0.2s,
        background-color 0.2s;
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auth/Form styles */
.auth-container {
    max-width: 600px;
    width: 90%;
    margin: 3rem auto;
    padding: 2.5rem 3rem;
    background: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.auth-container h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--color-error, #dc3545);
    color: var(--color-error, #dc3545);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form .form-group label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
}

.auth-form .form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .form-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 59, 130, 246), 0.15);
}

.auth-form .form-group input:focus-visible {
    outline: none;
}

.auth-form .btn {
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.form-group input {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
}

.form-group input:focus {
    border-color: var(--color-primary);
}

.form-group input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Base table styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
}

/* Table modifier: striped rows */
.table-striped tbody tr:nth-child(odd) {
    background-color: transparent;
}

.table-striped tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Table modifier: hover state (teal accent) */
.table-hover tbody tr:hover {
    background-color: var(--color-accent-10);
}

/* Table modifier: sticky header */
.table-sticky-header thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-sticky-header th {
    background-color: var(--color-surface);
}

/* Table modifier: accent header (teal background) */
.table-accent-header th {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

/* Data table: uses global table styles with transparent striping for game pages */
.data-table th,
.data-table td {
    border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:nth-child(odd) {
    background-color: transparent;
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background-color: var(--color-accent-10);
}

/* Data table responsive styles */
@media (max-width: 576px) {
    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.5rem;
    }

    /* Minimum touch target height */
    .data-table tbody tr {
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.35rem;
    }
}

/* Cards */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--color-text-muted);
}

/* Loading state */
.loading {
    color: var(--color-text-muted);
    font-style: italic;
}

/* HTMX loading indicator */
.htmx-request .loading {
    display: block;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* List table loading state (applied with 200ms delay) */
.table-wrapper.table-loading table {
    opacity: 0.6;
    transition: opacity 150ms ease-out;
}

.table-wrapper table {
    transition: opacity 150ms ease-out;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

/* Navbar controls (search + count) */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.result-count {
    color: var(--color-text-muted);
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Filters toggle button - hidden on desktop */
.filters-toggle {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s;
}

.filters-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.filters-toggle .filter-icon,
.filters-toggle .chevron-icon {
    width: 14px;
    height: 14px;
}

.filters-toggle .chevron-icon {
    transition: transform 0.2s;
}

.filters-toggle .chevron-icon.chevron-open {
    transform: rotate(180deg);
}

/* Filters label hidden on desktop (shown only on mobile) */
.filters-toggle .filters-label {
    display: none;
}

/* Filters collapsible container - visible inline on desktop */
.filters-collapsible {
    display: contents;
}

/* Navbar filters */
.navbar-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-group label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.filter-select {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--color-accent);
}

.filter-select:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.filter-input {
    width: 4rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
}

.filter-input::placeholder {
    color: var(--color-text-muted);
}

.filter-input:focus {
    border-color: var(--color-accent);
}

.filter-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Active filter highlight - when filter has a non-empty value */
.filter-input.filter-active {
    background-color: var(--color-accent-15);
    border-color: var(--color-accent);
}

.filter-separator {
    color: var(--color-text-muted);
}

/* Mobile navbar controls responsive styles */
@media (max-width: 768px) {
    .navbar-controls {
        order: 3;
        flex-basis: 100%;
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .navbar-controls .search-box {
        flex: 1;
        max-width: none;
    }

    /* Show filters toggle button on mobile */
    .filters-toggle {
        display: flex;
    }

    /* Show label on mobile (chevron is always visible when toggle is shown) */
    .filters-toggle .filters-label {
        display: inline;
    }

    /* Filters collapsible container on mobile - hidden by default */
    .filters-collapsible {
        display: none;
        flex-basis: 100%;
        overflow: hidden;
    }

    /* Show filters when open */
    .filters-collapsible.filters-open {
        display: block;
    }

    .navbar-filters {
        flex-basis: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-filters {
        gap: 0.5rem;
    }

    .filter-group label {
        font-size: 0.75rem;
    }

    .filter-select,
    .filter-input {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .filter-input {
        width: 3.25rem;
    }
}

/* Search box */

.search-box {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    color: var(--color-text);
}

.search-box input::placeholder {
    color: var(--color-text-muted);
}

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

.search-box input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Active filter highlight for search box */
.search-box input.filter-active {
    background-color: var(--color-accent-15);
    border-color: var(--color-accent);
}

/* Tables - Global styles for all tables in the app */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
}

th {
    background-color: var(--color-accent);
    color: var(--color-bg);
    font-weight: 600;
    position: sticky;
    top: var(--navbar-height);
    z-index: 40;
}

tbody tr:nth-child(odd) {
    background-color: var(--color-surface);
}

tbody tr:nth-child(even) {
    background-color: var(--color-bg);
}

tbody tr:hover {
    background-color: var(--color-accent-15);
}

/* Prevent date columns from wrapping */
.date-cell {
    white-space: nowrap;
    font-size: 0.75em;
}

/* Table wrapper for consistent widths */
.table-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.table-wrapper table {
    width: 100%;
    table-layout: fixed;
}

.table-wrapper .expand-header,
.table-wrapper .expand-cell {
    width: 3rem;
}

/* Table wrapper with horizontal scroll */
.table-wrapper-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        gap: 0;
        padding: 0.5rem 1rem;
        z-index: 99;
    }

    .nav-links.menu-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-user {
        display: flex;
        flex-direction: column;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .nav-user .user-email {
        font-size: 0.85rem;
        color: var(--color-text-muted);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    th,
    td {
        padding: 0.5rem 0.4rem;
        font-size: 0.875rem;
    }

    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .nav-brand a {
        font-size: 1.25rem;
    }
}

/* Stat cards */
.stat-cards {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-accent);
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Charts */
.charts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chart-container {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.chart-container h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* ECharts container needs explicit height */
#shows-chart,
#songs-chart {
    width: 100%;
    height: 350px;
}

/* Chart with details panel layout */
.chart-with-details {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.chart-with-details .chart-container {
    flex: 1;
    min-width: 0;
}

.chart-hint {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.chart-table-toggle {
    font-size: 0.85rem;
    color: var(--color-link);
    background: none;
    border: none;
    padding: 0.25rem 0;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 0.5rem;
}

.chart-table-toggle:hover {
    color: var(--color-link-hover);
}

.chart-table-toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.chart-data-table {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
}

.chart-data-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.chart-data-table th,
.chart-data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.chart-data-table th {
    background: var(--color-bg-elevated);
    position: sticky;
    top: 0;
}

.chart-data-table tbody tr:last-child td {
    border-bottom: none;
}

.chart-data-table tbody tr:hover {
    background: var(--color-bg-hover);
}

/* Song History Section */
.song-history-section {
    margin-bottom: 2rem;
}

.song-search-wrapper {
    position: relative;
    max-width: 400px;
    margin-bottom: 1rem;
}

.song-search-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    color: var(--color-text);
}

.song-search-input::placeholder {
    color: var(--color-text-muted);
}

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

.song-search-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.song-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    margin-top: 4px;
    z-index: 50;
}

.song-option {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.1s;
}

.song-option:hover,
.song-option.highlighted {
    background-color: var(--color-accent-15);
}

#song-history-chart {
    width: 100%;
    height: 350px;
}

.song-history-loading {
    color: var(--color-text-muted);
    padding: 2rem;
    text-align: center;
}

.song-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem;
    color: var(--color-text-muted);
}

.song-history-empty .empty-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

@media (max-width: 768px) {
    .song-search-wrapper {
        max-width: 100%;
    }

    #song-history-chart {
        height: 300px;
    }
}

.details-panel {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

.details-panel.hidden {
    display: none;
}

.details-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.details-panel h3 span {
    color: var(--color-accent);
}

.details-panel ol {
    list-style: none;
    counter-reset: song-counter;
}

.details-panel li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    counter-increment: song-counter;
}

.details-panel li::before {
    content: counter(song-counter) ".";
    color: var(--color-text-muted);
    margin-right: 0.5rem;
    min-width: 1.5rem;
}

.details-panel .song-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-panel .play-count {
    color: var(--color-primary);
    font-weight: bold;
    margin-left: 0.5rem;
}

.details-panel .venue-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-panel .venue-city {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .chart-with-details {
        flex-direction: column;
    }

    .details-panel {
        width: 100%;
    }

    .details-panel ol {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.5rem 2rem;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Utility */
.text-muted {
    color: var(--color-text-muted);
}

.text-center {
    text-align: center;
}

/* Accessibility: Screen reader only text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibility: Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    z-index: 200;
    text-decoration: none;
    border-radius: 0 0 var(--border-radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

/* Gradient text effect - used for hero and page titles */
.text-gradient {
    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-accent)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Row links - make table cells clickable without inline JS */
.row-link {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

.row-link:hover {
    color: inherit;
}

/* Expand/collapse column */
.expand-header {
    width: 2rem;
    padding: 0.5rem;
}

.expand-cell {
    width: 2rem;
    padding: 0.5rem;
    text-align: center;
}

/* .expand-btn extends .btn-icon - uses class="btn-icon expand-btn" in templates */
.expand-btn {
    background: none;
    color: var(--color-text-muted);
    padding: 0.25rem;
    font-size: 0.75rem;
    transition:
        transform 0.2s,
        color 0.2s;
}

.expand-btn:hover {
    color: var(--color-accent);
}

/* Rotate icon when row is expanded */
.show-row.expanded .expand-icon {
    display: inline-block;
    transform: rotate(90deg);
}

/* Preview row - hidden by default, shown when parent row is expanded */
.preview-row {
    display: none;
}

.show-row.expanded + .preview-row {
    display: table-row;
}

.preview-row td {
    padding: 0.75rem 1rem 1rem 2.5rem;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

/* Preview spinner positioning */
.preview-spinner {
    justify-content: center;
    padding: 1rem 0;
}

/* Setlist preview */
.setlist-preview {
    line-height: 1.8;
    color: var(--color-text-muted);
}

.preview-set {
    display: block;
    margin-bottom: 0.25rem;
}

.preview-set-label {
    font-weight: bold;
    color: var(--color-accent);
    margin-right: 0.5rem;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.preview-link {
    font-size: 0.85rem;
}

/* .btn-import-show uses .btn.btn-outline.btn-sm - only unique disabled state here */
.btn-import-show:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Future shows */
.future-show {
    opacity: 0.7;
}

.upcoming-badge,
.today-badge {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.upcoming-badge {
    color: var(--color-accent);
    background-color: var(--color-accent-15);
    border: 1px solid var(--color-accent);
}

.today-badge {
    color: var(--color-primary);
    background-color: var(--color-primary-15);
    border: 1px solid var(--color-primary);
}

/* Show detail page */
.show-detail {
    max-width: 800px;
    margin: 0 auto;
}

.show-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.show-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.show-header .venue-info {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.show-header .location-info {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Setlist */
.setlist {
    margin-bottom: 3rem;
}

.set-header-row .set-title {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    padding: 1.5rem 0 0.5rem 0;
}

/* Setlist table - extends global table styles with transparent striping */
.setlist-table tbody tr:not(.set-header-row):nth-child(odd) {
    background-color: transparent;
}

.setlist-table tbody tr:not(.set-header-row):nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.setlist-table tbody tr:not(.set-header-row):hover {
    background-color: var(--color-accent-10);
}

/* Subtle dotted line between song name and gap for visual tracking */
.setlist-table tbody tr:not(.set-header-row) {
    border-bottom: 1px dotted var(--color-border);
}

.song-cell {
    padding: 0.5rem 1rem 0.5rem 0;
}

.gap-cell {
    width: 3.5rem;
    text-align: right;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.setlist-table thead th {
    cursor: default;
    padding: 0.5rem 1rem;
}

.gap-header,
.last-played-header {
    text-align: right;
}

.last-played-cell {
    text-align: right;
    padding: 0.5rem 0 0.5rem 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.debut-indicator {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

.song-header {
    text-align: left;
}

.song-link {
    color: var(--color-text);
    text-decoration: none;
}

.song-link:hover {
    color: var(--color-primary);
}

.song-name.jam {
    font-style: italic;
}

.transition {
    color: var(--color-text-muted);
}

.reprise,
.footnote {
    color: var(--color-primary);
    margin-left: 0.1rem;
}

.footnote {
    cursor: help;
}

/* Setlist table responsive styles */
@media (max-width: 480px) {
    .setlist-table {
        font-size: 0.85rem;
    }

    .song-cell {
        padding: 0.5rem 0.5rem 0.5rem 0;
    }

    .gap-cell {
        width: 2.5rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    .last-played-cell {
        font-size: 0.75rem;
        padding: 0.5rem 0 0.5rem 0.25rem;
    }
}

/* Show notes */
.show-notes {
    background-color: var(--color-surface);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
}

.show-notes h2 {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.show-notes .notes-content {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.show-notes .notes-content em {
    color: var(--color-text);
}

.mt-1 {
    margin-top: 0.5rem;
}
.mt-2 {
    margin-top: 1rem;
}
.mt-3 {
    margin-top: 1.5rem;
}
.mb-1 {
    margin-bottom: 0.5rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.mb-3 {
    margin-bottom: 1.5rem;
}

/* Chat Interface - ChatGPT Style */
.container.chat-page {
    width: 100%;
    max-width: 100%;
    padding: 0;
    height: calc(100vh - var(--navbar-height) - 60px);
    display: flex;
    flex-direction: column;
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.chat-welcome h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.chat-welcome p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 600px;
}

.suggestion-chip {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-10);
}

.chat-message {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.chat-message-user {
    background: transparent;
}

.chat-message-assistant {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message-user .message-avatar {
    background: var(--color-primary);
    color: white;
}

.chat-message-assistant .message-avatar {
    background: var(--color-accent);
    color: var(--color-bg);
}

.message-avatar svg {
    width: 20px;
    height: 20px;
}

.message-content {
    flex: 1;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding-top: 0.25rem;
}

/* Markdown content styling */
.markdown-content {
    white-space: normal;
}

.markdown-content p {
    margin: 0 0 0.75rem 0;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0 0 0.75rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content li:last-child {
    margin-bottom: 0;
}

.markdown-content code {
    background: var(--color-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--color-bg);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0 0 0.75rem 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child {
    margin-top: 0;
}

.markdown-content table {
    border-collapse: collapse;
    margin: 0 0 0.75rem 0;
    width: 100%;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.markdown-content th {
    background: var(--color-bg);
    font-weight: 600;
}

.markdown-content blockquote {
    border-left: 3px solid var(--color-accent);
    margin: 0 0 0.75rem 0;
    padding-left: 1rem;
    color: var(--color-muted);
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content a {
    color: var(--color-accent);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.chat-input-wrapper {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.chat-input-form {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.chat-input-container:focus-within {
    border-color: var(--color-accent);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
}

.chat-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.chat-input::placeholder {
    color: var(--color-text-muted);
}

/* .send-btn extends .btn-icon - uses class="btn-icon send-btn" in templates */
.send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-lg);
    background: var(--color-primary);
    color: white;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--color-primary-hover);
}

.send-icon {
    width: 18px;
    height: 18px;
}

.chat-footer {
    text-align: center;
    padding-top: 0.75rem;
}

.clear-chat-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.clear-chat-btn:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* Message body wrapper for reasoning + content */
.message-body {
    flex: 1;
    min-width: 0;
}

/* Bouncing dots animation (typing indicator, preview spinner) */
.typing-indicator,
.preview-spinner {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator {
    padding: 0.5rem 0;
}

.typing-indicator span,
.preview-spinner span {
    width: 8px;
    height: 8px;
    background-color: var(--color-text-muted);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(1),
.preview-spinner span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2),
.preview-spinner span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3),
.preview-spinner span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.loading-message {
    opacity: 0.8;
}

/* Reasoning/Tool Calls Section */
.reasoning-section {
    margin-bottom: 0.75rem;
}

.reasoning-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 0.4rem 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reasoning-toggle:hover {
    background: var(--color-accent-10);
    border-color: var(--color-accent);
    color: var(--color-text);
}

.reasoning-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.reasoning-icon.expanded {
    transform: rotate(90deg);
}

.reasoning-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tool-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.reasoning-content {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    font-size: 0.85rem;
}

.tool-call {
    margin-bottom: 0.75rem;
}

.tool-call:last-child {
    margin-bottom: 0;
}

.tool-call-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tool-name {
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

.tool-args {
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.tool-output {
    background: var(--color-surface);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    overflow-x: auto;
}

.tool-output pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .chat-message {
        padding: 1rem;
    }

    .chat-welcome h1 {
        font-size: 1.5rem;
    }

    .chat-suggestions {
        flex-direction: column;
    }

    .suggestion-chip {
        width: 100%;
    }
}

/* Reduced motion - disable animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    /* Disable bouncing dots animation - show static dots at full opacity */
    .typing-indicator span,
    .preview-spinner span {
        animation: none;
        opacity: 0.7;
    }

    /* Disable table loading transition - instant opacity change */
    .table-wrapper table,
    .table-wrapper.table-loading table {
        transition: none;
    }

    /* Disable reasoning icon rotation */
    .reasoning-icon {
        transition: none;
    }
}

/* Sync status indicator */
.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary);
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.show-row.syncing {
    background-color: var(--color-primary-10) !important;
}

.sync-done-icon {
    color: var(--color-success, #4ade80);
    margin-right: 0.25rem;
}

/* Admin page */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-section {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

.admin-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background-color: var(--color-bg);
    border-radius: var(--border-radius-md);
}

.stat-item .value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--color-accent);
}

.stat-item .label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.meta-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.meta-info p {
    margin-bottom: 0.5rem;
}

.meta-info strong {
    color: var(--color-text);
}

.import-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.import-option {
    padding: 1rem;
    background-color: var(--color-bg);
    border-radius: var(--border-radius-md);
}

.import-option h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.import-option p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.import-option .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.import-option .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.date-range-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.date-range-inputs input[type="date"] {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
}

.date-range-inputs input[type="date"]:focus {
    border-color: var(--color-accent);
}

.date-range-inputs input[type="date"]:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.syncing-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.syncing-section h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.syncing-section.hidden {
    display: none;
}

.syncing-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.syncing-list li {
    padding: 0.5rem;
    background-color: var(--color-bg);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sync-count-badge {
    background-color: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.import-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.import-status.success {
    color: var(--color-accent);
}

.import-status.error {
    color: var(--color-primary);
}

/* Song History Page / Venue History Page */
.song-history,
.venue-history {
    max-width: 100%;
}

.history-header {
    margin-bottom: 1.5rem;
}

.history-header h1 {
    font-size: 2rem;
    margin: 0.5rem 0 0.25rem 0;
}

.history-header .performance-count {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.back-link {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-primary);
}

/* Venue with city/state below */
.venue-location {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Badges for debut, opener, closer */
.debut-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    color: var(--color-accent);
    background-color: var(--color-accent-15);
    border: 1px solid var(--color-accent);
}

.opener-badge,
.closer-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: bold;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1.25rem;
    text-align: center;
    border-radius: 3px;
    margin-left: 0.25rem;
}

.opener-badge {
    color: var(--color-accent);
    background-color: var(--color-accent-15);
    border: 1px solid var(--color-accent);
}

.closer-badge {
    color: var(--color-primary);
    background-color: var(--color-primary-15);
    border: 1px solid var(--color-primary);
}

/* Set Stats Mini Grid */
.set-stats-cell {
    padding: 0.25rem 0.5rem;
}

.set-stats-grid {
    display: grid;
    grid-template-columns: auto repeat(4, minmax(1.5rem, 1fr));
    gap: 0;
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.set-stats-grid span {
    text-align: center;
    padding: 0.1rem 0.2rem;
}

.set-stats-hdr {
    color: var(--color-text-muted);
    font-weight: bold;
    border-bottom: 1px solid var(--color-border);
}

.set-stats-label {
    color: var(--color-text-muted);
    font-weight: bold;
    text-align: right !important;
    padding-right: 0.3rem !important;
}

.set-stats-opener {
    color: var(--color-accent);
}

.set-stats-closer {
    color: var(--color-primary);
}

.set-stats-zero {
    opacity: 0.3;
}

@media (max-width: 768px) {
    .set-stats-grid {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .set-stats-cell {
        display: none;
    }
    /* Hide Set Stats header on mobile (last column in songs table) */
    .song-list table th:last-child {
        display: none;
    }
}

/* Nav user section */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* .btn-logout uses .btn.btn-outline.btn-sm - only unique text-decoration here */
.btn-logout {
    text-decoration: none;
}

@media (max-width: 768px) {
    .user-email {
        display: none;
    }
}

/* Game Entry Form */
.game-entry-form {
    max-width: 900px;
}

.breadcrumb {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.show-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.show-badge.halloween {
    background-color: #ff6600;
    color: #000;
}

.show-badge.nye {
    background-color: #ffd700;
    color: #000;
}

.show-badge.past {
    background-color: #6c757d;
    color: #fff;
}

.entry-status {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.entry-status.new-entry {
    color: var(--color-accent);
}

.entry-status.past-entry {
    color: var(--color-text-muted);
}

.entry-status.no-entry {
    color: #6c757d;
    font-style: italic;
}

.last-updated {
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.three-set-toggle {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.toggle-text {
    font-weight: 500;
    color: var(--color-text);
}

.toggle-help {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.entry-sections {
    display: grid;
    gap: 2rem;
}

.song-picks-section h3,
.special-picks-section h3 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.section-help {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.song-slots {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.song-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
}

.song-slot .position-number {
    color: var(--color-text-muted);
    font-weight: bold;
    min-width: 2rem;
}

.add-song-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.add-song-btn:hover:not(:disabled) {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.add-song-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.special-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.special-pick-group h4 {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.special-pick-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.special-pick-slot label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    min-width: 80px;
}

.entry-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.coming-soon-note,
.help-note {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
}

/* Song slot filled state */
.song-slot.filled,
.special-pick-slot.filled {
    background-color: var(--color-accent-10);
    border-color: var(--color-accent);
}

.selected-song {
    color: var(--color-text);
    font-weight: 500;
    flex: 1;
    cursor: pointer;
}

.selected-song:hover {
    text-decoration: underline;
}

/* Read-only mode styles for past shows */
.selected-song.readonly {
    cursor: default;
}

.selected-song.readonly:hover {
    text-decoration: none;
}

.empty-slot {
    color: var(--color-text-muted);
    font-style: italic;
}

.write-in-marker {
    color: var(--color-primary);
    font-style: italic;
    font-weight: normal;
}

/* Bustout warning indicator (gap < 30 shows) */
.bustout-warning {
    color: #f0ad4e;
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.has-bustout-warning {
    border-left: 3px solid #f0ad4e;
    padding-left: 0.5rem;
}

.remove-song-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

.remove-song-btn:hover {
    color: #ff4444;
}

/* Drag handle for reordering */
.drag-handle {
    color: var(--color-text-muted);
    cursor: grab;
    font-size: 1rem;
    letter-spacing: -0.15em;
    padding: 0.25rem;
    user-select: none;
    opacity: 0.6;
    transition:
        opacity 0.2s,
        color 0.2s;
}

.drag-handle:hover {
    opacity: 1;
    color: var(--color-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Drag states for SortableJS */
.song-slot-ghost {
    opacity: 0.4;
    background-color: var(--color-surface);
    border: 2px dashed var(--color-primary);
}

.song-slot-chosen {
    background-color: var(--color-primary-10);
    border-color: var(--color-primary);
}

.song-slot-drag {
    opacity: 1 !important;
    background-color: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Song Picker Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    color: var(--color-text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-filters {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    align-items: center;
}

.modal-filters .search-box {
    flex: 1;
    min-width: 200px;
}

.picker-gap-filters,
.picker-nshows-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-gap-filters label,
.picker-nshows-filter label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.picker-gap-filters .filter-input {
    width: 70px;
}

.picker-nshows-filter .filter-input {
    width: 80px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Picker Table - extends global table styles */
.picker-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.picker-table th {
    cursor: pointer;
    user-select: none;
}

.picker-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.picker-table tbody tr:hover {
    background-color: var(--color-primary-10);
}

.picker-table td {
    color: var(--color-text);
}

.picker-row {
    cursor: pointer;
}

.picker-row.song-already-selected {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(128, 128, 128, 0.1);
}

.picker-row.song-already-selected:hover {
    background-color: rgba(128, 128, 128, 0.2);
}

.selected-badge {
    color: var(--color-accent);
    font-size: 0.85em;
    margin-left: 0.25rem;
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

/* Write-in song section in picker */
.write-in-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.write-in-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.write-in-toggle:hover {
    color: var(--color-accent);
}

.write-in-toggle-icon {
    font-weight: bold;
    transition: transform 0.2s;
}

.write-in-toggle.expanded .write-in-toggle-icon {
    transform: rotate(45deg);
}

.write-in-form {
    margin-top: 0.75rem;
}

.write-in-help {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.write-in-input-group {
    display: flex;
    gap: 0.5rem;
}

.write-in-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
}

.write-in-input:focus {
    border-color: var(--color-primary);
}

.write-in-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.write-in-submit {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
}

.write-in-submit:hover {
    background: var(--color-accent);
}

.write-in-submit-row {
    margin-top: 0.5rem;
}

.write-in-position-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
}

.write-in-position-btn:hover {
    background: var(--color-accent);
}

.write-in-toggle:focus-visible,
.write-in-position-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.write-in-position-picker {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

/* Game history status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
}

.status-badge.status-upcoming {
    background-color: rgba(78, 205, 196, 0.2);
    color: var(--color-accent);
}

.status-badge.status-past {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--color-text-muted);
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.clickable-row:hover {
    background-color: var(--color-accent-10);
}

.clickable-row:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
    background-color: var(--color-accent-10);
}

/* Game history section */
.game-history .empty-state {
    color: var(--color-text-muted);
    padding: 2rem 0;
}

.game-history .empty-state a {
    color: var(--color-primary);
}

/* Game entries list (all predictions for a show) */
.game-entries-list .entries-count {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.game-entries-list .empty-state {
    color: var(--color-text-muted);
    padding: 2rem 0;
    text-align: center;
}

.entries-actions {
    margin-top: 2rem;
    text-align: center;
}

.own-entry-badge {
    font-size: 0.85em;
    color: var(--color-primary);
    font-weight: 500;
    margin-left: 0.25rem;
}

.sets-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.sets-badge.two-set {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--color-success, #4caf50);
}

.sets-badge.three-set {
    background-color: var(--color-primary-15);
    color: var(--color-primary);
}

.action-cell {
    text-align: right;
}

/* View entry page */
.entry-meta {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.entry-owner-info {
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.entry-owner-info.own-entry {
    color: var(--color-primary);
}

.entry-owner-info a {
    color: var(--color-primary);
}

.entry-timestamp {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.view-entry-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* .btn-secondary extends .btn-outline with text color and surface hover */
.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: var(--color-surface);
    border-color: var(--color-primary);
}

/* Entry header with title and action button */
.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.entry-header h2 {
    margin: 0;
}

/* ==========================================================================
   Mobile Responsiveness for Game Entry Page (UI-005)
   ========================================================================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
    /* Entry header - stack on tablets */
    .entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .entry-header .btn-sm {
        width: 100%;
        text-align: center;
    }

    /* Modal - larger on tablets */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    /* Special picks grid - 2 columns on tablets */
    .special-picks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Picker table - reduce padding */
    .picker-table th,
    .picker-table td {
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile breakpoint */
@media (max-width: 576px) {
    /* Game entry form - full width */
    .game-entry-form {
        max-width: 100%;
    }

    /* Modal - full screen on mobile */
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-close {
        font-size: 1.75rem;
        padding: 0.5rem;
    }

    /* Modal filters - stack vertically */
    .modal-filters {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .modal-filters .search-box {
        width: 100%;
        min-width: 100%;
    }

    .modal-filters .search-box input {
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
        font-size: 1rem;
    }

    .modal-filters .search-icon {
        left: 0.75rem;
        width: 1rem;
        height: 1rem;
    }

    .picker-gap-filters,
    .picker-nshows-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .picker-gap-filters .filter-input,
    .picker-nshows-filter .filter-input {
        flex: 1;
        max-width: 80px;
    }

    /* Picker table - simplify for mobile */
    .picker-table {
        font-size: 0.9rem;
    }

    .picker-table th,
    .picker-table td {
        padding: 0.75rem 0.5rem;
    }

    /* Hide less important columns on mobile */
    .picker-table th:nth-child(3),
    .picker-table td:nth-child(3),
    .picker-table th:nth-child(4),
    .picker-table td:nth-child(4) {
        display: none;
    }

    /* Larger touch targets for picker rows */
    .picker-row {
        min-height: 48px;
    }

    /* Song slots - better touch targets */
    .song-slot {
        padding: 0.75rem;
        min-height: 48px;
    }

    .song-slot .position-number {
        min-width: 1.75rem;
        font-size: 0.9rem;
    }

    /* Drag handle - larger touch target on mobile */
    .drag-handle {
        padding: 0.5rem;
        font-size: 1.25rem;
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .add-song-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-height: 36px;
    }

    .remove-song-btn {
        padding: 0.5rem;
        font-size: 1.5rem;
        min-width: 36px;
        min-height: 36px;
    }

    /* Special picks - single column on mobile */
    .special-picks-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .special-pick-slot {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
        min-height: 40px;
    }

    .special-pick-slot label {
        min-width: 70px;
        font-size: 0.85rem;
    }

    .special-pick-slot .add-song-btn {
        flex: 1;
    }

    .special-pick-slot .selected-song {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Entry sections - reduce gap */
    .entry-sections {
        gap: 1.5rem;
    }

    /* Section help text - smaller */
    .section-help {
        font-size: 0.85rem;
    }

    /* Three-set toggle - wrap text */
    .three-set-toggle {
        padding: 0.5rem 0.75rem;
    }

    .toggle-label {
        flex-wrap: wrap;
    }

    .toggle-help {
        width: 100%;
        margin-top: 0.25rem;
        font-size: 0.8rem;
    }

    /* Write-in section - larger inputs */
    .write-in-section {
        padding: 0.5rem 0.75rem;
    }

    .write-in-toggle {
        font-size: 0.95rem;
        padding: 0.5rem 0;
    }

    .write-in-input-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .write-in-input {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .write-in-submit {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
    }

    /* Entry actions */
    .entry-actions {
        margin-top: 1.5rem;
    }

    .help-note {
        font-size: 0.85rem;
    }

    /* View entry actions - stack */
    .view-entry-actions {
        flex-direction: column;
    }

    .view-entry-actions .btn {
        width: 100%;
    }

    /* Entry status */
    .entry-status {
        font-size: 0.9rem;
    }

    .last-updated {
        font-size: 0.8rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem;
    }

    /* Page header - smaller on mobile */
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header .venue-info {
        font-size: 1rem;
    }

    .page-header .location-info {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .song-slot {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .song-slot .position-number {
        min-width: 1.5rem;
    }

    .drag-handle {
        padding: 0.35rem;
    }

    .special-pick-slot label {
        min-width: 60px;
    }

    .picker-table {
        font-size: 0.85rem;
    }

    .picker-table th,
    .picker-table td {
        padding: 0.5rem 0.4rem;
    }
}

/* ==========================================================================
   Game Show Selector (Songs Page Integration)
   ========================================================================== */

.game-show-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
}

.selector-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.selector-icon {
    font-size: 1.25rem;
}

.selector-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.selector-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition:
        border-color 0.2s,
        background-color 0.2s;
}

.selector-button:hover {
    border-color: var(--color-primary);
    background-color: rgba(255, 107, 53, 0.05);
}

.selector-button .show-date {
    font-weight: 600;
    color: var(--color-primary);
}

.selector-button .show-venue {
    color: var(--color-text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selector-button .no-selection {
    color: var(--color-text-muted);
    font-style: italic;
}

.selector-button .dropdown-arrow {
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.selector-button .dropdown-arrow.open {
    transform: rotate(180deg);
}

.selector-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 200;
}

.selector-option {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s;
}

.selector-options li:last-child .selector-option {
    border-bottom: none;
}

.selector-option:hover,
.selector-option.active {
    background-color: var(--color-primary-10);
    color: var(--color-text);
}

.selector-option.active {
    outline: var(--focus-ring);
    outline-offset: -2px;
}

.selector-option.selected {
    background-color: var(--color-accent-10);
    border-left: 3px solid var(--color-accent);
}

.selector-option .option-date {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 90px;
}

.selector-option .option-venue {
    flex: 1;
    min-width: 150px;
}

.selector-option .option-location {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    width: 100%;
}

.selector-option .option-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.selector-option .option-badge.halloween {
    background-color: #ff6600;
    color: #000;
}

.selector-option .option-badge.nye {
    background-color: #ffd700;
    color: #000;
}

.selector-option .option-badge.past {
    background-color: #6c757d;
    color: #fff;
}

/* Game Selectors Layout */
.game-selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.game-selectors .show-selector {
    min-width: 200px;
}

.game-selectors .tour-selector .selector-button {
    min-width: 180px;
}

/* Past Show Banner */
.past-show-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: rgba(108, 117, 125, 0.15);
    border: 1px solid #6c757d;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

.past-show-banner .banner-icon {
    font-size: 1.1rem;
}

.past-show-banner .banner-text {
    font-size: 0.9rem;
}

/* Past Show Table Styling (subtle) */
.picks-table.past-show {
    opacity: 0.95;
}

/* 3-Set Toggle Inline (in game show selector) */
.three-set-toggle-inline {
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
    border-left: 1px solid var(--color-border);
    margin-left: auto;
}

.toggle-label-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
}

.toggle-label-inline input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.toggle-text-inline {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.toggle-label-inline:hover .toggle-text-inline {
    color: var(--color-text);
}

.special-show-hint {
    font-size: 0.9rem;
    margin-left: 0.25rem;
    cursor: help;
}

/* 3-Set Badge for special shows */
.three-set-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--color-primary-15);
    border-radius: var(--border-radius-sm);
    margin-left: auto;
    white-space: nowrap;
}

.three-set-badge .badge-icon {
    font-size: 0.9rem;
}

.three-set-badge .badge-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Alpine.js transitions */
.transition-enter {
    transition:
        opacity 0.15s ease-out,
        transform 0.15s ease-out;
}

.transition-leave {
    transition:
        opacity 0.1s ease-in,
        transform 0.1s ease-in;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

/* Game Show Sticky Indicator */
.game-show-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: 90;
    font-size: 0.85rem;
}

.game-show-indicator .indicator-icon {
    font-size: 1rem;
}

.game-show-indicator .indicator-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.game-show-indicator .indicator-label {
    color: var(--color-text-muted);
}

.game-show-indicator .indicator-show {
    color: var(--color-primary);
    font-weight: 500;
}

.game-show-indicator .indicator-badge {
    padding: 0.15rem 0.4rem;
    background-color: var(--color-primary-15);
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .game-show-indicator {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .game-show-indicator .indicator-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .game-show-indicator .indicator-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .game-show-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .selector-label {
        font-size: 0.85rem;
    }

    .selector-button {
        flex-wrap: wrap;
    }

    .selector-button .show-venue {
        width: 100%;
        margin-top: 0.25rem;
    }

    .selector-options {
        max-height: 50vh;
    }

    .three-set-toggle-inline {
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-left: 0;
        padding-top: 0.5rem;
        margin-left: 0;
    }

    .three-set-badge {
        margin-left: 0;
        align-self: flex-start;
    }
}

/* Users table in admin - extends global table styles */
.users-table {
    margin-top: 1rem;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid var(--color-border);
}

.users-table th {
    font-size: 0.875rem;
}

.users-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.users-table input[type="text"],
.users-table input[type="email"] {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
}

.users-table input[type="text"]:focus,
.users-table input[type="email"]:focus {
    border-color: var(--color-accent);
}

.users-table input[type="text"]:focus-visible,
.users-table input[type="email"]:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.user-actions {
    white-space: nowrap;
}

.user-actions .btn {
    margin-right: 0.25rem;
}

.user-actions .btn:last-child {
    margin-right: 0;
}

.user-error {
    color: var(--color-danger, #dc3545);
    font-size: 0.875rem;
    padding: 0.5rem;
    display: block;
}

.user-row .htmx-indicator {
    display: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.user-row.htmx-request .htmx-indicator {
    display: inline;
}

/* Users table responsive styles */
@media (max-width: 768px) {
    .users-table th,
    .users-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    .users-table input[type="text"],
    .users-table input[type="email"] {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    /* Stack actions on smaller screens */
    .user-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .user-actions .btn {
        margin-right: 0;
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .users-table {
        font-size: 0.85rem;
    }

    .users-table th,
    .users-table td {
        padding: 0.5rem 0.35rem;
    }

    /* Hide Created column on mobile - less important */
    .users-table th:nth-child(3),
    .users-table td:nth-child(3) {
        display: none;
    }

    /* Ensure minimum touch target */
    .users-table tbody tr {
        min-height: 48px;
    }
}

/* Add User Form */
.add-user-form {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.add-user-form h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.add-user-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.add-user-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.add-user-form .form-group label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.add-user-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    width: 100%;
}

.add-user-form input:focus {
    border-color: var(--color-primary);
}

.add-user-form input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.add-user-form .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.add-user-form .error-message {
    color: var(--color-danger, #dc3545);
    background: rgba(220, 53, 69, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

/* Song Row Pick Controls */
.pick-header {
    width: 36px;
    min-width: 36px;
}

.pick-control-cell {
    width: 36px;
    min-width: 36px;
    padding: 0.25rem !important;
    text-align: center;
}

.song-pick-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    padding: 0;
}

.song-pick-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-10);
}

.song-pick-btn.picked {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.song-pick-btn.picked:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.pick-plus {
    font-size: 1.1rem;
    line-height: 1;
}

.pick-position {
    font-size: 0.75rem;
}

.song-row.song-picked {
    background: rgba(255, 107, 53, 0.05);
}

/* Position Picker Popup */
.position-picker-popup {
    position: fixed;
    z-index: 1200;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    max-width: 280px;
}

.position-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    gap: 0.5rem;
}

.picker-song-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.position-picker-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.position-picker-close:hover {
    color: var(--color-text);
}

.position-picker-body {
    padding: 0.75rem 1rem 1rem;
}

.position-picker-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.position-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.375rem;
}

.position-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.position-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-15);
    color: var(--color-primary);
}

.position-btn.occupied {
    background: var(--color-accent-15);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.position-btn.occupied:hover {
    background: rgba(78, 205, 196, 0.25);
}

.position-btn.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.position-btn.current:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* Position picker sections */
.position-picker-section {
    margin-bottom: 0.75rem;
}

.position-picker-section:last-child {
    margin-bottom: 0;
}

.position-picker-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.75rem 0;
}

/* Special picks grid in popup */
#special-picks-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.special-pick-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: left;
    transition: all 0.15s ease;
}

.special-pick-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-15);
    color: var(--color-primary);
}

.special-pick-btn.occupied {
    background: var(--color-accent-15);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.special-pick-btn.occupied:hover {
    background: rgba(78, 205, 196, 0.25);
}

.special-pick-btn.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.special-pick-btn.current:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* Position picker focus styles for keyboard accessibility */
.position-picker-close:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.position-btn:focus-visible,
.special-pick-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    /* Larger tap target for pick button on mobile */
    .song-pick-btn {
        width: 36px;
        height: 36px;
    }

    .pick-header {
        width: 44px;
        min-width: 44px;
    }

    .pick-control-cell {
        width: 44px;
        min-width: 44px;
    }

    .position-picker-popup {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Larger close button for easier tapping */
    .position-picker-close {
        width: 32px;
        height: 32px;
        font-size: 1.75rem;
    }

    .position-picker-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    /* Ensure position buttons have adequate tap area */
    .position-btn {
        width: 100%;
        height: 44px;
        font-size: 1rem;
    }

    /* Larger special pick buttons for touch */
    .special-pick-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    /* Larger View Picks button */
    .indicator-picks-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
}

/* Game Selections Panel */
.game-selections-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: 100%;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.game-selections-panel.open {
    right: 0;
}

.selections-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

/* Only show backdrop on mobile - on desktop, allow clicking through */
@media (max-width: 768px) {
    .selections-panel-backdrop.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.panel-open {
        overflow: hidden;
    }

    /* SSI-001: Allow song selection while panel is open on mobile
       Give song pick buttons a higher z-index than the backdrop so they remain clickable */
    body.panel-open .song-pick-btn {
        position: relative;
        z-index: 1095; /* Above backdrop (1090), below panel (1100) */
    }
}

.selections-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

.selections-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text);
}

.selections-panel-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.selections-panel-close:hover {
    color: var(--color-text);
}

/* Three-set toggle in panel (SSI-014) */
.three-set-toggle-panel {
    padding: 0.5rem 1rem;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.three-set-toggle-panel .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    margin: 0;
}

.three-set-toggle-panel .toggle-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.three-set-toggle-panel .toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.three-set-toggle-panel .toggle-help {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Three-set notice for Halloween/NYE shows */
.three-set-notice {
    padding: 0.5rem 1rem;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.three-set-notice .show-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.three-set-notice .halloween-badge {
    background-color: #f97316;
    color: white;
}

.three-set-notice .nye-badge {
    background-color: #8b5cf6;
    color: white;
}

.selections-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.selections-section {
    margin-bottom: 1.5rem;
}

.selections-section:last-child {
    margin-bottom: 0;
}

.selections-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.selections-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selection-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

.selection-item:last-child {
    border-bottom: none;
}

.selection-item.empty {
    opacity: 0.5;
}

.selection-position {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    min-width: 1.75rem;
}

.selection-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    min-width: 5rem;
}

.selection-song {
    flex: 1;
    color: var(--color-text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-empty {
    flex: 1;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* .selection-remove-btn extends .btn-icon - uses class="btn-icon selection-remove-btn" in templates */
.selection-remove-btn {
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    border-radius: 3px;
}

.selection-remove-btn:hover {
    background: rgba(255, 100, 100, 0.15);
    color: var(--color-danger);
}

.special-selections-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.special-picks-group {
    margin-bottom: 0.75rem;
}

.special-picks-group:last-child {
    margin-bottom: 0;
}

.special-picks-group-label {
    font-size: 0.75rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.selection-item.special {
    padding: 0.375rem 0.25rem;
}

/* Drag and drop styles for songs list to panel (SSI-004) */
.song-row-ghost {
    opacity: 0.4;
    background-color: var(--color-surface-alt);
}

.song-row-chosen {
    background-color: var(--color-primary-10);
    cursor: grabbing;
}

.song-row-drag {
    opacity: 0.9;
    background-color: var(--color-surface);
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Visual feedback: Songs list fades during drag to indicate it's not a drop target (SSI-009) */
body.song-dragging .list-table tbody,
body.position-to-special-dragging .list-table tbody,
body.special-to-position-dragging .list-table tbody,
body.special-dragging .list-table tbody {
    opacity: 0.5;
    pointer-events: none;
}

/* Visual feedback: Dragged item source highlighted while dragging (SSI-009) */
.song-row-drag,
.selection-item-dragging {
    z-index: 100;
}

/* Highlight drop zones when dragging (SSI-017) */

/* Empty slots - show as inviting add target */
body.song-dragging .selection-item.drop-zone-active.empty {
    border: 2px dashed var(--color-success);
    border-radius: var(--border-radius-sm);
    background-color: rgba(34, 197, 94, 0.08);
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

body.song-dragging .selection-item.drop-zone-active.empty:hover,
body.song-dragging .selection-item.drop-zone-hover.empty {
    border-color: var(--color-success);
    background-color: rgba(34, 197, 94, 0.2);
    border-style: solid;
}

/* Add indicator for empty slots during song drag */
body.song-dragging .selection-item.drop-zone-active.empty::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

body.song-dragging .selection-item.drop-zone-hover.empty::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Filled slots - show as swap target */
body.song-dragging .selection-item.drop-zone-active.filled {
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius-sm);
    background-color: rgba(255, 107, 53, 0.08);
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

body.song-dragging .selection-item.drop-zone-active.filled:hover,
body.song-dragging .selection-item.drop-zone-hover.filled {
    border-color: var(--color-primary);
    background-color: var(--color-primary-15);
    border-style: solid;
}

/* Swap indicator for filled slots during song drag */
body.song-dragging .selection-item.drop-zone-active.filled::after {
    content: "⇄";
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

body.song-dragging .selection-item.drop-zone-hover.filled::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Ghost element in drop zone */
.selection-item-ghost {
    opacity: 0.5;
    background-color: var(--color-primary);
    border-color: var(--color-primary) !important;
}

/* Drag handle for reordering positions (SSI-005) */
.selection-drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 0 0.25rem;
    opacity: 0.6;
    user-select: none;
    transition:
        opacity 0.15s,
        color 0.15s;
}

.selection-drag-handle:hover {
    opacity: 1;
    color: var(--color-primary);
}

.selection-item-chosen .selection-drag-handle,
.selection-item-dragging .selection-drag-handle {
    cursor: grabbing;
    opacity: 1;
    color: var(--color-primary);
}

/* Chosen state for reordering */
.selection-item-chosen {
    background-color: var(--color-primary-15);
    border-radius: var(--border-radius-sm);
}

/* Dragging state for reordering */
.selection-item-dragging {
    background-color: var(--color-surface);
    border: 2px solid var(--color-primary) !important;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Auto-open panel when dragging starts */
body.song-dragging .game-selections-panel {
    transform: translateX(0);
}

body.song-dragging .selections-panel-backdrop {
    opacity: 0;
    pointer-events: none;
}

/* Cross-section drag: Position to Special (SSI-007) - COPY operation */
body.position-to-special-dragging .selection-item.special.drop-zone-active {
    border: 2px dashed var(--color-success);
    border-radius: var(--border-radius-sm);
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

body.position-to-special-dragging
    .selection-item.special.drop-zone-active:hover,
body.position-to-special-dragging .selection-item.special.drop-zone-hover {
    border-color: var(--color-success);
    background-color: rgba(34, 197, 94, 0.15);
}

/* Make selection items position relative for indicator badges */
.selection-item.special,
#selections-list .selection-item {
    position: relative;
}

/* Base styles for drag indicator badges */
.drop-zone-copy::after,
body.special-dragging
    .selection-item.special.drop-zone-active:not(
        .selection-item-dragging
    )::after {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Copy indicator (position-to-special and special-to-position) */
body.position-to-special-dragging .selection-item.special.drop-zone-copy::after,
body.special-to-position-dragging
    #selections-list
    .selection-item.drop-zone-copy::after {
    content: "+";
    background: var(--color-success);
    font-size: 14px;
}

/* Cross-section drag: Special to Position (SSI-008) - COPY operation */
body.special-to-position-dragging
    #selections-list
    .selection-item.drop-zone-active {
    border: 2px dashed var(--color-success);
    border-radius: var(--border-radius-sm);
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

body.special-to-position-dragging
    #selections-list
    .selection-item.drop-zone-active:hover,
body.special-to-position-dragging
    #selections-list
    .selection-item.drop-zone-hover {
    border-color: var(--color-success);
    background-color: rgba(34, 197, 94, 0.15);
}

/* Within-section drag: Special to Special - MOVE/SWAP operation (SSI-009) */
body.special-dragging
    .selection-item.special.drop-zone-active:not(.selection-item-dragging) {
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius-sm);
    transition:
        border-color 0.15s,
        background-color 0.15s;
}

body.special-dragging
    .selection-item.special.drop-zone-hover:not(.selection-item-dragging) {
    border-color: var(--color-primary);
    background-color: var(--color-primary-15);
}

/* Move/swap indicator for filled slots */
body.special-dragging
    .selection-item.special.drop-zone-active.filled:not(
        .selection-item-dragging
    )::after {
    content: "⇄";
    background: var(--color-primary);
    font-size: 11px;
}

/* Move indicator for empty slots */
body.special-dragging
    .selection-item.special.drop-zone-active.empty:not(
        .selection-item-dragging
    )::after {
    content: "↓";
    background: var(--color-primary);
    font-size: 12px;
}

.selections-panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

.selections-panel-footer .btn {
    width: 100%;
    text-align: center;
}

/* View Picks button in indicator */
.indicator-picks-btn {
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    margin-left: auto;
}

.indicator-picks-btn:hover {
    background: var(--color-primary-hover);
}

/* Move button in selections panel */
/* .selection-move-btn extends .btn-icon - uses class="btn-icon selection-move-btn" in templates */
.selection-move-btn {
    background: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.selection-move-btn:hover {
    color: var(--color-primary);
    background: var(--color-surface-alt);
}

.selection-move-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Keyboard reorder buttons (A11y alternative to drag-and-drop) */
.selection-reorder-btns {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.selection-reorder-btn {
    background: none;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    line-height: 1;
}

.selection-reorder-btn:hover:not(:disabled) {
    color: var(--color-primary);
    background: var(--color-surface-alt);
}

.selection-reorder-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.selection-reorder-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.selection-remove-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Move position picker - inline in selection item */
.move-position-picker {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1200;
    min-width: 180px;
    padding: 0.5rem;
}

.move-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.move-picker-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.move-picker-close:hover {
    color: var(--color-text);
}

.move-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
}

.move-picker-btn {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
    text-align: center;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.move-picker-btn:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

.move-picker-btn.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
    cursor: default;
}

.move-picker-btn.occupied {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
}

.move-picker-btn.occupied:hover:not(:disabled) {
    background: var(--color-accent-light, #6fd9d1);
    border-color: var(--color-accent-light, #6fd9d1);
}

/* Make selection-item position relative for picker */
.selection-item {
    position: relative;
}

/* Mobile responsive for selections panel */
@media (max-width: 576px) {
    .game-selections-panel {
        width: 100%;
        right: -100%;
    }

    /* Maintain adequate tap target on small screens */
    .indicator-picks-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
        min-height: 36px;
    }

    .move-position-picker {
        right: auto;
        left: 0;
        min-width: 160px;
    }

    /* Remove and move buttons need larger touch targets */
    .selection-remove-btn,
    .selection-move-btn {
        padding: 0.4rem 0.6rem;
        font-size: 1.1rem;
        min-width: 32px;
        min-height: 32px;
    }

    /* Make selection items taller for easier interaction */
    .selection-item {
        padding: 0.625rem 0.25rem;
        min-height: 44px;
    }

    /* Selections panel close button larger on mobile */
    .selections-panel-close {
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
    }
}

/* ===========================================
   Game Picks View
   =========================================== */

.picks-view {
    max-width: 100%;
}

.picks-view .show-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Picks View Selector Overrides - base selector styles are inherited */
.picks-view .selector-label {
    font-weight: 600;
    color: var(--color-text);
}

.picks-view .selector-dropdown {
    min-width: 250px;
    max-width: 500px;
}

.picks-view .selector-button {
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
}

.picks-view .selector-button .show-date {
    color: var(--color-text);
}

.picks-view .selector-options {
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 400px;
    z-index: 100;
}

.picks-view .selector-option:hover,
.picks-view .selector-option.active {
    background: var(--color-bg-hover);
}

.picks-view .selector-option.selected {
    background: var(--color-primary-10);
    border-left: 3px solid var(--color-primary);
}

/* Picks Table - extends global table styles */
.picks-table-container {
    margin-top: 1rem;
}

.picks-table {
    font-size: 0.875rem;
}

.picks-table th,
.picks-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.picks-table th {
    top: 0;
    z-index: 1;
}

.picks-table th.user-column {
    color: var(--color-bg);
}

.picks-table th.user-column .user-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
}

.picks-table th.user-column .user-score {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-surface);
    margin-top: 0.2rem;
}

.picks-table .row-label-header {
    width: 140px;
    min-width: 140px;
}

.picks-table .row-label {
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.picks-table .user-column {
    min-width: 150px;
    max-width: 200px;
}

.picks-table .user-column .user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.picks-table .pick-cell {
    min-width: 150px;
}

.picks-table .song-name {
    color: var(--color-text);
}

.picks-table .song-name.write-in {
    font-style: italic;
}

.picks-table .empty-pick {
    color: var(--color-text-muted);
}

.picks-table .separator-row td {
    padding: 0;
    border-bottom: none;
}

.picks-table .picks-separator {
    border: none;
    border-top: 2px solid var(--color-border);
    margin: 0.5rem 0;
}

.picks-table .special-pick-row .row-label {
    font-size: 0.8rem;
}

/* Correct pick highlighting - used for picks that match the setlist */
.picks-table .pick-cell.pick-correct {
    background-color: var(--color-success-10);
    border-left: 2px solid var(--color-success);
}

.picks-table .pick-cell.pick-correct .song-name {
    color: var(--color-success);
}

/* Mobile responsiveness for picks view */
@media (max-width: 768px) {
    .picks-view .show-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .picks-view .selector-dropdown {
        max-width: none;
    }

    .picks-view .selector-button {
        flex-wrap: wrap;
    }

    .picks-view .selector-button .show-location {
        width: 100%;
        margin-top: 0.25rem;
    }

    .picks-table .row-label-header,
    .picks-table .row-label {
        width: 100px;
        min-width: 100px;
        font-size: 0.8rem;
    }

    .picks-table .user-column,
    .picks-table .pick-cell {
        min-width: 120px;
        font-size: 0.8rem;
    }
}

/* ===========================================
   Toast Notifications (A11y)
   =========================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-error {
    border-left: 4px solid var(--color-danger, #dc3545);
}

.toast-success {
    border-left: 4px solid var(--color-success, #22c55e);
}

.toast-info {
    border-left: 4px solid var(--color-primary);
}

.toast-message {
    flex: 1;
    color: var(--color-text);
    font-size: 0.9rem;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Mobile: Stack toasts at bottom on small screens */
@media (max-width: 576px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }

    .toast {
        max-width: none;
        transform: translateY(100%);
    }

    .toast.toast-show {
        transform: translateY(0);
    }

    .toast.toast-hide {
        transform: translateY(100%);
    }
}

/* Error Pages */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-danger, #dc3545);
}

.error-page .error-message {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.error-page .error-detail {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.error-page .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ---- Predictions page ---- */
.prediction-provenance {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.prediction-warning {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(240, 180, 60, 0.4);
    border-left: 3px solid #f0b43c;
    border-radius: var(--border-radius-md);
    background-color: rgba(240, 180, 60, 0.08);
    font-size: 0.9rem;
    line-height: 1.45;
}

.prediction-warning-icon {
    color: #f0b43c;
    font-size: 1.1rem;
    line-height: 1.3;
}

.prediction-warning strong {
    color: var(--color-text);
}

.prediction-top-table .rank-col {
    width: 2.5rem;
    text-align: center;
}

.prediction-top-table .gap-col {
    width: 4rem;
    text-align: right;
    white-space: nowrap;
}

/* Mute the body cells only — on the th these would override the header's
   dark-on-accent text and read as white next to the other headers. */
.prediction-top-table td.rank-col,
.prediction-top-table td.gap-col {
    color: var(--color-text-muted);
}

.prediction-top-table .prob-col {
    width: 7rem;
    text-align: right;
    white-space: nowrap;
}

.owed-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-bg);
    background-color: var(--color-accent);
    border-radius: 3px;
    vertical-align: middle;
}

.prediction-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.slot-card {
    margin-bottom: 0;
}

.slot-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.slot-picks {
    margin: 0;
    padding-left: 1.25rem;
}

.slot-picks li {
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.slot-gap {
    font-size: 0.85rem;
}

.slot-prob {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Right-side number stack on slot picks: slot prob with the song's play
   probability beneath it (specialists are unlikely plays but near-certain
   slot-fillers when played — both numbers make the bet legible). */
.slot-nums {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.slot-play-prob {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    opacity: 0.75;
}

/* ---- Suggested Board (strategy layer over the predictions) ---- */
.suggested-board {
    margin-top: 2rem;
}

.board-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.board-control-group {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.board-toggle {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.board-toggle:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.board-toggle-active {
    background: var(--color-primary-15);
    color: var(--color-text);
    font-weight: 600;
}

.board-columns {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1rem;
}

@media (max-width: 700px) {
    .board-columns {
        grid-template-columns: 1fr;
    }
}

.board-card h3 {
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.board-ev {
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
}

.board-picks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.board-picks li,
.board-specials li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.board-pos {
    min-width: 1.6rem;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-accent);
    background: var(--color-primary-15);
    border-radius: 4px;
    font-size: 0.85rem;
}

.board-song {
    flex: 1;
}

.board-prob {
    font-size: 0.85rem;
    white-space: nowrap;
}

.board-tag {
    font-size: 0.7rem;
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    color: var(--color-accent);
    white-space: nowrap;
}

.board-specials {
    margin: 0;
    padding: 0;
    list-style: none;
}

.board-slot-label {
    min-width: 7.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ---- List tables on phone-class viewports ---- */
/* The global fixed table layout divides width evenly, which at phone widths
   squeezes columns until their content paints over the neighbors (venues:
   city over state; shows: the upcoming badge over the venue). table-layout
   returns to auto so columns size to content, and low-priority columns opt
   out with .hide-sm (th and td). NOTE: no overflow-x on the wrapper — an
   overflow ancestor would kill the sticky table headers. */
@media (max-width: 576px) {
    .table-wrapper table {
        table-layout: auto;
    }

    .table-wrapper th.hide-sm,
    .table-wrapper td.hide-sm,
    .song-list td.date-cell {
        display: none;
    }

    /* Single-line headers ("Next ↓", "Last Played") and tighter cells. */
    .table-wrapper th {
        white-space: nowrap;
    }

    .table-wrapper th,
    .table-wrapper td {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

    /* Dates never wrap; the shows list hides them on the songs page instead
       (rule above). */
    .show-list td.date-cell,
    .song-history td.date-cell,
    .venue-history td.date-cell {
        white-space: nowrap;
    }

    /* Status badges drop under the date instead of painting over the next
       column when inline space runs out. */
    .upcoming-badge,
    .today-badge {
        display: block;
        width: fit-content;
        margin-top: 0.15rem;
    }
}

/* Above phone widths the songs table keeps the global fixed layout, which
   sizes columns from the header row — the Set Stats grid needs its width
   RESERVED there (its tracks are floored at 1.5rem and paint past the table
   edge between ~577-1030px otherwise). */
@media (min-width: 577px) {
    .song-list table th:last-child {
        width: 8.5rem;
    }
}

/* iPhone notch/Dynamic Island safe areas. Gated at 480px to exactly match the
   existing mobile container padding (1rem) — env() is 0 everywhere else, so
   this is a no-op outside notched devices. */
@media (max-width: 480px) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}
