:root {
  --volt: #502379;
  --volt-dark: #35164f;
  --volt-soft: #eee7f5;
  --yellow: #f4c542;
  --paper: #f8f6fa;
  --card: #ffffff;
  --ink: #211a26;
  --muted: #6e6674;
  --line: #e2dce6;
  --green: #217a4c;
  --green-soft: #e6f4ec;
  --red: #a52b3c;
  --red-soft: #f8e8eb;
  --amber: #875d00;
  --amber-soft: #fff3d0;
  --shadow: 0 12px 34px rgba(45, 24, 61, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 36%, rgba(244, 197, 66, 0.08), transparent 24rem),
    var(--paper);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 214px;
  color: white;
  background: linear-gradient(135deg, var(--volt-dark), var(--volt));
}

.hero-orb {
  position: absolute;
  right: clamp(-76px, -4vw, -22px);
  top: -74px;
  width: 210px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
}

.hero-orb::after {
  content: "";
  position: absolute;
  width: 54px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--volt);
  left: 34px;
  bottom: 22px;
}

.hero-inner {
  position: relative;
  width: min(100% - 36px, 760px);
  margin: 0 auto;
  padding: 22px 0 38px;
}

.wordmark {
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  padding: 5px 10px 4px;
  color: white;
  background: rgba(255,255,255,.1);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
}

.kicker, .eyebrow {
  margin: 24px 0 5px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: calc(100% - 86px);
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: .98;
  letter-spacing: -.04em;
}

.subtitle { margin: 8px 0 0; color: rgba(255,255,255,.78); font-size: 1.08rem; }

main {
  width: min(100% - 28px, 760px);
  margin: -22px auto 0;
  padding-bottom: 108px;
  position: relative;
}
main:focus { outline: none; }

.view { display: none; }
.view.active { display: block; animation: arrive .22s ease-out; }
#detailView, #listView { padding-top: 24px; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }

.intro-card, .content-card, .detail-hero, .detail-section {
  border: 1px solid rgba(80, 35, 121, .08);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.intro-card { padding: clamp(22px, 5vw, 36px); }
.eyebrow { display: block; margin: 0 0 7px; color: var(--volt); }

h2, h3 { margin-top: 0; line-height: 1.12; }
.intro-card h2, .section-heading h2, .content-card h2 {
  margin-bottom: 9px;
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  letter-spacing: -.025em;
}

.intro-card > p { color: var(--muted); margin: 0; }
.search-form { margin-top: 24px; }
.search-form label, .filters label { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 750; color: var(--muted); }
.search-control { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

input, select {
  width: 100%;
  min-height: 52px;
  border: 1.5px solid #cfc5d6;
  border-radius: 13px;
  padding: 0 15px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus { border-color: var(--volt); box-shadow: 0 0 0 4px rgba(80,35,121,.12); }
#motionSearch { text-transform: uppercase; font-size: 1.08rem; font-weight: 750; letter-spacing: .04em; }

.search-button, .primary-action {
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  padding: 0 18px;
  color: white;
  background: var(--volt);
  font-weight: 800;
}
.search-button:hover, .primary-action:hover { background: var(--volt-dark); }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: .8rem; }

.suggestions { display: grid; gap: 4px; margin-top: 10px; }
.suggestion {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 10px 12px;
  text-align: left;
  background: var(--volt-soft);
  color: var(--ink);
}
.suggestion strong { color: var(--volt); }
.suggestion span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 4px 13px;
}
.section-heading h2 { margin: 0; }
.count-pill {
  flex: none;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--volt);
  background: var(--volt-soft);
  font-size: .76rem;
  font-weight: 750;
}

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.quick-card, .motion-row {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  text-align: left;
  color: inherit;
}
.quick-card { min-height: 116px; padding: 16px; }
.quick-card:hover, .motion-row:hover { border-color: var(--volt); transform: translateY(-1px); }
.quick-card strong { display: block; margin-bottom: 9px; color: var(--volt); font-size: 1.18rem; }
.quick-card span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--muted); line-height: 1.3; }

.back-button {
  border: 0;
  padding: 12px 3px;
  background: transparent;
  color: var(--volt);
  font-weight: 750;
}

