/* Micro-bar for key numbers */
.micro-bar {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}
.micro-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.micro-bar-left {
  background: #6366f1;
}
.micro-bar-right {
  background: #a21caf;
}
/* Modern Comparison Grid */
.comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Shared hover lift for cards */
.lift-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.lift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  border-color: #e2e8f0;
  background-color: #ffffff;
}

/* Simple tooltip for info dots */
.info-dot {
  position: relative;
}

.info-dot::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 25;
}

.info-dot::before {
  content: "";
  position: absolute;
  top: 102%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #0f172a;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 25;
}

.info-dot:hover::after,
.info-dot:hover::before {
  opacity: 1;
}

/* Section headers with modern styling */
.comparison-section-row {
  margin-top: 24px;
  padding-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid #f1f5f9;
}

/* Header row styling */
.compare-header {
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* The header row in HTML also has .comparison-row; ensure it stays a flex header
   (otherwise mobile grid/card rules can distort the area name layout). */
.compare-header.comparison-row {
  display: flex;
  grid-template-columns: unset;
  grid-template-areas: unset;
  padding: 0 0 12px 0;
  border-bottom: 2px solid #f1f5f9;
  background: #fff;
  border-radius: 0;
}

#badgeA, #badgeB {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Keep header visible while scrolling nerd mode */

.compare-header-wrapper {
  background: #fff;
  padding-top: 8px;
  padding-bottom: 4px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  margin-left: 16px;
  margin-right: 0;
  padding-right: 32px;
}

@media (max-width: 900px) {
  .compare-header-wrapper {
    margin-left: 0;
    margin-right: 0;
    padding-right: 0;
    box-shadow: none;
  }

  /* Remove the empty label column on mobile */
  .compare-header > div:first-child {
    display: none;
  }

  .compare-header {
    width: 100%;
    align-items: stretch;
  }

  /* Undo the card-like row styling for the header itself */
  .compare-header.comparison-row {
    background: transparent;
    border: 0;
    border-bottom: 2px solid #f1f5f9;
    padding: 0 0 12px 0;
  }

  .compare-header .area-col {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
  }

  .compare-header .area-col:nth-child(2) {
    padding-top: 0;
    border-top: 0;
  }

  .compare-header .area-name {
    font-size: 1.125rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .compare-header .area-meta {
    font-size: 0.875rem;
    line-height: 1.25;
  }
}

/* When header is inside grid, make it sticky */
.compare-header-wrapper.sticky-in-grid {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

/* Mobile nerd mode: turn the sticky header into a compact context bar */
@media (max-width: 900px) {
  .compare-header-wrapper.sticky-in-grid {
    top: 56px; /* leaves room for the sticky navbar */
    margin: 0;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
  }

  .compare-header-wrapper.sticky-in-grid::before {
    content: "Comparing";
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
  }

  .compare-header-wrapper.sticky-in-grid .compare-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 0;
    margin: 0;
    border-bottom: 0;
  }

  .compare-header-wrapper.sticky-in-grid .compare-header > div:first-child {
    display: none;
  }

  /* Hide extras in sticky context bar for clarity */
  .compare-header-wrapper.sticky-in-grid #badgeA,
  .compare-header-wrapper.sticky-in-grid #badgeB,
  .compare-header-wrapper.sticky-in-grid .area-meta,
  .compare-header-wrapper.sticky-in-grid #addFavoriteLeft,
  .compare-header-wrapper.sticky-in-grid #addFavoriteRight,
  .compare-header-wrapper.sticky-in-grid .mt-3 {
    display: none !important;
  }

  .compare-header-wrapper.sticky-in-grid .area-col {
    width: 100%;
    padding: 0;
    border: 0;
  }

  .compare-header-wrapper.sticky-in-grid .area-name {
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow-wrap: anywhere;
  }

  /* Give A/B subtle identity so the eye can track columns */
  .compare-header-wrapper.sticky-in-grid .area-col:nth-child(2) .area-name {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
  }

  .compare-header-wrapper.sticky-in-grid .area-col:nth-child(3) .area-name {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.12);
  }

  /* In nerd-mode rows, add A/B micro-labels above values */
  .comparison-grid.nerd-mode .comparison-row > .stat-value {
    position: relative;
    padding-left: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-weight: 600;
  }

  .comparison-grid.nerd-mode .comparison-row > .stat-value:nth-child(2)::before,
  .comparison-grid.nerd-mode .comparison-row > .stat-value:nth-child(3)::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  }

  .comparison-grid.nerd-mode .comparison-row > .stat-value:nth-child(2)::before {
    content: "A";
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  }

  .comparison-grid.nerd-mode .comparison-row > .stat-value:nth-child(3)::before {
    content: "B";
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  }

  /* More horizontal, modern value cells on mobile */
  .comparison-grid.nerd-mode .comparison-row {
    background: #ffffff;
  }

  .comparison-grid.nerd-mode .comparison-row > .stat-value {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    min-height: 44px;
  }
}

