:root {
    /* Brand palette (unchanged) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Extended design system */
    --border-strong: #cbd5e1;
    --danger: #ff4d4d;
    --focus-ring: rgba(37, 99, 235, 0.25);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 9999px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    --text-base: 0.95rem;
    --text-md: 1rem;
    --text-lg: 1.2rem;
}

/* ===== Manual scrape source chips ===== */
.advanced-source-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    max-height: 6.5rem;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.btn-crawl-source-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-main);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-crawl-source-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-crawl-source-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 2rem;
}

h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Panel chrome ===== */
.controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    background: var(--surface);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.panel-title {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--text-main);
}

.scraper-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.scraper-action .btn {
    flex: 0 0 auto;
}

#last-scraped-time {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

#failure-indicator {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: help;
    white-space: nowrap;
}

#scraper-status {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Staleness banner ===== */
.stale-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: #78350f;
    font-size: var(--text-sm);
}

.stale-banner[hidden] {
    display: none;
}

.stale-banner-text {
    flex: 1 1 auto;
    min-width: 220px;
}

.stale-banner-text #stale-age-text {
    font-weight: 600;
}

.stale-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
}

.stale-banner-actions .btn {
    flex: 0 0 auto;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    font-size: var(--text-sm);
}

/* Link-style controls (Toggle All, Clear) */
.text-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

/* Data islands kept out of layout until JS reveals them */
#scrape-report-data,
#events-data,
#events-table,
#health-container {
    display: none;
}

/* Keyboard focus ring */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Section layout ===== */
.filter-section {
    min-width: 0;
}

.field-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

/* Search row */
.search-row .search-input {
    height: 2.75rem;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    font-size: var(--text-md);
    border-radius: var(--radius-md);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1.1rem;
}

/* Filter grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4) var(--space-5);
    align-items: end;
}

.filter-grid .span-2 {
    grid-column: span 2;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

/* Form controls — consistent height + focus */
input[type="text"],
select,
input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: var(--text-base);
    min-height: 2.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="text"]:hover,
select:hover,
input[type="date"]:hover {
    border-color: var(--border-strong);
}

input[type="text"]:focus,
select:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.9rem;
    cursor: pointer;
}

/* ===== Multi-select dropdown ===== */
.dropdown-multi {
    position: relative;
    width: 100%;
    z-index: 20;
}

.dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-main);
    font-size: var(--text-base);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dropdown-trigger:hover {
    border-color: var(--border-strong);
}

.dropdown-trigger::after {
    content: '';
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-right: 0.25rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.dropdown-multi.active .dropdown-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.dropdown-multi.active .dropdown-trigger::after {
    transform: rotate(-135deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(320px, calc(100vw - 2rem));
    max-height: min(420px, 60vh);
    z-index: 100;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.dropdown-multi.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.checkbox-list-container {
    max-height: 250px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.dropdown-toggle-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
}

.source-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-sm);
}

.checkbox-list-container label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.1s ease;
}

.checkbox-list-container label:hover {
    background: var(--surface-hover);
}

.checkbox-list-container input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.source-label {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.source-count {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* ===== Date range ===== */
.date-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-main);
}

.date-filters input[type="date"] {
    flex: 1 1 0;
    min-width: 0;
}

.date-separator {
    color: var(--text-muted);
    flex: 0 0 auto;
}

/* ===== Chips ===== */
.quick-chips {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 6px;
    min-height: 2.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-main);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.chip.chip-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.chip.chip-active::before {
    content: "✓";
    margin-right: 0.35rem;
    font-size: 0.75em;
}

/* Tag chips: bounded height so a long list scrolls instead of dominating the panel */
#tag-chips {
    max-height: 7.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 2px 2px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

#tag-chips::-webkit-scrollbar {
    width: 6px;
}

#tag-chips::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-pill);
}

#tag-chips::-webkit-scrollbar-track {
    background: transparent;
}

/* ===== Chip-block sections (Tags, Manual Scrape) ===== */
.tags-section,
.manual-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.section-heading .field-label {
    margin: 0;
}

.section-heading .text-link {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Advanced (collapsible) ===== */
.advanced-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
}

