.parties-grid {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 600px) {
  .parties-grid {
    grid-template-columns: 1fr;
  }
}

.party-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #e0e0e0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.party-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: #6bbc8a;
}

.party-card-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #fff;
  padding: 12px;
  box-sizing: border-box;
}

.party-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  box-sizing: border-box;
}

.party-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.party-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.party-card-name {
  font-size: 16px;
  font-weight: 600;
}

.party-card-leader {
  font-size: 13px;
  color: #888;
}

.party-card-number {
  font-size: 12px;
  font-weight: 700;
  color: #6bbc8a;
  white-space: nowrap;
  flex-shrink: 0;
}

.party-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 640px;
  gap: 12px;
}

.party-title-row h2 {
  margin: 0;
}

.party-ballot-number {
  font-size: 14px;
  font-weight: 700;
  color: #6bbc8a;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Disclaimer */
.disclaimer {
  margin-top: 40px;
  padding: 12px 16px;
  font-size: 13px;
  color: #ff4d4d;
  border: 1px solid #ff4d4d33;
  border-radius: 8px;
  background: #ff4d4d0d;
  text-align: center;
  max-width: 640px;
  width: 100%;
}

/* Party detail page */
.party-hero-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
}

.party-hero-image {
  display: block;
  width: 100%;
  max-width: 640px;
  border-radius: 12px;
  object-fit: cover;
}

.party-hero-image--logo {
  height: 160px;
  max-width: 300px;
  object-fit: contain;
  background: #fff;
  padding: 16px;
  box-sizing: border-box;
}

.placeholder-text {
  text-align: center;
  color: #888;
  padding: 40px 0;
}

.stance-badges {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.stance-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-flag {
  font-size: 20px;
  line-height: 1;
}

.badge-flags-multi {
  font-size: 13px;
  line-height: 1;
  letter-spacing: -3px;
  padding-right: 3px;
}

.badge-face {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* Key people */
.key-people {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.key-person {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px 16px;
  flex: 1 1 180px;
}

.key-person-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  border: 2px solid #333;
}

.key-person-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.key-person-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.key-person-role {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}

.party-leader {
  font-size: 15px;
  color: #888;
}

.party-detail {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.party-detail h3 {
  font-size: 20px;
  color: #6bbc8a;
  margin-top: 8px;
}

.party-detail h4 {
  font-size: 18px;
  margin-top: 12px;
}

.party-detail h5 {
  font-size: 16px;
  color: #ccc;
  margin-top: 8px;
}

.party-detail p {
  font-size: 15px;
  line-height: 1.6;
  color: #ddd;
}

.party-detail ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.party-detail li {
  font-size: 14px;
  line-height: 1.5;
  color: #ccc;
}

.summary-list li {
  font-size: 15px;
  margin-bottom: 4px;
}

.section-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 8px 0;
}

/* Sources */
.sources {
  width: 100%;
  max-width: 640px;
  margin-top: 24px;
  padding: 16px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
}

.sources h4 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #e0e0e0;
}

.sources ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sources li {
  font-size: 13px;
  color: #888;
}

.sources a {
  color: #6bbc8a;
  text-decoration: none;
}

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

/* Leader rating bar */
.leader-rating {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leader-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leader-rating-label {
  font-size: 14px;
  color: #888;
}

.leader-rating-score {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
}

.leader-rating-bar {
  width: 100%;
  height: 14px;
  border-radius: 7px;
  background: #2a2a2a;
  border: 1px solid #444;
  overflow: hidden;
  position: relative;
}

.leader-rating-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  border-radius: 7px;
  background: linear-gradient(
    to right,
    #e53935 0%,
    #fb8c00 25%,
    #fdd835 50%,
    #6bbc8a 100%
  );
  clip-path: inset(0 40% 0 0 round 7px);
}

/* ── Comparison section ─────────────────────────────────────── */
.comparison-section {
  width: 100%;
  max-width: 960px;
  margin-top: 40px;
}

.comparison-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.comparison-subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
}

.comparison-note {
  max-width: 760px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #9a9a9a;
  margin-bottom: 18px;
}

.comparison-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  margin-bottom: 28px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.comparison-table thead tr {
  background: #1e1e1e;
}

.comparison-table th {
  padding: 12px 16px;
  text-align: center;
  color: #aaa;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 1px solid #2a2a2a;
}

.comparison-table th:first-child {
  text-align: left;
}

.comparison-table td {
  padding: 10px 16px;
  color: #ccc;
  border-bottom: 1px solid #1f1f1f;
  text-align: center;
  vertical-align: middle;
}

.comparison-table td:first-child {
  text-align: left;
  color: #aaa;
  font-size: 0.82rem;
}

.comparison-table tbody tr:hover {
  background: #1c1c1c;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.ct-row-total {
  background: #1a1a1a;
  font-weight: 700;
}

.ct-row-total td:first-child {
  color: #e0e0e0 !important;
  font-weight: 700;
}

.ct-party {
  display: block;
  font-size: 0.85rem;
  color: #e0e0e0;
  font-weight: 700;
}

.ct-party--winner {
  color: #6bbc8a;
}

.ct-party-sub {
  display: block;
  font-size: 0.72rem;
  color: #666;
  font-weight: 400;
  margin-top: 2px;
}

.ct-score {
  display: inline-block;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
}

.ct-score--high {
  background: rgba(107, 188, 138, 0.15);
  color: #6bbc8a;
}

.ct-score--mid {
  background: rgba(253, 216, 53, 0.12);
  color: #fdd835;
}

.ct-score--low {
  background: rgba(229, 57, 53, 0.13);
  color: #e57373;
}

/* Analysis cards */
.comparison-analysis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .comparison-analysis {
    grid-template-columns: 1fr;
  }
}

.ca-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ca-card--winner {
  border-color: #6bbc8a;
  background: #141e17;
}

.ca-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.ca-score {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ca-score--high {
  background: rgba(107, 188, 138, 0.18);
  color: #6bbc8a;
  border: 2px solid #6bbc8a;
}

.ca-score--mid {
  background: rgba(253, 216, 53, 0.15);
  color: #fdd835;
  border: 2px solid #fdd835;
}

.ca-score--low {
  background: rgba(229, 57, 53, 0.15);
  color: #e57373;
  border: 2px solid #e57373;
}

.ca-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e0e0e0;
}

.ca-party {
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

.ca-card p {
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
  margin: 0;
}

.ca-verdict {
  font-style: italic;
  color: #888 !important;
  border-top: 1px solid #2a2a2a;
  padding-top: 8px;
  margin-top: 4px !important;
}
