/* V4 — cognitive-load, overflow and horizontal-timeline pass */
:root{--timeline-progress:0}

/* Content drives height. Nothing important is clipped. */
.result-card,.position-card,.plan-card,.career-stop,.election-card,.party-stop,.footprint-card{height:auto!important;max-height:none!important;overflow:visible!important;min-width:0}
.result-card,.position-card,.plan-card{min-height:0!important}
.career-stop{min-height:420px!important;padding-bottom:28px!important}
.profile-source.compact{position:static!important;inset:auto!important;margin-top:28px}
.profile-source{min-width:0;align-items:flex-start}
.profile-source span{min-width:0;overflow-wrap:anywhere;word-break:normal}
.profile-source small{flex:0 0 auto;white-space:normal;text-align:right;max-width:118px}
.result-card h3,.position-card h3,.plan-card h3,.career-stop h3,.election-card h3,.party-stop h3,.bill-title,.impact-cell p{overflow-wrap:anywhere;word-break:normal;hyphens:auto}
.result-card>p,.position-card>p,.career-stop>p,.plan-card p,.election-card p,.party-stop p{max-width:100%!important}
.results-grid,.positions-grid,.plan-grid{align-items:start}
.positions-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.position-card{min-height:0!important}
.impact-grid{align-items:stretch}
.impact-cell{min-height:100%;overflow:visible!important}
.bill-row{height:auto!important;max-height:none!important;overflow:visible!important}