.detail-hero { overflow: hidden; }
.detail-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 12px; background: var(--volt-soft); }
.motion-id { color: var(--volt); font-size: clamp(2.4rem, 12vw, 4.7rem); font-weight: 900; letter-spacing: -.06em; line-height: .9; }
.agenda-tag { max-width: 54%; color: var(--muted); font-size: .72rem; text-align: right; }
.detail-title { padding: 22px; }
.detail-title h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 5vw, 2.2rem); letter-spacing: -.025em; }
.meta-line { display: grid; grid-template-columns: repeat(2,1fr); border-top: 1px solid var(--line); }
.meta-line div { padding: 13px 12px 0 0; }
.meta-line span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .72rem; }
.meta-line strong { font-size: .9rem; }

.recommendation { margin-top: 12px; padding: 20px 22px; border-top: 1px solid var(--line); }
.recommendation-label { display: block; margin-bottom: 9px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.recommendation strong { display: block; font-size: clamp(1.2rem, 4vw, 1.55rem); line-height: 1.25; }
.recommendation.approve { color: var(--green); background: var(--green-soft); }
.recommendation.reject { color: var(--red); background: var(--red-soft); }
.recommendation.abstain { color: var(--amber); background: var(--amber-soft); }
.recommendation.neutral { color: var(--muted); background: #f1eef3; }

.detail-section { margin-top: 12px; padding: 22px; box-shadow: none; }
.detail-section h3 { margin-bottom: 9px; font-size: 1.12rem; }
.detail-section p { margin: 0; white-space: pre-line; color: #3f3844; line-height: 1.55; }
.detail-section + .detail-section { margin-top: 10px; }
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-button {
  border: 1px solid #cfc4d8;
  border-radius: 12px;
  padding: 9px 11px;
  background: white;
  color: var(--volt);
  font-weight: 800;
}
.related-button small { display: block; margin-top: 2px; color: var(--muted); font-size: .65rem; font-weight: 600; }
.external-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: var(--volt); font-weight: 800; }

.list-heading { margin-top: 14px; }
.filter-button { border: 1px solid var(--volt); border-radius: 999px; padding: 8px 13px; color: var(--volt); background: transparent; font-weight: 750; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 14px; padding: 16px; border-radius: 17px; background: var(--volt-soft); }
.filters input, .filters select { min-height: 46px; }
.motion-list { display: grid; gap: 8px; }
.motion-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 14px; }
.motion-row-id { color: var(--volt); font-weight: 900; }
.motion-row-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .95rem; line-height: 1.28; }
.motion-row-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.recommendation-dot { width: 11px; height: 11px; border-radius: 50%; background: #c7c0ca; }
.recommendation-dot.approve { background: var(--green); }
.recommendation-dot.reject { background: var(--red); }
.recommendation-dot.abstain { background: #d89b12; }
.empty-state { padding: 40px 12px; text-align: center; color: var(--muted); }

.content-card { margin-top: 14px; padding: clamp(22px, 5vw, 34px); }
.content-card p { color: var(--muted); line-height: 1.58; }
.info-grid { display: grid; grid-template-columns: repeat(3,1fr); margin: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-grid div { padding: 16px 12px 16px 0; }
.info-grid dt { color: var(--muted); font-size: .72rem; }
.info-grid dd { margin: 5px 0 0; font-weight: 800; }
.source-note { border-left: 4px solid var(--yellow); padding-left: 14px; }
.empty-detail { text-align: center; padding-block: 46px; }
.empty-detail .motion-id { font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(70px + env(safe-area-inset-bottom));
  padding: 7px max(16px, calc((100vw - 760px) / 2)) env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(15px);
}
.bottom-nav button { display: grid; place-items: center; align-content: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: .72rem; }
.bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bottom-nav button[aria-current="page"] { color: var(--volt); font-weight: 850; }

@media (max-width: 560px) {
  .hero { min-height: 200px; }
  .hero-inner { width: min(100% - 30px,760px); padding-top: 17px; }
  main { width: min(100% - 20px,760px); }
  .search-control { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: auto; }
  .filters { grid-template-columns: 1fr; }
  .motion-row { grid-template-columns: 54px 1fr auto; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid div + div { border-top: 1px solid var(--line); }
}

@media (min-width: 860px) {
  .hero { min-height: 238px; }
  .hero-inner { width: min(100% - 48px,880px); }
  main { width: min(100% - 48px,880px); }
  .intro-card { margin-top: -4px; }
  .bottom-nav { left: 50%; right: auto; width: 480px; transform: translateX(-50%); bottom: 18px; height: 64px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
