/*
 * Compare: two members, mirrored. Built on record.css tokens (ink, panel, paper, gold, dem, rep,
 * ind, line, focus) and the member page's look: mono uppercase labels, big gold numbers, gold
 * solid + hatched bars. Every class here starts with "duo-" so nothing collides with record.css.
 * Values copied from shared files (not edited there): .skip and .sr-only and the skeleton
 * gradient from official.css; the hatch from official.css .amt-bar__fill--hatch; the share
 * pill and box from bill.css; the Independent fill (#98a1ae dark / #687080 light) from bill.css.
 */

/* ── Helpers ───────────────────────────────────────────────── */
.duo-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.duo-skip {
  position: absolute; left: 8px; top: -80px; z-index: 30; padding: 10px 14px; border-radius: 4px;
  background: var(--gold); color: var(--ink); font-weight: 700; text-decoration: none;
}
.duo-skip:focus { top: 8px; }
.duo-page { --ind-fill: #98a1ae; --hatch: repeating-linear-gradient(135deg, var(--gold) 0 2px, var(--ink-2) 2px 5px); }

.duo-skel {
  background: linear-gradient(90deg, var(--ink-2) 0%, var(--line) 50%, var(--ink-2) 100%) 0 0 / 300% 100%;
  animation: duo-skel 1.4s ease-in-out infinite; border-radius: 3px;
}
@keyframes duo-skel { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ── Intro and pickers ─────────────────────────────────────── */
.duo-intro { padding: 26px 0 4px; }
.duo-intro .official-header__kicker { margin: 0; }
.duo-intro h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(28px, 4.4vw, 40px); line-height: 1.05; letter-spacing: -.02em; margin: 6px 0 0; color: var(--paper); }
.duo-lede { margin: 10px 0 0; font-size: 16px; color: var(--paper-dim); }

.duo-form { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px 14px; align-items: start; margin-top: 22px; }
.duo-field { display: grid; gap: 6px; min-width: 0; }
.duo-field label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-dim); }
.duo-field input {
  width: 100%; min-height: 48px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--paper); font-family: var(--sans); font-size: 16px; padding: 11px 13px;
}
.duo-field input::placeholder { color: var(--paper-mute); opacity: 1; }
.duo-field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--gold); }
.duo-field input[aria-invalid="true"] { border-color: var(--rep); }
.duo-msg { margin: 0; min-height: 0; font-size: 14px; color: var(--rep-ink); }
.duo-msg:empty { display: none; }
.duo-form__vs { align-self: start; margin-top: 30px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-mute); }
.duo-form .btn { margin-top: 24px; min-height: 48px; justify-content: center; }

.duo-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; }
.duo-quick label { font-size: 14px; color: var(--paper-dim); }
.duo-quick select {
  min-height: 44px; min-width: 200px; background: var(--panel); color: var(--paper); border: 1px solid var(--line-2); border-radius: 4px;
  font-family: var(--sans); font-size: 15px; padding: 8px 12px; cursor: pointer;
}
.duo-quick select:disabled { opacity: .6; cursor: progress; }
.duo-quick-people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; }
.duo-quick-people[hidden] { display: none; }

/* A pill button: the bill page's share toggle, at a 44 px target. */
.duo-pill {
  min-height: 44px; font: 600 14px var(--sans); color: var(--paper-dim); background: transparent;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 16px; cursor: pointer;
}
.duo-pill:hover, .duo-pill[aria-expanded="true"], .duo-pill[aria-pressed="true"] { color: var(--paper); border-color: var(--paper-mute); background: var(--panel-2); }
.duo-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.duo-suggest__label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-mute); flex-basis: 100%; }
.duo-quick-people .duo-suggest__label { flex-basis: auto; }

/* ── The result ────────────────────────────────────────────── */
.duo-result { margin-top: 30px; }
.duo-result:focus { outline: none; }
/* The waking line sits where the comparison will be, above its grey blocks. */
.duo-wait .cc-wake { margin: 0 0 16px; }
.duo-wait .cc-wake:empty { margin: 0; }
.duo-result:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.duo-page[data-mode="empty"] .duo-result { display: none; }
/* A pair's result is empty only until compare.js draws its grey blocks: hold the footer below the
 * screen meanwhile, so the blocks arriving never move it in view (the page's first-paint shift). */
.duo-page[data-mode="pair"] .duo-result:empty { min-height: 100vh; }
/* Once a pair is on screen the quick way in has done its job. */
.duo-page[data-mode="pair"] .duo-quick, .duo-page[data-mode="pair"] .duo-lede { display: none; }