/* Legislative outcome score */
.legislative-score{margin:54px 0 34px;border-top:1px solid var(--ink);border-bottom:1px solid var(--ink)}
.legislative-score-head{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;padding:18px 0 16px}
.legislative-score-head h3{font:600 clamp(1.6rem,3vw,3.4rem)/.98 Unbounded,sans-serif;letter-spacing:-.055em;margin:0}
.legislative-score-head small{max-width:420px;text-align:right;font:9px/1.45 "DM Mono",monospace;color:var(--muted);text-transform:uppercase}
.legislative-score-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--line)}
.legislative-score-card{background:var(--paper);padding:24px;min-height:190px;display:flex;flex-direction:column;min-width:0}
.legislative-score-card strong{font:600 clamp(3rem,6vw,6rem)/.82 Unbounded,sans-serif;letter-spacing:-.075em}
.legislative-score-card span{margin-top:auto;font-weight:750;font-size:14px;line-height:1.2}
.legislative-score-card small{margin-top:7px;font:9px/1.4 "DM Mono",monospace;color:var(--muted)}
.legislative-score-card.accent strong{color:var(--red)}
.legislative-score-detail{display:grid;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);gap:1px;background:var(--line)}
.legislative-score-copy,.legislative-statuses{background:var(--paper);padding:24px;min-width:0}
.legislative-score-copy h4,.legislative-statuses h4{margin:0 0 14px;font:600 18px/1.1 Unbounded,sans-serif;letter-spacing:-.03em}
.legislative-score-copy .score-subhead{margin-top:26px}
.approved-item{padding:12px 0;border-top:1px solid var(--line)}
.approved-item b{display:block;font:600 10px/1 "DM Mono",monospace;color:var(--red);margin-bottom:5px}
.approved-item>span{font-size:12px;line-height:1.4;display:block}
.approved-item .profile-source{margin-top:10px}
.status-row{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.status-row:last-child{border-bottom:0}
.status-row b{font-size:12px;font-weight:650}
.status-row>span{font:600 12px/1 "DM Mono",monospace}
.status-bar{grid-column:1/-1;height:4px;background:rgba(17,16,14,.08);overflow:hidden}
.status-bar i{display:block;height:100%;background:var(--ink);transform-origin:left}
.legislative-source-row{padding:15px 0 0}
.score-note{font-size:11px;line-height:1.5;color:var(--muted);margin:14px 0 0}
.result-scope-label{display:flex;justify-content:space-between;gap:24px;align-items:baseline;padding:14px 0;border-top:1px solid var(--ink);font-size:12px}
.result-scope-label b{font:600 9px/1 "DM Mono",monospace;text-transform:uppercase;color:var(--red)}
.result-scope-label span{color:var(--muted);text-align:right}

/* Plan: show enough to scan, expand for full topic list, source every card. */
.plan-card:not(.expanded) .topic:nth-child(n+9){display:none}
.plan-expand{margin-top:18px;border:1px solid rgba(242,239,231,.25);background:transparent;color:var(--acid);padding:8px 10px;font:600 9px/1 "DM Mono",monospace;text-transform:uppercase;cursor:pointer}
.plan-expand:hover,.plan-expand:focus{background:var(--acid);color:var(--ink);outline:0}
.plan-card-source{margin-top:22px;padding-top:10px;border-top:1px solid rgba(242,239,231,.12)}
.plan-card .profile-source{color:var(--warm);border-color:rgba(242,239,231,.16);font-size:10px}
.plan-card .profile-source small{color:#8f8980}

/* Timeline: vertical scroll drives a horizontal, newest-first archive. */
.timeline-section{display:block!important;padding-top:120px!important;padding-bottom:0!important;overflow:visible!important;background:linear-gradient(180deg,var(--bg),#e9e4d8 42%,var(--bg))!important}
.timeline-section .sticky-heading{position:relative!important;top:auto!important;max-width:980px;margin-bottom:38px!important}
.timeline-v4-shell{position:relative;margin:0 -5vw;height:320vh;min-height:1500px}
.timeline-v4-stage{position:sticky;top:61px;height:calc(100vh - 61px);overflow:hidden;background:linear-gradient(180deg,rgba(242,239,231,.985),rgba(236,231,219,.98));border-top:1px solid var(--ink);border-bottom:1px solid var(--ink)}
.timeline-v4-stage:after{content:"";position:absolute;z-index:5;left:0;right:0;bottom:0;height:3px;background:rgba(17,16,14,.1)}
.timeline-v4-stage:before{content:"";position:absolute;z-index:6;left:0;bottom:0;height:3px;width:100%;background:linear-gradient(90deg,var(--red),var(--blue));transform:scaleX(var(--timeline-progress));transform-origin:left;pointer-events:none}
.timeline-controls{position:relative!important;top:auto!important;margin:0!important;padding:16px 5vw 15px!important;display:flex!important;gap:7px;overflow-x:auto;flex-wrap:nowrap!important;background:rgba(242,239,231,.94)!important;border-bottom:1px solid var(--line);backdrop-filter:blur(14px);scrollbar-width:none}
.timeline-controls::-webkit-scrollbar{display:none}
.timeline-controls .filter-btn{white-space:nowrap;flex:0 0 auto}
.timeline{display:flex!important;grid-column:auto!important;gap:18px!important;align-items:stretch;max-width:none!important;margin:0!important;padding:28px 5vw 42px!important;height:calc(100% - 66px);overflow:visible!important;will-change:transform;transform:translate3d(0,0,0)}
.timeline:before{display:none!important}
.timeline .event{display:block!important;flex:0 0 clamp(330px,36vw,520px);padding:0!important;opacity:.25;transform:scale(.94) translateY(18px);transition:opacity .45s ease,transform .6s cubic-bezier(.16,1,.3,1);min-width:0}
.timeline .event.is-current{opacity:1;transform:none}
.timeline .event.is-past,.timeline .event.is-future{opacity:.48}
.timeline .event-dot,.timeline .event-year{display:none!important}
.timeline .event-card{height:100%;min-height:0!important;display:flex!important;flex-direction:column!important;grid-template-columns:none!important;gap:0!important;padding:clamp(22px,2.6vw,34px)!important;border:1px solid rgba(17,16,14,.22)!important;background:rgba(250,248,242,.9)!important;overflow:hidden!important;box-shadow:none!important;position:relative}
.timeline .event-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--red)}
.timeline .event[data-tone="decision"] .event-card:before{background:var(--blue)}
.timeline .event[data-tone="context"] .event-card:before{background:var(--lime)}
.timeline .event-kicker{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:20px}
.timeline .event-index{font:600 clamp(2rem,4vw,4rem)/.82 Unbounded,sans-serif;letter-spacing:-.08em;color:rgba(17,16,14,.10)}
.timeline .event-date{font:600 10px/1 "DM Mono",monospace;text-transform:uppercase;color:var(--muted);text-align:right}
.timeline .event-meta{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 16px!important}
.timeline .event h3{font:600 clamp(1.55rem,2.4vw,2.6rem)/1.02 Unbounded,sans-serif!important;letter-spacing:-.05em!important;margin:0 0 16px!important;max-width:none!important;overflow-wrap:anywhere}
.timeline .event p{font-size:14px!important;line-height:1.58!important;max-width:none!important;margin:0!important;color:#514d46}
.timeline .event-footer{margin-top:auto;padding-top:24px;border-top:1px solid var(--line)}
.timeline .event-evidence{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-start!important}
.timeline .event-source-count{display:block;margin-top:10px!important;font:500 9px/1.3 "DM Mono",monospace!important;text-transform:uppercase;color:var(--muted)}
.timeline .event-open{display:inline-block;margin-top:15px;font:600 10px/1 "DM Mono",monospace;text-transform:uppercase;border-bottom:1px solid currentColor;padding-bottom:3px}
.timeline-era{position:absolute;z-index:0;right:4vw;bottom:26px;font:700 clamp(4rem,11vw,11rem)/.8 Unbounded,sans-serif;letter-spacing:-.08em;color:transparent;-webkit-text-stroke:1px rgba(17,16,14,.08);pointer-events:none}
.timeline-hint{position:absolute;z-index:8;right:5vw;top:19px;font:500 9px/1 "DM Mono",monospace;text-transform:uppercase;color:var(--muted);letter-spacing:.07em}

/* Graph: grouped index reduces cognitive load. */
.graph-shell{overflow:hidden!important}
.edge-label{opacity:.42;transition:opacity .2s}
.node circle{transition:transform .25s,filter .25s}
.node:hover circle,.node:focus circle{transform:scale(1.08);filter:drop-shadow(0 0 16px rgba(242,239,231,.28))}
.graph-index.graph-index-grouped{display:block!important;background:transparent!important;border:0!important;margin-top:24px}
.graph-index-group{margin:0 0 18px;border:1px solid rgba(242,239,231,.14);background:#11100e}
.graph-index-head{display:flex;justify-content:space-between;gap:14px;padding:11px 14px;border-bottom:1px solid rgba(242,239,231,.14);color:var(--bg)}
.graph-index-head b{font:600 10px/1 "DM Mono",monospace;text-transform:uppercase;letter-spacing:.07em}
.graph-index-head span{font:500 9px/1 "DM Mono",monospace;color:#827d75}
.graph-index-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:rgba(242,239,231,.12)}
.graph-index-items button{min-height:76px;height:auto!important;min-width:0;text-align:left;border:0;background:#151410;color:var(--bg);padding:14px;cursor:pointer;transition:background .2s}
.graph-index-items button:hover,.graph-index-items button:focus{background:#24211b;outline:1px solid var(--lime);outline-offset:-1px}
.graph-index-items b,.graph-index-items small{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
.graph-index-items b{display:block;font-size:12px}
.graph-index-items small{display:block;margin-top:5px;font:8px/1.35 "DM Mono",monospace;text-transform:uppercase;color:#8f8980}

@media(max-width:1100px){
  .positions-grid{grid-template-columns:1fr!important}
  .legislative-score-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .legislative-score-detail{grid-template-columns:1fr}
  .graph-index-items{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .timeline-v4-shell{height:auto!important;min-height:0!important;margin:0 -18px}
  .timeline-v4-stage{position:relative;top:auto;height:auto;overflow:visible}
  .timeline-hint{display:none}
  .timeline{height:auto!important;overflow-x:auto!important;transform:none!important;scroll-snap-type:x mandatory;padding:22px 18px 34px!important;scrollbar-width:none}
  .timeline::-webkit-scrollbar{display:none}
  .timeline .event{flex-basis:min(86vw,410px);opacity:1;transform:none;scroll-snap-align:center}
  .timeline .event-card{min-height:520px!important}
  .legislative-score-head{display:block}.legislative-score-head small{display:block;text-align:left;margin-top:12px}
  .legislative-score-grid{grid-template-columns:1fr 1fr}
  .graph-index-items{grid-template-columns:repeat(2,minmax(0,1fr))}
  .result-scope-label{display:block}.result-scope-label span{display:block;text-align:left;margin-top:8px}
}
@media(max-width:520px){
  .legislative-score-grid{grid-template-columns:1fr}
  .legislative-score-card{min-height:145px}
  .timeline .event{flex-basis:88vw}
  .timeline .event-card{min-height:500px!important;padding:22px!important}
  .graph-index-items{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .timeline-v4-shell{height:auto!important;min-height:0!important}
  .timeline-v4-stage{position:relative;top:auto;height:auto;overflow:visible}
  .timeline{height:auto!important;overflow-x:auto!important;transform:none!important}
  .timeline .event{opacity:1!important;transform:none!important;transition:none!important}
  .timeline-v4-stage:before{display:none}
}
