/* ============================================
   ClearVoting — Design Tokens
   ============================================ */
:root {
    --bg-primary: #F5F6FA;
    --bg-secondary: #112E51;
    --bg-card: #FFFFFF;
    --bg-card-hover: #EEF1F6;
    --text-primary: #1B1B1B;
    --text-secondary: #5B616B;
    --text-dim: #8D9297;
    --accent: #0071BC;
    --accent-dim: #205493;
    --accent-red: #C5283D;
    --vote-yea: #2E8540;
    --vote-nay: #CD2026;
    --vote-absent: #AEB0B5;
    --vote-present: #0071BC;
    --border: #D6D7D9;
    --border-light: #E8E8E8;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --max-width: 1100px;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

/* ============================================
   Demo Banner
   ============================================ */
.demo-banner {
    background: var(--accent-red);
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   Skip Link (accessibility)
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--accent-red);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    font-weight: 600;
}

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

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--bg-secondary);
    border-bottom: none;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 0.02em;
}

.logo span {
    color: rgba(255, 255, 255, 0.8);
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
}

nav a:hover, nav a.active {
    color: #fff;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   Main Content
   ============================================ */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   Hero
   ============================================ */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.hero h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 500px;
    margin: 0 auto;
}

.hero-mission-link {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.hero-mission-link a {
    color: var(--text-dim);
    transition: color var(--transition);
}

.hero-mission-link a:hover {
    color: var(--accent);
}

/* ============================================
   About Page
   ============================================ */
.about-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.about-section p {
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.about-list {
    list-style: none;
    padding: 0;
}

.about-list li {
    padding: 0.5rem 0 0.5rem 1.25rem;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
}

.about-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.about-list li strong {
    color: var(--text-primary);
}

.about-cta {
    width: auto;
    margin-top: 0.5rem;
}

/* ============================================
   Lookup Section
   ============================================ */
.lookup {
    max-width: 550px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.lookup h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

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

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select, input[type="number"], input[type="text"], input[type="search"] {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-body);
    width: 100%;
    transition: border-color var(--transition);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    min-height: 44px;
}

.btn-primary {
    background: var(--accent-red);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #A82235;
}

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

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

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
}

.btn-small {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

/* ============================================
   Results Section
   ============================================ */
.results {
    margin-top: 2rem;
}

.results h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.member-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.member-card.expanded {
    border-color: var(--accent-dim);
    box-shadow: var(--shadow);
}

.member-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
    box-shadow: var(--shadow);
}

.member-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.member-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.member-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.member-info .chamber {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.member-info .state-district {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.party-badge {
    display: none;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    margin-top: 0.3rem;
}

.show-party .party-badge {
    display: inline-block;
}

/* ============================================
   Card Snapshot (expandable voting summary)
   ============================================ */
.card-snapshot {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.card-snapshot.visible {
    max-height: 300px;
    opacity: 1;
}

.snapshot-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.snapshot-stat strong {
    color: var(--text-primary);
}

.snapshot-yea {
    color: var(--vote-yea);
    font-weight: 600;
}

.snapshot-nay {
    color: var(--vote-nay);
    font-weight: 600;
}

.snapshot-area-header {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0.6rem 0 0.35rem;
}

.card-snapshot .summary-issue-row {
    grid-template-columns: 120px 45px 1fr;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.snapshot-profile-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.snapshot-profile-link:hover {
    color: var(--accent-dim);
}

.snapshot-loading {
    padding: 0.75rem 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.75rem;
}

.snapshot-loading .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.snapshot-empty {
    padding: 0.75rem 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
    border-top: 1px solid var(--border-light);
    margin-top: 0.75rem;
}

/* ============================================
   Party Toggle (inline)
   ============================================ */
.party-toggle-inline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
    white-space: nowrap;
}

.party-toggle-inline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.party-toggle-inline.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================
   Browse Section
   ============================================ */
.browse {
    margin-top: 3rem;
}

.browse h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-bar input {
    flex: 1;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.category-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.category-tag:hover, .category-tag.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card-hover);
}

/* ============================================
   Bill List
   ============================================ */
.bill-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bill-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}

.bill-item:hover {
    border-color: var(--accent-dim);
    background: var(--bg-card-hover);
}

.bill-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.bill-item .bill-number {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
}

.bill-item .bill-date {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.bill-item .bill-action {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ============================================
   Impact Tags
   ============================================ */
.impact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.impact-tag {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

/* ============================================
   Vote Display
   ============================================ */
.vote-summary {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.vote-count {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.vote-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.vote-dot.yea { background: var(--vote-yea); }
.vote-dot.nay { background: var(--vote-nay); }
.vote-dot.present { background: var(--vote-present); }
.vote-dot.absent { background: var(--vote-absent); }

.vote-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.vote-bar-segment {
    transition: width var(--transition);
}

.vote-bar-segment.yea { background: var(--vote-yea); }
.vote-bar-segment.nay { background: var(--vote-nay); }
.vote-bar-segment.present { background: var(--vote-present); }
.vote-bar-segment.absent { background: var(--vote-absent); }

/* ============================================
   Vote Label
   ============================================ */
.vote-label {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
}

.vote-label.yea { background: var(--vote-yea); color: #fff; }
.vote-label.nay { background: var(--vote-nay); color: #fff; }
.vote-label.present { background: var(--vote-present); color: #fff; }
.vote-label.not-voting, .vote-label.absent {
    background: var(--vote-absent);
    color: #fff;
}

/* ============================================
   Vote Block (on bill detail page)
   ============================================ */
.vote-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.vote-block h4 {
    font-family: var(--font-heading);
    color: var(--accent);
    margin: 0 0 0.5rem;
}

.vote-question {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.vote-result {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.vote-note {
    color: var(--accent-dim);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.75rem;
}

/* ============================================
   Pie Charts
   ============================================ */
.vote-chart-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.vote-pie {
    flex-shrink: 0;
}

.party-breakdown {
    margin: 1rem 0;
}

.party-pie-charts {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.party-pie-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.party-pie-wrapper h5 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin: 0;
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pie-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ============================================
   Table
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.data-table th {
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.data-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: var(--bg-card-hover);
}

.data-table .col-party {
    display: none;
}

.show-party .data-table .col-party {
    display: table-cell;
}

/* ============================================
   Bill Detail Page
   ============================================ */
.bill-header {
    margin-bottom: 2rem;
}

.bill-header .bill-number {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
}

.bill-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.bill-header .bill-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bill-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.bill-section h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.provision-list {
    list-style: none;
    padding: 0;
}

.provision-list li {
    padding: 0.5rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-primary);
    line-height: 1.5;
}

.provision-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.ai-disclaimer {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.75rem;
    font-style: italic;
}

.official-summary {
    color: var(--text-secondary);
    line-height: 1.7;
}

.source-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
}

/* ============================================
   Member Detail Page
   ============================================ */
.member-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.member-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.member-sticky-bar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.member-sticky-bar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.member-sticky-bar .sticky-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.member-sticky-bar .sticky-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.member-header .member-photo,
.member-header .member-photo-placeholder {
    width: 96px;
    height: 96px;
}

.member-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    line-height: 1.3;
}

.member-header .member-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.member-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.15rem;
}

/* Voting Summary — "At a Glance" Card */
.voting-summary {
    margin-bottom: 1.5rem;
}

.voting-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.voting-summary-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.summary-overview {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.summary-issues {
    margin-bottom: 1.25rem;
}

.summary-issues h4 {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.summary-issue-row {
    display: grid;
    grid-template-columns: 140px 60px 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.summary-issue-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.summary-issue-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: right;
}

.summary-mini-bar {
    height: 6px;
    background: var(--vote-nay);
    border-radius: 3px;
    overflow: hidden;
}

.summary-mini-bar-yea {
    height: 100%;
    background: var(--vote-yea);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.summary-voted-section {
    margin-bottom: 1rem;
}

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

.summary-voted-section h4 {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.summary-vote-list li {
    padding: 0.35rem 0 0.35rem 1rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.summary-vote-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.summary-for .summary-vote-list li::before {
    background: var(--vote-yea);
}

.summary-against .summary-vote-list li::before {
    background: var(--vote-nay);
}

/* Deficit Impact */
.summary-deficit {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.summary-deficit h4 {
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.summary-deficit-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}

.summary-deficit-net {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
}

.deficit-increase {
    color: #E07A5F;
}

.deficit-decrease {
    color: var(--vote-yea);
}

.summary-deficit-net.deficit-increase {
    background: rgba(224, 122, 95, 0.1);
    border-left: 3px solid #E07A5F;
}

.summary-deficit-net.deficit-decrease {
    background: rgba(46, 133, 64, 0.1);
    border-left: 3px solid var(--vote-yea);
}

.summary-deficit-breakdown {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.summary-deficit-breakdown li {
    padding: 0.3rem 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.summary-deficit-breakdown li span {
    font-weight: 600;
}

.cbo-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.cbo-tag.deficit-increase {
    background: rgba(224, 122, 95, 0.15);
    color: #E07A5F;
}

.cbo-tag.deficit-decrease {
    background: rgba(46, 133, 64, 0.15);
    color: var(--vote-yea);
}

/* Scorecard — Issues You Care About */
.scorecard-section {
    margin: 1.5rem 0;
}

.scorecard-section > h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.scorecard-subtitle {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.scorecard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.scorecard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
}

.scorecard-card-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0 0 0.15rem 0;
}

.scorecard-card-subtitle {
    color: var(--text-dim);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.8rem;
}

.scorecard-empty {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
}

.scorecard-net {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.8rem;
}

.scorecard-net.deficit-increase {
    background: rgba(224, 122, 95, 0.1);
    border-left: 3px solid #E07A5F;
    color: #E07A5F;
}

.scorecard-net.deficit-decrease {
    background: rgba(46, 133, 64, 0.1);
    border-left: 3px solid var(--vote-yea);
    color: var(--vote-yea);
}

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

.scorecard-vote-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(214, 215, 217, 0.4);
    line-height: 1.4;
}

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

.scorecard-vote-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.scorecard-vote-badge.vote-yea {
    background: rgba(46, 133, 64, 0.2);
    color: var(--vote-yea);
}

.scorecard-vote-badge.vote-nay {
    background: rgba(205, 32, 38, 0.2);
    color: var(--vote-nay);
}

.scorecard-vote-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.scorecard-deficit-tag {
    font-weight: 600;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .scorecard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Service History (compact) */
.service-compact {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
}

.service-compact-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-compact h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--accent);
    margin: 0;
    white-space: nowrap;
}

.service-compact-summary {
    color: var(--text-secondary);
    font-size: 0.88rem;
    flex: 1;
}

.service-expand-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
    white-space: nowrap;
}

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

.service-detail-table {
    display: none;
    margin-top: 0.75rem;
}

.service-detail-table.expanded {
    display: table;
}

/* ============================================
   Loading & Error States
   ============================================ */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.error-message {
    background: var(--bg-card);
    border: 1px solid var(--vote-nay);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    max-width: var(--max-width);
    margin: 3rem auto 0;
    padding: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.8;
}

.site-footer a {
    color: var(--text-secondary);
}

/* ============================================
   Member Voting Profile
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-heading);
}

.stat-big-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
    line-height: 1;
}

.stat-sublabel {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.stat-legend {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.issue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.vote-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: all var(--transition);
}

.vote-item:hover {
    border-color: var(--accent-dim);
    background: var(--bg-card-hover);
}

.vote-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.vote-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.vote-item-oneliner {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.vote-item-bottom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.vote-item-result {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .site-header { padding: 0.75rem 1rem; }
    .hamburger { display: block; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
    }

    nav.open { display: flex; }

    main { padding: 1rem; }

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

    .form-row { flex-direction: column; }

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

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-bar {
        flex-direction: column;
    }

    .member-header {
        flex-direction: column;
        text-align: center;
    }

    .member-meta-row {
        justify-content: center;
    }

    .member-sticky-bar {
        padding: 0.4rem 1rem;
    }

    .service-compact-header {
        flex-wrap: wrap;
    }

    .summary-issue-row {
        grid-template-columns: 110px 50px 1fr;
        gap: 0.5rem;
    }

    .card-snapshot .summary-issue-row {
        grid-template-columns: 100px 40px 1fr;
    }

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

    .issue-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .issue-filters .category-tag {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .bill-header h2 { font-size: 1.35rem; }

    .data-table { font-size: 0.85rem; }
    .data-table th, .data-table td {
        padding: 0.5rem;
    }
}

/* ============================================
   Feedback Button & Modal
   ============================================ */
.feedback-btn {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-secondary);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition);
    z-index: 90;
}

.feedback-btn:hover {
    color: #fff;
    background: var(--accent-dim);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1.5rem;
}

.feedback-modal[hidden] {
    display: none;
}

.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
}

.feedback-form {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 360px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.feedback-form h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.feedback-context {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.feedback-form textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--transition);
}

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

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feedback-status {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-align: center;
}

.feedback-success { color: var(--vote-yea); }
.feedback-error { color: var(--vote-nay); }

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html { scroll-behavior: auto; }
}
