/* === The 80% Bill - Design Tokens === */
/* Version: 2026-04-07-00:11 - Search input height fix */
:root {
    --blue-primary: #1E3A5F;
    --blue-hover: #2c5282;
    --red-accent: #C41E3A;
    --red-hover: #a01830;
    --white: #FFFFFF;
    --gray-light: #F7F8FA;
    --gray-text: #4A5568;
    --gray-border: #E2E8F0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background-color: var(--white);
    color: var(--gray-text);
}

/* === App Bar (mobile only) === */
.app-bar {
    display: none;
}

/* === Sidebar === */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, var(--blue-primary) 0%, #152a47 100%);
    padding: 1.5rem 1rem;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar-content {
    position: sticky;
    top: 1rem;
}

.sidebar-logo {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
}

.sidebar-heading {
    color: var(--white) !important;
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
}

.sidebar-trust-signal {
    margin: 0.6rem 0 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    text-align: center;
}

.sidebar-trust-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.sidebar-trust-link:hover {
    color: var(--white);
}

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-btn:last-of-type {
    margin-bottom: 0;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.sidebar-btn-active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    border-left-color: var(--white);
    font-weight: 700;
}

.sidebar-btn-active:hover {
    background: rgba(255, 255, 255, 0.3);
    border-left-color: var(--white);
}

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

.sidebar-btn-disabled .coming-soon {
    font-size: 0.8rem;
    opacity: 0.9;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 1rem 0;
}

/* === Donate Button === */
.btn-donate {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
    transition: all 0.2s;
}

.btn-donate:hover {
    background: linear-gradient(135deg, #d4243f 0%, #c41e3a 100%);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.55);
    transform: translateY(-1px);
}

/* === Main Content === */
.main-content {
    flex: 1;
    padding: 2rem 3rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content-inner {
    width: 100%;
    max-width: 720px;
}

.main-content.pledge-page {
    padding-top: 0.5rem;
}

.main-content.bill-page h1 {
    border-bottom-color: var(--red-accent);
}

/* === Typography === */
h1, h2, h3, h4 {
    color: var(--blue-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 3px solid var(--blue-primary);
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p, li, label {
    color: var(--gray-text);
    font-weight: 500;
}

strong, b {
    font-size: 1.1em;
    font-weight: 700;
}

/* === Buttons === */
.btn {
    display: inline-block;
    background-color: var(--blue-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--blue-hover);
    color: var(--white);
    box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.2);
}

.btn-secondary {
    background-color: var(--gray-light);
    color: var(--blue-primary);
    border: 2px solid var(--gray-border);
}

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

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    background-color: var(--white);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

/* === Article Boxes (Bill) === */
.article-box {
    background: var(--white);
    border: 2px solid var(--gray-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--blue-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.article-box:hover {
    border-left-color: var(--red-accent);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
}

.article-title {
    color: var(--blue-primary);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.article-desc {
    color: var(--gray-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.note-text {
    color: var(--gray-text);
    background-color: var(--gray-light);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-style: italic;
    border-radius: 8px;
    margin-top: 0.75rem;
}

.bill-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--blue-primary);
    color: var(--white) !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.bill-link:hover {
    background-color: var(--red-accent);
    color: var(--white) !important;
}

/* === Alerts === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #DC2626;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #059669;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--blue-primary);
}

/* === Hero / Home === */
.hero-subtitle {
    color: var(--gray-text);
    font-size: 1.1rem;
    margin-top: -0.25rem;
    padding-top: 0.25rem;
}

.hero-subtitle .text-accent {
    color: var(--blue-primary);
    font-weight: 700;
}

.cta-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.cta-card {
    padding: 1.5rem;
    border: 2px solid var(--gray-border);
    border-radius: 12px;
    background: var(--white);
}

.cta-card h3 {
    margin-top: 0;
}

/* === Pledge Steps === */
.form-hint {
    font-size: 0.875rem;
    color: var(--gray-text);
    margin: -0.5rem 0 1rem 0;
}

.pledge-form {
    width: 100%;
    max-width: 640px;
    padding: 1.5rem 2rem;
    border: 2px solid var(--gray-border);
    border-left: 5px solid var(--blue-primary);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Action buttons (Add Your Name / Read the Bill) */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid var(--blue-primary);
    background: var(--blue-primary);
    color: var(--white);
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
    color: var(--white);
}

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

.action-btn.outline:hover {
    background: var(--gray-light);
    border-color: var(--blue-hover);
    color: var(--blue-hover);
    box-shadow: 0 0 0 1px rgba(196, 30, 58, 0.2);
}

/* Address search dropdown */
.address-search-wrap {
    position: relative;
}

.address-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--white);
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    list-style: none;
    padding: 0;
    margin: 0;
}

.address-dropdown li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--gray-text);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--gray-border);
}

.address-dropdown li:last-child {
    border-bottom: none;
}

.address-dropdown li:hover {
    background: var(--gray-light);
    color: var(--blue-primary);
}

.step-nav {
    margin-top: 1rem;
}

/* === Social Share Buttons === */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.share-btn-x {
    background: #000;
    color: #fff;
    border-color: #000;
}

.share-btn-x:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.share-btn-facebook {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}

.share-btn-facebook:hover {
    background: #0d65d9;
    border-color: #0d65d9;
    color: #fff;
}

.share-btn-copy {
    background: var(--gray-light);
    color: var(--blue-primary);
    border-color: var(--gray-border);
}

.share-btn-copy:hover {
    background: var(--gray-border);
    border-color: var(--blue-primary);
    color: var(--blue-hover);
}

.copy-confirm-msg {
    color: #065F46;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* === Mobile === */
@media (max-width: 768px) {
    .app-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 44px;
        padding: 0 1rem 0 0.8rem;
        background: var(--blue-primary);
        color: var(--white);
        z-index: 1001;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-donate.app-bar-donate {
        display: inline-block;
        width: auto;
        padding: 0.28rem 0.75rem;
        font-size: 0.72rem;
        letter-spacing: 0.05em;
        border-radius: 6px;
    }

    .app-bar-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        background: transparent;
        border: none;
        color: var(--white);
        font-size: 1.5rem;
        cursor: pointer;
        border-radius: 6px;
    }

    .app-bar-menu-btn:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .app-bar-title {
        font-size: 0.95rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        color: var(--white);
        flex: 1;
        text-align: center;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        min-width: unset;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-logo {
        max-width: 180px;
    }

    .main-content {
        padding: 1rem 1.5rem 2rem;
        padding-top: calc(44px + 1rem);
        max-width: 100%;
    }

    .main-content.pledge-page {
        padding-top: calc(33px + 0.25rem);
    }

    .main-content-inner {
        max-width: 100%;
    }

    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.25rem; }

    input[type="text"],
    input[type="email"],
    textarea {
        max-width: 100%;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .rep-search-input {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        height: auto !important;
    }
}

/* === District Map === */
.main-content.data-page {
    padding: 1.5rem 2rem;
}

.main-content.data-page .main-content-inner {
    max-width: 100%;
}

#map-container {
    position: relative;
    width: 100%;
    border: 2px solid var(--gray-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#map {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    background: var(--gray-light);
}

#map path:focus {
    outline: none;
}

#map .leaflet-interactive:focus {
    outline: none;
}

#map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    color: var(--gray-text);
    font-weight: 600;
    z-index: 1000;
}

