/* vaalilupaus.fi — Tyylit */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #dbeafe;
  --primary-mid: #3b82f6;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-sm: 0 1px 0 rgba(15,23,42,0.08);
  --shadow: 0 2px 0 rgba(15,23,42,0.1);
  --shadow-hover: 0 3px 0 rgba(15,23,42,0.14);
  --shadow-blue: 0 2px 0 rgba(29,78,216,0.3);
  --radius: 0px;
  --radius-sm: 0px;
  --radius-xs: 0px;
  --max-width: 1100px;
  --transition: 0.18s ease;

  /* Puoluevärit */
  --sdp: #E11931;
  --kok: #006288;
  --ps: #D4A000;
  --kesk: #00A651;
  --vihr: #4CAF50;
  --vas: #CC0000;
  --rkp: #D4A000;
  --kd: #1C408A;
  --liik: #00B7E1;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
  background: #0f172a;
  color: white;
  padding: 2.5rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
  border-bottom: 3px solid var(--primary);
}

.site-header::before {
  display: none;
}

.site-header::after {
  display: none;
}

.header-inner {
  position: relative;
  z-index: 1;
}

.site-header h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.site-header h1 .accent {
  color: #fbbf24;
}

.site-header .tagline {
  font-size: 1.1rem;
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.header-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.header-badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
}

/* === VIEW TOGGLE === */
.view-toggle {
  display: flex;
  gap: 2px;
  margin-bottom: 1.25rem;
  background: var(--border);
  border: 1px solid var(--border);
  width: fit-content;
}

.view-btn {
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  letter-spacing: -0.01em;
}

.view-btn.active {
  background: var(--primary);
  color: #fff;
}

.view-btn:not(.active):hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* === STATS NÄKYMÄ === */
.stats-section {
  margin-bottom: 2rem;
}

.stats-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stats-cell {
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stats-cell-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stats-cell-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.stats-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* === PUOLUEKOHTAISET KORTIT === */
.party-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.party-stat-card {
  background: var(--bg-card);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.party-stat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.party-stat-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.party-stat-total {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.party-stack-bar {
  display: flex;
  height: 8px;
  background: var(--border);
  overflow: hidden;
  gap: 1px;
}

.party-stack-segment {
  height: 100%;
  min-width: 2px;
  transition: width 0.3s ease;
}

.party-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.party-status-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.party-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.party-status-label {
  flex: 1;
  color: var(--text-secondary);
}

.party-status-count {
  font-weight: 700;
  color: var(--text);
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  align-items: center;
  gap: 0.75rem;
}

.bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: var(--border);
  height: 18px;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}

.bar-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}

/* === MAIN === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* === STATS === */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 1.5rem;
  margin-top: 0;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-card {
  background: var(--bg-card);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: background var(--transition);
}

.stat-card:hover {
  background: #f8faff;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  display: block;
  line-height: 1;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* === LEGAL BANNER === */
.legal-banner {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #0c4a6e;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.legal-banner .banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.legal-banner strong {
  font-weight: 700;
  color: #0369a1;
}

/* === FILTERS === */
.filters-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.search-box {
  position: relative;
  margin-bottom: 1.1rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.08);
  background: white;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.filter-group {
  margin-bottom: 0.85rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  min-width: 48px;
}

.filter-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.3rem 0.7rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  color: var(--text-secondary);
  line-height: 1.4;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-blue);
}

.chip[data-party] {
  position: relative;
  padding-left: 1.65rem;
}

.chip[data-party]::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.chip[data-party="sdp"]::before { background: var(--sdp); }
.chip[data-party="kok"]::before { background: var(--kok); }
.chip[data-party="ps"]::before  { background: var(--ps); }
.chip[data-party="kesk"]::before { background: var(--kesk); }
.chip[data-party="vihr"]::before { background: var(--vihr); }
.chip[data-party="vas"]::before  { background: var(--vas); }
.chip[data-party="rkp"]::before  { background: var(--rkp); }
.chip[data-party="kd"]::before   { background: var(--kd); }
.chip[data-party="liik"]::before { background: var(--liik); }

/* === RESULTS TOOLBAR === */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.results-count-text strong {
  color: var(--text);
  font-weight: 700;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition);
  font-weight: 500;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* === PROMISES LIST === */
.promises-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.promise-card {
  background: var(--bg-card);
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  transition: border-left-color var(--transition), background var(--transition);
  cursor: default;
  position: relative;
}

.promise-card:hover {
  background: #fafcff;
}

