.config-surface { container-type: inline-size; }
.config-surface .editor-header {
  padding-bottom: 0.75rem;
  border-bottom: 0.0625rem solid #dfe5ef;
}
.editor-header .file-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #435b83;
}
.editor-header .file-tag::before { content: '{ }'; color: var(--blue); }
.config-surface #preset-description { margin: 0.875rem 0 0.875rem 2.5rem; line-height: 1.6; }
.config-surface #fields { counter-reset: config-line; padding-left: 2.5rem; }
.config-surface .editor-section {
  margin: 1rem 0 0;
  padding: 0.125rem 0 0.125rem 0.625rem;
  border-left-color: #dce3ee;
}
.config-surface .editor-section:first-of-type { margin-top: 0; }
.config-surface .editor-section-heading { margin-left: -0.6875rem; }
.config-surface .section-toggle { color: #435b83; font-size: 0.75rem; font-weight: 500; }
.config-surface .field-row { position: relative; padding-block: 0.1875rem; }
.config-surface .field-row::before {
  position: absolute;
  right: calc(100% + 1rem);
  top: 0.1875rem;
  min-width: 1.5rem;
  color: #9aa5b6;
  font: 0.625rem/1.875rem ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: right;
  counter-increment: config-line;
  content: counter(config-line, decimal-leading-zero);
  pointer-events: none;
}
.config-surface .field-row.is-dependent { margin-left: 0; padding-left: 0; border-left: 0; }
.config-surface .is-dependent .field-key { padding-left: 0.5rem; }
.config-surface .field-body { grid-template-columns: 8.75rem minmax(0, 1fr); align-items: center; gap: 0.625rem; }
.config-surface .field-key, .config-surface .field-value { font-size: 0.6875rem; }
.config-surface .field-key { min-height: 1.875rem; color: #566480; }
.config-surface .equals { margin-left: auto; color: #9aa5b6; }
.config-surface .field-value { margin-left: 0; }
.config-surface .string-value { border-color: transparent; background: transparent; color: #327569; }
.config-surface .string-value::before, .config-surface .string-value::after { content: '"'; color: #91a69f; }
.config-surface .string-value::before { padding-left: 0.25rem; }
.config-surface .string-value::after { padding-right: 0.25rem; }
.config-surface .string-value .value-input { padding-inline: 0.125rem; caret-color: var(--blue); }
.config-surface .select-value { width: fit-content; max-width: 100%; border-color: #dfe4ec; background: #f4f6f9; color: #566480; border-radius: 0.375rem; }
.config-surface .select-value .value-input { width: auto; max-width: 100%; padding-inline: 0.5rem 1.75rem; text-overflow: ellipsis; }
.config-surface .select-value::after {
  content: '';
  top: 50%;
  right: 0.625rem;
  width: 0.3125rem;
  height: 0.3125rem;
  margin-top: -0.25rem;
  border: solid currentColor;
  border-width: 0 0.0625rem 0.0625rem 0;
  transform: rotate(45deg);
}
.config-surface .select-value:has(select:disabled) { color: #8a919f; background: #f0f2f6; }
.config-surface .string-value:hover:has(input:enabled) { border-color: #dce2ed; background: #ffffff80; }
.config-surface .select-value:hover:has(select:enabled) { border-color: #c3cdda; background: #edf1f6; }
.config-surface .field-row:focus-within { background: #0075d608; }
.config-surface .field-value:focus-within { border-color: #89b7e7; background: white; box-shadow: 0 0 0 0.125rem #0075d611; }
.config-surface .config-footer { margin: 1rem 0 0 2.5rem; padding-top: 0.75rem; }

@media (hover: hover) and (pointer: fine) {
  .config-surface .help-button { opacity: 0; }
  .config-surface .field-row:hover .help-button,
  .config-surface .field-row:focus-within .help-button { opacity: 1; }
}

@container (max-width: 23rem) {
  .config-surface .field-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .config-surface .field-value { margin-left: 0.5rem; }
  .config-surface .value-input { font-size: 1rem; }
  .config-surface .editor-hint { max-width: 7rem; text-align: right; }
}