.map-legend {
    background: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.78rem;
    color: var(--gray-text);
    line-height: 1.5;
    max-width: 200px;
}

.map-legend strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--blue-primary);
    font-size: 0.9rem;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-swatch {
    display: inline-block;
    width: 18px;
    height: 14px;
    border: 1px solid #ccc;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-unmapped {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-border);
    font-style: italic;
    font-size: 0.8rem;
    color: var(--gray-text);
}

.map-total {
    background: var(--white);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-primary);
}

.map-total strong {
    font-size: 1.4rem;
    color: var(--blue-primary);
}

.district-tooltip {
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.district-tooltip .tooltip-code {
    color: #718096;
    font-size: 0.8rem;
}

/* === Reps Directory & Profile === */
.main-content.reps-page .main-content-inner {
    max-width: 960px;
}

/* Filters bar */
.rep-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.rep-search-input {
    flex: 1 1 200px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    background-color: var(--white);
    line-height: 1.4;
}

.rep-search-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.rep-filters select {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    background-color: var(--white);
    color: var(--gray-text);
    cursor: pointer;
}

.rep-filters select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

/* Score slider */
.score-slider-wrap {
    margin: 1.5rem 0;
    text-align: center;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 8px;
    background: var(--gray-border);
    margin-bottom: 1rem;
    cursor: pointer;
    touch-action: none;
    overflow: visible;
    padding: 14px 0;
    margin-top: -14px;
    background-clip: content-box;
}

.slider-fill {
    position: absolute;
    top: 14px;
    left: 0;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(to right, var(--gray-border), var(--blue-primary));
    pointer-events: none;
    transition: width 0.05s linear;
}

.slider-notch {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 14px;
    margin-top: -7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 1;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    margin-left: -16px;
    border-radius: 50%;
    background: var(--red-accent);
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: grab;
    z-index: 2;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    touch-action: none;
}

.slider-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.slider-thumb.dragging {
    cursor: grabbing;
    transform: scale(1.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.1s ease, transform 0.1s ease;
}

.score-slider-tiers {
    display: flex;
    justify-content: space-between;
}

.score-tier {
    font-size: 0.8rem;
    color: var(--gray-text);
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    flex: 1;
    text-align: center;
    user-select: none;
}

.score-tier.active {
    opacity: 1;
    color: var(--blue-primary);
    font-weight: 700;
    transform: scale(1.08);
}

.score-tier small {
    font-size: 0.7rem;
    color: var(--gray-text);
}

/* Card transitions for slider filtering */
.rep-card.hiding {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.rep-card.hidden-by-slider {
    display: none;
}

.rep-count {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Card grid */
.rep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.rep-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 2px solid var(--gray-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s, opacity 0.25s ease, transform 0.25s ease;
}

.rep-card:hover {
    border-color: var(--blue-primary);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.rep-card-photo-wrap {
    position: relative;
    overflow: hidden;
}

.rep-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 58, 95, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.rep-card-overlay p {
    color: #fff;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.3;
    text-align: center;
    margin: 0;
}

.rep-card:hover .rep-card-overlay {
    opacity: 1;
}

@media (hover: none) {
    .rep-card-overlay {
        display: none;
    }
}

.rep-card-photo {
    width: 100%;
    aspect-ratio: 225 / 275;
    object-fit: cover;
    background: var(--gray-light);
}

.rep-card-score {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.rep-card:hover .rep-card-score {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rep-card-score .score-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.rep-card-score .score-total {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-text);
    line-height: 1;
}

/* Color-code scores by tier */
.rep-card-score[data-score="0"],
.rep-card-score[data-score="1"],
.rep-card-score[data-score="2"],
.rep-card-score[data-score="3"] {
    /* Dumpster Fire: 0-3 = red */
}

.rep-card-score[data-score="0"] .score-number,
.rep-card-score[data-score="1"] .score-number,
.rep-card-score[data-score="2"] .score-number,
.rep-card-score[data-score="3"] .score-number {
    color: #dc2626;
}

.rep-card-score[data-score="4"],
.rep-card-score[data-score="5"],
.rep-card-score[data-score="6"],
.rep-card-score[data-score="7"] {
    /* Warm Body: 4-7 = orange */
}

.rep-card-score[data-score="4"] .score-number,
.rep-card-score[data-score="5"] .score-number,
.rep-card-score[data-score="6"] .score-number,
.rep-card-score[data-score="7"] .score-number {
    color: #ea580c;
}

.rep-card-score[data-score="8"],
.rep-card-score[data-score="9"],
.rep-card-score[data-score="10"],
.rep-card-score[data-score="11"] {
    /* Shows Promise: 8-11 = yellow */
}

.rep-card-score[data-score="8"] .score-number,
.rep-card-score[data-score="9"] .score-number,
.rep-card-score[data-score="10"] .score-number,
.rep-card-score[data-score="11"] .score-number {
    color: #ca8a04;
}

.rep-card-score[data-score="12"],
.rep-card-score[data-score="13"],
.rep-card-score[data-score="14"],
.rep-card-score[data-score="15"] {
    /* Would Subscribe: 12-15 = light green */
}

.rep-card-score[data-score="12"] .score-number,
.rep-card-score[data-score="13"] .score-number,
.rep-card-score[data-score="14"] .score-number,
.rep-card-score[data-score="15"] .score-number {
    color: #16a34a;
}

.rep-card-score[data-score="16"],
.rep-card-score[data-score="17"],
.rep-card-score[data-score="18"],
.rep-card-score[data-score="19"],
.rep-card-score[data-score="20"],
.rep-card-score[data-score="21"] {
    /* National Treasure: 16-21 = dark green */
}

.rep-card-score[data-score="16"] .score-number,
.rep-card-score[data-score="17"] .score-number,
.rep-card-score[data-score="18"] .score-number,
.rep-card-score[data-score="19"] .score-number,
.rep-card-score[data-score="20"] .score-number,
.rep-card-score[data-score="21"] .score-number {
    color: #15803d;
}

.rep-card-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rep-card-name {
    font-weight: 700;
    color: var(--blue-primary);
    font-size: 0.9rem;
}

.rep-card-district {
    font-size: 0.8rem;
    color: var(--gray-text);
}

/* Party badges */
.party-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
}

.party-badge.party-D {
    background: #DBEAFE;
    color: #1E40AF;
}

.party-badge.party-R {
    background: #FEE2E2;
    color: #991B1B;
}

.party-badge.party-I {
    background: #E5E7EB;
    color: #4B5563;
}

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

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

.rep-header-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    border: 2px solid var(--gray-border);
    border-radius: 12px;
    margin-bottom: 2rem;
    background: var(--white);
}

.rep-header-photo {
    width: 140px;
    border-radius: 8px;
    flex-shrink: 0;
}

.rep-header-info {
    flex: 1;
}

.rep-header-name {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    padding: 0;
    border: none;
}

.rep-header-district,
.rep-header-term {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--gray-text);
}

.rep-section {
    margin-bottom: 2rem;
}

.rep-section h2 {
    border-bottom: 2px solid var(--gray-border);
    padding-bottom: 0.5rem;
}

.narrative-sources {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-border);
    font-size: 0.85rem;
    color: var(--gray-text);
    padding-left: 1.25rem;
}
.narrative-sources li {
    margin-bottom: 0.25rem;
}
.narrative-sources a {
    color: var(--blue-primary);
}
.footnote-ref {
    color: var(--blue-primary);
    text-decoration: none;
    font-size: 0.75rem;
}

.rep-meta {
    font-size: 0.85rem;
    color: var(--gray-text);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Alignment score ring */
.alignment-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.alignment-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.alignment-bg {
    fill: none;
    stroke: var(--gray-border);
    stroke-width: 8;
}

.alignment-fill {
    fill: none;
    stroke: var(--blue-primary);
    stroke-width: 8;
    stroke-linecap: round;
}

.alignment-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue-primary);
}

/* Bill position cards */
.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.position-card {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-border);
    border-left: 4px solid var(--gray-border);
    border-radius: 8px;
    background: var(--white);
}