.advanced-toggle::-webkit-details-marker {
    display: none;
}

.advanced-toggle::after {
    content: '';
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.advanced-section[open] .advanced-toggle::after {
    transform: rotate(-135deg);
}

.advanced-toggle:hover {
    background: var(--surface-hover);
}

.advanced-section[open] .advanced-toggle {
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.advanced-content {
    padding: var(--space-4);
}

/* ===== Checkbox rows (Dedupe, Weekend) ===== */
.inline-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: var(--text-base);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.inline-check:hover {
    border-color: var(--primary);
}

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

.inline-check:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 500;
}

.inline-check:has(input:focus-visible) {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ===== View toggles footer ===== */
.controls-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.view-toggles {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.view-toggles button {
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-md) - 3px);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.view-toggles button:hover:not(.active) {
    background: var(--surface);
    color: var(--text-main);
}

.view-toggles button.active {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

#btn-hp-view {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #fcd34d;
    font-weight: 700;
}

#btn-hp-view:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f;
}

#btn-hp-view.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #d97706;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: var(--text-base);
    text-align: center;
    text-decoration: none;
    flex: 1;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}

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

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

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

/* Focus ring visible against solid primary fills */
.btn-primary:focus-visible,
.chip.chip-active:focus-visible,
.view-toggles button.active:focus-visible {
    outline-color: var(--primary-hover);
}

/* ===== Cards View ===== */
.view-cards #events-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.event-card .header-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    align-items: center;
    font-size: 0.85rem;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
    font-weight: 500;
}

.badge.source {
    background: #dbeafe;
    color: #1e40af;
}

.badge.format {
    background: #f1f5f9;
    color: #334155;
}

.badge.req {
    background: #fee2e2;
    color: #991b1b;
}

.badge.entity {
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid var(--border);
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge.astro {
    background: #0f172a;
    color: #e2e8f0;
    font-size: var(--text-xs);
}

.entity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.event-date {
    font-weight: 600;
    color: var(--primary);
}

.event-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-main);
    line-height: 1.3;
}

.event-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    overflow-wrap: anywhere;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* ===== Table View ===== */
#events-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

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

#events-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

#events-table tr:last-child td {
    border-bottom: none;
}

#events-table td[colspan] {
    padding: 2rem 1rem;
    color: var(--text-muted);
    background: var(--surface);
}

.hidden {
    display: none !important;
}

/* ===== Empty / no-results state ===== */
.no-events {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
}

/* ===== Source Health view ===== */
.health-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

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

.health-table th,
.health-table td {
    padding: 0.6rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.health-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

.health-table tr:last-child td {
    border-bottom: none;
}

.health-detail {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.badge.hp-ok {
    background: #dcfce7;
    color: #166534;
}

.badge.hp-stale {
    background: #fef9c3;
    color: #854d0e;
}

.badge.hp-fail {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Date TBD (collapsed) section ===== */
.tbd-section {
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tbd-section summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
}

.tbd-section summary::-webkit-details-marker {
    display: none;
}

.tbd-section summary::before {
    content: '';
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.tbd-section[open] summary::before {
    transform: rotate(-135deg);
}

.tbd-section summary:hover {
    background: var(--surface-hover);
}

.tbd-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}

/* Table view: header row + hidden rows tbody */
#events-table tr.tbd-header td {
    background: var(--bg);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.tbd-toggle {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 0.15rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tbd-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

#events-table tbody.tbd-rows[hidden] {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 959px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid .span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .controls {
        padding: var(--space-4);
        gap: var(--space-4);
    }

    .controls-header {
        align-items: flex-start;
    }

    .scraper-action {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid .span-2 {
        grid-column: span 1;
    }

    .filter-item input[type="text"],
    .filter-item select {
        width: 100%;
    }

    .date-filters {
        flex-wrap: wrap;
    }

    .view-toggles {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .view-toggles::-webkit-scrollbar {
        display: none;
    }

    .stale-banner-actions {
        width: 100%;
    }

    .stale-banner-actions .btn {
        flex: 1 1 0;
    }
}
