/* ==========================================================================
   WA Legislative Tracker - C6S Design System
   Extracted from index.html inline styles
   Color palette: Circle6Systems (c6s) design tokens
   ========================================================================== */

:root {
    /* C6S Core Palette */
    --c6s-navy: #2d2a2e;
    --c6s-navy-light: #3a3640;
    --c6s-navy-mid: #504a52;
    --c6s-slate: #beb3a7;
    --c6s-slate-light: #d4cab9;
    --c6s-white: #f5f0e8;
    --c6s-accent: #a8c196;
    --c6s-accent-bg: #8faa7b;
    --c6s-accent-hover: #b8d1a8;
    --c6s-accent-dim: rgba(143, 170, 123, 0.09);

    /* Semantic Mappings */
    --bg: var(--c6s-navy);
    --bg-card: var(--c6s-navy-light);
    --border: var(--c6s-navy-mid);
    --text: var(--c6s-slate-light);
    --text-muted: var(--c6s-slate);
    --text-heading: var(--c6s-white);
    --accent: var(--c6s-accent);
    --accent-bg: var(--c6s-accent-bg);

    /* Status Colors (C6S-harmonized) */
    --status-enacted: #a8c196;
    --status-governor: #d4a76a;
    --status-active: #7ba8aa;
    --status-failed: #c17c74;
    --status-prefiled: #beb3a7;
    --status-passed: #c9b86c;

    /* Keep existing semantic names for backward compat with app.js references */
    --primary: var(--c6s-navy);
    --secondary: var(--c6s-navy-light);
    --success: var(--c6s-accent);
    --warning: #d4a76a;
    --danger: #c17c74;
    --glow: rgba(168, 193, 150, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, var(--glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 193, 150, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(193, 124, 116, 0.15) 0%, transparent 50%);
    opacity: 0.3;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-20px, -20px) scale(1.1); }
    66% { transform: translate(20px, -10px) scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
        transform: none;
    }
}

/* Header */
header {
    background: rgba(58, 54, 64, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sync-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--c6s-accent-dim);
    border: 1px solid var(--accent);
    border-radius: 9999px;
    transition: opacity 0.3s, background-color 0.3s;
}

.sync-status.syncing {
    animation: pulse 1.5s infinite;
}

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

.sync-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Bill Type Navigation */
.bill-type-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 1rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--primary);
    touch-action: pan-x;
}

.bill-type-nav::-webkit-scrollbar {
    height: 6px;
}

.bill-type-nav::-webkit-scrollbar-track {
    background: var(--primary);
}

.bill-type-nav::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.nav-tab {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s, background-color 0.3s;
    cursor: pointer;
}

@media (hover: hover) {
    .nav-tab:hover {
        background: var(--secondary);
        color: var(--text);
        border-color: var(--accent);
    }
}

.nav-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Page Title */
.page-title {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
}

.page-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* View Modes */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

/* Stats Grid - Clickable */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

@media (hover: hover) {
    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        border-color: var(--accent);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--success));
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Controls */
.controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--c6s-accent-dim);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) {
    .filter-btn:hover {
        background: var(--secondary);
        border-color: var(--accent);
    }
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.inactive-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.inactive-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
}

.cutoff-banner {
    background: var(--secondary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
}

.cutoff-banner .cutoff-label {
    font-weight: 600;
}

.cutoff-banner .cutoff-days {
    margin-left: auto;
    font-weight: 700;
    color: var(--accent);
}

.bill-card.inactive-bill {
    opacity: 0.6;
    border-left: 3px solid var(--text-muted);
}

.tag.session-2025 {
    background: #6c757d;
    color: white;
    font-size: 0.7rem;
}

.tag.cutoff-failed {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
}

/* Cutoff Failed Bills Section */
.cutoff-failed-section {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.cutoff-failed-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(193, 124, 116, 0.1);
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text);
    font-family: inherit;
}

.cutoff-failed-header:hover {
    background: rgba(193, 124, 116, 0.15);
}

