@font-face {
  font-family: 'Roboto';
  font-display: swap;
  src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu7GxKOzY.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-display: swap;
  src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --chart-primary-color: #E69F00;
  --chart-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --chart-text-color: #6b7280;
  --chart-grid-color: #9ca3af;
  --chart-grid-opacity: 0.4;
  --chart-bg: #ffffff;
  --chart-tooltip-bg: #ffffff;
  --chart-tooltip-border: #e5e7eb;
  --chart-tooltip-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  --chart-tooltip-radius: 7px;
  --chart-radius-sm: 4px;
  --chart-radius-md: 7px;
  --chart-spacing-xs: 2px;
  --chart-spacing-sm: 4px;
  --chart-spacing-md: 8px;
  --chart-spacing-lg: 16px;
  --chart-button-color: #6b7280;
  --chart-button-hover-bg: rgba(107, 114, 128, 0.1);
  --chart-focus-ring: 0 0 0 2px rgba(59, 130, 246, 0.5);
  --chart-transition-speed: 300ms;
  --chart-ref-line-color: #9ca3af;
  --chart-ref-line-width: 2px;
  --chart-cursor-rule-color: #6b7280;
  --chart-cursor-rule-width: 1px;
  --chart-cursor-rule-dasharray: 3 3;
  --chart-calendar-cell-gap: 2;
  --chart-calendar-cell-stroke: none;
  --chart-calendar-empty-fill: #ebedf0;
  --chart-legend-inactive-opacity: 0.4;
  --chart-sheet-bg: #ffffff;
  --chart-sheet-border: rgba(17, 24, 39, 0.1);
  --chart-sheet-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  --chart-sheet-backdrop: rgba(15, 23, 42, 0.32);
  --chart-sheet-surface: rgba(243, 244, 246, 0.9);
  --chart-sheet-accent: #111827;
  --chart-brush-fill: rgba(0, 0, 0, 0.08);
  --chart-brush-stroke: #6b7280;
  --chart-brush-dim-opacity: 0.25;
  --chart-annotation-ring: #E63946;
  --chart-annotation-font-size: 11px;
  --chart-status-bar-bg: #f9fafb;
  --chart-status-bar-color: #6b7280;
  --chart-popover-bg: #ffffff;
  --chart-popover-border: #e5e7eb;
  --chart-popover-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  --chart-slider-track: #e5e7eb;
  --chart-slider-thumb: #E69F00;
}

@media (prefers-reduced-motion: reduce) {
  :root { --chart-transition-speed: 0ms; }
}

.myIO-svg {
  background: var(--chart-bg);
}

.myIO-hover-rule {
  stroke: var(--chart-cursor-rule-color);
  stroke-width: var(--chart-cursor-rule-width);
  stroke-dasharray: var(--chart-cursor-rule-dasharray);
  pointer-events: none;
}

.inner-text,
.legendElement,
.x-label,
.y-label,
.legend-label,
.myIO-chart-title,
.myIO-axis-title,
.myIO-inline-legend-label,
.toolTip,
.button,
.myIO-empty-state {
  font-family: var(--chart-font);
}

.inner-text,
.x-label,
.y-label,
.legend-label,
.myIO-axis-title,
.myIO-inline-legend-label {
  font-size: 13px;
  fill: var(--chart-text-color);
}

.myIO-chart-title {
  fill: var(--chart-sheet-accent);
  font-size: 16px;
  font-weight: 700;
}

.myIO-inline-legend-item {
  cursor: pointer;
  outline: none;
}

