:root {
  --accent: #083048;
  --accent-2: #0890c8;
  --accent-light: #80d0f0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #0f1c2b;
  --muted: #5b6b7a;
  --border: #e5eaf0;
  --shadow-sm: 0 1px 2px rgba(8, 48, 72, 0.04), 0 1px 3px rgba(8, 48, 72, 0.06);
  --shadow-md: 0 4px 12px rgba(8, 48, 72, 0.06), 0 2px 4px rgba(8, 48, 72, 0.04);
  --shadow-lg: 0 12px 32px rgba(8, 48, 72, 0.10);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 780px; margin: 0 auto; padding: 20px 16px; }

/* ---------- Header ---------- */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255, 255, 255, 0.92);
}
header .container { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em;
}
.brand img { height: 32px; width: auto; display: block; }
.brand .sep { color: var(--border); font-weight: 400; margin: 0 2px; }
nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.who { color: var(--muted); font-size: 0.875rem; }
.linkbtn {
  background: none; border: none; color: var(--accent-2); cursor: pointer;
  padding: 6px 10px; font-size: 0.875rem; font-weight: 500;
  border-radius: 6px; transition: background 0.15s;
}
.linkbtn:hover { background: rgba(8, 144, 200, 0.08); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card.narrow { max-width: 420px; margin: 8vh auto; padding: 32px; box-shadow: var(--shadow-md); }

h1 { margin: 0 0 20px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 20px 0 8px; font-size: 1rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Forms ---------- */
label { display: block; margin: 14px 0 6px; font-size: 0.875rem; color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #9aa5b1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(8, 144, 200, 0.14);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); cursor: pointer;
  font-size: 0.95rem; font-family: inherit; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover { border-color: #cdd6e0; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(8, 48, 72, 0.15);
}
.btn.primary:hover { background: #0c405f; border-color: #0c405f; }
.btn.big { padding: 16px 28px; font-size: 1.05rem; font-weight: 600; border-radius: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Alerts / Toast ---------- */
.error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0;
  font-size: 0.9rem;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 100; font-size: 0.9rem; font-weight: 500;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.muted { color: var(--muted); }
.stats-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.stats-row > span {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; background: #f4f8fc; border-radius: 999px;
  font-size: 0.9rem; color: var(--muted);
}
.stats-row .stat-label { color: var(--muted); font-weight: 500; }
.stats-row strong { color: var(--accent); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------- Questions ---------- */
.question { padding: 16px 0; border-bottom: 1px solid var(--border); }
.question:last-child { border-bottom: none; }
.question > div:first-child { margin-bottom: 10px; font-size: 0.98rem; }
.question .opts { display: flex; flex-direction: column; gap: 4px; }
.question .opts label {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 10px 12px;
  color: var(--text); font-size: 0.95rem; font-weight: 400;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.question .opts label:hover { background: #f4f8fc; }
.question .opts label:has(input:checked) { background: rgba(8,144,200,0.08); border-color: var(--accent-2); }
.question input[type=radio], .question input[type=checkbox] { accent-color: var(--accent-2); width: 18px; height: 18px; margin: 0; }

.scale-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.scale-row label { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; min-width: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container { padding: 16px 12px; }
  .card { padding: 18px; border-radius: 12px; }
  .card.narrow { margin: 24px auto; padding: 24px; }
  h1 { font-size: 1.4rem; }
  header .container { padding: 10px 12px; }
  .brand img { height: 26px; }
  .brand { font-size: 0.9rem; gap: 6px; }
  .brand .sep { display: none; }
  .who { display: none; }
  nav { gap: 4px; }
  .btn { padding: 12px 18px; }
  .btn.big { width: 100%; padding: 16px 20px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .stats-row > span { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 380px) {
  .brand span, .brand .sep { display: none; }
}

/* ---------- Admin ---------- */
.admin-breadcrumb { margin: -8px 0 12px; font-size: 0.9rem; }
.admin-breadcrumb a { color: var(--muted); text-decoration: none; }
.admin-breadcrumb a:hover { color: var(--accent-2); }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { margin: 0; }

.admin-tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 8px; }
.tile {
  display: block; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-2); }
.tile-title { font-size: 1.1rem; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.tile-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.4; }

/* ---------- Forms — grid layout ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.form-grid label { margin: 8px 0 0; }
.form-grid .form-actions { grid-column: 1 / -1; margin-top: 8px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Users list ---------- */
.users-card { padding: 0; overflow: hidden; }
.users-list { display: flex; flex-direction: column; }
.user-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row.is-inactive { background: #fafbfc; }
.user-row.is-inactive .user-email { color: var(--muted); }
.user-row.is-me .user-email::after { content: ' (ty)'; color: var(--accent-2); font-size: 0.8em; font-weight: 400; }
.user-main { min-width: 0; }
.user-email { font-weight: 500; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; }
.user-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; font-size: 0.85rem; }
.user-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.user-actions .linkbtn { border: none; padding: 6px 10px; font-size: 0.85rem; }
.user-edit-panel, .user-password-panel { grid-column: 1 / -1; padding: 16px; background: #f8fafc; border-radius: var(--radius-sm); margin-top: 8px; }

.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: lowercase;
}
.role-admin { background: var(--accent); color: white; }
.role-reporter { background: rgba(8,144,200,0.12); color: var(--accent-2); }
.role-interviewer { background: #eef1f5; color: var(--muted); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 640px) {
  .user-row { grid-template-columns: 1fr; padding: 14px 16px; }
  .user-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Surveys list ---------- */
.surveys-card { padding: 0; overflow: hidden; }
.surveys-list { display: flex; flex-direction: column; }
.survey-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border);
  align-items: start;
}
.survey-row:last-child { border-bottom: none; }
.survey-row.is-active { background: linear-gradient(0deg, rgba(8,144,200,0.03), transparent); }
.survey-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.survey-title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.survey-title:hover { color: var(--accent-2); }
.survey-desc { margin-top: 4px; font-size: 0.9rem; line-height: 1.4; }
.survey-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.survey-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.survey-actions .linkbtn { border: none; padding: 6px 10px; font-size: 0.85rem; }
.survey-actions .act-delete { color: #b91c1c; }
.survey-actions .act-delete:hover { background: rgba(185, 28, 28, 0.08); }
.survey-actions .act-delete:disabled { color: var(--muted); opacity: 0.5; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: #eef2f6; border-radius: 999px; font-size: 0.8rem; color: var(--muted); }
.chip-num { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-plain { font-size: 0.8rem; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-active { background: rgba(16, 185, 129, 0.14); color: #047857; }

/* ---------- Survey edit ---------- */
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.items-list { display: flex; flex-direction: column; }
.item-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding: 16px 0; border-top: 1px solid var(--border);
  align-items: start;
}
.item-row:first-child { border-top: none; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.item-text { font-size: 0.98rem; line-height: 1.4; }
.item-opts { margin-top: 6px; font-size: 0.85rem; }
.item-actions { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.item-actions .linkbtn { border: none; padding: 6px 8px; font-size: 0.85rem; }
.item-actions .act-delete { color: #b91c1c; }
.item-actions .act-delete:hover { background: rgba(185, 28, 28, 0.08); }
.item-actions .linkbtn:disabled { opacity: 0.35; }
.item-edit-panel { grid-column: 1 / -1; padding: 16px; background: #f8fafc; border-radius: var(--radius-sm); margin-top: 8px; }

.add-panel { padding: 16px; background: #f8fafc; border-radius: var(--radius-sm); margin: 8px 0 16px; }

.type-badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; background: #eef1f5; color: var(--muted); }
.type-single { background: rgba(8,144,200,0.12); color: var(--accent-2); }
.type-multi { background: rgba(139,92,246,0.14); color: #6d28d9; }
.type-scale { background: rgba(245,158,11,0.16); color: #b45309; }
.type-text { background: #eef1f5; color: var(--muted); }
.type-number { background: rgba(16,185,129,0.14); color: #047857; }

.required-flag { font-size: 0.78rem; }
.meta-key { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8rem;
  padding: 1px 6px; background: #eef1f5; border-radius: 4px; }

/* ---------- Editor form ---------- */
.item-editor { display: flex; flex-direction: column; gap: 4px; }
.editor-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-row-2 label { margin-top: 8px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; color: var(--text); font-weight: 500; font-size: 0.9rem; }
.checkbox-line input { width: auto; }

.options-editor { margin-top: 8px; padding: 12px; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.opt-choices > label:first-child { margin-top: 0; }
.opt-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.opt-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; align-items: center; }
.opt-row input { padding: 8px 10px; font-size: 0.9rem; }
.opt-remove { color: #b91c1c; padding: 4px 8px; }
.opt-add { margin-top: 4px; padding: 6px 12px; font-size: 0.85rem; }
.opt-max { margin-top: 12px; }

@media (max-width: 640px) {
  .survey-row { grid-template-columns: 1fr; padding: 16px; }
  .survey-actions { justify-content: flex-start; }
  .item-row { grid-template-columns: 1fr; padding: 14px 0; }
  .item-actions { justify-content: flex-start; }
  .editor-row-2 { grid-template-columns: 1fr; }
  .opt-row { grid-template-columns: 1fr auto; }
  .opt-row input:first-child { grid-column: 1 / -1; }
}

/* ---------- Dashboard ---------- */
.inline-select { width: auto; padding: 8px 12px; font-size: 0.9rem; }
.footnote { font-size: 0.8rem; margin-top: 4px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  padding: 20px 24px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-value { font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.kpi-accent { background: linear-gradient(135deg, var(--accent) 0%, #0c405f 100%); border-color: var(--accent); }
.kpi.kpi-accent .kpi-label { color: rgba(255,255,255,0.75); }
.kpi.kpi-accent .kpi-value { color: white; }

/* Daily trend bars */
.daily-trend {
  display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px;
  height: 200px; align-items: end; margin-top: 8px;
}
.trend-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.trend-num { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 14px; }
.trend-bar { width: 100%; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity 0.15s; }
.trend-bar:hover { opacity: 0.85; }
.trend-label { font-size: 0.7rem; color: var(--muted); }

/* Hourly heatmap */
.heatmap { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; overflow-x: auto; }
.heat-header, .heat-row { display: grid; grid-template-columns: 32px repeat(24, 1fr); gap: 3px; align-items: center; min-width: 480px; }
.heat-dow-label { font-size: 0.75rem; color: var(--muted); text-align: right; padding-right: 6px; font-weight: 500; }
.heat-hour-label { font-size: 0.68rem; color: var(--muted); text-align: center; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; min-height: 16px; }
.heat-0 { background: #eef2f6; }
.heat-1 { background: rgba(8,144,200,0.20); }
.heat-2 { background: rgba(8,144,200,0.42); }
.heat-3 { background: rgba(8,144,200,0.68); }
.heat-4 { background: var(--accent-2); }
.heatmap-legend { margin-top: 12px; font-size: 0.82rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.heat-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }

/* Interviewers */
.interviewers-list { display: flex; flex-direction: column; }
.interviewer-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.95rem;
}
.interviewer-row:first-child { border-top: none; padding-top: 4px; }
.interviewer-name { font-weight: 500; }
.interviewer-count { display: flex; align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
.int-today { color: var(--accent-2); font-size: 0.85rem; font-weight: 600; }
.int-total strong { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

/* Demografie */
.demographics-list { display: grid; gap: 20px; }
.demo-card { padding: 4px 0; }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.demo-label { font-weight: 600; font-size: 0.98rem; }
.demo-count { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.demo-bars { display: flex; flex-direction: column; gap: 8px; }
.demo-bar-row { display: grid; grid-template-columns: 160px 1fr 100px; gap: 12px; align-items: center; font-size: 0.9rem; }
.dbr-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbr-track { height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.dbr-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; transition: width 0.3s; }
.dbr-num { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.dbr-num strong { color: var(--accent); }

@media (max-width: 640px) {
  .kpi-value { font-size: 1.9rem; }
  .kpi { padding: 16px 18px; }
  .daily-trend { gap: 3px; height: 140px; }
  .trend-num { font-size: 0.65rem; }
  .trend-label { font-size: 0.6rem; }
  .demo-bar-row { grid-template-columns: 1fr 80px; }
  .demo-bar-row .dbr-track { grid-column: 1 / -1; }
}




/* ---------- Report tabs (Přehled / Volební potenciál) ---------- */
.report-tabs {
  display: flex; gap: 0; margin: -8px 0 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.report-tabs a {
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  white-space: nowrap;
}
.report-tabs a:hover { color: var(--accent); }
.report-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent-2);
}

/* ---------- Voter Potential vote colors ---------- */
.v-yes-hard { --vc: #16a34a; }  /* určitě ano — sytá zelená */
.v-yes-soft { --vc: #86d1a5; }  /* spíše ano — světle zelená */
.v-no-soft  { --vc: #f4a462; }  /* spíše ne — oranžová */
.v-no-hard  { --vc: #dc2626; }  /* určitě ne — červená */

/* ---------- Aggregate cards ---------- */
.vp-aggregate {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px; margin: 8px 0 20px;
}
.agg-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.1));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.agg-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.agg-value { font-size: 2rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.agg-card.big .agg-value { font-size: 2.5rem; }
.agg-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.agg-yes { background: linear-gradient(135deg, #16a34a, #22c55e); color: white; border-color: transparent; }
.agg-yes .agg-label, .agg-yes .agg-sub, .agg-yes .agg-value { color: white; }

.agg-core { border-left: 4px solid #16a34a; }
.agg-persuadable { border-left: 4px solid #f59e0b; }
.agg-no { border-left: 4px solid #dc2626; }

/* ---------- Distribution bars (Q5 rozklad) ---------- */
.vp-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.vp-bar-row {
  display: grid; grid-template-columns: 130px 1fr 110px;
  align-items: center; gap: 12px;
}
.vpbr-label { font-size: 0.9rem; color: var(--text); }
.vpbr-track { background: var(--bg); border-radius: 6px; height: 20px; overflow: hidden; }
.vpbr-fill { height: 100%; background: var(--vc, var(--accent-2)); border-radius: 6px; transition: width 0.3s; }
.vpbr-num { text-align: right; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.vpbr-num strong { color: var(--text); }

.vp-qtext { font-size: 0.8rem; margin-top: 16px; font-style: italic; }

/* ---------- Trend (14 days stacked) ---------- */
.vp-trend {
  display: grid; grid-template-columns: repeat(14, 1fr);
  gap: 4px; height: 180px;
  align-items: end;
}
.vpt-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 3px; }
.vpt-num { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; height: 12px; }
.vpt-stack {
  width: 100%; min-height: 2px; display: flex; flex-direction: column;
  border-radius: 4px; overflow: hidden;
  align-self: flex-end;
  max-height: calc(100% - 30px);
}
.vpt-seg { width: 100%; background: var(--vc, var(--accent-2)); min-height: 1px; }
.vpt-label { font-size: 0.7rem; color: var(--muted); text-align: center; }

/* ---------- Transition matrix ---------- */
.matrix-wrap { overflow-x: auto; }
.matrix {
  width: 100%; border-collapse: separate; border-spacing: 3px;
  font-size: 0.85rem;
}
.matrix th, .matrix td { padding: 6px 8px; text-align: center; }
.matrix thead th {
  background: var(--bg); font-weight: 600; color: var(--text);
  border-radius: 6px;
  vertical-align: bottom;
}
.matrix .mx-corner { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.matrix .mx-past {
  text-align: left; background: var(--bg); border-radius: 6px;
  font-weight: 500; color: var(--text); min-width: 220px; padding: 8px 10px;
}
.matrix .mx-vote { position: relative; }
.matrix .mx-vote::before {
  content: ''; display: block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--vc); margin: 0 auto 4px;
}
.matrix .mx-cell {
  background: color-mix(in oklab, var(--vc) calc(var(--heat) * 100%), white);
  border-radius: 6px;
  min-width: 60px;
  color: var(--text);
}
.matrix .mx-cell .mx-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.matrix .mx-cell .mx-pct { font-size: 0.75rem; color: var(--muted); }
.matrix .mx-total {
  background: var(--bg); border-radius: 6px;
  font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.matrix .mx-share { background: transparent; }
.supp-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.85rem;
}
.supp-badge.supp-high { background: #16a34a; color: white; }
.supp-badge.supp-mid  { background: #fef3c7; color: #92400e; }
.supp-badge.supp-low  { background: #fee2e2; color: #991b1b; }

/* Fallback if color-mix unsupported */
@supports not (background: color-mix(in oklab, red 50%, white)) {
  .matrix .mx-cell { background: var(--vc); opacity: calc(0.2 + var(--heat) * 0.8); }
}

/* ---------- Persuasion window ---------- */
.pw-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pw-block {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.pw-block.pw-wide { grid-column: 1 / -1; }
.pw-title {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); font-weight: 600; margin-bottom: 10px;
}
.dbr-mini {
  display: grid; grid-template-columns: 180px 1fr 100px;
  gap: 10px; align-items: center; padding: 4px 0;
  font-size: 0.85rem;
}
.dbr-mini-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbr-mini-track { background: white; border-radius: 4px; height: 12px; overflow: hidden; }
.dbr-mini-fill { height: 100%; background: var(--accent-2); border-radius: 4px; }
.dbr-mini-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .vp-aggregate { grid-template-columns: 1fr 1fr; }
  .agg-card.big { grid-column: 1 / -1; }
  .pw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .vp-bar-row { grid-template-columns: 100px 1fr 80px; font-size: 0.8rem; }
  .vpbr-label { font-size: 0.8rem; }
  .vp-trend { height: 140px; }
  .vpt-num { font-size: 0.6rem; }
  .vpt-label { font-size: 0.6rem; }
  .matrix { font-size: 0.75rem; }
  .matrix .mx-past { min-width: 160px; font-size: 0.8rem; }
  .dbr-mini { grid-template-columns: 120px 1fr 80px; font-size: 0.8rem; }
  .agg-card { padding: 10px 12px; }
  .agg-value { font-size: 1.5rem; }
  .agg-card.big .agg-value { font-size: 1.8rem; }
}