.cutoff-failed-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.cutoff-failed-icon {
    font-size: 1.25rem;
}

.cutoff-failed-count {
    color: var(--danger);
    font-weight: 700;
}

.cutoff-failed-chevron {
    font-size: 0.875rem;
    transition: transform 0.3s;
    color: var(--text-muted);
}

.cutoff-failed-section.expanded .cutoff-failed-chevron {
    transform: rotate(180deg);
}

.cutoff-failed-content {
    display: none;
    padding: 1.5rem;
}

.cutoff-failed-section.expanded .cutoff-failed-content {
    display: block;
}

.cutoff-failed-explanation {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(193, 124, 116, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--danger);
}

.cutoff-group {
    margin-bottom: 1.5rem;
}

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

.cutoff-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cutoff-group-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.cutoff-group-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cutoff-group-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cutoff-failed-bills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.cutoff-failed-bills-grid .bill-card {
    opacity: 0.85;
}

.cutoff-failed-bills-grid .bill-card:hover {
    opacity: 1;
}

/* Cutoff Explainer Banner */
.cutoff-explainer-banner {
    background: linear-gradient(135deg, rgba(212, 167, 106, 0.15) 0%, rgba(193, 124, 116, 0.1) 100%);
    border: 1px solid var(--warning);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.cutoff-explainer-banner.dismissed {
    display: none;
}

.cutoff-explainer-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
}

.cutoff-explainer-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.cutoff-explainer-headline {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    flex: 1;
    min-width: 200px;
}

.cutoff-explainer-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.cutoff-explainer-toggle:hover {
    background: var(--secondary);
    border-color: var(--accent);
}

.cutoff-explainer-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.cutoff-explainer-banner.expanded .cutoff-explainer-arrow {
    transform: rotate(180deg);
}

.cutoff-explainer-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.cutoff-explainer-dismiss:hover {
    color: var(--text);
}

.cutoff-explainer-flyout {
    display: none;
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
}

.cutoff-explainer-banner.expanded .cutoff-explainer-flyout {
    display: block;
    animation: slideDown 0.3s ease;
}

.cutoff-explainer-flyout h4 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.cutoff-explainer-flyout h4:not(:first-child) {
    margin-top: 1.25rem;
}

.cutoff-explainer-flyout p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0 0.75rem 0;
}

.cutoff-explainer-flyout ul {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0;
    padding-left: 1.25rem;
}

.cutoff-explainer-flyout li {
    margin-bottom: 0.35rem;
}

.cutoff-explainer-flyout strong {
    color: var(--text);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--c6s-accent-hover);
        transform: translateY(-2px);
        box-shadow: 0 10px 20px var(--glow);
    }
}

/* Filters Panel */
.filters-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: none;
}

