/* ==========================================================================
   PsychRX Infographics Design System
   Healthcare infographic components for smoking cessation workshop
   Compatible with html2pdf.js (html2canvas rendering)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Primary palette */
  --ig-teal: #0d9488;
  --ig-teal-light: #ccfbf1;
  --ig-coral: #ef4444;
  --ig-coral-light: #fef2f2;
  --ig-amber: #f59e0b;
  --ig-amber-light: #fffbeb;
  --ig-green: #22c55e;
  --ig-green-light: #f0fdf4;
  --ig-blue: #3b82f6;
  --ig-blue-light: #eff6ff;
  --ig-purple: #8b5cf6;
  --ig-purple-light: #f5f3ff;

  /* Neutrals */
  --ig-navy: #1e293b;
  --ig-slate: #64748b;
  --ig-track: #f1f5f9;
  --ig-border: #e2e8f0;
  --ig-muted: #cbd5e1;

  /* Layout */
  --ig-radius: 12px;
  --ig-padding: 24px;
  --ig-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Color Utility Classes (for Jinja2 dynamic coloring)
   -------------------------------------------------------------------------- */
.ig-color-teal { color: var(--ig-teal); }
.ig-color-coral { color: var(--ig-coral); }
.ig-color-amber { color: var(--ig-amber); }
.ig-color-green { color: var(--ig-green); }
.ig-color-blue { color: var(--ig-blue); }
.ig-color-purple { color: var(--ig-purple); }

.ig-bg-teal { background-color: var(--ig-teal-light); }
.ig-bg-coral { background-color: var(--ig-coral-light); }
.ig-bg-amber { background-color: var(--ig-amber-light); }
.ig-bg-green { background-color: var(--ig-green-light); }
.ig-bg-blue { background-color: var(--ig-blue-light); }
.ig-bg-purple { background-color: var(--ig-purple-light); }

.ig-border-teal { border-color: var(--ig-teal); }
.ig-border-coral { border-color: var(--ig-coral); }
.ig-border-amber { border-color: var(--ig-amber); }
.ig-border-green { border-color: var(--ig-green); }
.ig-border-blue { border-color: var(--ig-blue); }
.ig-border-purple { border-color: var(--ig-purple); }

/* --------------------------------------------------------------------------
   Base Card & Typography
   -------------------------------------------------------------------------- */
.ig-card {
  background: #ffffff;
  border-radius: var(--ig-radius);
  padding: var(--ig-padding);
  box-shadow: var(--ig-shadow);
  page-break-inside: avoid;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  margin-bottom: 24px;
}