/* Two member headers, mirrored about the middle. */
.duo-heads { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); align-items: center; gap: 0 14px; }
.duo-card { display: flex; align-items: center; gap: 16px; min-width: 0; min-height: 88px; }
.duo-card--a { flex-direction: row-reverse; text-align: right; }
.duo-card--a .duo-card__seat { justify-content: flex-end; }
.duo-card--slot { border: 1px dashed var(--line-2); border-radius: 6px; padding: 14px 16px; min-height: 88px; }
.duo-card--slot .duo-card__name { font-size: 18px; color: var(--paper-dim); }
.duo-heads > .duo-card--slot:first-child { visibility: hidden; }
.duo-card__body { min-width: 0; }
/* A waiting card's body takes the card's width, so its grey blocks shrink on a phone instead of widening the page. */
.duo-card__body--skel { flex: 1 1 auto; align-self: stretch; }
.duo-card__line, .duo-card__seat, .duo-card__warn { margin: 0; }
.duo-card__name { font-family: var(--sans); font-weight: 800; font-size: 26px; line-height: 1.12; letter-spacing: -.015em; color: var(--paper); text-decoration: none; overflow-wrap: anywhere; margin: 0; }
a.duo-card__name:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.duo-card__seat { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-top: 6px; font-family: var(--mono); font-size: 13px; letter-spacing: .03em; color: var(--paper-dim); }
.duo-card__party { color: var(--paper); }
.duo-card__warn { margin-top: 6px; font-size: 14px; color: var(--rep-ink); }
.duo-card .duo-skel--name { display: block; width: 220px; max-width: 100%; height: 29px; }
.duo-card .duo-skel--seat { display: block; width: 150px; max-width: 80%; height: 16px; margin-top: 8px; }
.duo-card--a .duo-skel { margin-left: auto; }
.duo-vs { justify-self: center; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--ink-2); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-mute); }

.duo-face { position: relative; flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line-2); }
.duo-face__initials { font: 800 22px var(--sans); color: var(--paper-dim); letter-spacing: .02em; }
.duo-face__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.duo-face--none { border-style: dashed; background: transparent; }

.duo-party-mark { flex: none; display: inline-block; vertical-align: -1px; }
.duo-party-mark.dem { fill: var(--dem); }
.duo-party-mark.rep { fill: var(--rep); }
.duo-party-mark.ind { fill: var(--ind-fill); }
.duo-party-mark.oth { fill: var(--paper-mute); }

/* The board: one mirrored row per measure. */
.duo-board { margin-top: 22px; padding: 6px 26px; }
.duo-rows { display: grid; padding: 0; border-bottom: 0; }
/* record.css gives every [class*="-row"] a bottom rule and padding; these rows draw their own. */
.duo-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 176px minmax(0, 1fr); align-items: center; gap: 0 18px;
  padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 0;
}
.duo-row:first-child { border-top: 0; }
.duo-side { display: grid; align-items: center; gap: 0 14px; min-width: 0; }
.duo-side--a { grid-template-columns: 172px minmax(0, 1fr); }
.duo-side--b { grid-template-columns: minmax(0, 1fr) 172px; }
.duo-side--b .duo-fig { order: 2; }
.duo-side--a .duo-fig { text-align: right; }
.duo-side--a .duo-fig__main, .duo-side--a .duo-sub { justify-content: flex-end; }

.duo-label { text-align: center; display: grid; gap: 6px; justify-items: center; }
.duo-label__t { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-dim); line-height: 1.35; }
.duo-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; font-size: 12px; color: var(--paper-mute); }
.duo-key__item { display: inline-flex; align-items: center; gap: 5px; }

.duo-fig { min-width: 0; }
.duo-who { display: none; }
.duo-fig__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.duo-num { font-family: var(--sans); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; color: var(--gold); font-variant-numeric: tabular-nums; }
.duo-note { font-size: 13px; color: var(--paper-dim); }
.duo-empty { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--paper-mute); line-height: 33px; }
.duo-partial {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
  padding: 4px 6px; border-radius: 3px; border: 1px dashed var(--line-2); color: var(--paper-dim); cursor: help; align-self: center;
}
.duo-foot { margin: 14px 0 0; font-size: 13px; line-height: 1.45; color: var(--paper-dim); max-width: 68ch; }
.duo-foot + .duo-foot { margin-top: 6px; }
.duo-foot:last-child { margin-bottom: 18px; }
.duo-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 13px; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.duo-sub__item { display: inline-flex; align-items: center; gap: 5px; }

