/* VoteCraft Vote Page Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --upper-chamber: #14CCB0;
    --lower-chamber: #FFC280;
    --democrat: #3b82f6;
    --republican: #ef4444;
    --background: #ffffff;
    --background-alt: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --left-bg: #111827;
    --left-text: #f9fafb;
    --right-bg: #2563eb;
    --right-text: #ffffff;
}

html, body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--left-bg);
    color: var(--text);
    line-height: 1.5;
}

/* ========== TWO-PANEL LAYOUT ========== */

.vote-widget {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.vote-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ========== PANEL DIVIDER ========== */

.panel-divider {
    width: 6px;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 5;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 32px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.divider-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: var(--left-bg);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.divider-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.divider-btn-left {
    top: calc(50% - 22px);
    left: 50%;
    transform: translateX(-50%);
}

.divider-btn-right {
    top: calc(50% + 6px);
    left: 50%;
    transform: translateX(-50%);
}

.divider-btn-left:hover {
    transform: translateX(-50%) scale(1.1);
}

.divider-btn-right:hover {
    transform: translateX(-50%) scale(1.1);
}

/* Restore button (shown when a panel is expanded) */
.divider-btn-restore {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: var(--left-bg);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.divider-btn-restore:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

/* .divider-btn-restore.visible is in mobile media query only */

/* Expand states */
.vote-layout .left-panel,
.vote-layout .right-panel {
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expand states are mobile-only — see @media (max-width: 900px) */

/* ========== LEFT PANEL ========== */

.left-panel {
    width: 30%;
    min-width: 340px;
    max-width: 480px;
    background: var(--left-bg);
    color: var(--left-text);
    padding: 24px 16px;
    overflow-y: auto;
    flex-shrink: 0;
    direction: rtl;
}

.left-panel > * {
    direction: ltr;
}

.left-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track {
    background: #111827;
}

.left-panel::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sidebar-logo {
    display: block;
}

.sidebar-support-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #14CCB0;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid rgba(20, 204, 176, 0.3);
    border-radius: 9999px;
    transition: background 0.2s, border-color 0.2s;
}

.sidebar-support-link:hover {
    background: rgba(20, 204, 176, 0.1);
    border-color: #14CCB0;
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.search-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.search-section input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 400;
    text-transform: none;
    font-family: inherit;
    border: 1px solid #374151;
    border-radius: var(--radius);
    background: #1f2937;
    color: var(--left-text);
    outline: none;
}

.search-section input::placeholder {
    color: #9ca3af;
}

.search-section input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.btn-search {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search:hover {
    background: var(--primary-dark);
}

/* Toggle buttons */
.panel-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid #374151;
    border-radius: var(--radius);
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.toggle-btn:not(.active):hover {
    border-color: #6b7280;
    color: #f9fafb;
}

/* Rep sections */
.panel-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rep-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rep-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--left-text);
    padding-bottom: 4px;
}

.rep-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Individual rep item */
.rep-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.rep-item:hover {
    border-color: #6b7280;
    background: #1f2937;
}

.rep-item.selected {
    border-color: var(--primary);
    background: #1e3a5f;
}

.rep-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
}

.rep-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rep-info {
    flex: 1;
    min-width: 0;
}

.rep-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--left-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rep-details {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rep-district {
    font-size: 0.75rem;
    color: #9ca3af;
}

.rep-party.democratic {
    color: var(--democrat);
    font-weight: 500;
}

.rep-party.republican {
    color: var(--republican);
    font-weight: 500;
}

.rep-separator {
    color: #6b7280;
    font-size: 0.6rem;
}

.rep-chamber {
    color: #9ca3af;
}

.explore-badge {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 4px;
    background: #dc2626;
    color: #fff;
    display: none;
    cursor: pointer;
    transition: background 0.2s;
}

.explore-badge:hover {
    background: #b91c1c;
}

.rep-item.selected .explore-badge {
    display: inline-block;
}

/* District accordion groups */
.district-group {
    border: 1px solid #374151;
    border-radius: var(--radius);
    overflow: hidden;
}

.district-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #1f2937;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.district-header:hover {
    background: #374151;
}

.district-header-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d1d5db;
}