.ig-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ig-navy);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.ig-subtitle {
  font-size: 0.8125rem;
  color: var(--ig-slate);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   1. Horizontal Bars
   -------------------------------------------------------------------------- */
.ig-hbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ig-hbar-emoji {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ig-track);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-hbar-label {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ig-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-hbar-track {
  flex: 1;
  height: 32px;
  background: var(--ig-track);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-hbar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ig-teal), #14b8a6);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-hbar-fill.ig-color-coral {
  background: linear-gradient(135deg, #dc2626, #f87171);
}

.ig-hbar-fill.ig-color-amber {
  background: linear-gradient(135deg, #d97706, #fbbf24);
}

.ig-hbar-fill.ig-color-green {
  background: linear-gradient(135deg, #16a34a, #4ade80);
}

.ig-hbar-fill.ig-color-blue {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.ig-hbar-fill.ig-color-purple {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.ig-hbar-fill.ig-color-teal {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.ig-hbar-value {
  width: 60px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ig-navy);
}

/* Highlighted row */
.ig-hbar-highlight .ig-hbar-track {
  height: 38px;
}

.ig-hbar-highlight .ig-hbar-emoji {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.ig-hbar-highlight .ig-hbar-value {
  font-size: 1rem;
}

.ig-hbar-badge {
  display: inline-block;
  background: var(--ig-teal);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 8px;
  vertical-align: middle;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* --------------------------------------------------------------------------
   2. Icon Grid
   -------------------------------------------------------------------------- */
.ig-icons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.ig-icon-cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 8px;
  color: var(--ig-muted);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-icon-cell svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.ig-icon-highlighted {
  color: var(--ig-coral);
}

.ig-icon-highlighted.ig-color-teal { color: var(--ig-teal); }
.ig-icon-highlighted.ig-color-coral { color: var(--ig-coral); }
.ig-icon-highlighted.ig-color-amber { color: var(--ig-amber); }
.ig-icon-highlighted.ig-color-green { color: var(--ig-green); }
.ig-icon-highlighted.ig-color-blue { color: var(--ig-blue); }
.ig-icon-highlighted.ig-color-purple { color: var(--ig-purple); }

.ig-icon-callout {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--ig-border);
}

.ig-icon-callout-stat {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ig-navy);
  line-height: 1.2;
}

.ig-icon-callout-detail {
  font-size: 0.8125rem;
  color: var(--ig-slate);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   3. Before/After
   -------------------------------------------------------------------------- */
.ig-ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--ig-radius);
  overflow: hidden;
  border: 1px solid var(--ig-border);
}

.ig-ba-header-before,
.ig-ba-header-after {
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-ba-header-before {
  background: var(--ig-coral-light);
  border-left: 4px solid var(--ig-coral);
  color: var(--ig-coral);
}

.ig-ba-header-after {
  background: var(--ig-green-light);
  border-left: 4px solid var(--ig-green);
  color: var(--ig-green);
}

.ig-ba-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-column: 1 / -1;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--ig-border);
}

.ig-ba-row:nth-child(odd) {
  background: #fafafa;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-ba-value-before {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ig-coral);
  text-align: center;
}

.ig-ba-value-after {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ig-green);
  text-align: center;
}

.ig-ba-metric {
  background: #ffffff;
  border: 1px solid var(--ig-border);
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ig-slate);
  text-align: center;
  white-space: nowrap;
  margin: 0 12px;
}

/* --------------------------------------------------------------------------
   4. Circular Gauge
   -------------------------------------------------------------------------- */
.ig-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ig-gauge-svg-container {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.ig-gauge-svg-container svg {
  width: 160px;
  height: 160px;
}

.ig-gauge-svg-container circle {
  fill: none;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-gauge-track {
  stroke: var(--ig-track);
  stroke-width: 10;
}

.ig-gauge-progress {
  stroke-width: 10;
  stroke-linecap: round;
  stroke: var(--ig-teal);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-gauge-progress.ig-color-coral { stroke: var(--ig-coral); }
.ig-gauge-progress.ig-color-amber { stroke: var(--ig-amber); }
.ig-gauge-progress.ig-color-green { stroke: var(--ig-green); }
.ig-gauge-progress.ig-color-blue { stroke: var(--ig-blue); }
.ig-gauge-progress.ig-color-purple { stroke: var(--ig-purple); }
.ig-gauge-progress.ig-color-teal { stroke: var(--ig-teal); }

.ig-gauge-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ig-gauge-stat {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ig-navy);
  line-height: 1;
}

.ig-gauge-subtext {
  font-size: 0.75rem;
  color: var(--ig-slate);
  margin-top: 2px;
}

.ig-gauge-description {
  flex: 1;
}

.ig-gauge-description h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ig-navy);
  margin: 0 0 8px 0;
}

.ig-gauge-description p {
  font-size: 0.8125rem;
  color: var(--ig-slate);
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. Health Timeline
   -------------------------------------------------------------------------- */
.ig-timeline {
  position: relative;
  padding-left: 72px;
}

.ig-timeline-line {
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--ig-coral),
    var(--ig-amber) 50%,
    var(--ig-green)
  );
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}

.ig-timeline-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--ig-muted);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: absolute;
  left: -72px;
  top: 0;
  z-index: 1;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-timeline-marker.ig-border-coral { border-color: var(--ig-coral); }
.ig-timeline-marker.ig-border-amber { border-color: var(--ig-amber); }
.ig-timeline-marker.ig-border-green { border-color: var(--ig-green); }
.ig-timeline-marker.ig-border-teal { border-color: var(--ig-teal); }
.ig-timeline-marker.ig-border-blue { border-color: var(--ig-blue); }
.ig-timeline-marker.ig-border-purple { border-color: var(--ig-purple); }

.ig-timeline-content {
  flex: 1;
  padding-top: 4px;
}

.ig-timeline-time {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ig-slate);
  margin-bottom: 2px;
}

.ig-timeline-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ig-navy);
  margin-bottom: 4px;
}

.ig-timeline-detail {
  font-size: 0.8125rem;
  color: var(--ig-slate);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   6. Flowchart
   -------------------------------------------------------------------------- */
.ig-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}

