:root {
  --blue: #0f579f;
  --blue-dark: #083a6d;
  --ink: #111827;
  --muted: #687386;
  --line: #d8e0ea;
  --surface: #ffffff;
  --backdrop: #eef3f8;
  --favor: #0f579f;
  --against: #111827;
  --accepted: #198754;
  --rejected: #c62828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--backdrop);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: #f8fbff;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.party-mark {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.eyebrow,
.label,
.source-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

h4 {
  margin-bottom: 10px;
  font-size: 15px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 14px;
}

.tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.panel {
  display: none;
  padding: 18px;
}

.active-panel {
  display: block;
}

.section-title {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.section-count {
  width: max-content;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.agenda-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-section,
.result-card,
.vote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 87, 159, 0.08);
}

.agenda-section {
  padding: 14px;
}

.agenda-section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.agenda-section-head strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.agenda-section-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 800;
  white-space: nowrap;
}

.agenda-blocks {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.agenda-block h3 {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 15px;
  line-height: 1.25;
}

.agenda-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.agenda-block li {
  color: #354054;
  font-size: 14px;
  line-height: 1.4;
}

.source-note {
  margin-top: 14px;
  line-height: 1.45;
}

.result-card {
  padding: 14px;
  margin-bottom: 16px;
}

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

.vote-card,
.party-card {
  padding: 14px;
}

.vote-card-header {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.vote-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.vote-card p {
  margin: 0;
  color: #354054;
  font-size: 14px;
  line-height: 1.45;
}

.result-card p {
  margin: 10px 0 0;
  color: #354054;
  line-height: 1.45;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f1fa;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 14px;
}

.result-pill.accepted {
  background: #dff4e8;
  color: #0f5f37;
  border: 1px solid #9bd3b5;
}

.result-pill.rejected {
  background: #fde2e2;
  color: #9f1d1d;
  border: 1px solid #f1a6a6;
}

.result-pill.unknown {
  background: #eef2f7;
  color: #526176;
  border: 1px solid #d8e0ea;
}

.result-pill.neutral {
  background: #fff4d8;
  color: #76520b;
  border: 1px solid #e5c36d;
}

.sequence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.data-state {
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  background: #eef6ff;
  color: var(--blue-dark) !important;
  font-weight: 700;
}

.chart-row {
  display: grid;
  grid-template-columns: 152px 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
  margin-top: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pie {
  width: 152px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid #f0f4f9;
}

.pie.pending {
  background:
    repeating-conic-gradient(
      from -12deg,
      #d9e4f0 0deg 18deg,
      #ffffff 18deg 36deg
    );
  position: relative;
}

.pie.pending::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fbfdff;
  border: 1px solid var(--line);
}

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

.count-summary {
  display: grid;
  gap: 4px;
  padding-bottom: 4px;
}

.count-summary strong {
  color: var(--blue-dark);
  font-size: 22px;
  line-height: 1.05;
}

.count-summary span {
  color: #354054;
  font-size: 18px;
  font-weight: 700;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.in-favor {
  background: var(--favor);
}

.dot.against {
  background: var(--against);
}

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

.party-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 87, 159, 0.08);
}

.party-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.party-card p {
  margin: 0;
  color: #354054;
  font-size: 14px;
  line-height: 1.45;
}

.party-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.party-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.party-column.for {
  border-left: 4px solid var(--favor);
}

.party-column.against {
  border-left: 4px solid var(--rejected);
}

.party-column h4 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.2;
}

.party-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.party-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.party-chip.own-party {
  width: 36px;
  min-width: 36px;
  padding: 2px 6px;
}

.party-chip.own-party img {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.party-column.for .party-chip {
  background: #dff4e8;
  color: #0f5f37;
  border: 1px solid #9bd3b5;
}

.party-column.against .party-chip {
  background: #fde2e2;
  color: #9f1d1d;
  border: 1px solid #f1a6a6;
}

.party-empty,
.party-note {
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  background: #eef6ff;
  color: var(--blue-dark) !important;
  font-weight: 700;
}

@media (max-width: 360px) {
  .chart-row,
  .party-columns {
    grid-template-columns: 1fr;
  }

  .pie {
    justify-self: center;
  }
}
