/* Contextual help is outside form labels and stays above cards/dialogs. */
sv-help {
  display: inline-flex;
  vertical-align: middle;
  flex: 0 0 auto;
  font-weight: 400;
}
sv-help button.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-muted);
  background: transparent;
  font: 600 12px/1 var(--font-ui);
  cursor: help;
  touch-action: manipulation;
}
sv-help .help-trigger > span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
sv-help button.help-trigger:hover,
sv-help button.help-trigger[aria-expanded='true'] {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
sv-help button.help-trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
sv-help .help-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 320px;
  padding: 16px 18px;
  border: 1px solid #cbc5e3;
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 6px 24px #20243c26;
  overflow: auto;
  overscroll-behavior: contain;
  font: 400 13px/1.6 var(--font-ui);
  text-align: left;
  letter-spacing: normal;
  white-space: normal;
  overflow-wrap: break-word;
}
sv-help .help-popover > strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}
sv-help .help-popover > p {
  margin: 7px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.6;
}
.help-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.help-heading > :is(h1, h2, h3) {
  min-width: 0;
}
.help-heading > sv-help {
  align-self: flex-start;
  margin-top: -1px;
}
.help-heading > h1 + sv-help {
  margin-top: 4px;
}
.field-help {
  position: relative;
  min-width: 0;
}
.field-help > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  column-gap: 4px;
}
.field-help > label > :is(input, select, textarea) {
  grid-column: 1 / -1;
}
.field-help > sv-help {
  position: absolute;
  right: 0;
  top: -5px;
}
.help-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.help-heading > p {
  margin-bottom: 0;
}
@media (pointer: coarse) {
  sv-help button.help-trigger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .field-help > label {
    grid-template-columns: minmax(0, 1fr) 36px;
  }
}
@media (forced-colors: active) {
  sv-help .help-popover {
    border-color: CanvasText;
  }
}