.ig-flow-node {
  padding: 14px 24px;
  border-radius: var(--ig-radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-flow-trigger {
  background: linear-gradient(135deg, #dc2626, #f87171);
  color: #ffffff;
  border-radius: var(--ig-radius);
}

.ig-flow-decision {
  background: var(--ig-amber-light);
  border: 2px dashed var(--ig-amber);
  color: var(--ig-navy);
}

.ig-flow-action {
  background: var(--ig-teal-light);
  border-left: 4px solid var(--ig-teal);
  color: var(--ig-navy);
  text-align: left;
}

.ig-flow-success {
  background: linear-gradient(135deg, #16a34a, #4ade80);
  color: #ffffff;
  border-radius: 9999px;
  padding: 14px 32px;
}

.ig-flow-connector {
  width: 2px;
  height: 24px;
  background: var(--ig-muted);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-flow-edge-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ig-slate);
  background: #ffffff;
  border: 1px solid var(--ig-border);
  border-radius: 9999px;
  padding: 2px 10px;
  margin: -4px 0;
  position: relative;
  z-index: 1;
}

.ig-flow-branch {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.ig-flow-branch > * {
  flex: 1;
  max-width: 200px;
}

/* --------------------------------------------------------------------------
   7. Wheel Hub
   -------------------------------------------------------------------------- */
.ig-wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ig-wheel-center {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--ig-navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-wheel-spokes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  border-top: 2px solid var(--ig-border);
  padding-top: 20px;
  margin-top: -2px;
}

.ig-wheel-spoke {
  padding: 14px;
  border-radius: 8px;
  border-left: 4px solid var(--ig-teal);
  background: var(--ig-teal-light);
  font-size: 0.8125rem;
  color: var(--ig-navy);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-wheel-spoke.ig-border-coral { border-left-color: var(--ig-coral); }
.ig-wheel-spoke.ig-bg-coral { background: var(--ig-coral-light); }
.ig-wheel-spoke.ig-border-amber { border-left-color: var(--ig-amber); }
.ig-wheel-spoke.ig-bg-amber { background: var(--ig-amber-light); }
.ig-wheel-spoke.ig-border-green { border-left-color: var(--ig-green); }
.ig-wheel-spoke.ig-bg-green { background: var(--ig-green-light); }
.ig-wheel-spoke.ig-border-blue { border-left-color: var(--ig-blue); }
.ig-wheel-spoke.ig-bg-blue { background: var(--ig-blue-light); }
.ig-wheel-spoke.ig-border-purple { border-left-color: var(--ig-purple); }
.ig-wheel-spoke.ig-bg-purple { background: var(--ig-purple-light); }
.ig-wheel-spoke.ig-border-teal { border-left-color: var(--ig-teal); }
.ig-wheel-spoke.ig-bg-teal { background: var(--ig-teal-light); }

.ig-wheel-spoke-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.ig-wheel-spoke-detail {
  font-size: 0.75rem;
  color: var(--ig-slate);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   8. Stat Callouts
   -------------------------------------------------------------------------- */
.ig-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.ig-stat-card {
  text-align: center;
  padding: 20px 16px;
  border-radius: var(--ig-radius);
  border-top: 4px solid var(--ig-teal);
  background: var(--ig-teal-light);
  page-break-inside: avoid;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-stat-card.ig-border-coral { border-top-color: var(--ig-coral); }
.ig-stat-card.ig-bg-coral { background: var(--ig-coral-light); }
.ig-stat-card.ig-border-amber { border-top-color: var(--ig-amber); }
.ig-stat-card.ig-bg-amber { background: var(--ig-amber-light); }
.ig-stat-card.ig-border-green { border-top-color: var(--ig-green); }
.ig-stat-card.ig-bg-green { background: var(--ig-green-light); }
.ig-stat-card.ig-border-blue { border-top-color: var(--ig-blue); }
.ig-stat-card.ig-bg-blue { background: var(--ig-blue-light); }
.ig-stat-card.ig-border-purple { border-top-color: var(--ig-purple); }
.ig-stat-card.ig-bg-purple { background: var(--ig-purple-light); }
.ig-stat-card.ig-border-teal { border-top-color: var(--ig-teal); }
.ig-stat-card.ig-bg-teal { background: var(--ig-teal-light); }

.ig-stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--ig-teal);
  line-height: 1;
  margin-bottom: 6px;
}

.ig-stat-number.ig-color-coral { color: var(--ig-coral); }
.ig-stat-number.ig-color-amber { color: var(--ig-amber); }
.ig-stat-number.ig-color-green { color: var(--ig-green); }
.ig-stat-number.ig-color-blue { color: var(--ig-blue); }
.ig-stat-number.ig-color-purple { color: var(--ig-purple); }
.ig-stat-number.ig-color-teal { color: var(--ig-teal); }

.ig-stat-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ig-navy);
  margin-bottom: 4px;
}

.ig-stat-detail {
  font-size: 0.75rem;
  color: var(--ig-slate);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   9. Stacked Comparison
   -------------------------------------------------------------------------- */
.ig-stacked-wrap {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: flex-end;
  justify-content: center;
}

.ig-stacked-header {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ig-navy);
  margin-bottom: 8px;
}

.ig-stacked-col {
  display: flex;
  flex-direction: column;
  width: 120px;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ig-border);
}

.ig-stacked-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  min-height: 0;
  overflow: hidden;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-stacked-segment-label-side {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ig-navy);
  white-space: nowrap;
  margin-left: 8px;
}

.ig-stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

.ig-stacked-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ig-slate);
}