.filters-panel.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.committee-filter-options {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.filter-group-label {
    width: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-group-label:first-child {
    margin-top: 0;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

@media (hover: hover) {
    .filter-tag:hover {
        background: var(--secondary);
        border-color: var(--accent);
    }
}

.filter-tag.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.pagination-controls button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 48px;
    transition: background-color 0.3s, border-color 0.3s;
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-controls .page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Skeleton Loading */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
}

.skeleton-line {
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--border) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.skeleton-title { height: 1.25rem; width: 40%; }
.skeleton-short { height: 0.875rem; width: 25%; }
.skeleton-long { height: 0.875rem; width: 90%; }
.skeleton-medium { height: 0.875rem; width: 60%; margin-bottom: 0; }

/* Scroll sentinel for infinite scroll detection */
.scroll-sentinel { height: 1px; }

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

@media (prefers-reduced-motion: reduce) {
    .skeleton-line {
        animation: none;
    }
}

/* Bills Grid */
.bills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
}

/* Rubber stamp overlay for milestone statuses */
.bill-stamp {
    position: absolute;
    top: 18px;
    right: -12px;
    transform: rotate(-15deg);
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #b83230;
    opacity: 0.55;
    border: 3px solid #b83230;
    border-radius: 6px;
    padding: 4px 14px;
    box-shadow: inset 0 0 0 2px #b83230;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

.bill-stamp-signed {
    color: #2e7d32;
    border-color: #2e7d32;
    box-shadow: inset 0 0 0 2px #2e7d32;
}

@media (max-width: 768px) {
    .bill-stamp {
        font-size: 1rem;
        top: 12px;
        right: -8px;
        padding: 3px 10px;
    }
}

@media (hover: hover) {
    .bill-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        border-color: var(--accent);
    }
}

.bill-card.tracked {
    border-color: var(--warning);
}

.bill-card.tracked::before {
    content: '\2B50';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    z-index: 10;
}

.bill-header {
    padding: 1.5rem;
    background: var(--c6s-accent-dim);
    border-bottom: 1px solid var(--border);
}

.bill-number {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.bill-number:hover {
    color: var(--c6s-accent-hover);
}

.bill-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.bill-body {
    padding: 1.5rem;
}

.bill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bill-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.bill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.status-prefiled { background: rgba(212, 167, 106, 0.1); color: var(--status-prefiled); border-color: var(--status-prefiled); }
.tag.status-introduced { background: var(--c6s-accent-dim); color: var(--accent); border-color: var(--accent); }
.tag.status-committee,
.tag.status-opposite_committee { background: rgba(123, 168, 170, 0.1); color: var(--status-active); border-color: var(--status-active); }
.tag.status-floor,
.tag.status-opposite_floor { background: rgba(123, 168, 170, 0.15); color: var(--status-active); border-color: var(--status-active); }
.tag.status-passed,
.tag.status-passed_origin,
.tag.status-passed_legislature { background: rgba(201, 184, 108, 0.1); color: var(--status-passed); border-color: var(--status-passed); }
.tag.status-governor { background: rgba(212, 167, 106, 0.1); color: var(--status-governor); border-color: var(--status-governor); }
.tag.status-enacted { background: rgba(168, 193, 150, 0.15); color: var(--status-enacted); border-color: var(--status-enacted); font-weight: 700; }
.tag.status-vetoed,
.tag.status-failed { background: rgba(193, 124, 116, 0.1); color: var(--status-failed); border-color: var(--status-failed); }

.tag.priority-high { background: rgba(193, 124, 116, 0.1); color: var(--danger); border-color: var(--danger); }
.tag.priority-medium { background: rgba(212, 167, 106, 0.1); color: var(--warning); border-color: var(--warning); }
.tag.priority-low { background: rgba(168, 193, 150, 0.1); color: var(--success); border-color: var(--success); }

/* Bill Status Progress Tracker -- stacked vertical layout */
.bill-progress-tracker {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 1.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

.bill-progress-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bill-progress-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    opacity: 0.5;
    width: 3.5rem;
    flex-shrink: 0;
    text-align: right;
}

.bill-progress-row {
    display: flex;
    align-items: flex-start;
    flex: 1;
}

.bill-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    z-index: 1;
}

.bill-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
    flex-shrink: 0;
}

.bill-progress-step.completed .bill-progress-dot {
    background: var(--accent);
    border-color: var(--accent);
}

.bill-progress-step.active .bill-progress-dot {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--c6s-accent-dim);
}

.bill-progress-step.failed .bill-progress-dot,
.bill-progress-step.vetoed .bill-progress-dot {
    background: var(--danger);
    border-color: var(--danger);
}

.bill-progress-step.enacted .bill-progress-dot {
    background: var(--success);
    border-color: var(--success);
}

.bill-progress-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0.5;
}

.bill-progress-step.completed .bill-progress-label,
.bill-progress-step.active .bill-progress-label {
    color: var(--accent);
    opacity: 1;
    font-weight: 600;
}

.bill-progress-step.failed .bill-progress-label,
.bill-progress-step.vetoed .bill-progress-label {
    color: var(--danger);
    opacity: 1;
    font-weight: 600;
}