.district-header-count {
    font-size: 0.75rem;
    color: #9ca3af;
    background: #374151;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 8px;
}

.district-toggle {
    font-size: 1rem;
    font-weight: 700;
    color: #9ca3af;
    width: 20px;
    text-align: center;
}

.district-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.district-body .rep-item {
    border: none;
    border-radius: 4px;
}

.chamber-desc {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 3px;
    line-height: 1.3;
}

/* County sub-groups inside House */
.county-group {
    border: 1px solid #2d3748;
    border-radius: 6px;
    margin-bottom: 4px;
    overflow: hidden;
}

.county-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #111827;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.county-header:hover {
    background: #1f2937;
}

.county-header-title {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
}

.county-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px;
}

.county-body .rep-item {
    border: none;
    border-radius: 4px;
}

/* State legislators loading spinner */
.state-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.state-loading .mini-loader {
    width: 16px;
    height: 16px;
    border: 2px solid #374151;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Issues sidebar list */
.issues-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.issue-sidebar-item {
    padding: 12px;
    border: 1px solid #374151;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--left-text);
    transition: all 0.2s;
}

.issue-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.issue-sidebar-title {
    flex: 1;
    min-width: 0;
}

.issue-toggle-arrow {
    font-size: 0.75rem;
    color: #6b7280;
    transition: transform 0.25s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.issue-sidebar-item.active .issue-toggle-arrow {
    transform: rotate(180deg);
    color: #93c5fd;
}

.issue-sidebar-item:hover {
    border-color: #6b7280;
    background: #1f2937;
}

.issue-sidebar-item.active {
    border-color: var(--primary);
    background: #1e3a5f;
}

/* Stance accordion buttons (Supporters / Opposed) */
.issue-stance-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.stance-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #1f2937;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.stance-btn:hover {
    border-color: #6b7280;
    color: #d1d5db;
}

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

.stance-btn.explore-stance {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.stance-btn.explore-stance:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Stance list (accordion body) */
.stance-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.stance-rep-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.stance-rep-item:hover {
    background: #1f2937;
}

.stance-rep-item:active {
    background: #2563eb;
    transform: scale(0.98);
}

.stance-rep-item.selected {
    background: #1e3a5f;
    border-left: 3px solid #3b82f6;
}

.stance-rep-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
}

.stance-rep-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stance-rep-info {
    flex: 1;
    min-width: 0;
}

.stance-rep-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--left-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stance-rep-detail {
    font-size: 0.75rem;
    color: #9ca3af;
}

.stance-bill-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    white-space: nowrap;
}

.stance-bill-count.opposed {
    color: #ef4444;
}

.stance-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    color: #9ca3af;
    font-size: 0.8rem;
}

.stance-loading .mini-loader {
    width: 14px;
    height: 14px;
    border: 2px solid #374151;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.stance-empty {
    padding: 12px 8px;
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
}

.stance-rep-item.placeholder {
    opacity: 0.5;
    cursor: default;
}

/* ========== RIGHT PANEL ========== */

.right-panel {
    flex: 1;
    background: var(--right-bg);
    color: var(--right-text);
    padding: 0 clamp(16px, 3vw, 40px) 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.view-container {
    margin: 0 auto;
}

#issue-detail-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-top: clamp(16px, 3vh, 30px);
    position: relative;
}

/* ========== SUPPORT OVERLAY ========== */

.support-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--right-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 24px 24px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.support-overlay.active {
    transform: translateY(0);
    pointer-events: auto;
}

.support-overlay-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: #000;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 1001;
}

.support-overlay-close:hover {
    opacity: 1;
}

.support-overlay-header {
    max-width: 1100px;
    width: 100%;
    padding: 0 24px 2px;
    text-align: center;
}

.support-overlay-title {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
}

.support-overlay-tagline {
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    color: #fff;
    margin: 0 0 20px;
    line-height: 1.4;
    white-space: nowrap;
}

.support-overlay-split {
    display: flex;
    gap: clamp(16px, 3vw, 40px);
    max-width: 800px;
    width: 100%;
    padding: 8px 24px 16px;
    align-items: flex-start;
}