.myIO-inline-legend-item:focus-visible .myIO-inline-legend-hit {
  stroke: var(--chart-sheet-accent, #2563eb);
  stroke-width: 2px;
  rx: 3px;
}

.myIO-inline-legend-label {
  font-size: 12px;
  dominant-baseline: middle;
}

.dot {
  height: 10px;
  width: 10px;
  min-width: 10px;
  border-radius: 50%;
  display: inline-block;
}

.axis {
  shape-rendering: crispEdges;
}

.x-grid,
.y-grid {
  stroke: var(--chart-grid-color);
  stroke-width: 1px;
  opacity: var(--chart-grid-opacity);
  stroke-dasharray: 3, 3;
  shape-rendering: crispEdges;
}

.x-axis-line,
.y-axis-line,
.legend-line {
  display: none;
}

.toolTip {
  pointer-events: none;
  position: absolute;
  z-index: 9999;
  display: none;
  max-width: 280px;
  min-width: 125px;
  height: auto;
  color: var(--chart-text-color);
  background: var(--chart-tooltip-bg);
  border: 1px solid var(--chart-tooltip-border);
  border-radius: var(--chart-tooltip-radius);
  line-height: 1.4;
  box-shadow: var(--chart-tooltip-shadow);
}

.toolTipTitle {
  min-height: 35px;
  border-left: 3px solid var(--chart-text-color);
}

.toolTipTitle span {
  font-weight: 700;
  min-width: 125px;
  margin: auto;
  padding: 10px 12px 8px;
  text-align: left;
  display: block;
}

.toolTipBody {
  min-width: 120px;
  padding: 0 12px 12px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.toolTipItem {
  display: flex;
  align-items: center;
  gap: var(--chart-spacing-sm);
  margin-top: var(--chart-spacing-sm);
}

.toolTipLabel {
  font-weight: 600;
}

.toolTipValue {
  margin-left: auto;
}

.myIO-fab {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 21;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--chart-sheet-accent);
  background: var(--chart-sheet-bg);
  box-shadow: var(--chart-sheet-shadow);
  cursor: pointer;
  transition: transform var(--chart-transition-speed) ease, box-shadow var(--chart-transition-speed) ease, opacity var(--chart-transition-speed) ease;
}

.myIO-fab:hover {
  transform: translateY(-1px);
}

.myIO-fab:focus-visible {
  outline: none;
  box-shadow: var(--chart-sheet-shadow), var(--chart-focus-ring);
}

.myIO-fab svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

/* Tier class is applied by JS from the widget's own container width, so a
   narrow widget in a wide viewport gets consistent narrow-tier treatment. */
.myIO-container:not(.myIO-container--narrow) .myIO-fab {
  bottom: auto;
  top: 8px;
}

.myIO-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.myIO-sheet-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--chart-text-color);
  opacity: 0.5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--chart-transition-speed) ease, background-color var(--chart-transition-speed) ease;
}

.myIO-sheet-close:hover {
  opacity: 1;
  background: var(--chart-button-hover-bg);
}

.myIO-sheet-close:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-sheet-close svg {
  width: 14px;
  height: 14px;
}

.myIO-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--chart-sheet-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--chart-transition-speed) ease;
}

.myIO-sheet-backdrop--open {
  opacity: 1;
  pointer-events: all;
}

.myIO-panel {
  position: absolute;
  z-index: 21;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--chart-sheet-bg);
  color: var(--chart-text-color);
  box-shadow: var(--chart-sheet-shadow);
  opacity: 0;
  pointer-events: all;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: transform var(--chart-transition-speed) ease, opacity var(--chart-transition-speed) ease;
  will-change: transform, opacity;
}

.myIO-panel--bottom {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60%;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--chart-sheet-border);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
}

.myIO-panel--side {
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  max-width: 100%;
  padding: 16px 14px;
  border-left: 1px solid var(--chart-sheet-border);
  border-radius: 16px 0 0 16px;
  transform: translateX(100%);
}

.myIO-panel--open {
  opacity: 1;
}

.myIO-panel--open.myIO-panel--bottom,
.myIO-panel--open.myIO-panel--side {
  transform: translate(0, 0);
}

.myIO-sheet-handle {
  display: none;
  align-self: center;
  width: 42px;
  height: 5px;
  margin: 2px 0 4px;
  border-radius: 999px;
  background: var(--chart-sheet-surface);
}

.myIO-sheet-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.myIO-sheet-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chart-text-color);
}

.myIO-sheet-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.myIO-sheet-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color var(--chart-transition-speed) ease, opacity var(--chart-transition-speed) ease;
}

.myIO-sheet-legend-item:hover {
  background: var(--chart-button-hover-bg);
}

.myIO-sheet-legend-item:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-sheet-legend-item[aria-checked="false"] {
  opacity: var(--chart-legend-inactive-opacity);
}

