/* InstaCalculate — IC Charts v1.1
   Dependency-free, self-hosted SVG visualizations. Compact reading layout. */

.ic-chart-module {
  --ic-chart-blue: #2563eb;
  --ic-chart-mint: #10b981;
  --ic-chart-peach: #f59e0b;
  --ic-chart-violet: #8b5cf6;
  --ic-chart-rose: #ef6a78;
  --ic-chart-text: #111827;
  --ic-chart-muted: #667085;
  --ic-chart-line: #e6e9ef;
  --ic-chart-soft: #f8fafc;
  margin-top: 0;
  padding: 20px 22px;
  border: 1px solid #e7e9ee;
  border-radius: 15px;
  background: #fff;
}

.ic-resource-page > .ic-chart-module {
  width: min(100% - 32px, 1120px);
  margin: 28px auto 0;
}

.ic-chart-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.ic-chart-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--ic-chart-blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ic-chart-module h2 {
  margin: 0;
  color: var(--ic-chart-text);
  font: inherit;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.ic-chart-module-head p {
  max-width: 650px;
  margin: 5px 0 0;
  color: var(--ic-chart-muted);
  font-size: 14px;
  line-height: 1.5;
}

.ic-chart-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f7f8fa;
}

.ic-chart-tab {
  appearance: none;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #667085 !important;
  box-shadow: none !important;
  padding: 8px 11px !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer;
}

.ic-chart-tab:hover { color: #111827 !important; }
.ic-chart-tab.is-active {
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 1px 3px rgba(15,23,42,.08) !important;
}

.ic-chart-frame {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(248,250,252,.8), rgba(255,255,255,.25));
}

.ic-chart-canvas {
  width: 100%;
  height: 250px;
  min-width: 0;
}

.ic-chart-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ic-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #98a2b3;
  font-size: 13px;
  text-align: center;
}

.ic-chart-module.has-chart .ic-chart-empty { display: none; }

.ic-chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  max-width: 240px;
  pointer-events: none;
  padding: 10px 12px;
  border: 1px solid rgba(17,24,39,.1);
  border-radius: 12px;
  background: rgba(17,24,39,.95);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15,23,42,.16);
  font-size: 12px;
  line-height: 1.45;
  transform: translate(10px, -50%);
}

.ic-chart-tooltip strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-size: 12px;
}

.ic-chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255,255,255,.82);
}

.ic-chart-tooltip b { color: #fff; font-weight: 700; }

.ic-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.ic-chart-legend:empty { display: none; }

.ic-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.ic-chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--legend-color, #2563eb);
}

.ic-chart-note {
  margin: 7px 0 0;
  color: #8a94a6;
  font-size: 12px;
  line-height: 1.55;
}

.ic-chart-axis-text {
  fill: #98a2b3;
  font-size: 11px;
  font-family: inherit;
}

.ic-chart-grid-line { stroke: #e9edf2; stroke-width: 1; }
.ic-chart-axis-line { stroke: #dfe4ea; stroke-width: 1; }
.ic-chart-hover-line { stroke: #aeb7c5; stroke-width: 1; stroke-dasharray: 3 4; pointer-events: none; }
.ic-chart-hover-dot { stroke: #fff; stroke-width: 2; pointer-events: none; }

@media (max-width: 760px) {
  .ic-chart-module { border-radius: 14px; padding: 16px; }
  .ic-chart-module-head { display: block; }
  .ic-chart-tabs { margin-top: 12px; }
  .ic-chart-frame { min-height: 230px; }
  .ic-chart-canvas { height: 230px; }
  .ic-chart-tooltip { max-width: 190px; }
}


/* Full-width chart row on calculator pages. */
body.is-ic-calculator-page .ic-tool-shell > .ic-chart-module {
  grid-column: 1 / -1;
  width: 100%;
}
