/* One presentation for all graph settings beneath detailed analyses. */
.ps-unified-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--palette-border, var(--ps-dedfe3));
  border-radius: 10px;
  background: var(--palette-surface, var(--ps-ffffff));
  box-sizing: border-box;
}
.ps-graph-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 0 1 170px;
  min-width: 130px;
  margin: 0;
  color: var(--palette-text, var(--ps-1f2937));
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}
.ps-graph-field > select {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--palette-border, var(--ps-dedfe3));
  border-radius: 7px;
  background-color: var(--palette-surface, var(--ps-ffffff));
  color: var(--palette-text, var(--ps-1f2937));
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}
.ps-graph-field > select:focus-visible {
  outline: 2px solid var(--scheme-accent, #076c46);
  outline-offset: 2px;
}
.ps-unified-chart-controls > [role="button"],
.ps-unified-chart-controls > button {
  min-height: 40px !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 7px !important;
  justify-content: center;
}
.ps-unified-chart-controls > [role="alert"] {
  flex-basis: 100%;
}
@media (max-width: 680px) {
  .ps-unified-chart-controls { gap: 12px; padding: 12px; }
  .ps-unified-chart-controls > .ps-graph-field { flex: 1 1 calc(50% - 12px); min-width: 120px; }
  .ps-unified-chart-controls > [role="button"], .ps-unified-chart-controls > button { flex: 1 0 100%; }
}
@media (pointer: coarse) {
  .ps-graph-field > select, .ps-unified-chart-controls > [role="button"], .ps-unified-chart-controls > button { min-height: 44px !important; }
}
.ps-engine-plot {
  box-sizing: border-box;
  min-width: 0;
  padding: 10px 12px 4px;
  border: 1px solid var(--palette-border, var(--ps-dedfe3));
  border-radius: 10px;
  background: var(--palette-surface, var(--ps-ffffff));
}
.ps-engine-plot > svg { display: block; max-width: 100%; }
.ps-engine-plot .ps-contained-chart-legend { justify-content: flex-start; padding: 10px 6px; }
@media (max-width: 680px) {
  .ps-engine-plot { padding: 8px 4px 4px; }
  .ps-engine-plot .ps-contained-chart-legend { gap: 7px 12px; font-size: 11px; }
}

/* Detailed Engine forms and explanations share the chart controls' left edge. */
.workspace-panel[data-panel="editor"],
.workspace-panel[data-panel="empty-editor"] {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.workspace-panel .balanced-form,
[id^="engine-controls-"] .balanced-form {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0 !important;
  align-self: stretch;
  box-sizing: border-box;
}
.workspace-panel .balanced-form .ps-graph-field:not(.ps-unified-chart-controls > .ps-graph-field),
[id^="engine-controls-"] .balanced-form .ps-graph-field:not(.ps-unified-chart-controls > .ps-graph-field) {
  flex: 0 0 auto;
  width: min(100%, 420px);
}
@media (max-width: 760px) {
  .workspace-panel .balanced-form-grid,
  [id^="engine-controls-"] .balanced-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ps-engine-method {
  align-self: stretch;
  box-sizing: border-box;
  width: 100%;
  margin: 16px 0 0;
  text-align: left;
}
.ps-engine-method .ps-explanation-body > p {
  margin: 0 0 8px;
}
.ps-engine-method .ps-explanation-body > p:last-child {
  margin-bottom: 0;
}

.ps-chart-controls .ps-readable-info > button.ps-info-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--scheme-accent, var(--palette-text));
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.ps-chart-controls .ps-readable-info > button.ps-info-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
}
.ps-chart-controls .ps-info-icon[aria-expanded="true"] {
  background: var(--palette-surface, var(--ps-ffffff));
}

.ps-contained-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 12px;
  color: var(--ps-525866);
  font-size: 12px;
  line-height: 1.4;
}
.ps-contained-chart-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ps-contained-chart-key > i {
  display: inline-block;
  flex: 0 0 20px;
  width: 20px;
  height: 3px;
  border-radius: 1px;
}
.ps-contained-chart-key > i.is-bound {
  height: 1.5px;
}
.ps-contained-chart-key > i.is-dashed {
  height: 0;
  background: transparent !important;
  border-top: 2px dashed;
  border-radius: 0;
}

/* Property menus: the complete option row is the interaction target. */
.property-options,
.property-option-results {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.property-option-results > :is(button, [role="button"], .property-option-row),
.property-menu-surface .property-option-results :is(button, [role="button"], .property-option-row) {
  box-sizing: border-box !important;
  display: flex !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 40px !important;
  margin-inline: 0 !important;
  text-align: left;
  cursor: pointer;
}

/* Some native option renderers add a wrapper before the pressable row. */
.property-menu-surface .property-option-results > :has(> :is(button, [role="button"], .property-option-row)) {
  box-sizing: border-box;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.property-option-results > :is(button, [role="button"], .property-option-row):is(:hover, :focus-visible),
.property-menu-surface .property-option-results :is(button, [role="button"], .property-option-row):is(:hover, :focus-visible) {
  background: var(--ps-e8edf3) !important;
}

.property-option-results > :is(button, [role="button"], .property-option-row):is([aria-selected="true"], [aria-pressed="true"]),
.property-menu-surface .property-option-results :is(button, [role="button"], .property-option-row):is([aria-selected="true"], [aria-pressed="true"]) {
  background: var(--ps-ededed) !important;
}

.property-option-results > :is(button, [role="button"], .property-option-row):focus-visible,
.property-menu-surface .property-option-results :is(button, [role="button"], .property-option-row):focus-visible {
  outline: 2px solid var(--scheme-accent, #076c46);
  outline-offset: -2px;
}

@media (pointer: coarse) {
  .property-option-results > :is(button, [role="button"], .property-option-row),
  .property-menu-surface .property-option-results :is(button, [role="button"], .property-option-row) {
    min-height: 44px !important;
  }
}