.myIO-sheet-swatch {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.myIO-sheet-legend-label {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.3;
}

.myIO-sheet-gradient {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1f5f9 0%, #94a3b8 50%, #0f172a 100%);
}

.myIO-sheet-gradient-ticks {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.myIO-sheet-gradient-ticks span {
  font-size: 12px;
  line-height: 1.2;
  color: var(--chart-text-color);
  white-space: nowrap;
}

.myIO-sheet-divider {
  border: 0;
  border-top: 1px solid var(--chart-sheet-border);
  margin: 4px 0;
}

.myIO-sheet-legend-reset {
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--chart-sheet-accent);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
}

.myIO-sheet-legend-reset:hover {
  opacity: 1;
  text-decoration: underline;
}

.myIO-sheet-legend-reset:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-container--narrow .myIO-sheet-handle {
  display: block;
}

/* Grid mode is item-count-driven (set in JS), not tier-driven. */
.myIO-sheet-legend--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.myIO-sheet-legend--grid .myIO-sheet-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.myIO-panel--side {
  max-height: none;
}

.myIO-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.myIO-sheet-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--chart-transition-speed) ease;
}

.myIO-sheet-action:hover {
  background: var(--chart-button-hover-bg);
}

.myIO-sheet-action:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-sheet-action-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.myIO-sheet-action-icon svg {
  width: 16px;
  height: 16px;
}

.myIO-sheet-action-label {
  flex: 1 1 auto;
}

.button {
  color: var(--chart-button-color);
  border-radius: var(--chart-radius-md);
  padding: 6px;
  margin: 0;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  width: 44px;
  height: 32px;
  transition: background-color 0.15s ease;
}

.button:hover {
  background-color: var(--chart-button-hover-bg);
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.legendElement {
  cursor: pointer;
}

.legendElement:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

[class^="tag-bar-"],
[class^="tag-point-"],
[class^="tag-hexbin-"],
[class^="tag-tree-"],
.tag-grouped-bar-g rect,
.donut,
.button,
.legendElement {
  cursor: pointer;
}

.toolLine {
  stroke: var(--chart-ref-line-color);
  stroke-width: var(--chart-ref-line-width);
}

.myIO-empty-state {
  font-size: 14px;
  fill: var(--chart-text-color);
  text-anchor: middle;
  dominant-baseline: central;
  opacity: 0.5;
}

.sr-only,
.myIO-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Brush selection */
.myIO-brush .overlay {
  cursor: crosshair;
}

.myIO-brush .selection {
  fill: var(--chart-brush-fill);
  stroke: var(--chart-brush-stroke);
  stroke-dasharray: 4, 4;
}

/* Status bar */
.myIO-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--chart-spacing-md);
  padding: var(--chart-spacing-sm) var(--chart-spacing-md);
  background: var(--chart-status-bar-bg);
  color: var(--chart-status-bar-color);
  font-family: var(--chart-font);
  font-size: 12px;
  border-top: 1px solid var(--chart-sheet-border);
}

.myIO-status-bar-actions {
  display: flex;
  gap: var(--chart-spacing-sm);
}

.myIO-status-bar-btn {
  padding: 2px 8px;
  border: 1px solid var(--chart-sheet-border);
  border-radius: var(--chart-radius-sm);
  background: var(--chart-sheet-bg);
  color: var(--chart-status-bar-color);
  font-family: var(--chart-font);
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.myIO-status-bar-btn:hover {
  background: var(--chart-button-hover-bg);
}

.myIO-status-bar-btn:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-keyframe-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--chart-spacing-sm);
  padding: var(--chart-spacing-sm) var(--chart-spacing-md);
  border-top: 1px solid var(--chart-sheet-border);
  background: var(--chart-status-bar-bg);
  color: var(--chart-status-bar-color);
  font-family: var(--chart-font);
  font-size: 12px;
}

.myIO-keyframe-button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--chart-sheet-border);
  border-radius: var(--chart-radius-sm);
  background: var(--chart-sheet-bg);
  color: var(--chart-status-bar-color);
  font: inherit;
  cursor: pointer;
}

.myIO-keyframe-button:hover:not(:disabled) {
  background: var(--chart-button-hover-bg);
}

