/* ==========================================================================
   Chart-Specific Styling
   ========================================================================== */

/* --- Chart Wrapper (chart + optional legend) --- */
.chart-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Spacing between consecutive chart-wrappers and content blocks */
.chart-wrapper + .chart-wrapper,
.chart-wrapper + [id$="-content"],
[id$="-content"] + .chart-wrapper {
  margin-top: 2.5rem;
}

.chart-wrapper__title {
  font-family: var(--font-heading-ka);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gold-primary);
  margin: 0;
}

.chart-wrapper canvas {
  width: 100% !important;
  border-radius: var(--radius-sm);
}

/* Emotional arc chart */
.chart-container--emotional-arc {
  height: 400px;
}

/* Radar chart container */
.chart-container--radar {
  height: 520px;
}


/* ==========================================================================
   Chart Legend
   ========================================================================== */

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  padding: 0.75rem 0 0;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-data);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: opacity var(--transition-base), color var(--transition-base);
  user-select: none;
  padding: 0.2rem 0;
}

.chart-legend-item:hover {
  color: var(--text-primary);
}

.chart-legend-item.hidden {
  opacity: 0.3;
}

.chart-legend-item.hidden .chart-legend-dot {
  opacity: 0.3;
}

.chart-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity var(--transition-base);
}

/* Emotion legend variant (slightly larger dots, more spacing) */
.emotion-legend {
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem 0;
}

.emotion-legend .chart-legend-item,
.emotion-legend .chart-inline-legend__item {
  font-size: 0.82rem;
}

.emotion-legend .chart-legend-dot,
.emotion-legend .chart-inline-legend__swatch {
  width: 12px;
  height: 12px;
}

/* Pre-defined emotion color dots */
.chart-legend-dot--love { background-color: var(--emotion-love); }
.chart-legend-dot--sorrow { background-color: var(--emotion-sorrow); }
.chart-legend-dot--battle { background-color: var(--emotion-battle); }
.chart-legend-dot--joy { background-color: var(--emotion-joy); }
.chart-legend-dot--beauty { background-color: var(--emotion-beauty); }
.chart-legend-dot--loyalty { background-color: var(--emotion-loyalty); }
.chart-legend-dot--death { background-color: var(--emotion-death); }
.chart-legend-dot--longing { background-color: var(--emotion-longing); }
.chart-legend-dot--anger { background-color: var(--emotion-anger); }
.chart-legend-dot--hope { background-color: var(--emotion-hope); }


/* ==========================================================================
   Inline Chart Legend (used by emotionalArc, natureImagery, rhetoric, dialogue)
   ========================================================================== */

.chart-inline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

.chart-inline-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: opacity 0.2s;
  font-family: var(--font-body-ka);
  font-size: 11px;
  color: var(--text-secondary);
}

.chart-inline-legend__item:hover {
  color: var(--text-primary);
}

.chart-inline-legend__item--hidden {
  opacity: 0.4;
}

.chart-inline-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chart-inline-legend__swatch--square {
  border-radius: 3px;
}

/* Non-interactive variant (display-only) */
.chart-inline-legend--static .chart-inline-legend__item {
  cursor: default;
}


/* ==========================================================================
   Emotion Legend Pills (emotionalArc section)
   ========================================================================== */

.emotion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body-ka);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  user-select: none;
}

.emotion-pill:hover {
  color: var(--text-primary);
}

.emotion-pill--hidden {
  opacity: 0.4;
  border-color: var(--border-subtle);
  background: transparent;
}

.emotion-pill--hidden:hover {
  opacity: 0.65;
}

.emotion-pill__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ==========================================================================
   Emotion Summary Badges
   ========================================================================== */

.emotion-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.emotion-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}

.chart-stat-badge__label {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.chart-stat-badge__detail {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* Character selector chips (bigFive radar chart) */
.character-chip {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body-ka);
  border: 1.5px solid rgba(154, 148, 132, 0.15);
  background: transparent;
  color: var(--text-dim);
  opacity: 0.6;
  transition: all 0.2s ease;
}

.character-chip:hover {
  opacity: 1;
  border-color: rgba(154, 148, 132, 0.4);
  color: var(--text-secondary);
}

.character-chip--active {
  opacity: 1;
  font-weight: 500;
}

.character-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  justify-content: center;
}


/* ==========================================================================
   Heatmap
   ========================================================================== */

.heatmap-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

.heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) var(--bg-secondary);
  padding: 1rem;
}

.heatmap-scroll::-webkit-scrollbar {
  height: 4px;
}

.heatmap-scroll::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.heatmap-scroll::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: var(--radius-pill);
}

.heatmap-scroll canvas {
  display: block;
}

/* Scroll shadow indicators */
.heatmap-container::before,
.heatmap-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.heatmap-container::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-secondary), transparent);
}

.heatmap-container::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-secondary), transparent);
}

.heatmap-container.scroll-left::before,
.heatmap-container.scroll-right::after {
  opacity: 1;
}

/* Heatmap tooltip */
.heatmap-tooltip {
  position: absolute;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -110%);
  transition: opacity 0.15s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.heatmap-tooltip.visible {
  opacity: 1;
}