.support-overlay-left {
    flex: 1;
    text-align: center;
}

.support-overlay-right {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: clamp(20px, 3vw, 32px);
    color: var(--text);
}

.support-overlay-logo {
    width: clamp(120px, 15vw, 180px);
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto 12px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.support-overlay-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.support-overlay-name {
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.support-overlay-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.donate-widget-title {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2px;
}

.donate-widget-subtitle {
    font-size: 0.85rem;
    color: #000;
    text-align: center;
    margin: 0 0 10px;
    line-height: 1.4;
}

.donate-widget-desc {
    font-size: 0.75rem;
    color: #1e293b;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.donate-freq-toggle {
    display: flex;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.donate-freq-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    border: none;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.donate-freq-btn.active {
    background: #ddd6fe;
    color: #1e1b4b;
}

.donate-amounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.donate-amount-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donate-rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.donate-rank-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.donate-rank-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.donate-rank:hover .donate-rank-tooltip {
    display: block;
}

.donate-amount-btn,
.donate-custom-input {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    box-sizing: border-box;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 10px 16px;
    transition: all 0.2s;
}

.donate-amount-btn {
    font-weight: 700;
    color: #000;
    cursor: pointer;
    text-align: center;
}

.donate-amount-btn:hover {
    border-color: #3b82f6;
}

.donate-amount-btn.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.donate-amount-note {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--right-bg);
    flex: 1;
}

.donate-custom-input {
    color: var(--text);
}

.donate-custom-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}

.donate-custom-note {
    font-size: 0.8rem;
    color: var(--right-bg);
    margin: 2px 0 0 24px;
    line-height: 1.3;
}

.patron-tooltip-trigger {
    position: relative;
    cursor: pointer;
}

.patron-callout {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 400;
    padding: 14px 16px 24px;
    border-radius: 10px;
    text-align: left;
    width: 240px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
    line-height: 1.5;
}

.patron-callout::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.patron-tooltip-trigger:hover .patron-callout {
    display: block;
}

.support-overlay-donate-btn {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--right-bg);
    color: #fff;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.support-overlay-donate-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vc-info-panel {
    position: relative;
    padding: 16px 0 0;
}

.vc-info-close {
    position: absolute;
    top: 8px;
    right: 0;
    background: #000;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.vc-info-close:hover {
    opacity: 1;
}

.vc-info-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 10px;
}

.vc-info-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.vc-info-list li {
    font-size: 0.95rem;
    padding: 6px 0;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.vc-info-list li:last-child {
    border-bottom: none;
}

.right-panel-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    padding-top: 30px;
}

.right-panel-subtitle {
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* ========== ISSUES GRID ========== */

.issues-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.issue-card {
    background: rgba(30, 58, 138, 0.6);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0;
}

.issue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.issue-card-image {
    width: 160px;
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #fff;
}

.issue-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Awareness chart overlay on issue hero image */
.issue-hero {
    position: relative;
}

.awareness-chart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.issue-hero:hover .awareness-chart-overlay {
    opacity: 1;
}

.awareness-chart-overlay .chart-header {
    font-size: clamp(0.85rem, 1.2vw, 1.3rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
    flex-shrink: 0;
}

.awareness-chart-overlay svg {
    width: 100%;
    max-width: 95%;
    flex: 1;
    min-height: 0;
}

.awareness-chart-overlay .chart-footnote {
    font-size: clamp(0.55rem, 0.7vw, 0.7rem);
    color: #94a3b8;
    text-align: center;
    margin-top: 2px;
    line-height: 1.2;
    max-width: 95%;
    flex-shrink: 0;
}

.issue-card-title {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

/* ========== ISSUE DETAIL VIEW ========== */

.btn-back {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 5;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-back:hover {
    background: #e2e8f0;
}

.issue-detail-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: clamp(12px, 2vw, 20px);
    align-items: stretch;
    max-width: 1110px;
    margin: 0 auto 20px;
    flex: 1;
    min-height: 0;
}

.issue-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    overflow: hidden;
}

.issue-col > * {
    max-width: 100%;
    box-sizing: border-box;
}

.issue-col:nth-child(2) {
}

.issue-col:nth-child(3) {
    gap: 16px;
}

/* State bills panel (under the map) */
.state-bills-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.state-bills-panel .state-bills-title {
    margin-top: 0;
    flex-shrink: 0;
}

.state-bills-panel .alignment-bills {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.issue-map-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
    height: 250px;
    isolation: isolate;
}

#issue-map {
    width: 100%;
    height: 100%;
}

.issue-detail-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    margin-bottom: clamp(8px, 1.5vh, 16px);
    text-align: left;
}