.myIO-keyframe-button:focus-visible {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-keyframe-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.myIO-keyframe-label {
  min-width: 8ch;
  font-weight: 600;
  text-align: center;
}

/* Annotation marks */
.myIO-annotation-label {
  font-family: var(--chart-font);
  font-size: var(--chart-annotation-font-size);
  fill: var(--chart-text-color);
  pointer-events: none;
}

/* Popover */
.myIO-popover {
  position: absolute;
  z-index: 9999;
  min-width: 170px;
  max-width: 220px;
  padding: var(--chart-spacing-md);
  background: var(--chart-popover-bg);
  border: 1px solid var(--chart-popover-border);
  border-radius: var(--chart-radius-md);
  box-shadow: var(--chart-popover-shadow);
  font-family: var(--chart-font);
  font-size: 13px;
  color: var(--chart-text-color);
}

.myIO-popover-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--chart-spacing-md);
}

.myIO-popover-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.myIO-popover-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--chart-popover-border);
  border-radius: var(--chart-radius-sm);
  font-family: var(--chart-font);
  font-size: 13px;
  box-sizing: border-box;
}

.myIO-popover-input:focus {
  outline: none;
  box-shadow: var(--chart-focus-ring);
}

.myIO-popover-colors {
  display: flex;
  gap: 4px;
}

.myIO-popover-color-btn {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.myIO-popover-color-btn.selected {
  border-color: var(--chart-sheet-accent);
}

.myIO-popover-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.myIO-popover-btn {
  padding: 4px 10px;
  border: 1px solid var(--chart-popover-border);
  border-radius: var(--chart-radius-sm);
  background: var(--chart-sheet-bg);
  color: var(--chart-text-color);
  font-family: var(--chart-font);
  font-size: 12px;
  cursor: pointer;
}

.myIO-popover-btn--primary {
  background: var(--chart-primary-color);
  color: #fff;
  border-color: var(--chart-primary-color);
}

.myIO-popover-btn--danger {
  color: #E63946;
  border-color: #E63946;
}

/* Sliders */
.myIO-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--chart-spacing-sm);
  padding: var(--chart-spacing-sm) var(--chart-spacing-md);
  font-family: var(--chart-font);
}

.myIO-slider-row {
  display: flex;
  align-items: center;
  gap: var(--chart-spacing-md);
}

.myIO-slider-label {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--chart-text-color);
  min-width: 100px;
}

.myIO-slider-input {
  flex: 1 1 auto;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--chart-slider-track);
  border-radius: 2px;
  outline: none;
}

.myIO-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--chart-slider-thumb);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.myIO-slider-input:focus-visible {
  box-shadow: var(--chart-focus-ring);
}

.myIO-slider-input:disabled {
  cursor: not-allowed;
}

.myIO-slider-value {
  flex: 0 0 auto;
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--chart-text-color);
}

/* ── Export: copy submenu ── */
.myIO-copy-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  background: var(--chart-sheet-bg);
  border: 1px solid var(--chart-sheet-border);
  border-radius: var(--chart-radius-md);
  box-shadow: var(--chart-popover-shadow);
  padding: var(--chart-spacing-xs) 0;
  min-width: 140px;
}

.myIO-copy-menu-item {
  display: block;
  width: 100%;
  padding: var(--chart-spacing-sm) var(--chart-spacing-md);
  font-family: var(--chart-font);
  font-size: 13px;
  color: var(--chart-text-color);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
}

.myIO-copy-menu-item:hover,
.myIO-copy-menu-item:focus {
  background: var(--chart-button-hover-bg);
  outline: none;
}

.myIO-copy-menu-item:focus-visible {
  box-shadow: var(--chart-focus-ring);
}

/* ── Export: success feedback ── */
.myIO-btn-success svg {
  color: #22c55e;
}

/* ── Screen reader announcements ── */
.myIO-sr-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Calendar heatmap ── */
.myIO-calendar-cell {
  stroke: var(--chart-calendar-cell-stroke);
  shape-rendering: crispEdges;
  cursor: pointer;
}

.myIO-calendar-month,
.myIO-calendar-dow {
  font-size: 10px;
  fill: var(--chart-text-color, #6b7280);
  font-family: var(--chart-font, system-ui, sans-serif);
}

[data-theme="dark"] {
  --chart-calendar-empty-fill: #27272a;
}

@media print {
  .myIO-fab,
  .myIO-panel,
  .myIO-sheet-backdrop { display: none !important; }
  .toolTip { display: none !important; }
  .myIO-status-bar { display: none !important; }
  .myIO-keyframe-controls { display: none !important; }
  .myIO-popover { display: none !important; }
  .myIO-slider-wrapper { display: none !important; }
}