/* Swatches: the member page's solid and hatched marks. */
.duo-sw { display: inline-block; flex: none; width: 10px; height: 10px; }
.duo-key .duo-sw, .duo-sub .duo-sw, .duo-pos .duo-sw { border-radius: 50%; }
.duo-sw--solid { background: var(--gold); }
.duo-sw--hatch { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--gold); }
.duo-key .duo-sw--hatch, .duo-sub .duo-sw--hatch, .duo-pos .duo-sw--hatch { border-radius: 1px; }
.duo-sw--hollow { background: transparent; box-shadow: inset 0 0 0 1px var(--gold-dim); }

.duo-track { position: relative; display: flex; height: 16px; min-width: 0; }
.duo-track--a { justify-content: flex-end; }
.duo-track--b { justify-content: flex-start; }
.duo-fill { display: flex; height: 100%; min-width: 3px; transform-origin: right center; animation: duo-grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.duo-track--a .duo-fill { flex-direction: row-reverse; border-radius: 3px 0 0 3px; overflow: hidden; }
.duo-track--b .duo-fill { transform-origin: left center; border-radius: 0 3px 3px 0; overflow: hidden; }
.duo-seg { display: block; flex-basis: 0; min-width: 2px; height: 100%; }
.duo-seg.duo-sw--hatch { box-shadow: inset 0 0 0 1px var(--gold); }
@keyframes duo-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* A row with no bar (a partial figure, or nothing on file): a quiet dotted rule where the bar would be. */
.duo-row.is-unscaled .duo-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dotted var(--line-2); }
.duo-row.is-loading .duo-track { height: 16px; }
.duo-skel--num { display: inline-block; width: 96px; height: 33px; }

/* Share and the neutral line. */
.duo-share { margin-top: 18px; }
.duo-share__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.duo-verdict { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--paper-mute); }
.duo-sharebox { margin: 12px 0 0; padding: 12px 14px; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 6px; }
.duo-sharebox[hidden] { display: none; }
.duo-sharebox__text { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--paper); }
.duo-sharebox__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.duo-sharebox__row .btn { min-height: 44px; }
.duo-sharebox__status { color: var(--paper-dim); font-size: 13px; }

/* Panels: did they vote alike, bills both signed. */
.duo-panel { margin-top: 22px; }
.duo-panel .panel__title { margin: 0; }
.duo-panel .panel__body { padding: 16px 22px 20px; }
.duo-alike__lead { margin: 0; font-size: 17px; color: var(--paper-dim); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.duo-big { font-family: var(--sans); font-weight: 800; font-size: 30px; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; }
.duo-cross { margin: 22px 0 0; padding: 14px 18px; border: 1px dashed var(--line-2); border-radius: 6px; font-size: 15px; color: var(--paper-dim); }
.duo-panel .duo-cross { margin: 0; }
/* "Bills both signed" (compare.js billsPanel): its heading and one line while the lists come; the
   bills go below that line, so nothing waits at a guessed height. Its Try again lines up with the
   dashed line's left edge (record.css gives the waking line's button an 8 px inset). */
.duo-panel .cc-wake__again { margin: 12px 0 0; }

.duo-strip-wrap { margin-top: 18px; }
.duo-strip { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.duo-mark { position: relative; display: inline-block; flex: none; width: 10px; height: 20px; }
.duo-mark::before { content: ""; position: absolute; }
.duo-mark.is-same::before { left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.duo-mark.is-diff::before { left: 2px; top: 0; width: 6px; height: 20px; border-radius: 1px; background: var(--paper); }
.duo-strip__ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--paper-mute); }
.duo-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; font-size: 14px; color: var(--paper-dim); }
.duo-legend__item { display: inline-flex; align-items: center; gap: 8px; }

