/* Charts made with the chart shortcode: the Jev Field Guide's widget card.
   Colors and fonts are the site's CSS custom properties (_theme/theme.scss),
   so light and dark mode need no rules here. */

.chartkit.widget {
  margin: 1.6em 0 1.8em;
  padding: 16px 18px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  position: relative;
}

.chartkit .w-kicker {
  margin: 0 0 4px;
  font: 600 0.68rem/1.3 var(--font-sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.chartkit .w-title {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
}

.chartkit .w-sub {
  margin: 3px 0 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.chartkit :is(.w-kicker, .w-title, .w-sub, .w-note, .w-src) > p {
  margin: 0 !important;
}

.chartkit .w-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.chartkit .w-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chartkit .w-legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.chartkit .w-legend i.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chartkit .w-legend i.dash {
  background: repeating-linear-gradient(to right, currentColor 0 5px, transparent 5px 9px) !important;
}

.chartkit .w-legend .c1 {
  background: var(--c1);
  color: var(--c1);
}

.chartkit .w-legend .c2 {
  background: var(--c2);
  color: var(--c2);
}

.chartkit .w-legend .c3 {
  background: var(--c3);
  color: var(--c3);
}

.chartkit .w-legend .cp {
  background: var(--person);
  color: var(--person);
}

.chartkit .w-chart {
  position: relative;
  width: 100%;
  min-height: var(--ck-h, 200px);
}

html:not(.ck-js) .chartkit .w-chart {
  display: none;
}

.chartkit .w-chart[data-ready] {
  min-height: 0;
}

.chartkit .w-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 20px;
}

.chartkit .w-grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
}

.chartkit .w-panel-title {
  margin: 0 0 2px !important;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}

.chartkit .w-panel-chart {
  position: relative;
}

.chartkit .w-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  margin: 4px 0 12px;
  font-size: 0.86rem;
  color: var(--text-2);
}

.chartkit .w-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.chartkit .w-controls output {
  font: 500 0.86rem/1 var(--font-mono);
  color: var(--text);
  min-width: 3.4em;
  font-variant-numeric: tabular-nums;
}

.chartkit input[type="range"] {
  accent-color: var(--accent);
  width: 170px;
  max-width: 100%;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.chartkit .w-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}

.chartkit .stat {
  min-width: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
}

.chartkit .stat b {
  display: block;
  font: 600 1.14rem/1.25 var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.chartkit .stat span {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
}

.chartkit .stat.hl {
  background: var(--accent-soft);
}

.chartkit .w-note {
  margin: 10px 0 2px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-2);
}

.chartkit .w-src {
  margin: 8px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.chartkit .w-data {
  margin-top: 8px;
  font-size: 0.8rem;
}

.chartkit .w-data summary {
  cursor: pointer;
  color: var(--link);
  width: max-content;
}

.chartkit .w-data .table-wrap {
  margin: 8px 0 2px;
  max-height: 22rem;
  overflow: auto;
}

.chartkit .w-data table {
  font-size: 0.8rem;
}

.chartkit .w-data th, .chartkit .w-data td {
  padding: 5px 10px !important;
}

.chartkit .w-data td.num, .chartkit .w-data th.num {
  text-align: right;
  white-space: nowrap;
}

/* The SVG ---------------------------------------------------------------- */

.chartkit .chart {
  display: block;
  overflow: visible;
  touch-action: pan-y;
}

.chartkit .chart text {
  font-family: var(--font-sans);
  font-size: 11.5px;
  fill: var(--muted);
}

.chartkit .chart .t-strong {
  fill: var(--text-2);
  font-weight: 500;
}
.chartkit .chart .t-label {
  fill: var(--text-2);
  font-size: 12px;
}
.chartkit .chart .grid {
  stroke: var(--border);
  stroke-width: 1;
}
.chartkit .chart .base {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.chartkit .chart .ref {
  stroke: var(--border-strong);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  fill: none;
}
.chartkit .chart .ref-strong {
  stroke: var(--text-2);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  fill: none;
}
.chartkit .chart .xhair {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chartkit .chart .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chartkit .chart .band {
  fill: var(--band);
}
.chartkit .chart .gap {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.chartkit .chart .dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.chartkit .chart .ring {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
}
.chartkit .chart .l1 {
  stroke: var(--c1);
}
.chartkit .chart .l2 {
  stroke: var(--c2);
}
.chartkit .chart .l3 {
  stroke: var(--c3);
}
.chartkit .chart .lp {
  stroke: var(--person);
}
.chartkit .chart .f1 {
  fill: var(--c1);
}
.chartkit .chart .f2 {
  fill: var(--c2);
}
.chartkit .chart .f3 {
  fill: var(--c3);
}
.chartkit .chart .fp {
  fill: var(--person);
}
.chartkit .chart .hit {
  fill: transparent;
  cursor: crosshair;
}

.chartkit .tip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: nowrap;
  color: var(--text);
}

.chartkit .tip b {
  font-weight: 600;
}

.chartkit .tip .k {
  color: var(--muted);
}

.chartkit .tip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 0;
}

@media (max-width: 560px) {
  .chartkit.widget {
    padding: 14px 12px 12px;
  }
}

@media print {
  .chartkit .tip {
    display: none;
  }
}
