/* U.S. Senate Representation 1901–2025 — styles (extracted from index.html) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Source Serif 4',Georgia,serif;background:#faf9f6;color:#1a1a1a}
header{text-align:center;padding:36px 20px 18px;border-bottom:2px solid #1a1a1a}
header h1{font-family:'Playfair Display',Georgia,serif;font-size:2.2rem;font-weight:900;margin-bottom:4px}
.title-sub{display:block;font-family:'Source Serif 4',Georgia,serif;font-size:1rem;font-weight:400;letter-spacing:.18em;color:#595959;margin-top:4px;font-style:normal}
header p{font-size:.9rem;color:#595959;font-style:italic}
.container{max-width:1160px;margin:0 auto;padding:24px 24px 48px}

/* TIMELINE */
.timeline-card{background:#fff;border:2px solid #1a1a1a;border-radius:4px;padding:20px 28px 22px;margin-bottom:22px;box-shadow:4px 4px 0 #1a1a1a}
.timeline-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px;flex-wrap:wrap}
.year-display{font-family:'Playfair Display',Georgia,serif;font-size:2.8rem;font-weight:900;line-height:1;color:#1a1a1a;min-width:90px}
.congress-label{font-size:.78rem;color:#666;font-style:italic;margin-top:2px}
.play-btn{display:flex;align-items:center;gap:8px;padding:8px 18px;font-size:.8rem;font-family:'Source Serif 4',Georgia,serif;font-weight:600;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;border:2px solid #1a1a1a;border-radius:4px;background:#faf9f6;color:#1a1a1a;transition:background .15s,color .15s}
.play-btn:hover,.play-btn.playing{background:#1a1a1a;color:#fff}
.play-btn svg{width:14px;height:14px;flex-shrink:0}
.slider-wrap{position:relative;padding:0 2px}
.slider-track{position:relative;height:6px;background:#1a1a1a;border-radius:3px;border:1px solid #999;margin-bottom:10px;cursor:pointer}
.slider-fill{position:absolute;left:0;top:0;height:100%;background:#e0ddd6;border-radius:3px;pointer-events:none}
.slider-thumb{position:absolute;top:50%;width:18px;height:18px;background:#1a1a1a;border:3px solid #fff;border-radius:50%;transform:translate(-50%,-50%);cursor:grab;box-shadow:0 1px 4px rgba(0,0,0,.3)}
.slider-thumb:active{cursor:grabbing}

/* POI MARKERS — desktop only */
@media(hover:hover){
  /* outer wrapper: positions on track, not rotated */
  .poi-wrap{position:absolute;top:50%;transform:translate(-50%,-50%);width:24px;height:24px;z-index:10;cursor:pointer;overflow:visible}
  /* inner diamond: purely cosmetic rotation */
  .poi-diamond{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(45deg);width:9px;height:9px;background:#faf9f6;border:2px solid #1a1a1a;border-radius:1px;transition:background .15s,transform .15s;pointer-events:none}
  .poi-wrap:hover{z-index:200}
  .poi-wrap:focus,.poi-wrap:focus-within{z-index:200;outline:2px solid #1a1a1a;outline-offset:2px;border-radius:2px}
  .poi-wrap:hover .poi-diamond,.poi-wrap:focus .poi-diamond,.poi-wrap:focus-within .poi-diamond{background:#1a1a1a;transform:translate(-50%,-50%) rotate(45deg) scale(1.3)}
  /* tooltip: child of wrapper (not diamond), so no inherited rotation */
  .poi-tooltip{
    position:absolute;
    bottom:16px;
    left:50%;
    transform:translateX(-50%);
    background:#fff;
    border:2px solid #1a1a1a;
    border-radius:4px;
    padding:9px 13px;
    width:240px;
    pointer-events:none;
    opacity:0;
    transition:opacity .18s;
    z-index:300;
    box-shadow:3px 3px 0 rgba(0,0,0,.18);
    font-size:.75rem;
    white-space:normal;
  }
  .poi-tooltip::after{content:'';position:absolute;top:100%;left:var(--arrow-left,50%);transform:translateX(-50%);border:7px solid transparent;border-top-color:#1a1a1a;pointer-events:none}
  .poi-tooltip::before{content:'';position:absolute;top:calc(100% - 3px);left:var(--arrow-left,50%);transform:translateX(-50%);border:6px solid transparent;border-top-color:#fff;z-index:1;pointer-events:none}
  .poi-wrap:hover .poi-tooltip,.poi-wrap:focus .poi-tooltip,.poi-wrap:focus-within .poi-tooltip{opacity:1}
  .poi-year{font-family:'Playfair Display',Georgia,serif;font-size:.82rem;font-weight:700;margin-bottom:3px;color:#1a1a1a}
  .poi-desc{color:#444;line-height:1.45}
}
@media(hover:none){.poi-wrap{display:none}}

.year-ticks{display:flex;justify-content:space-between;margin-top:2px}
.tick{font-size:.6rem;color:#999;text-align:center;cursor:pointer;user-select:none;transition:color .12s;flex:1;line-height:1.4}
.tick:hover{color:#444}
.tick.active{color:#1a1a1a;font-weight:700}
.tick.decade{color:#767676;font-weight:600}
.tick.decade.active{color:#1a1a1a}

/* LEGEND */
.party-legend{display:flex;justify-content:center;gap:28px;margin-bottom:18px;flex-wrap:wrap}
.legend-item{display:flex;align-items:center;gap:7px;font-size:.8rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.legend-swatch{width:18px;height:18px;border-radius:3px;border:1.5px solid #1a1a1a;flex-shrink:0}

/* MAP */
.map-wrapper{background:#fff;border:2px solid #1a1a1a;border-radius:4px;padding:14px;margin-bottom:20px;box-shadow:4px 4px 0 #1a1a1a}
#map-svg{width:100%;height:auto;display:none}
.state-path{stroke:#fff;stroke-width:.5;cursor:pointer;transition:fill .3s ease,filter .12s}
.state-path:hover{filter:brightness(.8);stroke:#1a1a1a;stroke-width:1.1}
.state-border{fill:none;stroke:#1a1a1a;stroke-width:.5;pointer-events:none}

/* TOOLTIP */
#tooltip{position:fixed;background:#fff;border:2px solid #1a1a1a;border-radius:6px;padding:11px 15px;pointer-events:none;opacity:0;transition:opacity .15s;z-index:200;min-width:215px;box-shadow:3px 3px 0 #1a1a1a}
#tooltip.visible{opacity:1}
.tt-state{font-family:'Playfair Display',Georgia,serif;font-size:.95rem;font-weight:700;margin-bottom:4px}
.tt-row{font-size:.8rem;color:#333;margin-bottom:2px}
.tt-row span{font-weight:600;color:#1a1a1a}
.tt-party{font-size:.74rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;margin-top:4px;padding-top:4px;border-top:1px solid #ddd}

/* STATS */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:13px;margin-bottom:20px}
.stat-card{background:#fff;border:2px solid #1a1a1a;border-radius:4px;padding:14px 16px;box-shadow:3px 3px 0 #1a1a1a}
.stat-card .label{font-size:.64rem;color:#595959;text-transform:uppercase;letter-spacing:.08em;margin-bottom:5px;font-weight:600}
.stat-card .value-row{display:flex;align-items:flex-start;gap:5px;flex-wrap:wrap;margin-bottom:6px}
.stat-card .value{font-family:'Playfair Display',Georgia,serif;font-size:1.38rem;font-weight:700;line-height:1.1}
.stat-card .unit{font-size:.58rem;color:#595959;text-transform:uppercase;letter-spacing:.06em;font-weight:600;line-height:1.3;padding-left:3px}
.stat-card .sub{font-size:.71rem;color:#595959;font-style:italic}

/* LIST */
.list-card{background:#fff;border:2px solid #1a1a1a;border-radius:4px;padding:18px 20px;box-shadow:4px 4px 0 #1a1a1a;margin-bottom:22px}
.list-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;padding-bottom:8px;border-bottom:1.5px solid #1a1a1a;gap:10px;flex-wrap:wrap}
.list-title,h2.list-title{font-family:'Playfair Display',Georgia,serif;font-size:.95rem;font-weight:700;margin:0}
.toggle-wrap{display:flex;border:1.5px solid #1a1a1a;border-radius:4px;overflow:hidden}
.toggle-btn{padding:5px 13px;font-size:.72rem;font-family:'Source Serif 4',Georgia,serif;font-weight:600;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;border:none;background:#faf9f6;color:#666;transition:background .15s,color .15s}
.toggle-btn.active{background:#1a1a1a;color:#fff}
.toggle-btn:not(:last-child){border-right:1.5px solid #1a1a1a}
.state-list{display:flex;flex-direction:column;gap:3px;list-style:none;padding:0;margin:0}
.bar-item{display:flex;align-items:center;gap:8px;padding:2px 0}
.bar-rank{width:24px;font-size:.68rem;color:#767676;flex-shrink:0;text-align:right;font-weight:600}
.bar-sname{width:130px;font-size:.78rem;color:#222;flex-shrink:0}
.bar-track{flex:1;background:#eee;border-radius:2px;height:7px;overflow:hidden;border:1px solid #e0e0e0;position:relative}
.bar-fill{height:100%;border-radius:2px;transition:width .35s ease,background .3s ease}
.bar-val{font-size:.72rem;color:#595959;width:60px;text-align:right;flex-shrink:0;font-style:italic}
.bar-item.unrepresented .bar-sname{color:#595959}
.bar-item.unrepresented .bar-rank{color:#767676}
.bar-unrep-tag{font-size:.66rem;color:#767676;font-style:italic;width:140px;text-align:right;flex-shrink:0;letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar-unrep-pop{font-size:.72rem;color:#767676;width:52px;text-align:right;flex-shrink:0;font-style:italic}
.unrep-section-head{font-size:.65rem;text-transform:uppercase;letter-spacing:.1em;color:#767676;font-weight:700;padding:8px 0 4px 30px;border-top:1px solid #f0ede8;margin-top:4px}
.unrep-section-head:first-child{border-top:none;margin-top:0;padding-top:2px}

/* FOOTNOTE */
.footnote{text-align:center;font-size:.73rem;color:#595959;margin-top:20px;line-height:2}
.footnote a{color:#444;text-decoration:underline;text-underline-offset:2px}
.footnote a:hover{color:#1a1a1a}
.footnote-label{font-weight:700;color:#1a1a1a}

/* Skip navigation link (WCAG 2.4.1) */
.skip-link{position:absolute;top:-100%;left:0;z-index:9999;padding:10px 18px;background:#1a1a1a;color:#fff;font-size:.85rem;font-weight:600;text-decoration:none;border-radius:0 0 4px 0;transition:top .15s}
.skip-link:focus{top:0}

/* Visually hidden but available to screen readers */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* FOCUS STYLES — keyboard navigation (WCAG 2.4.7) */
:focus-visible{outline:3px solid #1a1a1a;outline-offset:3px}
.play-btn:focus-visible,.toggle-btn:focus-visible{outline:3px solid #1a1a1a;outline-offset:2px}
.slider-thumb:focus-visible{outline:3px solid #1a1a1a;outline-offset:3px;box-shadow:0 0 0 5px rgba(26,26,26,0.2)}

.loading-msg{text-align:center;padding:55px;color:#595959;font-style:italic;font-size:.88rem}