.issue-hero {
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    min-height: 0;
    width: 100%;
}

.issue-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    display: block;
}

.issue-desc-box {
    margin-top: clamp(8px, 1.5vh, 16px);
    border: none;
    border-radius: 12px;
    padding: clamp(8px, 1.5vw, 16px);
    background: transparent;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.issue-detail-desc {
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.45;
    opacity: 0.95;
    margin-top: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.btn-learn-more {
    display: block;
    width: 50%;
    margin: clamp(12px, 2vh, 30px) auto clamp(16px, 3vh, 50px);
    padding: 7px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    background: #fff;
    color: var(--primary);
    border: 1px solid #fff;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-learn-more:hover {
    background: #e2e8f0;
}

.switch-issue-link {
    display: block;
    text-align: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 8px;
    text-decoration: none;
    opacity: 0.85;
    cursor: pointer;
}

.switch-issue-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Sponsored bills in alignment card */
.rep-sponsored-bills {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 8px;
}

.rep-sponsored-bills .bill-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.rep-sponsored-bills .bill-item:last-child {
    border-bottom: none;
}

.rep-sponsored-bills .bill-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.rep-sponsored-bills .bill-item a:hover {
    text-decoration: underline;
}

.sponsored-bills-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0 8px;
    text-align: left;
}

/* State Related Bills title */
.state-bills-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0 8px;
    text-align: center;
}

/* Top supporters widget (now inside rep-alignment-card) */
.top-supporters-widget {
    background: transparent;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.top-supporters-divider {
    display: none;
}

.top-supporters-widget .rep-party {
    color: inherit;
}

/* Placeholder state (no longer a separate card — kept for compatibility) */
.top-supporters-widget.placeholder .top-supporter-item {
    opacity: 0.5;
}

.top-supporters-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 16px;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: normal;
}

.top-supporters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.top-supporter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--background-alt);
    border-radius: 8px;
}

.top-supporter-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.top-supporter-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-supporter-info {
    flex: 1;
    min-width: 0;
}

.top-supporter-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-supporter-detail {
    font-size: 0.75rem;
    color: var(--text-light);
}

.top-supporter-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    white-space: nowrap;
}

.top-supporter-item.placeholder {
    opacity: 0.5;
}