.compare-header {
  background: #fff;
}

/* Modern stat rows */
.comparison-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
}

.comparison-row:hover {
  background-color: #f8fafc;
}

/* Labels & values */
.stat-label {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.stat-value {
  display: flex;
  justify-content: flex-end;   /* both columns align inward */
  align-items: left;
}
/* highlight winning column */
.stat-value.better {
  background: rgba(34, 197, 94, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
}

/* area headers */
.area-col {
  text-align: right;
}

#badgeA,
#badgeB {
  text-align: right;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-height: 1.5rem;
  margin-bottom: 0.5rem;
}

.persona-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.area-name {
  font-weight: 600;
}

.area-meta {
  font-size: 13px;
  color: #64748b;
}

/* background polish */
#comparison {
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
}

.compare-cell {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.compare-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.better {
  color: var(--green-600);
}
.worse {
  color: var(--red-500);
}
.equal {
  color: var(--gray-500);
}

.compare-section {
  grid-column: 1 / -1;
  font-weight: 600;
  margin-top: 16px;
}

.compare-summary {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.compare-summary h4 {
  margin-bottom: 8px;
  font-weight: 600;
}

.compare-badge {
  position: relative;
  cursor: help;
}

/* Tooltip bubble */
.compare-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20;
}

/* Tooltip arrow */
.compare-badge::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Show on hover */
.compare-badge:hover::after,
.compare-badge:hover::before {
  opacity: 1;
}


/* Base winner styling (you already have something like this) */
.stat-value.better {
  font-weight: 600;
  color: #166534; /* green-700 */
}

/* Animate ONLY on fresh comparison render */
.animate .stat-value.better {
  animation: winPulse 0.6s ease-out both;
}

/* Keyframes */
@keyframes winPulse {
  0% {
    background-color: rgba(34, 197, 94, 0);
    transform: translateY(4px);
  }
  40% {
    background-color: rgba(34, 197, 94, 0.18);
  }
  100% {
    background-color: rgba(34, 197, 94, 0);
    transform: translateY(0);
  }
}

/* Base winner styling (you already have something like this) */
.stat-value.better {
  font-weight: 600;
  color: #166534; /* green-700 */
}

/* Animate ONLY on fresh comparison render */
.animate .stat-value.better {
  animation: winPulse 0.6s ease-out both;
}

/* Keyframes */
@keyframes winPulse {
  0% {
    background-color: rgba(34, 197, 94, 0);
    transform: translateY(4px);
  }
  40% {
    background-color: rgba(34, 197, 94, 0.18);
  }
  100% {
    background-color: rgba(34, 197, 94, 0);
    transform: translateY(0);
  }
}

.compare-confidence {
  margin-top: 0.75rem;
  max-width: 420px;
}

.confidence-header {
  font-size: 0.85rem;
  color: #334155; /* slate-700 */
  margin-bottom: 0.3rem;
}

.confidence-bar {
  height: 6px;
  background: #e5e7eb; /* gray-200 */
  border-radius: 999px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    #22c55e,
    #16a34a
  );
  border-radius: 999px;
  transition: width 0.4s ease;
}


/* Fade all rows when hovering a badge */
.compare-badge:hover
  ~ .comparison-grid
  .comparison-row {
  opacity: 0.35;
}

/* Highlight rows relevant to the hovered audience */
.compare-badge[data-audience="family"]:hover
  ~ .comparison-grid
  .comparison-row[data-audience~="family"],
.compare-badge[data-audience="singles"]:hover
  ~ .comparison-grid
  .comparison-row[data-audience~="singles"] {
  opacity: 1;
  background-color: rgba(59, 130, 246, 0.08); /* blue tint */
  border-radius: 6px;
}

/* ===============================
   Audience-based row highlighting
   =============================== */