.bill-progress-step.enacted .bill-progress-label {
    color: var(--success);
    opacity: 1;
    font-weight: 600;
}

.bill-progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 -1px;
    margin-top: 6px;
    z-index: 0;
}

.bill-progress-line.completed {
    background: var(--accent);
}

/* Vote Results Tracker -- replaces progress tracker for passed bills */
.vote-tracker {
    padding: 1rem;
    margin: 0.5rem 0;
}

.vote-results {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .vote-results {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.vote-chamber {
    flex: 1;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.vote-chamber-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.vote-counts {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.vote-yeas {
    color: var(--status-enacted);
}

.vote-nays {
    color: var(--status-failed);
}

.vote-separator {
    color: var(--text-muted);
    margin: 0 0.3rem;
}

.vote-motion {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.vote-passed {
    border-left: 3px solid var(--status-enacted);
}

.vote-failed {
    border-left: 3px solid var(--status-failed);
}

/* Governor Status Row */
.governor-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
}

.governor-status-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--text-muted);
}

.governor-status-value {
    font-weight: 700;
}

.governor-status-awaiting {
    color: var(--status-governor);
}

.governor-status-signed {
    color: var(--status-enacted);
}

.governor-status-vetoed {
    color: var(--status-failed);
}

/* Notes Display in Bill Card */
.bill-notes-preview {
    padding: 0 1.5rem 1rem;
    font-size: 0.875rem;
    color: var(--warning);
    font-style: italic;
}

.bill-actions {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    text-align: center;
    text-decoration: none;
}

@media (hover: hover) {
    .action-btn:hover {
        background: var(--secondary);
        color: var(--text);
        border-color: var(--accent);
    }
}

.action-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* User Panel Enhanced */
.user-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    transition: transform 0.3s, opacity 0.3s;
}

.user-panel.expanded {
    min-height: 400px;
}

.user-panel.panel-collapsed {
    min-width: auto;
    max-width: none;
    padding: 0.5rem;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-panel.panel-collapsed .user-header {
    margin: 0;
    padding: 0;
    border: none;
}

.user-panel.panel-collapsed .user-info > div:last-child,
.user-panel.panel-collapsed .user-stats,
.user-panel.panel-collapsed .expand-btn,
.user-panel.panel-collapsed .user-notes-section {
    display: none;
}

.user-panel.panel-collapsed .user-info {
    gap: 0;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.user-name {
    font-weight: 600;
    cursor: pointer;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.expand-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: transform 0.3s;
}

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

.expand-btn.expanded {
    transform: rotate(180deg);
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-notes-section {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    max-height: 250px;
    overflow-y: auto;
}

.user-notes-section.active {
    display: block;
}

.notes-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notes-section-header h4 {
    margin: 0;
}

.notes-export-btns {
    display: flex;
    gap: 0.25rem;
}

.notes-export-btn {
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.notes-export-btn:hover {
    background: var(--secondary);
    color: var(--text);
}

.user-notes-section h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.user-note-item {
    background: var(--primary);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-note-bill {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-note-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 0.25rem;
}

/* Stats Detail View */
.stats-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stats-detail h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.stats-list {
    display: grid;
    gap: 1rem;
}

.stats-item {
    background: var(--primary);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-item-label {
    font-weight: 600;
}

.stats-item-value {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    color: var(--accent);
}

/* Tracked Bill Cards */
.tracked-bill-card {
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.tracked-bill-card:hover {
    border-color: var(--accent);
    background: var(--secondary);
}

.tracked-bill-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.tracked-bill-header .bill-number {
    font-weight: 700;
    white-space: nowrap;
}

.tracked-bill-title {
    color: var(--text);
    font-weight: 600;
}

.tracked-bill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .tracked-bill-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    .tracked-bill-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
}

@media (hover: hover) {
    .back-btn:hover {
        background: var(--primary);
        border-color: var(--accent);
        transform: translateX(-4px);
    }
}

/* Modal for Notes */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

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

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

.existing-notes {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.existing-notes:empty {
    display: none;
}

.existing-note-item {
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.existing-note-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.existing-note-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.existing-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.note-delete-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    transition: color 0.2s, border-color 0.2s;
}

.note-delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.note-delete-all-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    transition: color 0.2s, border-color 0.2s;
}

.note-delete-all-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.existing-note-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.note-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Utility classes for inline style replacements */
.hidden-input {
    display: none;
}

/* Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
}

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

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1rem 2rem;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 3000;
}

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

/* Responsive */
@media (max-width: 768px) {
    body::before {
        animation: none;
        transform: none;
        background: radial-gradient(circle at 50% 50%, var(--glow) 0%, transparent 60%);
    }

    header {
        background: rgba(58, 54, 64, 1);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    h1 {
        font-size: 1.35rem;
    }

    .container {
        padding: 1rem;
    }

    .page-title {
        padding: 0.75rem 1rem 0;
    }

    .bill-type-nav {
        padding: 0 1rem 1rem;
    }

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

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

    .stat-card {
        padding: 1rem;
    }

    .user-panel {
        bottom: 1rem;
        right: 1rem;
        left: auto;
        max-width: none;
        min-width: auto;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .user-panel .user-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .user-panel .user-info > div:last-child,
    .user-panel .user-stats,
    .user-panel .user-notes-section,
    .user-panel .expand-btn {
        display: none;
    }

    .user-panel .user-info {
        gap: 0;
    }

    .user-panel .user-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        cursor: pointer;
    }

    .user-panel.mobile-expanded {
        width: auto;
        height: auto;
        left: 1rem;
        right: 1rem;
        border-radius: 12px;
        padding: 1rem;
        overflow: visible;
        display: block;
    }

    .user-panel.mobile-expanded .user-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .user-panel.mobile-expanded .user-info > div:last-child,
    .user-panel.mobile-expanded .user-stats,
    .user-panel.mobile-expanded .expand-btn {
        display: block;
    }

    .user-panel.mobile-expanded .user-notes-section.active {
        display: block;
    }

    .user-panel.mobile-expanded .user-info {
        gap: 0.75rem;
    }

    .user-panel.mobile-expanded .user-avatar {
        width: 40px;
        height: 40px;
    }

    .filter-tag,
    .filter-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .cutoff-failed-section {
        margin-top: 1.5rem;
    }

    .cutoff-failed-header {
        padding: 0.75rem 1rem;
    }

    .cutoff-failed-title {
        font-size: 0.875rem;
    }

    .cutoff-failed-content {
        padding: 1rem;
    }

    .cutoff-failed-bills-grid {
        grid-template-columns: 1fr;
    }

    .cutoff-group-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cutoff-group-count {
        margin-left: 0;
    }

    .cutoff-explainer-main {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .cutoff-explainer-headline {
        font-size: 0.85rem;
        min-width: 100%;
        order: 2;
    }

    .cutoff-explainer-icon {
        order: 1;
    }

    .cutoff-explainer-dismiss {
        order: 1;
        margin-left: auto;
    }

    .cutoff-explainer-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .cutoff-explainer-flyout {
        padding: 1rem;
    }

    .cutoff-explainer-flyout h4 {
        font-size: 0.9rem;
    }

    .cutoff-explainer-flyout p,
    .cutoff-explainer-flyout ul {
        font-size: 0.8rem;
    }

    .bill-progress-tracker {
        padding: 0.5rem 0.75rem 0.4rem;
    }

    .bill-progress-section-label {
        font-size: 0.5rem;
        width: 2.5rem;
    }

    .bill-progress-label {
        display: none;
    }

    .bill-progress-dot {
        width: 8px;
        height: 8px;
    }

    .bill-progress-line {
        margin-top: 5px;
    }

    .bill-header {
        padding: 1rem;
    }

    .bill-body {
        padding: 1rem;
    }

    .bill-actions {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .action-btn {
        min-height: 48px;
        padding: 0.75rem;
    }

    .nav-tab {
        padding: 0.75rem 1.25rem;
    }
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
