/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-primary: #1a5632;
    --color-primary-light: #e8f5ee;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-accent: #2563eb;
    --color-video: #7c3aed;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Header === */
header {
    background: var(--color-primary);
    color: white;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 56px;
}

.logo {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.tagline {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

/* === Category Filter Bar === */
.category-filter-bar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.6rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    cursor: pointer;
    border: 1.5px solid transparent;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.filter-chip:hover {
    opacity: 0.85;
}

.filter-chip-active {
    opacity: 1;
    border-color: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

.filter-clear {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.filter-clear:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.topics-no-match {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Collapsed card when no topics match the active filter */
.meeting-card-collapsed {
    padding: 0.5rem 1.25rem;
    opacity: 0.55;
}

.meeting-card-collapsed .meeting-topics {
    display: none;
}

.meeting-card-collapsed .meeting-card-actions {
    display: none;
}

/* === Main content === */
main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* === Hero === */
.hero {
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

/* === Meetings Layout === */
.meetings-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.meetings-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meeting-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
    display: block;
}

.meeting-card:hover {
    box-shadow: var(--shadow-sm);
}

.meeting-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.meeting-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.meeting-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.meeting-categories {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


.badge-reorder {
    background: #fff7ed;
    color: #c2410c;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

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

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

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

.btn-primary:hover:not(:disabled) {
    background: #14472a;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
}

/* === Open Button === */
.meeting-card-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.btn-open {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: transparent;
    text-decoration: none;
    font-weight: 500;
}

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

.topic-play-link {
    background: #ede9fe;
    text-decoration: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    transition: background 0.15s;
}

.topic-play-link::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.3rem 0 0.3rem 0.5rem;
    border-color: transparent transparent transparent var(--color-video);
    margin-left: 0.1rem;
}

.topic-play-link:hover {
    background: #ddd6fe;
}

/* === Scroll Sentinel / End Message === */
.scroll-sentinel {
    height: 1px;
}

.end-message {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* === Meeting Detail === */
.back-link {
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.meeting-detail h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.meeting-meta-detail {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.meeting-meta-detail a {
    color: var(--color-accent);
    text-decoration: none;
}

.meeting-meta-detail a:hover {
    text-decoration: underline;
}

/* === Video Section === */
.video-section {
    margin-bottom: 2rem;
}

.video-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-loading-bar {
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 0 0 var(--radius, 8px) var(--radius, 8px);
    transition: opacity 5s ease;
}

/* --- Sticky mini-player --- */
.video-section.sticky {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: auto;
    z-index: 100;
    margin-bottom: 0;
    background: #000;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    /* width set by JS to the scaled-down size */
}

.video-section.sticky h2 {
    display: none;
}

.video-section.sticky .video-container {
    /* JS sets width + transform on this element */
    transform-origin: top left;
    border-radius: 0;
}

.video-section.sticky .video-loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    z-index: 10;
}

.video-spacer {
    /* height set dynamically via JS */
}

/* Highlight flash on agenda item when scrolled-to */
@keyframes agenda-highlight {
    0%   { background-color: #ede9fe; }
    100% { background-color: transparent; }
}
.agenda-item.highlight {
    animation: agenda-highlight 1.5s ease-out;
}

/* === Agenda Items === */
.agenda-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.agenda-controls h2 {
    font-size: 1.2rem;
}

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

.sort-option {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: none;
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sort-option:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.sort-option.sort-active {
    background: var(--color-primary);
    color: white;
}

.sort-option:not(.sort-active):hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.agenda-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agenda-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.agenda-item-consent {
    padding: 0.6rem 1.25rem;
}

.badge-consent {
    background: #fef2f2;
    color: #991b1b;
    white-space: nowrap;
}

.badge-attachments {
    background: #fef3c7;
    color: #92400e;
    border: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
}


.badge-attachments:hover {
    background: #fde68a;
}

.item-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.item-number {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 3rem;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.item-title {
    flex: 1;
    font-weight: 500;
}

.timestamp-link {
    background: #ede9fe;
    color: var(--color-video);
    border: none;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.timestamp-link:hover {
    background: #ddd6fe;
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.item-summary {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* === Transcript (meeting detail page) === */
.transcript-content {
    margin-top: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.transcript-clamped {
    max-height: 6.2em;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.transcript-clamped::after {
    content: "Show more...";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.4em;
    background: linear-gradient(transparent, var(--color-bg) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-primary);
    padding-bottom: 0.2rem;
}

.transcript-clamped:hover::after {
    text-decoration: underline;
}

.transcript-clampable:not(.transcript-clamped) {
    cursor: pointer;
}

.transcript-clampable:not(.transcript-clamped)::after {
    content: "Show less";
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-top: 0.4rem;
}

.transcript-clampable:not(.transcript-clamped):hover::after {
    text-decoration: underline;
}

.transcript-block {
    margin-bottom: 0.6rem;
}

.transcript-block:last-child {
    margin-bottom: 0;
}

.transcript-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
}

.transcript-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--color-text);
}

.transcript-vote {
    font-size: 0.88rem;
    font-weight: 600;
}

.vote-carried {
    color: #166534;
}

.vote-contested {
    color: #92400e;
}

.transcript-vote-explanation {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

.transcript-vote-detail {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

/* === Attachment Links === */
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attachment-list li {
    margin-bottom: 0.3rem;
}

.attachment-list li:last-child {
    margin-bottom: 0;
}

.attachment-link {
    font-size: 0.85rem;
    color: var(--color-primary);
    text-decoration: none;
}

.attachment-link::before {
    content: "\1F4CE ";
    font-size: 0.8rem;
}

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

/* === Meeting Topics (index page) === */
.meeting-topics {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.topics-error {
    font-size: 0.8rem;
    color: #dc2626;
    padding: 0.25rem 0;
}

.topics-empty {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 0.25rem 0;
}

/* Topics table */
.topics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.topics-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

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

.topic-name {
    color: var(--color-text);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-name > span {
    flex: 1;
}

/* Topic badges row */
.topic-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding-top: 0.15rem;
}

.topic-badge {
    white-space: nowrap;
    line-height: 1.4;
}

/* Outcome badge colors */
.badge-outcome-approved {
    background: #dcfce7;
    color: #166534;
}

.badge-outcome-defeated {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
}

.badge-outcome-contested {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.badge-outcome-deferred {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-outcome-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

/* Extracted detail badges */
.badge-money {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.badge-person {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-location {
    background: #fce7f3;
    color: #9d174d;
}

/* Per-category color-coded badges */
.badge-cat-homelessness {
    background: #fff7ed;
    color: #9a3412;
}

.badge-cat-housing {
    background: #fef3c7;
    color: #92400e;
}

.badge-cat-transit {
    background: #dbeafe;
    color: #1e40af;
}

.badge-cat-traffic {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-cat-greenspace {
    background: #dcfce7;
    color: #166534;
}

.badge-cat-small-business {
    background: #fef9c3;
    color: #854d0e;
}

.badge-cat-infrastructure {
    background: #f1f5f9;
    color: #475569;
}

.badge-cat-public-safety {
    background: #fee2e2;
    color: #991b1b;
}

.badge-cat-recreation {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-cat-zoning-dev {
    background: #fdf4ff;
    color: #86198f;
}

.badge-cat-property-tax {
    background: #fce7f3;
    color: #9d174d;
}

.badge-cat-arts-culture {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-cat-environment {
    background: #e0f2fe;
    color: #0c4a6e;
}

/* Major decision row highlight */
.topic-major {
    background: #fffbeb;
}

.topic-consent {
    font-size: 0.85em;
}

/* Tooltip on hover */
[data-tooltip] {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted currentColor;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--color-text);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 400;
    max-width: min(400px, 90vw);
    width: max-content;
    white-space: normal;
    z-index: 10;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 12px;
    border: 4px solid transparent;
    border-top-color: var(--color-text);
    z-index: 10;
    pointer-events: none;
}

/* === Skeleton Stencils === */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, #f0f0f0 50%, var(--color-border) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.skeleton-line {
    height: 0.75rem;
    margin-bottom: 0.5rem;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

.skeleton-line-sm {
    height: 0.6rem;
    margin-bottom: 0.4rem;
}

.skeleton-badge {
    display: inline-block;
    width: 3.5rem;
    height: 1.2rem;
    border-radius: 999px;
}

.skeleton-topics {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* === States === */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fef2f2;
    border-radius: var(--radius);
}

.empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

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

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

footer a:hover {
    text-decoration: underline;
}

/* === Dark Mode (system preference) === */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f1117;
        --color-surface: #1a1d27;
        --color-primary: #2d8a54;
        --color-primary-light: #1a2f22;
        --color-text: #e4e6eb;
        --color-text-muted: #9ca3af;
        --color-border: #2d3140;
        --color-accent: #60a5fa;
        --color-video: #a78bfa;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    }

    /* Badges */
    .badge-reorder {
        background: #431407;
        color: #fdba74;
    }

    .badge-consent {
        background: #7f1d1d;
        color: #fca5a5;
    }

    .badge-attachments {
        background: #78350f;
        color: #fcd34d;
    }

    .badge-attachments:hover {
        background: #92400e;
    }

    .badge-outcome-approved {
        background: #064e3b;
        color: #6ee7b7;
    }

    .badge-outcome-defeated {
        background: #7f1d1d;
        color: #fca5a5;
    }

    .badge-outcome-contested {
        background: #78350f;
        color: #fcd34d;
    }

    .badge-outcome-deferred {
        background: #312e81;
        color: #a5b4fc;
    }

    .badge-outcome-neutral {
        background: #374151;
        color: #9ca3af;
    }

    .badge-money {
        background: #1e3a5f;
        color: #93c5fd;
    }

    .badge-person {
        background: #3b1f5e;
        color: #c4b5fd;
    }

    .badge-location {
        background: #5b1a3a;
        color: #f9a8d4;
    }

    /* Per-category color-coded badges (dark) */
    .badge-cat-homelessness {
        background: #7c2d12;
        color: #fdba74;
    }

    .badge-cat-housing {
        background: #78350f;
        color: #fcd34d;
    }

    .badge-cat-transit {
        background: #1e3a5f;
        color: #93c5fd;
    }

    .badge-cat-traffic {
        background: #312e81;
        color: #a5b4fc;
    }

    .badge-cat-greenspace {
        background: #064e3b;
        color: #6ee7b7;
    }

    .badge-cat-small-business {
        background: #713f12;
        color: #fde047;
    }

    .badge-cat-infrastructure {
        background: #374151;
        color: #9ca3af;
    }

    .badge-cat-public-safety {
        background: #7f1d1d;
        color: #fca5a5;
    }

    .badge-cat-recreation {
        background: #3b1f5e;
        color: #c4b5fd;
    }

    .badge-cat-zoning-dev {
        background: #701a75;
        color: #f0abfc;
    }

    .badge-cat-property-tax {
        background: #5b1a3a;
        color: #f9a8d4;
    }

    .badge-cat-arts-culture {
        background: #4c1d95;
        color: #d8b4fe;
    }

    .badge-cat-environment {
        background: #164e63;
        color: #67e8f9;
    }

    /* Major decision row */
    .topic-major {
        background: #292317;
    }

    .topic-consent {
    }

    /* Buttons */
    .btn-primary:hover:not(:disabled) {
        background: #236b42;
    }

    .btn-open {
        background: #1a2f22;
        color: #6ee7b7;
    }

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

    .topic-play-link {
        background: #2e2459;
    }

    .topic-play-link::after {
        border-color: transparent transparent transparent #a78bfa;
    }

    .topic-play-link:hover {
        background: #3b2d70;
    }

    /* Transcript vote colors */
    .vote-carried {
        color: #6ee7b7;
    }

    .vote-contested {
        color: #fcd34d;
    }

    /* Timestamp link */
    .timestamp-link {
        background: #2e2459;
        color: #a78bfa;
    }

    .timestamp-link:hover {
        background: #3b2d70;
    }

    /* Video loading bar */
    .video-loading-bar {
        background: #1d4ed8;
    }

    /* Skeleton shimmer */
    .skeleton {
        background: linear-gradient(90deg, var(--color-border) 25%, #252833 50%, var(--color-border) 75%);
        background-size: 400px 100%;
    }

    /* Error/empty states */
    .error {
        color: #f87171;
        background: #1f1215;
    }

    .topics-error {
        color: #f87171;
    }

    /* Tooltip */
    [data-tooltip]:hover::after {
        background: #e4e6eb;
        color: #1a1d27;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    [data-tooltip]:hover::before {
        border-top-color: #e4e6eb;
    }
}

/* === Responsive === */
@media (max-width: 640px) {
    .meetings-grid {
        grid-template-columns: 1fr;
    }

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

    nav {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 0.75rem 0;
        gap: 0.25rem;
    }

    .agenda-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .item-header {
        flex-wrap: wrap;
    }

    .item-title {
        /* Force the title to fill the remaining row width so badges wrap below */
        flex: 1 0 calc(100% - 3rem - 0.75rem);
    }

}

/* === Back to Top Button === */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 90;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 2rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    filter: brightness(1.1);
}
