.weather-profile-chart-shell {
  --weather-profile-chart-control-bg: rgba(15, 31, 50, 0.96);
  --weather-profile-chart-control-border: rgba(125, 211, 252, 0.3);
  --weather-profile-chart-control-text: #e0f2fe;
  --weather-profile-chart-control-hover: #38bdf8;
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: inherit;
  overflow: hidden;
  background: inherit;
}

.weather-profile-chart-shell.is-light {
  --weather-profile-chart-control-bg: rgba(248, 250, 252, 0.98);
  --weather-profile-chart-control-border: rgba(71, 85, 105, 0.3);
  --weather-profile-chart-control-text: #334155;
  --weather-profile-chart-control-hover: #0369a1;
}

.weather-profile-chart-toolbar {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 4px 8px;
  border-bottom: 1px solid var(--weather-profile-chart-control-border);
  background: var(--weather-profile-chart-control-bg);
}

.weather-profile-chart-zoom-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--weather-profile-chart-control-border);
  border-radius: 4px;
  background: transparent;
  color: var(--weather-profile-chart-control-text);
  font: 700 15px/1 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.weather-profile-chart-zoom-button.is-reset {
  width: 56px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.weather-profile-chart-zoom-button:hover:not(:disabled),
.weather-profile-chart-zoom-button:focus-visible {
  border-color: var(--weather-profile-chart-control-hover);
  outline: 2px solid color-mix(in srgb, var(--weather-profile-chart-control-hover) 22%, transparent);
  outline-offset: 0;
}

.weather-profile-chart-zoom-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.weather-profile-chart-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}

.weather-profile-chart-shell
  .weather-profile-chart-viewport
  > .weather-profile-chart-zoom-svg {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  min-height: 0;
  cursor: crosshair;
  outline: none;
}

.weather-profile-chart-shell.is-zoomed
  .weather-profile-chart-viewport
  > .weather-profile-chart-zoom-svg,
.weather-profile-chart-shell.is-zoomed .weather-aerogram-hover-target,
.weather-profile-chart-shell.is-zoomed .weather-time-section-hover-target {
  cursor: grab;
}

.weather-profile-chart-shell.is-panning
  .weather-profile-chart-viewport
  > .weather-profile-chart-zoom-svg,
.weather-profile-chart-shell.is-panning .weather-aerogram-hover-target,
.weather-profile-chart-shell.is-panning .weather-time-section-hover-target {
  cursor: grabbing;
}

.weather-flight-profile-chart > .weather-profile-chart-shell {
  height: 656px;
}

.profile-widget-chart > .weather-profile-chart-shell {
  height: auto;
  min-height: 400px;
  aspect-ratio: var(--weather-profile-chart-aspect-ratio);
}

@media (max-width: 640px) {
  .weather-profile-chart-toolbar {
    min-height: 44px;
    padding: 4px 8px;
  }

  .weather-profile-chart-zoom-button {
    width: 36px;
    height: 36px;
  }

  .weather-profile-chart-zoom-button.is-reset {
    width: 64px;
  }

  .weather-flight-profile-chart > .weather-profile-chart-shell {
    height: 556px;
  }

  .profile-widget-chart > .weather-profile-chart-shell {
    min-height: 360px;
  }
}

@media print {
  .weather-profile-chart-shell {
    display: block;
    aspect-ratio: auto;
  }

  .weather-profile-chart-toolbar {
    display: none;
  }
}