.duo-h3 { margin: 26px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--paper-dim); }
.duo-list { list-style: none; margin: 8px 0 0; padding: 0; }
.duo-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 22px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.duo-item:first-child { border-top: 0; }
.duo-item__main { min-width: 0; }
.duo-item__q { margin: 0; font-size: 16px; color: var(--paper); }
.duo-item__sub { margin: 4px 0 0; font-size: 13px; color: var(--paper-mute); }
.duo-item__link { display: inline-block; margin-top: 4px; padding: 2px 0; font-size: 14px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.duo-item__main > .duo-item__link:first-child { margin-top: 0; font-size: 16px; color: var(--paper); text-decoration-color: var(--line-2); }
.duo-item__main > .duo-item__link:first-child:hover { color: var(--gold); }
.duo-item__pos { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.duo-item__date { font-family: var(--mono); font-size: 12px; color: var(--paper-mute); margin-right: 4px; white-space: nowrap; }
.duo-pos { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 13px; color: var(--paper-dim); white-space: nowrap; }
.duo-pos b { font-weight: 700; color: var(--paper); }

/* Everything as a table. */
.duo-table { margin-top: 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.duo-table summary { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 18px; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-dim); }
.duo-table summary:hover { color: var(--paper); }
.duo-table__wrap { overflow-x: auto; padding: 0 18px 16px; }
.duo-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.duo-table th, .duo-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-top: 1px solid var(--line); color: var(--paper); }
.duo-table thead th { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--paper-dim); font-weight: 600; border-top: 0; }
.duo-table tbody th { font-weight: 600; color: var(--paper-dim); white-space: nowrap; }

/* ── Light ─────────────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  .duo-page { --ind-fill: #687080; }
  .duo-board, .duo-card--slot { background: var(--panel); }
  .duo-vs { background: var(--panel); }
}

/* ── Phone and narrow ──────────────────────────────────────── */
@media (max-width: 760px) {
  /* The heading breaks after "members," in every font: the system font fits it on one line at 390 px
   * and Archivo does not, so the web font arriving moved the form down a line (a 0.023 shift). */
  .duo-h1-part { display: block; }
  .duo-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .duo-form__vs { display: none; }
  .duo-form .btn { margin-top: 2px; width: 100%; }
  .duo-quick select { flex: 1 1 100%; min-width: 0; width: 100%; }

  .duo-heads { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; align-items: start; }
  .duo-heads .duo-vs { display: none; }
  .duo-card, .duo-card--a { flex-direction: column; align-items: flex-start; text-align: left; gap: 10px; }
  .duo-card--a .duo-card__seat { justify-content: flex-start; }
  .duo-card--a .duo-skel { margin-left: 0; }
  .duo-card__name { font-size: 19px; }
  .duo-card__seat { font-size: 12px; }
  .duo-card__sep { display: none; }
  .duo-card__where { flex-basis: 100%; }
  .duo-face { width: 60px; height: 60px; }
  .duo-card--slot { padding: 12px; }

  .duo-board { padding: 4px 16px; }
  .duo-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px 0; }
  .duo-label { order: -1; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .duo-label__t { color: var(--paper); }
  /* Phone: name, bar, number on one line; both bars on the same track width so the scale holds. */
  .duo-side--a, .duo-side--b { grid-template-columns: 64px minmax(0, 1fr) 104px; grid-template-areas: "who track num" ". sub tag"; gap: 2px 10px; }
  .duo-fig, .duo-side .duo-fig__main { display: contents; }
  .duo-who { display: block; grid-area: who; text-align: left; font-size: 13px; font-weight: 600; color: var(--paper-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .duo-side .duo-num, .duo-side .duo-empty { grid-area: num; justify-self: end; white-space: nowrap; }
  .duo-side .duo-partial, .duo-side .duo-note { grid-area: tag; justify-self: end; align-self: start; }
  .duo-side .duo-sub { grid-area: sub; justify-content: flex-start; margin-top: 0; }
  .duo-side .duo-track { grid-area: track; height: 12px; }
  .duo-track--a { justify-content: flex-start; }
  .duo-track--a .duo-fill { flex-direction: row; transform-origin: left center; border-radius: 0 3px 3px 0; }
  .duo-num { font-size: 24px; }
  .duo-row.is-loading .duo-fig { display: block; grid-area: num; justify-self: end; }
  /* A side with no figure has no bar: its words ("Senate · being added") take the bar's width too. */
  .duo-side.is-none .duo-track { display: none; }
  .duo-side.is-none .duo-empty { grid-column: 2 / 4; }
  .duo-skel--num { width: 64px; height: 26px; }

  .duo-panel .panel__body { padding: 14px 16px 18px; }
  .duo-panel .panel__head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .duo-item { grid-template-columns: minmax(0, 1fr); }
  .duo-item__pos { justify-content: flex-start; }
  .duo-item__date { flex-basis: 100%; margin-right: 0; }
  .duo-pos { padding: 5px 8px; }
  .duo-mark { width: 8px; }
  .duo-mark.is-same::before { width: 8px; height: 8px; top: 6px; }
  .duo-mark.is-diff::before { left: 1px; }
  .duo-strip { gap: 3px; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .duo-fill { animation: none; }
  .duo-skel { animation: none; background: var(--line); }
}