/* Fade all rows when an audience highlight is active */
#comparison[data-highlight-audience]
  .comparison-row {
  opacity: 0.35;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

/* Highlight rows relevant to hovered audience */
#comparison[data-highlight-audience="family"]
  .comparison-row[data-audience~="family"], 
#comparison[data-highlight-audience="singles"]
  .comparison-row[data-audience~="singles"] {
  opacity: 1;
  background-color: rgba(59, 130, 246, 0.08);
  border-radius: 6px;
}

/* ===============================
   Winner-based row highlighting
   =============================== */

/* Fade all rows when confidence hover is active */
#comparison[data-highlight-winner]
  .comparison-row {
  opacity: 0.35;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

/* Highlight rows that contributed to the winner */
#comparison[data-highlight-winner="left"]
  .comparison-row[data-winner="left"],
#comparison[data-highlight-winner="right"]
  .comparison-row[data-winner="right"] {
  opacity: 1;
  background-color: rgba(34, 197, 94, 0.08);
  border-radius: 6px;
}

.confidence-details {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #334155;
}

.confidence-details-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.confidence-details ul {
  padding-left: 1rem;
  list-style: disc;
}

.compare-badge.family,
.compare-badge.singles {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 700;
  color: white;
  border: none;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.compare-badge.family {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.compare-badge.singles {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}

.compare-badge.overall {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
  letter-spacing: 0.5px;
}

.compare-card {
  background: white;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.04);
}

/* Heart button styling for save comparison */
.heart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #dc2626;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.heart-btn:hover:not(.saved) {
  background-color: rgba(220, 38, 38, 0.08);
  transform: scale(1.1);
}

.heart-btn.saved {
  color: #dc2626;
}

.heart-btn.saved svg {
  fill: #dc2626;
}

.heart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.heart-btn svg {
  width: 24px;
  height: 24px;
  transition: fill 0.2s ease, transform 0.2s ease;
}

/* Star button styling (for favorites) */
.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #ca8a04;
  transition: all 0.2s ease;
  border-radius: 8px;
  flex-shrink: 0;
}

.star-btn:hover:not(.favorited) {
  background-color: rgba(202, 138, 4, 0.1);
  transform: scale(1.1);
}

.star-btn.favorited {
  color: #ca8a04;
}

.star-btn.favorited svg {
  fill: #ca8a04;
  stroke: #ca8a04;
}

.star-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.star-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  fill: none;
  transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

/* Inline star button styling (next to buurt name) */
.star-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #ca8a04;
  transition: all 0.2s ease;
  border-radius: 4px;
  flex-shrink: 0;
}

.star-btn-inline:hover:not(.favorited) {
  background-color: rgba(202, 138, 4, 0.1);
  transform: scale(1.15);
}

.star-btn-inline.favorited {
  color: #ca8a04;
}

.star-btn-inline.favorited svg {
  fill: #ca8a04;
  stroke: #ca8a04;
}

.star-btn-inline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.star-btn-inline svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  fill: none;
  transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

/* Mobile-friendly layout for comparison grid */
@media (max-width: 900px) {
  .compare-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .area-col {
    text-align: left;
    width: 100%;
  }

  #badgeA,
  #badgeB,
  .persona-badges {
    justify-content: flex-start;
  }

  .comparison-grid {
    gap: 14px;
  }

  /* Card-like rows for easier scanning on mobile */
  .comparison-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label label"
      "left right";
    align-items: start;
    row-gap: 10px;
    column-gap: 12px;
    padding: 14px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
  }

  .comparison-row .stat-label {
    grid-area: label;
    font-size: 14px;
    color: #0f172a;
  }

  .comparison-row .stat-value:nth-of-type(1) {
    grid-area: left;
  }

  .comparison-row .stat-value:nth-of-type(2) {
    grid-area: right;
  }

  .stat-value {
    justify-content: flex-start;
    font-size: 15px;
  }

  .stat-value.better {
    background: rgba(34, 197, 94, 0.12);
    padding: 6px 10px;
    border-radius: 8px;
  }
}

.compare-header-wrapper {
  position: relative;
}

/* ===============================
   NERD MODE TOGGLE (iPhone-style)
   =============================== */

.nerd-toggle-container {
  user-select: none;
}

.nerd-toggle-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  cursor: pointer;
}

