.video-player {
    margin-bottom: 2rem;
}

.video-player iframe,
.video-player video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: var(--pico-border-radius);
}

.article-body {
    line-height: 1.8;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--pico-border-radius);
}

/* Rating badges */
.rating-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    border-radius: 0.25em;
    font-size: 0.75em;
    font-weight: bold;
    vertical-align: middle;
    margin-left: 0.5em;
    color: #fff;
}

.rating-high { background-color: #2e7d32; }
.rating-mid  { background-color: #f57f17; }
.rating-low  { background-color: #c62828; }

/* Rating bar on claim detail */
.rating-display {
    margin: 1rem 0;
}

.rating-bar {
    width: 100%;
    height: 1rem;
    background-color: #e0e0e0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    border-radius: 0.5rem;
    transition: width 0.3s ease;
}

.rating-fill.rating-high { background-color: #2e7d32; }
.rating-fill.rating-mid  { background-color: #f57f17; }
.rating-fill.rating-low  { background-color: #c62828; }

/* ---- Homepage: hero, loop viz, entry cards, stats strip ---- */
.home-hero {
    margin-bottom: 2.5rem;
}

.home-mission {
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 46rem;
}

.loop-viz {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1.75rem 0;
}

.loop-chip {
    display: inline-block;
    padding: 0.5em 1em;
    border-radius: 0.5em;
    background: var(--pico-primary, #1095c1);
    color: var(--pico-primary-inverse, #fff);
    font-weight: bold;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Money-page explainer: collapsible model of org -> committee -> candidates. */
.money-explainer {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--pico-muted-border-color, #ddd);
    border-radius: var(--pico-border-radius, 0.5rem);
}

.money-explainer summary {
    font-weight: 600;
    cursor: pointer;
}

.money-flow {
    margin: 1rem 0;
}

.money-flow .loop-chip {
    font-size: 0.9rem;
}

.money-explainer-terms dt {
    font-weight: 700;
    margin-top: 0.6rem;
}

.money-explainer-terms dd {
    margin-left: 0;
    color: var(--pico-muted-color, #555);
}

/* The chips are links — the loop IS the navigation. */
a.loop-chip:hover,
a.loop-chip:focus {
    color: var(--pico-primary-inverse, #fff);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.loop-chip-claim {
    background: #6a1b9a;
}

.loop-arrow {
    font-size: 1.4rem;
    color: var(--pico-muted-color, #777);
}

.loop-verdict {
    flex-basis: 100%;
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--pico-muted-color, #555);
}

.entry-paths .entry-card {
    padding: 1.25rem;
    border: 1px solid var(--pico-muted-border-color, #ddd);
    border-radius: var(--pico-border-radius, 0.5rem);
}

.entry-card h3 {
    margin-bottom: 0.4rem;
}

.entry-card p {
    margin-bottom: 0;
    color: var(--pico-muted-color, #555);
}

.visually-hidden-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.stats-strip {
    margin: 2.5rem 0;
    padding: 1.5rem;
    border-radius: var(--pico-border-radius, 0.5rem);
    background: var(--pico-card-background-color, #f6f8fa);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 1rem;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--pico-muted-color, #666);
}

.stats-source {
    margin: 1rem 0 0;
    color: var(--pico-muted-color, #666);
}

.latest-list {
    list-style: none;
    padding-left: 0;
}

.latest-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color, #eee);
}

/* ---- Header brand: civic EO seal + small-caps wordmark ---- */
.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.brand-seal {
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
    color: var(--pico-primary, #1095c1);
    transition: transform 0.18s ease;
}

.brand-word {
    font-variant: small-caps;
    letter-spacing: 0.09em;
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    color: var(--pico-h1-color, var(--pico-color, #1b2832));
    transition: color 0.18s ease;
}

.brand:hover .brand-word,
.brand:focus .brand-word {
    color: var(--pico-primary, #1095c1);
}

.brand:hover .brand-seal,
.brand:focus .brand-seal {
    transform: rotate(-8deg);
}

/* Speaker chip on claim detail ("Said by") */
.speaker-chip a {
    font-weight: bold;
}

/* Timestamps in video claims sidebar */
.timestamp {
    display: inline-block;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    padding: 0.1em 0.4em;
    border-radius: 0.25em;
    font-size: 0.8em;
    margin-right: 0.5em;
    font-family: monospace;
}

/* ---- Shared TIMELINE component (partials/timeline.html) ---- */
.tl-section {
    margin: 1.5rem 0 2rem;
}

.tl-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* No horizontal scrolling: milestone labels are kept inside the strip by the
   .tl-inset box, and intensity bars compress to fit the available width. */
.tl-scroll {
    overflow: visible;
}

/* Inset box for milestone events: half a label width (labels are 8rem) on
   each side, so a label centred on the 0% or 100% dot ends flush with the
   strip edge instead of overflowing it. */
.tl-inset {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4rem;
    right: 4rem;
}

/* -- Milestones: dots on a horizontal axis, staggered labels -- */
.tl-milestones .tl-track {
    position: relative;
    height: 8.5rem;
    min-width: 100%;
    margin: 0.25rem 0;
}

.tl-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--pico-muted-border-color, #ccc);
}

.tl-event {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tl-dot {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid var(--pico-background-color, #fff);
    background: var(--pico-muted-color, #777);
    position: relative;
    z-index: 2;
    cursor: pointer;
}

/* A merged cluster of near-coincident events: slightly larger dot with a
   halo ring; the "(+N more)" label + hover detail carry the member list. */
.tl-dot.tl-cluster {
    width: 1.1rem;
    height: 1.1rem;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pico-primary, #1976d2) 25%, transparent);
}

/* kind-based colours (kind doubles as the class suffix) */
.tl-action    { background: #1565c0; }
.tl-vote      { background: #f57f17; }
.tl-enacted   { background: #2e7d32; }
.tl-contribution { background: #6a1b9a; }

.tl-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8rem;
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.15;
    color: var(--pico-muted-color, #555);
}

.tl-above .tl-label { bottom: 1.1rem; }
.tl-below .tl-label { top: 1.1rem; }

/* -- Intensity: a compact monthly bar strip -- */
.tl-intensity .tl-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 3.5rem;
    min-width: 100%;
}

.tl-bar-col {
    flex: 1 1 0;
    min-width: 1px;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.tl-bar {
    width: 100%;
    min-height: 1px;
    background: #6a1b9a;
    border-radius: 2px 2px 0 0;
}

.tl-ticks {
    display: flex;
    gap: 2px;
    min-width: 100%;
    margin-top: 0.15rem;
}

.tl-tick {
    flex: 1 1 0;
    min-width: 1px;
    overflow: visible;
    font-size: 0.65rem;
    color: var(--pico-muted-color, #777);
    white-space: nowrap;
}

/* Narrow viewports: shrink milestone labels (and their edge inset with them)
   so clustered dots keep legible, non-overlapping labels without scrolling. */
@media (max-width: 768px) {
    .tl-label {
        width: 5.5rem;
        font-size: 0.65rem;
    }
    .tl-inset {
        left: 2.75rem;
        right: 2.75rem;
    }
}

/* -- Shared axis end labels -- */
.tl-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    color: var(--pico-muted-color, #777);
}

.tl-disclaimer {
    margin-top: 0.5rem;
    color: var(--pico-muted-color, #555);
}

.tl-strip-label {
    margin: 0.75rem 0 0.25rem;
}

/* -- Stepper: ordinal status pipeline (package-tracker) -- */
.tl-stepper {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0;
    margin: 0.5rem 0 0.75rem;
}

.tl-step {
    position: relative;
    flex: 1 1 0;
    min-width: 4.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* connector line between chips */
.tl-step::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--pico-muted-border-color, #ccc);
    z-index: 0;
}

.tl-step:first-child::before {
    display: none;
}

.tl-step-dot {
    position: relative;
    z-index: 1;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--pico-muted-border-color, #ccc);
    border: 2px solid var(--pico-background-color, #fff);
    box-shadow: 0 0 0 1px var(--pico-muted-border-color, #ccc);
}

.tl-step-label {
    font-size: 0.7rem;
    line-height: 1.15;
    margin-top: 0.3rem;
    color: var(--pico-muted-color, #666);
}

.tl-step-annotation {
    font-size: 0.62rem;
    font-style: italic;
}

/* states: done (green family), current (emphasized), future (muted), failed (red) */
.tl-step-done .tl-step-dot,
.tl-step-done::before {
    background: #2e7d32;
}
.tl-step-done .tl-step-dot { box-shadow: 0 0 0 1px #2e7d32; }

.tl-step-current .tl-step-dot {
    background: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.35);
    width: 1.15rem;
    height: 1.15rem;
}
.tl-step-current .tl-step-label {
    font-weight: bold;
    color: var(--pico-color, #222);
}

.tl-step-failed .tl-step-dot {
    background: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35);
}
.tl-step-failed .tl-step-label {
    font-weight: bold;
    color: #c62828;
}

/* mini variant for list rows: tiny dots, no labels */
.tl-stepper-mini {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 0 0 0.35rem;
    gap: 0;
}
.tl-stepper-mini .tl-step {
    flex: 0 0 auto;
    min-width: 0;
    width: 0.9rem;
}
.tl-stepper-mini .tl-step-dot {
    width: 0.6rem;
    height: 0.6rem;
}
.tl-stepper-mini .tl-step-current .tl-step-dot {
    width: 0.7rem;
    height: 0.7rem;
}
.tl-stepper-mini .tl-step::before {
    top: 0.3rem;
}

/* ---- Three-column measure detail (What the bill/analysts/politicians say) ---- */
.measure-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0 2rem;
    align-items: start;
}

.measure-col {
    min-width: 0;
    border-top: 3px solid var(--pico-primary, #1095c1);
    padding-top: 0.75rem;
}

.measure-col > h2 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.measure-col h3 {
    font-size: 0.95rem;
    margin: 1rem 0 0.35rem;
}

.measure-col-meta {
    color: var(--pico-muted-color, #666);
    margin-bottom: 0.75rem;
}

.measure-doc-list,
.measure-col-politicians .measure-claim {
    margin-bottom: 0.75rem;
}

.measure-doc-desc {
    margin: 0.25rem 0 0;
    color: var(--pico-muted-color, #666);
}

.measure-claim {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color, #eee);
}

.measure-claim-title {
    margin-bottom: 0.35rem;
}

.measure-col-politicians .speaker-chip {
    display: inline-block;
    margin: 0.15rem 0;
}

.measure-empty {
    color: var(--pico-muted-color, #666);
    font-style: italic;
}

/* Stack to a single column on narrow viewports. */
@media (max-width: 768px) {
    .measure-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Expandable CBO cost-estimate summary (full public-domain text from cbo.gov). */
.measure-doc-summary {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
}
.measure-doc-summary > summary {
    cursor: pointer;
    color: var(--pico-muted-color, #666);
    list-style-position: outside;
}
.measure-doc-summary[open] > summary {
    margin-bottom: 0.4rem;
    color: var(--pico-color, inherit);
}
.measure-doc-fulltext p {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.measure-doc-source {
    margin: 0.25rem 0 0;
    color: var(--pico-muted-color, #666);
}
