:root {
  color-scheme: dark;
  --bg: #08090d;
  --bg-strong: #050609;
  --panel: #15161b;
  --panel-strong: #1b1c24;
  --panel-soft: #101218;
  --ink: #f4f2eb;
  --muted: #b8b5aa;
  --line: #2f3046;
  --line-strong: #4b4a66;
  --brand-red: #ff4020;
  --brand-red-strong: #d92f18;
  --brand-blue: #20b8ff;
  --brand-blue-strong: #087fc8;
  --brand-yellow: #ffd76b;
  --brand-cream: #f0f0e8;
  --brand-charcoal: #505050;
  --brand-plum: #402050;
  --brand-navy: #1f245f;
  --green: var(--brand-blue);
  --green-strong: var(--brand-blue-strong);
  --cyan: #5ccaff;
  --amber: var(--brand-yellow);
  --tag: #ffe19a;
  --tag-bg: #35260f;
  --tag-border: #9a6f1e;
  --democrat: var(--brand-blue);
  --democrat-bg: #0d2639;
  --democrat-border: #146da6;
  --republican: var(--brand-red);
  --republican-bg: #351512;
  --republican-border: #a13224;
  --red: #ff7662;
  --focus: #8bd8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 42%, #111017 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.loading-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 10%) 0%, transparent 32%),
    linear-gradient(315deg, rgb(32 184 255 / 12%) 0%, transparent 34%);
}

.signed-out {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 10%) 0%, transparent 32%),
    linear-gradient(315deg, rgb(32 184 255 / 12%) 0%, transparent 34%);
}

.auth-panel {
  position: relative;
  width: min(100%, 560px);
  padding: 32px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(32 184 255 / 12%), transparent 42%),
    linear-gradient(160deg, var(--panel-strong) 0%, var(--panel) 58%, #12131a 100%);
  border: 1px solid #363653;
  border-radius: 8px;
  box-shadow: 0 22px 80px rgb(0 0 0 / 35%);
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-cream), var(--brand-blue));
}

.auth-panel > * {
  position: relative;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1;
}

.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 34%));
}

.brand-name {
  color: var(--brand-cream);
  font-size: 0.96rem;
  font-weight: 950;
  text-transform: uppercase;
}

.maker-mark {
  width: 16px;
  height: 16px;
  object-fit: cover;
  background: #050505;
  border: 1px solid rgb(240 240 232 / 18%);
  border-radius: 4px;
}

.auth-panel .brand-lockup {
  margin-bottom: 14px;
}

.auth-panel .brand-mark {
  width: 58px;
  height: 58px;
}