.ig-stacked-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* --------------------------------------------------------------------------
   10. Tip Cards
   -------------------------------------------------------------------------- */
.ig-tips {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ig-tip-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ig-tip-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ig-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-tip-number.ig-bg-coral,
.ig-tip-number.ig-color-coral { background: var(--ig-coral); color: #ffffff; }
.ig-tip-number.ig-bg-amber,
.ig-tip-number.ig-color-amber { background: var(--ig-amber); color: #ffffff; }
.ig-tip-number.ig-bg-green,
.ig-tip-number.ig-color-green { background: var(--ig-green); color: #ffffff; }
.ig-tip-number.ig-bg-blue,
.ig-tip-number.ig-color-blue { background: var(--ig-blue); color: #ffffff; }
.ig-tip-number.ig-bg-purple,
.ig-tip-number.ig-color-purple { background: var(--ig-purple); color: #ffffff; }
.ig-tip-number.ig-bg-teal,
.ig-tip-number.ig-color-teal { background: var(--ig-teal); color: #ffffff; }

.ig-tip-content {
  flex: 1;
  background: var(--ig-teal-light);
  border-radius: 8px;
  padding: 14px 18px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.ig-tip-content.ig-bg-coral { background: var(--ig-coral-light); }
.ig-tip-content.ig-bg-amber { background: var(--ig-amber-light); }
.ig-tip-content.ig-bg-green { background: var(--ig-green-light); }
.ig-tip-content.ig-bg-blue { background: var(--ig-blue-light); }
.ig-tip-content.ig-bg-purple { background: var(--ig-purple-light); }
.ig-tip-content.ig-bg-teal { background: var(--ig-teal-light); }

.ig-tip-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ig-navy);
  margin-bottom: 4px;
}

.ig-tip-body {
  font-size: 0.8125rem;
  color: var(--ig-slate);
  line-height: 1.5;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Print & PDF Overrides
   -------------------------------------------------------------------------- */
@media print {
  .ig-card {
    box-shadow: none;
    border: 1px solid var(--ig-border);
    page-break-inside: avoid;
  }

  .ig-hbar-fill,
  .ig-hbar-emoji,
  .ig-hbar-badge,
  .ig-ba-header-before,
  .ig-ba-header-after,
  .ig-gauge-progress,
  .ig-timeline-line,
  .ig-timeline-marker,
  .ig-flow-trigger,
  .ig-flow-decision,
  .ig-flow-action,
  .ig-flow-success,
  .ig-flow-connector,
  .ig-wheel-center,
  .ig-wheel-spoke,
  .ig-stat-card,
  .ig-stacked-segment,
  .ig-stacked-legend-dot,
  .ig-tip-number,
  .ig-tip-content,
  .ig-icon-cell {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* --------------------------------------------------------------------------
   Responsive (max-width: 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .ig-card {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* Horizontal bars: stack label above bar */
  .ig-hbar-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .ig-hbar-label {
    width: 100%;
    order: -1;
  }

  .ig-hbar-track {
    flex: 1;
  }

  /* Before/After: single column */
  .ig-ba-grid {
    grid-template-columns: 1fr;
  }

  .ig-ba-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  /* Gauge: stack vertically */
  .ig-gauge-wrap {
    flex-direction: column;
    text-align: center;
  }

  /* Flowchart: full width nodes */
  .ig-flow-branch {
    flex-direction: column;
    align-items: center;
  }

  .ig-flow-branch > * {
    max-width: 100%;
  }

  /* Wheel: 2 columns */
  .ig-wheel-spokes {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats: single column */
  .ig-stats-grid {
    grid-template-columns: 1fr;
  }

  /* Stacked comparison: narrower columns */
  .ig-stacked-wrap {
    gap: 16px;
  }

  .ig-stacked-col {
    width: 100px;
    height: 240px;
  }

  /* Tip cards: stack number + content */
  .ig-tip-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Timeline: tighter spacing */
  .ig-timeline {
    padding-left: 56px;
  }

  .ig-timeline-marker {
    width: 40px;
    height: 40px;
    left: -56px;
    font-size: 16px;
  }

  .ig-timeline-line {
    left: 19px;
  }

  /* Icon grid: 5-col still works at 48px each */
  .ig-icon-cell {
    width: 40px;
    height: 40px;
  }

  .ig-icon-cell svg {
    width: 22px;
    height: 22px;
  }
}