.nerd-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.nerd-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  border-radius: 34px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nerd-toggle-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nerd-toggle-switch input:checked + .nerd-toggle-slider {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.nerd-toggle-switch input:focus + .nerd-toggle-slider {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.nerd-toggle-switch input:checked + .nerd-toggle-slider:before {
  transform: translateX(20px);
}

/* Hover effects */
.nerd-toggle-switch:hover .nerd-toggle-slider {
  background-color: #cbd5e1;
}

.nerd-toggle-switch input:checked:hover + .nerd-toggle-slider {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* ===============================
   FRIENDLY VIEW STYLES
   =============================== */

.friendly-comparison {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 12px;
  padding-left: 12px;
}

.friendly-metric-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.friendly-metric-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.friendly-metric-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.friendly-metric-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

.friendly-metric-title {
  flex: 1;
}

.friendly-metric-title h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.friendly-metric-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

.friendly-comparison-bars {
  display: flex;
  gap: 16px;
  align-items: center;
}

.friendly-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friendly-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.friendly-bar-container {
  height: 32px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.friendly-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  min-width: 80px;
}

.friendly-bar-fill.winner {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.friendly-bar-value {
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.friendly-vs-icon {
  font-size: 24px;
  color: #cbd5e1;
  font-weight: 700;
  flex-shrink: 0;
}

.friendly-winner-badge {
  display: inline-block;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.friendly-metric-interpretation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  border-left: 4px solid #f59e0b;
}

.interpretation-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.interpretation-text {
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
  font-weight: 500;
}

/* Section headers for friendly view */
.friendly-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}

.friendly-section-icon {
  font-size: 28px;
}

.friendly-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Hide/show based on mode */
.comparison-grid.nerd-mode {
  display: flex !important;
  flex-direction: column;
  gap: 24px;
}

.comparison-grid.friendly-mode {
  display: none !important;
}

.friendly-comparison.nerd-mode {
  display: none !important;
}

.friendly-comparison.friendly-mode {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .nerd-toggle-container {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .friendly-comparison-bars {
    flex-direction: column;
    gap: 12px;
  }
  
  .friendly-vs-icon {
    transform: rotate(90deg);
  }
}

/* ===============================
   NARRATIVE COMPARISON STYLES
   (Modern, prose-based layout)
   =============================== */

.narrative-section {
  margin-bottom: 3rem;
  padding-left: 1rem;
  margin-left: 0;
}

.narrative-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
  margin-left: 0;
  margin-top: 1rem;
}

.narrative-card {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.narrative-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #e2e8f0;
}

.narrative-card-full {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.narrative-card-full:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #e2e8f0;
}

.narrative-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.narrative-card-title-large {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1.5rem;
}

.narrative-card-text {
  color: #475569;
  line-height: 1.7;
  font-size: 0.9375rem;
}

.narrative-bullet-list {
  list-style: disc;
  margin-left: 1.25rem;
  margin-top: 0.75rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.8;
}

.narrative-bullet-list li {
  margin-bottom: 0.25rem;
}

.narrative-tradeoff-card {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.1);
}

/* Better spacing for persona lists */
.narrative-card-full ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.narrative-card-full ul li span:first-child {
  flex-shrink: 0;
  margin-top: 2px;
}
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.comparison-section-row {
  margin-top: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.compare-confidence {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0 24px;
}

/* Subtle divider between summary & confidence */
.compare-card #comparisonSummary:not(:empty) {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb; /* slate-200 */
}

.compare-summary h4 {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 1.2rem;      /* bigger, but not shouty */
  font-weight: 700;
  color: #0f172a;         /* slate-900 */

  margin-bottom: 14px;   /* 👈 THIS creates the gap you want */
}

.compare-summary p {
  font-size: 0.95rem;
  color: #334155; /* slate-700 */
  line-height: 1.6;
}

.compare-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569; /* slate-600 */
  background: transparent;
  transition: all 0.2s ease;
}

.compare-tab:hover {
  background: #e5e7eb; /* gray-200 */
}

.compare-tab.active {
  background: white;
  color: #0f172a; /* slate-900 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.metric-why {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b; /* slate-500 */
}

.city-hint {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  color: #334155;
}

.city-hint-icon {
  font-size: 16px;
  margin-top: 2px;
}

.city-hint-text {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.metric-tip {
  margin-top: 6px;
  padding-left: 20px;
  font-size: 12px;
  color: #64748b; /* slate-500 */
  line-height: 1.45;
  position: relative;
  opacity: 0.9;
}

.metric-tip::before {
  content: "💡";
  position: absolute;
  left: 0;
  top: 0;
}

.index-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 110px;          /* 🔥 key line */
  line-height: 1.15;
}


.index-bars {
  font-size: 15px;        /* was 13px */
  letter-spacing: 1.5px;
  opacity: 0.9;
}

.index-label {
  font-size: 12px;        /* was 11px */
  margin-top: 3px;
}


.index-legend {
  font-size: 11px;
  color: #94a3b8;
  margin: 4px 0 10px 0;
}

.city-type {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-top: 2px;
}

.city-drill-btn {
  font-size: 13px;
  margin-top: 4px;
  color: #2563eb;
}