.btn-view-all-supporters {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-all-supporters:hover {
    background: var(--primary-dark);
}

/* Rep alignment card */
.rep-alignment-card {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: clamp(12px, 2vw, 24px);
    color: var(--text);
    text-align: center;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.rep-alignment-card::-webkit-scrollbar {
    width: 6px;
}

.rep-alignment-card::-webkit-scrollbar-track {
    background: transparent;
}

.rep-alignment-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.rep-alignment-card::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.rep-alignment-card.placeholder {
    display: flex;
    flex-direction: column;
}

.rep-alignment-card.placeholder .rep-card-name {
    order: -1;
    margin-bottom: 12px;
}

.rep-card-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.rep-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rep-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.rep-card-name-link {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
}

.rep-card-name-link:hover {
    color: #2563eb;
}

.rep-card-subtitle {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-light);
    margin-top: 2px;
}

.alignment-score {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.alignment-bills {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text);
    max-height: 220px;
    overflow-y: auto;
}

.alignment-bills .bill-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.alignment-bills .bill-item:last-child {
    border-bottom: none;
}

.alignment-bills .bill-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.alignment-bills .bill-item a:hover {
    text-decoration: underline;
}

.alignment-prompt {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Loading state for alignment */
.alignment-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.alignment-loading .mini-loader {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== LEARN MORE MODAL ========== */

.learn-more-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.learn-more-modal-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 90%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.learn-more-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #000;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
    padding: 0;
}

.learn-more-close:hover {
    background: #333;
}

.learn-more-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* ========== NONPROFITS ========== */

.nonprofits-section {
    margin: 15px calc(-1 * clamp(16px, 3vw, 40px)) 0;
    padding: calc(clamp(12px, 2vh, 23px) + 20px) clamp(16px, 3vw, 40px) clamp(20px, 4vh, 52px);
    background: #0036a9;
    color: #fff;
    flex: 0 0 auto;
}

.nonprofits-headline {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.nonprofits-subtext {
    font-size: clamp(0.85rem, 1vw, 1rem);
    text-align: center;
    opacity: 0.85;
    margin-bottom: 12px;
    line-height: 1.45;
}

.nonprofits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
}

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

.nonprofit-logo {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(30, 58, 138, 0.6);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.nonprofit-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nonprofit-logo .np-initials {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.np-card-active .nonprofit-logo {
    box-shadow: 0 0 16px 4px rgba(239, 68, 68, 0.6);
}

.btn-donate-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-donate-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    cursor: pointer;
}

.btn-num-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.btn-num-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.btn-donate-num:hover .btn-num-tooltip {
    display: block;
}

/* ===== Bot Challenge Modal ===== */
.bot-challenge-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.bot-challenge-modal.active {
    display: flex;
}

.bot-challenge-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bot-challenge-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #94a3b8;
}

.bot-challenge-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}

.bot-challenge-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 20px;
}

.bot-emoji-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.bot-emoji-btn {
    font-size: 2rem;
    width: 64px;
    height: 64px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.bot-emoji-btn:hover {
    border-color: #3b82f6;
    transform: scale(1.1);
}

.bot-emoji-btn.bot-correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.bot-emoji-btn.bot-wrong {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.5;
}

.bot-math-options {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.bot-math-btn {
    font-size: 1.2rem;
    font-weight: 700;
    width: 64px;
    height: 64px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.bot-math-btn:hover {
    border-color: #3b82f6;
}

.bot-math-btn.bot-correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.bot-math-btn.bot-wrong {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.5;
}

.bot-quote {
    font-size: 0.85rem;
    font-style: italic;
    color: #475569;
    margin: 0 0 4px;
    line-height: 1.45;
}

.bot-quote-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0 0 16px;
}

.bot-email-reveal {
    display: inline-block;
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--right-bg);
    text-decoration: none;
    padding: 10px 28px;
    background: #eff6ff;
    border-radius: 24px;
}

.bot-email-reveal:hover {
    background: #dbeafe;
}

.bot-challenge-subdesc {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 16px;
    line-height: 1.4;
}

.bot-email-form {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.bot-email-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    transition: border-color 0.2s;
}

.bot-email-input:focus {
    border-color: #3b82f6;
}

.bot-email-submit {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--right-bg);
    color: #fff;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.bot-email-submit:hover {
    background: #2563eb;
}

.bot-email-confirm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--right-bg);
    margin: 8px 0 0;
}

.bot-next-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 32px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    background: var(--right-bg);
    color: #fff;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.bot-next-btn:hover {
    background: #2563eb;
}

.email-me-link {
    color: #1e293b;
    text-decoration: none;
}