.heatmap-tooltip__label {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.heatmap-tooltip__value {
  color: var(--gold-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   Chart Annotations
   ========================================================================== */

.chart-annotation {
  position: absolute;
  font-family: var(--font-data);
  font-size: 0.7rem;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.3;
}

.chart-annotation--highlight {
  color: var(--gold-primary);
  font-weight: 500;
}

.chart-annotation--ka {
  font-family: var(--font-body-ka);
  font-size: 0.75rem;
}


/* ==========================================================================
   Chart Stat Badge
   ========================================================================== */

.chart-stat-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: var(--font-data);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

.chart-stat-badge__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-primary);
}


/* ==========================================================================
   Chart Controls
   ========================================================================== */

.chart-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.chart-controls .btn {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
}

.chart-controls .btn.active {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(201, 168, 76, 0.08);
}

/* Styled select */
.chart-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.4rem 2rem 0.4rem 1rem;
  font-family: var(--font-data);
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-base);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a9484' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.chart-select:hover,
.chart-select:focus {
  border-color: var(--gold-primary);
}

.chart-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}


/* ==========================================================================
   Network / D3 Graph Container
   ========================================================================== */

.network-container {
  position: relative;
  width: 100%;
  min-height: 550px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.network-container svg {
  display: block;
  width: 100%;
  height: 100%;
}

.network-container .node circle {
  stroke: var(--bg-primary);
  stroke-width: 1.5;
  cursor: pointer;
  transition: r 0.2s ease;
}

.network-container .node text {
  font-family: var(--font-body-ka);
  font-size: 11px;
  fill: var(--text-secondary);
  pointer-events: none;
}

.network-container .link {
  stroke: var(--border-subtle);
  stroke-opacity: 0.6;
}

.network-container .link--strong {
  stroke: var(--gold-dark);
  stroke-opacity: 0.8;
}

/* Fallback list for small screens */
.network-fallback-list {
  display: none;
  padding: 1.25rem;
}

.network-fallback-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body-ka);
  font-size: 0.88rem;
  color: var(--text-primary);
}

.network-fallback-item:last-child {
  border-bottom: none;
}

.network-fallback-item__count {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--gold-primary);
  font-weight: 600;
}


/* ==========================================================================
   Radar Container
   ========================================================================== */

.radar-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.radar-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.radar-container svg {
  width: 100%;
  height: 100%;
}


/* ==========================================================================
   Specific Chart Canvas Overrides
   ========================================================================== */

/* Doughnut / Pie charts */
.chart-doughnut-wrapper {
  position: relative;
  max-width: 350px;
  margin: 0 auto;
}

.chart-doughnut-wrapper canvas {
  width: 100% !important;
}

.chart-doughnut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.chart-doughnut-center__value {
  font-family: var(--font-data);
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-primary);
  line-height: 1.1;
}

.chart-doughnut-center__label {
  font-family: var(--font-body-ka);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Bar chart adjustments */
.chart-bar-wrapper {
  min-height: 300px;
}

.chart-bar-wrapper canvas {
  width: 100% !important;
  min-height: 280px;
}

/* Line chart adjustments */
.chart-line-wrapper {
  min-height: 280px;
}

.chart-line-wrapper canvas {
  width: 100% !important;
  min-height: 260px;
}

/* Horizontal bar */
.chart-hbar-wrapper {
  min-height: 350px;
}

/* Stacked area */
.chart-area-wrapper {
  min-height: 300px;
}

.chart-area-wrapper canvas {
  width: 100% !important;
}

/* Scatter plot */
.chart-scatter-wrapper {
  min-height: 320px;
}

/* Bubble chart */
.chart-bubble-wrapper {
  min-height: 380px;
}


/* ==========================================================================
   Chart.js Global Overrides (via CSS where possible)
   ========================================================================== */

/* Ensure chart containers don't collapse */
.chart-wrapper,
.chart-container {
  min-height: 200px;
}

/* Chart loading placeholder */
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  color: var(--text-dim);
  font-family: var(--font-data);
  font-size: 0.85rem;
}

.chart-placeholder::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  margin-right: 0.75rem;
  animation: chartSpin 0.8s linear infinite;
}

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

/* Chart error state */
.chart-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-dim);
  font-family: var(--font-data);
  font-size: 0.85rem;
  text-align: center;
  gap: 0.5rem;
}

.chart-error__icon {
  font-size: 1.5rem;
  opacity: 0.5;
}


/* ==========================================================================
   Tears & Drama Section
   ========================================================================== */

.tears-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.tears-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.tears-stat-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-glow);
}

.tears-stat-card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.tears-stat-card__value {
  font-family: var(--font-data);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
  line-height: 1.1;
}

.tears-stat-card__label {
  font-family: var(--font-body-ka);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.tears-leaderboard {
  margin-bottom: 2rem;
}

.tears-leaderboard__title {
  font-family: var(--font-heading-ka);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gold-primary);
  margin-bottom: 1rem;
}

.tears-leaderboard__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tears-leaderboard__name {
  font-family: var(--font-body-ka);
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 140px;
  text-align: right;
  flex-shrink: 0;
}