.auth-panel .brand-name {
  font-size: 1.14rem;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.lede,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px max(20px, calc((100vw - 1240px) / 2));
  background:
    linear-gradient(90deg, #06070a 0%, #12121a 54%, #071621 100%);
  border-bottom: 1px solid #343653;
  box-shadow: inset 0 -3px 0 rgb(32 184 255 / 18%);
}

.topbar h1 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.topbar-title {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.topbar-title .brand-lockup {
  margin-bottom: 0;
}

.topbar-title .brand-mark {
  width: 32px;
  height: 32px;
}

.topbar-title .brand-name {
  font-size: 0.9rem;
}

.account-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.view-switch {
  max-width: 100%;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgb(21 22 27 / 74%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.view-switch button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.view-switch button.is-active {
  color: #04121b;
  background: var(--brand-blue);
}

.app-footer {
  width: min(1240px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: auto auto 0;
  padding: 18px 0 22px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.app-footer strong {
  color: var(--brand-cream);
}

.app-footer .maker-mark {
  width: 18px;
  height: 18px;
}

.dashboard-layout,
.workspace,
.detail-layout,
.bill-text-layout,
.representatives-layout {
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.dashboard-layout,
.detail-layout,
.bill-text-layout,
.representatives-layout {
  display: grid;
  gap: 18px;
}

.dashboard-hero,
.representatives-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 170px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 13%), transparent 40%),
    linear-gradient(115deg, var(--panel-strong) 0%, #151825 56%, rgb(32 184 255 / 13%) 100%);
  border: 1px solid #383855;
  border-radius: 8px;
}

.dashboard-hero::before,
.representatives-hero::before,
.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-cream), var(--brand-blue));
}

.dashboard-hero > *,
.representatives-hero > *,
.detail-hero > * {
  position: relative;
}

.dashboard-hero h2,
.representatives-hero h2 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: 1.85rem;
  line-height: 1.14;
}

.hero-chips,
.reason-row,
.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chips span,
.reason-row span {
  max-width: 100%;
  padding: 6px 9px;
  color: #161205;
  background: var(--tag);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 3px 0 var(--brand-blue);
}

.metric-card strong {
  color: var(--green);
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card:nth-child(2) {
  box-shadow: inset 0 3px 0 var(--brand-red);
}

.metric-card:nth-child(2) strong {
  color: var(--brand-red);
}

.metric-card:nth-child(3) {
  box-shadow: inset 0 3px 0 var(--brand-yellow);
}

.metric-card:nth-child(3) strong {
  color: var(--brand-yellow);
}

.metric-card:nth-child(4) {
  box-shadow: inset 0 3px 0 var(--brand-cream);
}

.metric-card:nth-child(4) strong {
  color: var(--brand-cream);
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 18px;
}

.representatives-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.representatives-toolbar h2 {
  margin-bottom: 0;
}

.representative-list {
  display: grid;
  gap: 14px;
}

.representative-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgb(32 184 255 / 4%), transparent 38%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.representative-card.party-democrat {
  border-color: var(--democrat-border);
  box-shadow: inset 4px 0 0 var(--democrat);
}

.representative-card.party-republican {
  border-color: var(--republican-border);
  box-shadow: inset 4px 0 0 var(--republican);
}

.representative-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 16px;
  align-items: start;
}

.representative-card-header h3 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.representative-card-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.representative-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.party-dot {
  width: 9px;
  height: 9px;
  background: var(--line-strong);
  border-radius: 999px;
}

.party-democrat .party-dot {
  background: var(--democrat);
}

.party-republican .party-dot {
  background: var(--republican);
}

.representative-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.representative-counts div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.representative-counts dd {
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 950;
}

.representative-activity-box {
  max-height: 470px;
  overflow-y: auto;
  padding: 2px 4px 4px 2px;
  scrollbar-gutter: stable;
}

.representative-activity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.representative-activity {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 176px;
  padding: 14px;
  color: inherit;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

.representative-activity:hover {
  border-color: var(--brand-blue);
  transform: translateY(-1px);
}

.representative-activity h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

.representative-activity p,
.representative-activity span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.representative-activity-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0 4px;
  color: var(--muted);
}

.representative-activity-pager p {
  margin: 0;
}

.representative-profile-layout {
  display: grid;
  gap: 18px;
}

.representative-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

.representative-profile-main,
.representative-profile-rail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.profile-feed {
  display: grid;
  gap: 10px;
}

.profile-feed-scroll {
  max-height: 680px;
  overflow-y: auto;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-feed.compact {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.profile-activity-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  color: inherit;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.profile-activity-card:hover {
  border-color: var(--brand-blue);
}

.profile-activity-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.profile-activity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.vote-position-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vote-position-row strong {
  padding: 5px 8px;
  color: #04121b;
  background: var(--brand-blue);
  border-radius: 6px;
}

.vote-position-row span {
  color: var(--muted);
}

.social-link-list {
  display: grid;
  gap: 9px;
}

.social-link-item {
  display: grid;
  gap: 3px;
  padding: 11px;
  color: inherit;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.social-link-item:hover {
  border-color: var(--brand-blue);
}

.social-link-item span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.representative-profile-link {
  display: inline-flex;
  width: max-content;
  margin-top: 10px;
  padding: 7px 10px;
}

.bill-feed,
.dashboard-rail,
.questionnaire {
  min-width: 0;
}

.bill-feed {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  max-height: var(--bill-feed-max-height, min(680px, 72vh));
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  background:
    linear-gradient(145deg, rgb(32 184 255 / 5%), transparent 38%),
    var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bill-feed-scroll {
  min-height: 0;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: var(--line-strong) transparent;
}

.bill-feed-scroll:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px;
}

.bill-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 18px;
  padding: 18px;
  color: inherit;
  background:
    linear-gradient(145deg, rgb(32 184 255 / 4%), transparent 38%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

.bill-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-1px);
}

.bill-card-main {
  min-width: 0;
}

.bill-card h3 {
  color: var(--ink);
  font-size: 1.05rem;
}

.bill-card p {
  color: var(--muted);
  line-height: 1.5;
}

.bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.bill-meta span {
  padding: 5px 7px;
  color: #161205;
  background: var(--tag);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.bill-meta .party-tag {
  color: var(--ink);
  background: #252323;
  border-color: var(--line-strong);
}

.bill-meta .party-tag.party-democrat {
  background: var(--democrat-bg);
  border-color: var(--democrat-border);
  color: #dceeff;
}

.bill-meta .party-tag.party-republican {
  background: var(--republican-bg);
  border-color: var(--republican-border);
  color: #ffe7e2;
}

.latest-action {
  margin-bottom: 12px;
  color: var(--ink);
}

.score-pill {
  align-self: start;
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 10px;
  color: #04121b;
  background: var(--brand-blue);
  border-radius: 8px;
  box-shadow: inset 0 -3px 0 rgb(4 18 27 / 20%);
}

.bill-mark-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mark-action {
  min-height: 34px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.mark-action:hover,
.mark-action.is-active {
  color: var(--ink);
  border-color: var(--brand-blue);
}

.mark-action.is-active {
  background: rgb(32 184 255 / 14%);
}

.detail-hero-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.detail-hero-actions .bill-mark-actions {
  justify-content: flex-end;
}

.saved-bill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.saved-bill-section {
  display: grid;
  gap: 12px;
  align-content: start;
}

.saved-bill-list {
  display: grid;
  gap: 10px;
}

.saved-bill-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saved-bill-card a {
  color: inherit;
  text-decoration: none;
}

.saved-bill-card h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

.saved-bill-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.wrapped-panel {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 18%), transparent 34%),
    linear-gradient(115deg, #1c1622 0%, #121a25 52%, rgb(32 184 255 / 20%) 100%);
  border: 1px solid #464369;
  border-radius: 8px;
  box-shadow: inset 0 4px 0 var(--brand-yellow);
}

.wrapped-entry-panel {
  min-height: 220px;
}

.wrapped-panel-quiet {
  background:
    linear-gradient(135deg, rgb(32 184 255 / 10%), transparent 36%),
    linear-gradient(115deg, var(--panel-strong) 0%, #151825 58%, rgb(255 215 107 / 11%) 100%);
}

.wrapped-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.wrapped-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.wrapped-header {
  max-width: 860px;
}

.wrapped-header h2 {
  margin-bottom: 10px;
  font-size: 1.65rem;
  line-height: 1.12;
}

.wrapped-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wrapped-chip-row span {
  padding: 6px 9px;
  color: #161205;
  background: var(--brand-yellow);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.wrapped-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wrapped-preview-metrics div {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  background: rgb(8 9 13 / 58%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wrapped-preview-metrics strong {
  color: var(--brand-yellow);
  font-size: 1.55rem;
  line-height: 1;
}

.wrapped-preview-metrics span {
  color: var(--muted);
  font-weight: 850;
}

.wrapped-dialog {
  box-sizing: border-box;
  width: min(1060px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 28px));
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.wrapped-dialog::backdrop {
  background: rgb(0 0 0 / 78%);
}

.wrapped-dialog-frame {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(900px, calc(100vh - 28px));
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 14%), transparent 32%),
    linear-gradient(115deg, #120f18 0%, #101725 58%, rgb(32 184 255 / 15%) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 28px 110px rgb(0 0 0 / 58%);
}

.wrapped-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.wrapped-dialog-header h2 {
  margin-bottom: 0;
}

.wrapped-progress {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
}

.wrapped-progress-dot {
  flex: 1 1 0;
  min-width: 26px;
  height: 5px;
  padding: 0;
  background: rgb(255 255 255 / 18%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
}

.wrapped-progress-dot.is-active {
  background: linear-gradient(90deg, var(--brand-yellow), var(--brand-blue));
  box-shadow: 0 0 18px rgb(32 184 255 / 42%);
}

.wrapped-progress-dot:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 4px;
}

.wrapped-deck {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-color: var(--line-strong) transparent;
}

.wrapped-deck::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.wrapped-slide {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(18px, 4vw, 36px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  opacity: 0.36;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 260ms ease,
    transform 520ms cubic-bezier(0.2, 0.86, 0.2, 1);
}

.wrapped-slide.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wrapped-slide.is-before {
  transform: translateY(-22px) scale(0.985);
}

.wrapped-slide.is-after {
  transform: translateY(22px) scale(0.985);
}

.wrapped-slide.is-active > * {
  animation: wrapped-pop 560ms cubic-bezier(0.18, 0.84, 0.22, 1) both;
}

.wrapped-slide:nth-child(2n) {
  background: rgb(32 184 255 / 4%);
}

.wrapped-intro-slide {
  background:
    linear-gradient(135deg, rgb(255 64 32 / 20%), transparent 42%),
    linear-gradient(315deg, rgb(32 184 255 / 18%), transparent 46%);
}

.wrapped-intro-slide h2 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: 4.2rem;
  line-height: 1;
}

.wrapped-intro-slide p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.wrapped-slide .wrapped-section {
  min-height: min(620px, calc(100vh - 230px));
  min-height: min(620px, calc(100dvh - 230px));
  align-content: start;
}

.wrapped-story {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wrapped-story-card {
  min-height: 178px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 16px;
  background: #0d1118;
  border: 1px solid var(--line);
  border-radius: 8px;
  transform-origin: bottom left;
}

.wrapped-slide.is-active .wrapped-story-card {
  animation: wrapped-pop 520ms cubic-bezier(0.18, 0.84, 0.22, 1) both;
}

.wrapped-slide.is-active .wrapped-story-card:nth-child(2) {
  animation-delay: 80ms;
}

.wrapped-slide.is-active .wrapped-story-card:nth-child(3) {
  animation-delay: 160ms;
}

.wrapped-slide.is-active .wrapped-story-card:nth-child(4) {
  animation-delay: 240ms;
}

.wrapped-story-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wrapped-story-card strong {
  color: var(--brand-blue);
  font-size: 2.45rem;
  line-height: 0.95;
}

.wrapped-story-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.wrapped-story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.wrapped-blue {
  box-shadow: inset 0 4px 0 var(--brand-blue);
}

.wrapped-red {
  box-shadow: inset 0 4px 0 var(--brand-red);
}

.wrapped-red strong {
  color: var(--brand-red);
}

.wrapped-yellow {
  box-shadow: inset 0 4px 0 var(--brand-yellow);
}

.wrapped-yellow strong {
  color: var(--brand-yellow);
}

.wrapped-cream {
  box-shadow: inset 0 4px 0 var(--brand-cream);
}

.wrapped-cream strong {
  color: var(--brand-cream);
}

.wrapped-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wrapped-section {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  padding: 14px;
  background: rgb(8 9 13 / 54%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wrapped-list {
  min-height: 0;
  display: grid;
  gap: 9px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-color: var(--line-strong) transparent;
}

.wrapped-list-item {
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  padding: 12px;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transform-origin: center left;
}

.wrapped-slide.is-active .wrapped-list-item {
  animation: wrapped-rise 440ms ease both;
}

.wrapped-slide.is-active .wrapped-list-item:nth-child(2) {
  animation-delay: 60ms;
}

.wrapped-slide.is-active .wrapped-list-item:nth-child(3) {
  animation-delay: 120ms;
}

.wrapped-slide.is-active .wrapped-list-item:nth-child(4) {
  animation-delay: 180ms;
}

.wrapped-slide.is-active .wrapped-list-item:nth-child(5) {
  animation-delay: 240ms;
}

.wrapped-list-item:hover {
  border-color: var(--brand-blue);
}

.wrapped-list-item h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.wrapped-list-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.wrapped-list-item > strong {
  color: var(--brand-yellow);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.wrapped-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.wrapped-nav-button {
  min-width: 104px;
}

.wrapped-nav-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

@keyframes wrapped-pop {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wrapped-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wrapped-deck {
    scroll-behavior: auto;
  }

  .wrapped-slide,
  .wrapped-story-card,
  .wrapped-list-item {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.score-pill strong {
  font-size: 1.35rem;
  line-height: 1;
}

.score-pill span {
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.dashboard-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.rail-panel,
.summary-pane,
.question-block,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rail-panel {
  padding: 18px;
}

.topic-list,
.action-list,
.summary-list,
.questionnaire {
  display: grid;
  gap: 12px;
}

.topic-item {
  display: grid;
  gap: 8px;
}

.topic-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.topic-item strong {
  color: var(--ink);
}

.topic-bar {
  height: 8px;
  overflow: hidden;
  background: #222431;
  border-radius: 999px;
}

.topic-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-yellow), var(--brand-blue));
  border-radius: inherit;
}

.action-item {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  color: inherit;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 140ms ease, transform 140ms ease;
}

.action-item:hover {
  transform: translateX(2px);
}

.action-item:hover h3 {
  color: var(--brand-blue);
}

.action-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.action-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand-blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.action-item h3 {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.action-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 22px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.breadcrumb a {
  color: var(--green);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.detail-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(255 64 32 / 10%), transparent 38%),
    linear-gradient(115deg, var(--panel-strong) 0%, #151825 56%, rgb(32 184 255 / 11%) 100%);
  border: 1px solid #383855;
  border-radius: 8px;
}

.detail-hero.party-democrat {
  border-color: var(--democrat-border);
  box-shadow: inset 5px 0 0 var(--democrat);
}

.detail-hero.party-republican {
  border-color: var(--republican-border);
  box-shadow: inset 5px 0 0 var(--republican);
}

.detail-hero h2 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: 1.75rem;
  line-height: 1.15;
}

.bill-text-hero {
  align-items: center;
}

.bill-text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.bill-text-panel {
  display: grid;
  gap: 16px;
}

.bill-text-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
}

.bill-text-toolbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.bill-text-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.bill-text-meta strong {
  color: var(--ink);
}

.bill-text-content {
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  color: var(--ink);
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.bill-text-source-links {
  padding-top: 2px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.detail-main,
.detail-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.detail-panel {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.status-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.status-grid div {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-grid dd {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.subject-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subject-chip-list span {
  padding: 6px 9px;
  color: #161205;
  background: var(--tag);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.timeline-item time {
  color: var(--brand-blue);
  font-weight: 900;
}

.timeline-item p {
  margin-bottom: 6px;
}

.timeline-item span,
.mini-item span,
.sponsor-item span {
  color: var(--muted);
  line-height: 1.4;
}

.sponsor-list,
.mini-list {
  display: grid;
  gap: 10px;
}

.sponsor-item,
.mini-item {
  display: grid;
  gap: 5px;
  padding: 10px 0 10px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
}

.sponsor-item:last-child,
.mini-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.sponsor-item.party-democrat {
  border-left-color: var(--democrat);
}

.sponsor-item.party-republican {
  border-left-color: var(--republican);
}

.sponsor-item.party-democrat .sponsor-name {
  color: var(--democrat);
}

.sponsor-item.party-republican .sponsor-name {
  color: var(--republican);
}

.sponsor-panel.party-democrat {
  border-color: var(--democrat-border);
  box-shadow: inset 4px 0 0 var(--democrat);
}

.sponsor-panel.party-republican {
  border-color: var(--republican-border);
  box-shadow: inset 4px 0 0 var(--republican);
}

.primary-sponsor-line {
  color: var(--ink);
}

.primary-sponsor-line strong {
  color: inherit;
}

.sponsor-panel.party-democrat .primary-sponsor-line strong {
  color: var(--democrat);
}

.sponsor-panel.party-republican .primary-sponsor-line strong {
  color: var(--republican);
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.external-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 9px;
  color: #dff4ff;
  background: #0d2639;
  border: 1px solid #146da6;
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
}

.external-link:hover {
  border-color: var(--brand-blue);
}

.expand-action {
  width: 100%;
  margin-top: 14px;
}

.sponsor-dialog,
.action-dialog {
  max-height: min(760px, calc(100vh - 48px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.sponsor-dialog {
  width: min(820px, calc(100vw - 32px));
}

.action-dialog {
  width: min(900px, calc(100vw - 32px));
}

.sponsor-dialog::backdrop,
.action-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

.dialog-frame {
  display: grid;
  gap: 16px;
  max-height: inherit;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 90px rgb(0 0 0 / 55%);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin-bottom: 0;
}

.sponsor-dialog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  max-height: min(560px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.action-dialog-list {
  max-height: min(560px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.sponsor-dialog-list .sponsor-item {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
}

.sponsor-dialog-list .sponsor-item.party-democrat {
  border-left-color: var(--democrat);
}

.sponsor-dialog-list .sponsor-item.party-republican {
  border-left-color: var(--republican);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.summary-pane {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 20px;
}

.summary-list {
  margin: 0;
}

.summary-list div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.summary-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

dd {
  margin: 4px 0 0;
  line-height: 1.35;
}

.question-block {
  min-width: 0;
  padding: 20px;
}

.compact-grid {
  display: grid;
  grid-template-columns: 120px 1fr 190px;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  min-height: 42px;
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: #0c0e13;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(140 199 255 / 18%);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.tall-list {
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.choice {
  min-height: 46px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgb(32 184 255 / 5%), transparent 34%),
    var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.choice input {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
}

.choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subject-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  align-items: center;
  gap: 14px;
}

.subject-heading h2 {
  margin-bottom: 0;
}

.selected-chips {
  min-height: 34px;
  margin: 16px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 9px;
  color: #161205;
  background: var(--tag);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
}

.chip span {
  color: var(--brand-red);
  font-weight: 900;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
}

.primary-action {
  color: #04121b;
  background: var(--brand-blue);
  border: 1px solid var(--brand-blue-strong);
  box-shadow: inset 0 -2px 0 rgb(4 18 27 / 18%);
}

.primary-action:hover {
  background: #55ccff;
}

.ghost-action {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.ghost-action:hover {
  color: var(--brand-cream);
  border-color: var(--brand-yellow);
}

.error-text {
  color: var(--red);
  font-weight: 800;
}

.success-text {
  color: var(--brand-blue);
  font-weight: 900;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-strip {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    white-space: normal;
  }

  .metric-grid,
  .status-panel,
  .dashboard-grid,
  .workspace,
  .detail-grid,
  .bill-text-toolbar,
  .wrapped-sections {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wrapped-story {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wrapped-intro-slide h2 {
    font-size: 3rem;
  }

  .wrapped-preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-pane {
    position: static;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 1.65rem;
  }

  .brand-lockup {
    column-gap: 9px;
  }

  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar-title,
  .view-switch {
    width: 100%;
  }

  .view-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-switch button {
    width: 100%;
    padding-inline: 8px;
    text-align: center;
  }

  .auth-panel {
    padding: 26px;
  }

  .auth-panel .brand-mark {
    width: 50px;
    height: 50px;
  }

  .dashboard-hero,
  .representatives-hero,
  .detail-hero,
  .wrapped-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero h2,
  .representatives-hero h2,
  .detail-hero h2,
  .wrapped-header h2 {
    font-size: 1.45rem;
  }

  .hero-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bill-card {
    grid-template-columns: 1fr;
  }

  .saved-bill-grid {
    grid-template-columns: 1fr;
  }

  .score-pill {
    justify-self: start;
    min-width: 82px;
  }

  .compact-grid,
  .subject-heading {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

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

  .wrapped-panel {
    padding: 16px;
  }

  .wrapped-entry-actions {
    justify-content: stretch;
  }

  .wrapped-entry-actions .primary-action,
  .wrapped-entry-actions .ghost-action {
    flex: 1 1 150px;
  }

  .wrapped-preview-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .wrapped-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
  }

  .wrapped-dialog-frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .wrapped-dialog-header {
    align-items: center;
    flex-direction: row;
    padding: 12px;
  }

  .wrapped-dialog-header h2 {
    font-size: 1rem;
  }

  .wrapped-progress {
    gap: 6px;
    padding: 8px 12px 0;
  }

  .wrapped-progress-dot {
    min-width: 18px;
  }

  .wrapped-slide {
    justify-items: center;
    padding: 14px;
  }

  .wrapped-slide > * {
    width: 100%;
  }

  .wrapped-slide .wrapped-section {
    max-width: 440px;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
    justify-self: center;
  }

  .wrapped-intro-slide {
    text-align: center;
  }

  .wrapped-intro-slide > div {
    max-width: 360px;
    justify-self: center;
  }

  .wrapped-intro-slide h2 {
    font-size: 2.2rem;
  }

  .wrapped-intro-slide p,
  .wrapped-intro-slide .wrapped-chip-row {
    justify-content: center;
  }

  .wrapped-story {
    max-width: 440px;
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .wrapped-story-card {
    min-width: 0;
    min-height: 142px;
    padding: 12px;
    scroll-snap-align: unset;
  }

  .wrapped-story-card strong {
    font-size: 1.8rem;
  }

  .wrapped-nav {
    padding: 10px 12px 12px;
  }

  .wrapped-nav-button {
    min-width: 82px;
    padding-inline: 12px;
  }

  .dialog-header {
    align-items: stretch;
    flex-direction: column;
  }

  .representatives-toolbar,
  .representative-card-header {
    grid-template-columns: 1fr;
  }

  .representatives-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .representative-profile-grid {
    grid-template-columns: 1fr;
  }
}