.btn-donate {
    display: inline-block;
    padding: 6px 24px;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    background: #fff;
    color: var(--text);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-donate:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-donate.donate-active {
    background: var(--left-bg);
    color: #fff;
}

.btn-donate.donate-active:hover {
    background: var(--left-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-to-top {
    display: none;
}

/* ========== LOADING / ERROR ========== */

.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.9);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    font-size: 1.1rem;
}

.loading-overlay.active {
    display: flex;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-inline {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fca5a5;
}

.error-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
    .right-panel {
        padding: 32px 24px;
        overflow-y: auto;
    }

    .right-panel-title {
        font-size: 1.8rem;
    }

    .issue-detail-layout {
        grid-template-columns: 1fr;
        max-width: 100%;
        transform: none;
    }

    .issue-detail-title {
        display: none;
    }

    #issue-detail-view {
        flex: none;
        padding-top: 0;
    }

    .issue-hero {
        width: 100% !important;
        height: auto !important;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0 -24px;
        width: calc(100% + 48px) !important;
    }

    .issue-hero-img {
        aspect-ratio: 16 / 9;
    }

    .issue-desc-box {
        width: 100% !important;
    }

    .issue-map-card {
        height: 300px !important;
    }

    .rep-alignment-card {
        width: 100%;
        height: auto !important;
    }

    .rep-card-photo {
        margin: 0;
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 900px) {
    .vote-layout {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        max-width: none;
        min-width: auto;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        max-height: 40vh;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 2;
        position: relative;
    }

    .panel-divider {
        display: flex;
        width: 100%;
        height: 6px;
        flex-direction: row;
    }

    .panel-divider::before {
        width: 32px;
        height: 4px;
    }

    .divider-btn-right {
        top: 50%;
        left: 20px;
        transform: translateY(-50%) rotate(90deg);
    }

    .divider-btn-left {
        top: 50%;
        left: 48px;
        transform: translateY(-50%) rotate(90deg);
    }

    .divider-btn-left:hover {
        transform: translateY(-50%) rotate(90deg) scale(1.1);
    }

    .divider-btn-right:hover {
        transform: translateY(-50%) rotate(90deg) scale(1.1);
    }

    .vote-layout.expand-left .left-panel {
        max-height: 100dvh;
        flex-grow: 1;
    }

    .vote-layout.expand-left .right-panel {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
    }

    .vote-layout.expand-right .left-panel {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        width: 100%;
        min-width: auto;
    }

    .vote-layout.expand-right .right-panel {
        flex: 1;
    }

    .vote-layout.expand-left .panel-divider,
    .vote-layout.expand-right .panel-divider {
        height: 0;
        width: 100%;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .divider-btn-restore.visible {
        display: flex;
    }

    .vote-layout.expand-left .divider-btn-restore.visible {
        top: auto;
        bottom: 16px;
        transform: rotate(180deg);
    }

    .vote-layout.expand-left .divider-btn-restore.visible:hover {
        transform: rotate(180deg) scale(1.1);
    }

    .right-panel {
        padding: 24px 16px;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
        flex: 1;
        min-height: 0;
        max-height: 100dvh;
    }

    .issue-hero {
        margin: 0 -16px;
        width: calc(100% + 32px) !important;
    }

    .nonprofits-section {
        margin: 0 -16px;
        padding: 16px 16px 20px;
    }

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

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

    .issue-card {
        flex-direction: row;
    }

    .issue-card-image {
        width: 120px;
        height: 120px;
    }

    .right-panel-title {
        font-size: 1.5rem;
    }

    .issue-detail-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 520px) {
    .left-panel {
        padding: 6px 10px;
        padding-top: max(6px, env(safe-area-inset-top));
        max-height: 35vh;
    }

    .sidebar-header {
        margin-bottom: 4px;
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-logo img {
        height: 35px;
    }

    .sidebar-support-link {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .search-section {
        margin-bottom: 6px;
        gap: 6px;
    }

    .search-section input {
        padding: 0 10px;
        font-size: 0.8rem;
        height: 27px;
        border-radius: 6px;
        border-width: 1px;
    }

    .btn-search {
        padding: 0 12px;
        font-size: 0.8rem;
        height: 27px;
        border-radius: 6px;
    }

    .panel-toggle {
        margin-bottom: 6px;
        gap: 0;
        background: #1f2937;
        border-radius: 6px;
        padding: 2px;
    }

    .toggle-btn {
        padding: 0 8px;
        font-size: 0.7rem;
        height: 26px;
        border: none;
        border-radius: 4px;
        letter-spacing: 0.3px;
    }

    #federal-section {
        margin-top: 20px;
    }

    .right-panel {
        padding: 16px 12px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .btn-back {
        top: 16px;
        right: 12px;
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    #issue-detail-view {
        padding-top: 0;
        overflow: visible;
    }

    .issue-col {
        overflow: visible;
    }

    .issue-detail-title {
        order: 1;
    }

    .issue-detail-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .issue-hero {
        margin: -16px -12px 0;
        width: calc(100% + 24px) !important;
        max-width: none !important;
        border-radius: 0;
        border: none;
        max-height: 220px;
    }

    .btn-back {
        display: none !important;
    }

    .issue-map-card {
        height: 200px !important;
    }

    .issue-detail-desc {
        font-size: 0.9rem;
    }

    .issue-desc-box {
        padding: 10px 0;
    }

    .btn-learn-more {
        width: 60%;
        margin-top: 20px;
        padding: 10px;
        font-size: 0.85rem;
    }

    .rep-alignment-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .rep-card-photo {
        margin: 0 auto;
        width: 70px;
        height: 70px;
    }

    .rep-card-name {
        font-size: 1.1rem;
    }

    .nonprofits-section {
        margin: 0 -12px;
        padding: 54px 12px 24px;
    }

    .nonprofits-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nonprofit-logo {
        width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
    }

    .nonprofit-card .btn-donate {
        margin-bottom: 30px;
    }

    .btn-to-top {
        display: block;
        margin: 50px auto 0;
        padding: 8px 0;
        font-size: 0.85rem;
        font-family: inherit;
        font-weight: 500;
        background: none;
        color: #fff;
        border: none;
        opacity: 0.85;
        cursor: pointer;
    }

    .nonprofits-headline {
        font-size: 1.3rem;
    }

    .nonprofits-subtext {
        margin-bottom: 42px;
    }

    .right-panel-title {
        font-size: 1.3rem;
        padding-top: 16px;
    }

    .right-panel-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .issue-card-image {
        width: 90px;
        height: 90px;
    }

    .issue-card-title {
        padding: 12px 14px;
        font-size: 1.05rem;
    }

    .issues-grid {
        gap: 12px;
    }

    .search-section input {
        padding: 10px 12px;
        font-size: 1rem;
    }

    .btn-search {
        padding: 10px 16px;
    }

    .toggle-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .top-supporters-widget {
        padding: 12px;
        margin-bottom: 20px;
    }

    .top-supporters-widget.placeholder {
        padding: 16px;
    }

    .learn-more-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 20px;
        z-index: 1000;
    }

    .learn-more-modal-inner {
        max-width: 100%;
        height: 100%;
        border-radius: 8px;
    }

    /* Support overlay becomes full-screen popup on mobile */
    .support-overlay {
        position: fixed;
        padding: 0;
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .support-overlay-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .support-overlay-header {
        padding: 14px 16px 0;
    }

    .support-overlay-title {
        font-size: 1.1rem;
    }

    .support-overlay-tagline {
        font-size: 0.75rem;
        white-space: normal;
        margin-bottom: 10px;
    }

    .support-overlay-split {
        flex-direction: column;
        gap: 12px;
        padding: 8px 16px 32px;
    }

    .support-overlay-left {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .support-overlay-logo {
        width: 60px;
        min-width: 60px;
        margin-bottom: 0;
        border-radius: 8px;
    }

    .support-overlay-name {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .support-overlay-desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .support-overlay-right {
        padding: 14px;
        border-radius: 12px;
    }

    .donate-widget-title {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .donate-widget-subtitle {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .donate-amounts-list {
        gap: 8px;
        margin-bottom: 8px;
    }

    .donate-amount-row {
        gap: 6px;
    }

    .donate-amount-btn,
    .donate-custom-input {
        width: 75px;
        min-width: 75px;
        max-width: 75px;
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .donate-amount-note {
        font-size: 0.72rem;
    }

    .donate-rank {
        font-size: 0.7rem;
        width: 14px;
    }

    .support-overlay-donate-btn {
        padding: 10px;
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .donate-widget-desc {
        font-size: 0.7rem;
    }

    .patron-callout {
        width: 200px;
        font-size: 0.75rem;
        padding: 10px 12px 20px;
    }

    .vc-info-panel {
        padding: 12px 0 0;
    }

    .vc-info-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .vc-info-text {
        font-size: 0.85rem;
    }
}