.tears-leaderboard__bar-bg {
  flex: 1;
  height: 20px;
  background: rgba(201, 168, 76, 0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.tears-leaderboard__bar {
  height: 100%;
  border-radius: var(--radius-sm);
  opacity: 0.75;
  transition: width 0.8s ease;
}

.tears-leaderboard__count {
  font-family: var(--font-data);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 28px;
}

.tears-leaderboard__toggle {
  margin-top: 0.75rem;
}

/* Highlight badge (for single-entry leaderboards like fainting) */
.tears-highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: rgba(114, 47, 55, 0.06);
  border: 1px solid rgba(114, 47, 55, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.tears-highlight__title {
  font-family: var(--font-heading-ka);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wine-light);
}

.tears-highlight__name {
  font-family: var(--font-heading-ka);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tears-highlight__count {
  font-family: var(--font-data);
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-weight: 600;
}

.tears-highlight__note {
  font-family: var(--font-body-ka);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

.tears-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-family: var(--font-body-ka);
  font-size: 15px;
  font-style: italic;
}


/* ==========================================================================
   Chapter Structure / Poem Architecture Section
   ========================================================================== */

.chart-container--structure {
  height: 320px;
}

.structure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.structure-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Nature Imagery Section
   ========================================================================== */

.chart-container--nature {
  height: 320px;
}

.nature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

.nature-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.nature-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Narrative Tension Section
   ========================================================================== */

.chart-container--tension {
  height: 320px;
}

.tension-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 3.5rem;
}

.tension-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Rhetoric / Poetic Craftsmanship Section
   ========================================================================== */

.chart-container--shairi {
  height: 280px;
}

.chart-container--devices {
  height: 350px;
  padding-bottom: 2.5rem;
}

.rhetoric-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

.rhetoric-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.rhetoric-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Dialogue & Narration Section
   ========================================================================== */

/* Chart container heights */
.chart-container--dialogue-ratio {
  height: 280px;
}

.chart-container--speakers {
  height: 380px;
}

/* POV Strip */
.pov-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 0;
}

.pov-strip__title {
  font-family: var(--font-body-ka);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
}

.pov-strip__row {
  display: flex;
  gap: 1px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.pov-strip__cell {
  width: 10px;
  height: 14px;
  border-radius: 2px;
  cursor: default;
  opacity: 0.6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.pov-strip__cell--third {
  background-color: #c9a84c;
}

.pov-strip__cell--first {
  background-color: #722f37;
}

.pov-strip__cell--mixed {
  background: linear-gradient(135deg, #c9a84c, #722f37);
}

.pov-strip__cell--hover {
  opacity: 1;
  transform: scaleY(1.4);
}

.pov-strip__legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 6px;
}

.pov-strip__legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pov-strip__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  opacity: 0.7;
}

.pov-strip__swatch--third {
  background-color: #c9a84c;
}

.pov-strip__swatch--first {
  background-color: #722f37;
}

.pov-strip__swatch--mixed {
  background: linear-gradient(135deg, #c9a84c, #722f37);
}

.pov-strip__legend-item span:last-child {
  font-family: var(--font-data);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Dialogue summary badges */
.dialogue-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.dialogue-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Color Palette Section
   ========================================================================== */

.color-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 1.25rem;
  padding: 1.5rem 0;
}

.color-palette__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
  transition: transform 0.25s ease;
  max-width: 130px;
}

.color-palette__item:hover {
  transform: translateY(-4px);
}

.color-palette__item:hover .color-palette__circle {
  box-shadow: 0 0 18px rgba(201, 168, 76, 0.25), 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: scale(1.06);
}

.color-palette__circle {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.3s ease, transform 0.25s ease;
  flex-shrink: 0;
}

.color-palette__name {
  font-family: var(--font-body-ka);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  max-width: 130px;
}

.color-palette__count {
  font-family: var(--font-data);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Color summary badges */
.color-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.color-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}


/* ==========================================================================
   Geography Section
   ========================================================================== */

.geo-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-base);
}

.geo-group:hover {
  border-color: rgba(201, 168, 76, 0.2);
}

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

.geo-group__title {
  font-family: var(--font-heading-ka);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.geo-group__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.geo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.geo-row:hover {
  background: rgba(201, 168, 76, 0.03);
}

.geo-row:hover .geo-row__bar {
  opacity: 0.9;
}

.geo-row:hover .geo-row__name {
  color: var(--text-primary);
}

.geo-row__name {
  font-family: var(--font-body-ka);
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 160px;
  min-width: 120px;
  text-align: right;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.geo-row__bar-bg {
  flex: 1;
  height: 20px;
  background: rgba(201, 168, 76, 0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.geo-row__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
  border-radius: var(--radius-sm);
  opacity: 0.65;
  transition: width 0.6s ease, opacity 0.15s ease;
}

.geo-row__count {
  font-family: var(--font-data);
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-primary);
  min-width: 36px;
  text-align: right;
}

.geography-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.geography-summary .chart-stat-badge {
  margin-top: 0;
  gap: 0.35rem;
}