.position-card.position-sponsor,
.position-card.position-cosponsor,
.position-card.position-voted_yes {
    border-left-color: #059669;
}

.position-card.position-voted_no {
    border-left-color: var(--red-accent);
}

.position-card.position-no_position {
    border-left-color: var(--gray-border);
}

.position-article {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-text);
    text-transform: uppercase;
}

.position-title {
    display: block;
    font-weight: 600;
    color: var(--blue-primary);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.position-stance {
    font-size: 0.8rem;
    color: var(--gray-text);
}

/* Contact grid */
.rep-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.rep-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-text);
    transition: border-color 0.2s;
}

a.rep-contact-item:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.rep-contact-icon {
    font-size: 1.25rem;
}

/* Social media links */
.rep-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


@media (min-width: 769px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .rep-filters {
        flex-direction: column;
    }

    .rep-search-input {
        flex: 1 1 auto !important;
        width: 100% !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        height: auto !important;
        min-height: auto !important;
    }

    .rep-filters select {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .score-slider-tiers {
        flex-wrap: nowrap;
        gap: 0.15rem;
    }

    .score-tier {
        font-size: 0.6rem;
        flex: 0 0 auto;
        padding: 0.2rem 0.25rem;
        max-width: 60px;
        line-height: 1.2;
        text-align: center;
    }

    .score-tier br {
        display: inline;
    }

    .score-tier small {
        font-size: 0.55rem;
        display: block;
        margin-top: 0.1rem;
    }

    .slider-thumb {
        width: 36px;
        height: 36px;
        margin-top: -18px;
        margin-left: -18px;
    }

    .rep-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .rep-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rep-header-photo {
        width: 120px;
    }

    .rep-header-name {
        font-size: 1.5rem;
    }

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

    .rep-contact-grid {
        grid-template-columns: 1fr;
    }

    .main-content.data-page {
        padding: calc(44px + 0.25rem) 0.1rem 0.5rem 0.1rem !important;
    }

    .main-content.data-page .main-content-inner {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .main-content.data-page .main-content-inner > h1,
    .main-content.data-page .main-content-inner > p {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .main-content.data-page #map-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .map-total {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .map-total strong {
        font-size: 0.95rem;
    }

    .map-legend {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
        max-width: 105px;
    }

    .map-legend strong {
        font-size: 0.75rem;
    }

    .legend-swatch {
        width: 14px;
        height: 10px;
    }

    #map {
        height: 60vh;
        min-height: 300px;
    }
}