.promise-card[data-party="sdp"] { border-left-color: var(--sdp); }
.promise-card[data-party="kok"] { border-left-color: var(--kok); }
.promise-card[data-party="ps"]  { border-left-color: var(--ps); }
.promise-card[data-party="kesk"] { border-left-color: var(--kesk); }
.promise-card[data-party="vihr"] { border-left-color: var(--vihr); }
.promise-card[data-party="vas"]  { border-left-color: var(--vas); }
.promise-card[data-party="rkp"]  { border-left-color: var(--rkp); }
.promise-card[data-party="kd"]   { border-left-color: var(--kd); }
.promise-card[data-party="liik"] { border-left-color: var(--liik); }

.promise-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.promise-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.promise-category {
  font-size: 0.72rem;
  padding: 0.22rem 0.65rem;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.promise-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

/* Poliitikko-linkki kortissa */
.promise-meta .politician-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  padding: 0;
  transition: color var(--transition);
}

.promise-meta .politician-link:hover {
  color: var(--primary);
}

.promise-party-badge {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  color: white;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.promise-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.promise-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.promise-source {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.promise-source a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.promise-source a:hover {
  text-decoration: underline;
}

.promise-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  padding: 0.18rem 0.55rem;
  background: var(--bg);
  border-radius: 20px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* === STATUS BADGE === */
.promise-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.promise-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-lupaus {
  background: #dbeafe;
  color: #1e40af;
}
.status-lupaus::before { background: #3b82f6; }

.status-tehty {
  background: #dcfce7;
  color: #166534;
}
.status-tehty::before { background: #22c55e; }

.status-rikottu {
  background: #fee2e2;
  color: #991b1b;
}
.status-rikottu::before { background: #ef4444; }

.status-kesken {
  background: #fef3c7;
  color: #92400e;
}
.status-kesken::before { background: #f59e0b; }

/* === ELECTION BADGE === */
.promise-election {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid var(--border);
  font-weight: 500;
}

/* === LEVEL BADGE (henkilö / puolue) === */
.promise-level {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.promise-level--henkilo {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.promise-level--puolue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* === NO RESULTS === */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.no-results .emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

.no-results h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1.15rem;
}

.no-results p {
  font-size: 0.9rem;
}

/* === INFO SECTION === */
.info-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-top: 2.5rem;
  border: 1px solid var(--border);
}

.info-section h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.info-card {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.info-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === FOOTER === */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  line-height: 1.7;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* === MODAL === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(15,23,42,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-dialog--wide {
  max-width: 760px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.modal-close-btn {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-weight: 400;
}

.modal-close-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* Promise detail modal */
.modal-promise-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.modal-promise-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  padding-right: 2.5rem;
  letter-spacing: -0.02em;
}

.modal-politician-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.politician-link {
  background: none;
  border: none;
  padding: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}

.politician-link:hover {
  color: var(--primary-dark);
}

.modal-category-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-details-text {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.modal-source-box {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.modal-source-box a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.modal-source-box a:hover {
  text-decoration: underline;
}

/* Politician profile modal */
.pol-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-right: 2.5rem;
}

.pol-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-mid), var(--primary-dark));
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-blue);
}

.pol-info h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.pol-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.pol-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.pol-promises-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pol-promise-item {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
}

.pol-promise-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  background: #fafcff;
}

.pol-promise-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.pol-promise-text {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.pol-promise-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.pol-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* === LOADING === */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .site-header {
    padding: 2.5rem 1rem 3.5rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .site-header .tagline {
    font-size: 0.95rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: -1rem;
  }

  .stat-card .stat-number {
    font-size: 1.6rem;
  }

  .promise-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-content {
    padding: 1rem 1rem 2.5rem;
  }

  .info-section {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 2rem 1rem 3rem;
  }

  .site-header h1 {
    font-size: 1.65rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .promise-card {
    padding: 1rem 1.1rem;
  }

  .modal-dialog {
    padding: 1.5rem;
    max-height: 95vh;
  }
}

/* === Puolueohjelmat-näkymä === */
.prog-election-section {
  margin-bottom: 2.5rem;
}

.prog-election-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.prog-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.prog-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.prog-party-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.prog-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.prog-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.prog-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.prog-role {
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-secondary);
  text-align: right;
}

.prog-source-link {
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.prog-source-link:hover {
  text-decoration: underline;
}

.prog-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
}

.prog-status-chip {
  font-weight: 600;
}

.prog-total {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.prog-details {
  margin-top: 0.25rem;
}

.prog-details summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0.3rem 0;
  list-style: none;
  user-select: none;
}

.prog-details summary::-webkit-details-marker { display: none; }
.prog-details summary::before { content: '▶ '; font-size: 0.65rem; }
.prog-details[open] summary::before { content: '▼ '; }

.prog-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.prog-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.prog-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.prog-item-promise {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.prog-item-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

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