:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --surface-elevated: #FFFFFF;
  --ink: #0F172A;
  --ink-secondary: #334155;
  --ink-muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --brand: #E11D48;
  --brand-dark: #BE123C;
  --brand-soft: #FFF1F2;
  --navy: #0F172A;
  --navy-soft: #EEF2FF;
  --green: #059669;
  --green-soft: #ECFDF5;
  --green-border: #A7F3D0;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --red-border: #FECACA;
  --amber: #D97706;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;
  --blue: #2563EB;
  --blue-soft: #EFF6FF;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.12);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
}

a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==================== MINIMAL TOP HEADER & STICKY PROGRESS BAR ==================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.top-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 6px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-btn {
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.brand-logo-sm {
  height: 32px;
  width: auto;
  display: block;
}

.header-progress-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.progress-status-text {
  font-size: 0.76rem;
  color: var(--ink-muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-status-text strong {
  color: var(--ink);
}

.progress-counter-badge {
  font-weight: 900;
  font-size: 0.76rem;
  color: var(--navy);
  background: #E2E8F0;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Progress Dock — Compact Always Visible */
.progress-dock {
  max-width: 960px;
  margin: 0 auto;
  padding: 2px 16px 8px;
}

.progress-track-wrap {
  position: relative;
  padding-bottom: 15px;
}

.progress-track {
  height: 7px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0F172A 0%, #E11D48 100%);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-markers {
  position: relative;
  height: 15px;
  margin-top: 2px;
}

.progress-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
  pointer-events: none;
}

.progress-marker::before {
  content: "";
  width: 2px;
  height: 6px;
  background: #94A3B8;
  margin-top: -9px;
  margin-bottom: 2px;
  border-radius: 2px;
}

.progress-marker.reached {
  color: var(--green);
}

.progress-marker.reached::before {
  background: var(--green);
  width: 3px;
}

.progress-marker.active-target {
  color: var(--brand-dark);
  font-weight: 800;
}

.progress-marker.active-target::before {
  background: var(--brand);
  width: 3px;
  height: 8px;
}

.progress-marker.marker-end {
  transform: translateX(-95%);
}

.progress-adaptive-note {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #92400E;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: 8px;
  padding: 3px 9px;
}

/* ==================== MAIN VIEWPORT & TOP STEP NAVIGATION ==================== */
.main-view {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

.step-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.top-nav-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.14s ease;
  white-space: nowrap;
}

.top-nav-btn:hover:not(:disabled) {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.top-nav-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.top-nav-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  box-shadow: none;
}

.top-nav-btn.top-nav-primary,
.top-nav-btn.top-nav-next.is-ready {
  background: var(--navy);
  color: #FFFFFF;
  border-color: var(--navy);
}

.top-nav-btn.top-nav-primary:hover:not(:disabled),
.top-nav-btn.top-nav-next.is-ready:hover:not(:disabled) {
  background: #1E293B;
}

.top-nav-btn.top-nav-results {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: #FDA4AF;
}

.top-nav-btn.top-nav-results:hover {
  background: #FFE4E6;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.card + .card {
  margin-top: 18px;
}

/* ==================== WELCOME SCREEN ==================== */
.hero-card {
  text-align: center;
  padding: 32px 24px 28px;
  position: relative;
  overflow: hidden;
}

.hero-tricolor {
  height: 5px;
  width: 110px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #009246 0% 33.3%, #E2E8F0 33.3% 66.6%, #CE2B37 66.6% 100%);
}

.hero-logo {
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}

.hero-title {
  font-size: clamp(1.45rem, 3.6vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0 0 12px;
  color: var(--ink);
}

.hero-subtitle {
  font-size: 1.02rem;
  color: var(--ink-secondary);
  max-width: 650px;
  margin: 0 auto 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 14px 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #BE123C 0%, #9F1239 100%);
}

.btn-navy {
  background: var(--navy);
  color: #FFFFFF;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.btn-navy:hover {
  background: #1E293B;
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: #E2E8F0;
}

.btn-danger {
  background: #FFF1F2;
  color: #BE123C;
  border-color: #FECDD3;
}

.btn-danger:hover {
  background: #FFE4E6;
}

.btn-sm {
  font-size: 0.84rem;
  padding: 9px 14px;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.trust-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
}

.trust-box-icon {
  font-size: 1.3rem;
  margin-bottom: 6px;
  display: block;
}

.trust-box h3 {
  font-size: 0.92rem;
  font-weight: 800;
  margin: 0 0 5px;
  color: var(--ink);
}

.trust-box p {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.45;
}

/* ==================== STEP 2: OPTIONAL PAST VOTE & SYMPATHY RANKING ==================== */
.section-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #FECDD3;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.step-title {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.step-desc {
  font-size: 0.94rem;
  color: var(--ink-secondary);
  margin: 0 0 18px;
}

.party-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.party-select-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.party-select-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
}

.party-select-chip.selected {
  border-color: var(--navy);
  background: var(--navy-soft);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.party-badge-dot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 900;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.party-chip-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.party-chip-sub {
  font-size: 0.72rem;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

/* Sympathy Ranker */
.sympathy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.sympathy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 13px;
}

.sympathy-item.ranked {
  background: #FFFFFF;
  border-color: #94A3B8;
}

.sympathy-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #FFF;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-number.unranked {
  background: #E2E8F0;
  color: var(--ink-muted);
}

.sympathy-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-btn {
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-btn:hover:not(:disabled) {
  background: #E2E8F0;
}

.mini-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ==================== STEP 3: TONE SELECTION ==================== */
.tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.tone-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tone-card:hover {
  border-color: #94A3B8;
  transform: translateY(-2px);
}

.tone-card.selected {
  border-color: var(--brand);
  background: #FFF9FA;
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.12);
}

.tone-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.tone-card h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  font-weight: 900;
}

.tone-card p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.tone-example {
  background: var(--surface-alt);
  border-left: 3px solid var(--navy);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  font-style: italic;
}

/* ==================== STEP 4: QUESTION SCREEN ==================== */
@keyframes quizCardSlideIn {
  0% {
    opacity: 0.35;
    transform: translateX(14px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.quiz-card-enter {
  animation: quizCardSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.q-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.q-big-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.q-big-word {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.q-big-number {
  font-size: clamp(2.1rem, 6.8vw, 2.75rem);
  font-weight: 900;
  line-height: 0.92;
  color: var(--brand);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.q-big-goal {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.q-meta-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--navy-soft);
  color: #1E3A8A;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
}

.tone-toggle-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-secondary);
  cursor: pointer;
}

.tone-toggle-btn:hover {
  background: var(--border);
}

.q-dossier-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.q-text {
  font-size: clamp(1.12rem, 2.7vw, 1.44rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--ink);
}

/* ==================== 5 HORIZONTAL COLORED ANSWER BUTTONS (LEFT NO -> RIGHT SI) ==================== */
.answer-block {
  margin: 6px 0 18px;
}

.answer-scale-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 800;
  margin-bottom: 7px;
  padding: 0 2px;
}

.answer-scale-legend .scale-left {
  color: #B91C1C;
}

.answer-scale-legend .scale-right {
  color: #15803D;
}

.answer-row-horizontal {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.answer-horiz-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 82px;
  padding: 12px 6px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.15s ease, opacity 0.16s ease, filter 0.14s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.answer-horiz-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.answer-horiz-btn:active {
  transform: scale(0.96);
}

/* 5 Distinct Colors Always Visible BEFORE Selection: Rosso, Arancione, Grigio, Verdino, Verde Scuro */
.answer-horiz-btn.choice-color-rosso {
  background: #DC2626;
  border-color: #991B1B;
  color: #FFFFFF;
  box-shadow: 0 3px 0 #991B1B;
}

.answer-horiz-btn.choice-color-arancione {
  background: #FB923C;
  border-color: #C2410C;
  color: #271003;
  box-shadow: 0 3px 0 #C2410C;
}

.answer-horiz-btn.choice-color-grigio {
  background: #CBD5E1;
  border-color: #64748B;
  color: #0F172A;
  box-shadow: 0 3px 0 #64748B;
}

.answer-horiz-btn.choice-color-verdino {
  background: #86EFAC;
  border-color: #16A34A;
  color: #052E16;
  box-shadow: 0 3px 0 #16A34A;
}

.answer-horiz-btn.choice-color-verde-scuro {
  background: #15803D;
  border-color: #14532D;
  color: #FFFFFF;
  box-shadow: 0 3px 0 #14532D;
}

.answer-horiz-main {
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
  display: block;
}

.answer-horiz-sub {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 4px;
  opacity: 0.95;
  display: block;
  overflow-wrap: anywhere;
}

.answer-check-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0F172A;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.32);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.answer-row-horizontal.has-selection .answer-horiz-btn:not(.selected) {
  opacity: 0.38;
  transform: scale(0.97);
}

.answer-row-horizontal.has-selection .answer-horiz-btn:not(.selected):hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.answer-horiz-btn.selected {
  opacity: 1;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 5px #0F172A !important;
  z-index: 2;
}

.answer-horiz-btn.selected .answer-check-badge {
  opacity: 1;
  transform: scale(1);
}

@keyframes btnAnsweredPop {
  0% { transform: scale(0.95); }
  55% { transform: translateY(-3px) scale(1.06); }
  100% { transform: translateY(-2px) scale(1.03); }
}

.answer-horiz-btn.just-answered {
  animation: btnAnsweredPop 0.24s ease-out forwards;
}

/* Clear Feedback Banner When Answer Is Pressed & Moving to Next Question */
.answer-feedback-banner {
  display: none;
  margin-top: 11px;
  border-radius: 12px;
  overflow: hidden;
}

.answer-feedback-banner.visible {
  display: block;
}

.answer-feedback-banner.saved-static {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.answer-feedback-banner.animating {
  background: #0F172A;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.answer-feedback-text {
  padding: 9px 13px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.answer-feedback-banner.animating .answer-feedback-text strong {
  color: #4ADE80;
}

.answer-feedback-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  display: none;
}

.answer-feedback-banner.animating .answer-feedback-bar {
  display: block;
}

@keyframes feedbackSweep {
  0% { width: 0%; }
  100% { width: 100%; }
}

.answer-feedback-banner.animating .answer-feedback-bar-fill {
  height: 100%;
  background: #4ADE80;
  animation: feedbackSweep 0.52s linear forwards;
}

/* Context & Pro/Con Section Below Answer Row */
.q-context-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

.q-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.q-context-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.btn-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-soft);
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-details:hover {
  background: #DBEAFE;
}

.pro-con-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.reasons-box {
  border-radius: 13px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

.reasons-pro {
  background: var(--green-soft);
  border-color: var(--green-border);
}

.reasons-con {
  background: var(--red-soft);
  border-color: var(--red-border);
}

.reasons-box h4 {
  margin: 0 0 6px;
  font-size: 0.83rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reasons-pro h4 {
  color: #065F46;
}

.reasons-con h4 {
  color: #991B1B;
}

.reasons-box ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.81rem;
  color: var(--ink-secondary);
}

.reasons-box li + li {
  margin-top: 4px;
}

/* Rubric Browser List Item */
.rubric-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.rubric-item-btn:hover {
  border-color: #94A3B8;
  background: var(--surface-alt);
}

.q-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ==================== DOSSIER DETAILS SCREEN ==================== */
.details-party-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.party-pos-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--surface-alt);
}

.party-pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.party-pos-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.94rem;
}

.cat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.cat-A { background: #DBEAFE; color: #1E40AF; }
.cat-B { background: #E0E7FF; color: #3730A3; }
.cat-C { background: #FEF3C7; color: #92400E; }
.cat-D { background: #F1F5F9; color: #475569; }

.stance-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.stance-pos { background: #DCFCE7; color: #166534; }
.stance-neg { background: #FEE2E2; color: #991B1B; }
.stance-mid { background: #F1F5F9; color: #334155; }

.party-pos-body {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==================== RESULTS SCREEN ==================== */
.winner-hero {
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  background: linear-gradient(145deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.winner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #F8FAFC;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.winner-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.winner-party-info {
  flex: 1;
  min-width: 220px;
}

.winner-party-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.winner-badge-lg {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.winner-name {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}

.winner-leader {
  font-size: 0.88rem;
  color: #CBD5E1;
  margin-top: 3px;
}

.winner-tagline {
  font-size: 0.94rem;
  color: #E2E8F0;
  margin: 10px 0 0;
}

.winner-score-ring {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  padding: 16px 22px;
  text-align: center;
  min-width: 140px;
}

.winner-pct {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
  color: #4ADE80;
}

.winner-pct-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #CBD5E1;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Continue / Deepen Prompt Card */
.deepen-card {
  background: linear-gradient(135deg, #FFF1F2 0%, #FFFBEB 100%);
  border: 2px solid #FDA4AF;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-top: 18px;
}

.deepen-card h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 900;
  color: #881337;
}

.deepen-card p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: #4C0519;
}

.theme-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.theme-quick-btn {
  background: #FFFFFF;
  border: 1px solid #FECDD3;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.theme-quick-btn:hover {
  background: #FFE4E6;
}

/* Full 14-Party Ranking */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.ranking-row {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.14s ease;
}

.ranking-row:hover {
  border-color: #94A3B8;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.ranking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.ranking-party-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ranking-pos {
  width: 26px;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--ink-muted);
  text-align: center;
  flex-shrink: 0;
}

.ranking-pos.top3 {
  color: var(--brand-dark);
}

.ranking-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
}

.ranking-leader {
  font-size: 0.76rem;
  color: var(--ink-muted);
  display: block;
}

.ranking-pct {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.ranking-bar-bg {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.ranking-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Theme Affinity Cards */
.themes-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.theme-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.theme-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.theme-card-title {
  font-weight: 900;
  font-size: 0.96rem;
  margin: 0;
}

.theme-winner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.match-list-block {
  font-size: 0.81rem;
  margin-bottom: 8px;
}

.match-list-block strong {
  display: block;
  margin-bottom: 3px;
}

.match-common strong { color: #065F46; }
.match-against strong { color: #991B1B; }

.match-list-block ul {
  margin: 0;
  padding-left: 16px;
  color: var(--ink-secondary);
}

/* Social Share Preview Section */
.share-mode-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.share-mode-tab {
  padding: 13px 15px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-alt);
  cursor: pointer;
  text-align: left;
  font-weight: 800;
  font-size: 0.88rem;
}

.share-mode-tab.active {
  border-color: var(--navy);
  background: var(--navy-soft);
}

.share-mode-tab span {
  display: block;
  font-weight: 500;
  font-size: 0.77rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.share-preview-box {
  background: #0F172A;
  color: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}

.share-preview-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  margin-bottom: 8px;
}

.share-preview-text {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}

.share-canvas-wrap {
  margin-top: 12px;
  text-align: center;
}

.share-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: #0F172A;
  color: #CBD5E1;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.footer-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-pillar strong {
  color: #FFFFFF;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 5px;
}

.footer-pillar p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.48;
  color: #94A3B8;
}

.footer-pillar a {
  color: #FDA4AF;
}

.footer-pillar code {
  color: #E2E8F0;
  font-size: 0.78rem;
}

.footer-legal-bar {
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  color: #94A3B8;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #E2E8F0;
  text-decoration: underline;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.link-btn.danger-text {
  color: #FDA4AF;
}

/* ==================== MODALS & BOTTOM SHEETS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.close-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.legal-section h3 {
  font-size: 0.96rem;
  margin: 16px 0 6px;
  color: var(--ink);
}

.legal-section p, .legal-section li {
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.52;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  max-width: 92vw;
  text-align: center;
}

/* ==================== MOBILE NATIVE PHONE-APP FEEL ==================== */
@media (max-width: 680px) {
  .top-header-inner {
    padding: 5px 12px 3px;
  }

  .brand-logo-sm {
    height: 27px;
  }

  .progress-status-text {
    font-size: 0.7rem;
  }

  .progress-dock {
    padding: 2px 12px 6px;
  }

  .progress-marker {
    font-size: 0.58rem;
  }

  .main-view {
    padding: 8px 10px 24px;
  }

  .step-top-nav {
    margin-bottom: 8px;
    gap: 6px;
  }

  .top-nav-btn {
    padding: 7px 12px;
    font-size: 0.81rem;
    border-radius: 10px;
  }

  .card {
    padding: 15px 13px;
    border-radius: 18px;
  }

  .q-header-row {
    padding-bottom: 8px;
    margin-bottom: 8px;
    gap: 6px;
  }

  .q-big-word {
    font-size: 0.74rem;
  }

  .q-big-number {
    font-size: 2.05rem;
  }

  .q-big-goal {
    font-size: 0.88rem;
  }

  .theme-pill {
    font-size: 0.71rem;
    padding: 4px 8px;
  }

  .tone-toggle-btn {
    font-size: 0.71rem;
    padding: 4px 8px;
  }

  .q-dossier-label {
    font-size: 0.74rem;
  }

  .q-text {
    font-size: 1.08rem;
    line-height: 1.28;
    margin-bottom: 12px;
  }

  .answer-row-horizontal {
    gap: 5px;
  }

  .answer-horiz-btn {
    min-height: 70px;
    padding: 9px 3px;
    border-radius: 11px;
  }

  .answer-horiz-main {
    font-size: 0.92rem;
  }

  .answer-horiz-sub {
    font-size: 0.62rem;
    margin-top: 3px;
    letter-spacing: -0.015em;
  }

  .answer-check-badge {
    width: 19px;
    height: 19px;
    font-size: 0.65rem;
    top: -6px;
    right: -4px;
  }

  .hero-card {
    padding: 20px 14px;
  }

  .hero-logo {
    max-width: 210px;
  }

  .trust-grid {
    gap: 10px;
    margin-top: 18px;
  }

  .trust-box {
    padding: 12px 13px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .party-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .pro-con-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reasons-box {
    padding: 10px 12px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    border-radius: 24px 24px 0 0;
    max-height: 91dvh;
    padding: 18px 15px calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .winner-main-row {
    flex-direction: column;
    align-items: stretch;
  }

  .winner-score-ring {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
  }
}

@media (max-width: 370px) {
  .progress-status-text {
    display: none;
  }
  .answer-row-horizontal {
    gap: 4px;
  }
  .answer-horiz-sub {
    font-size: 0.58rem;
  }
}
