.config-surface { padding: 1rem; border: 0.0625rem solid #dfe5ef; border-radius: 1.75rem; background: #f7f8fc; box-shadow: 0 0.1875rem 0.625rem #20284605, inset 0 0.0625rem 0 white; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 0.875rem; }
.editor-hint { color: var(--muted); font-size: 0.625rem; }
#preset-description { margin: 0.625rem 0 0.5rem; color: #737d90; font: 0.6875rem/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; }
#preset-description::before { content: '# '; }
#config-form { margin: 0; }
#fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-row { display: grid; grid-template-columns: 1.125rem minmax(0, 1fr); gap: 0.1875rem; padding-block: 0.1875rem; border-radius: 0.5rem; }
#fields [hidden] { display: none; }
.field-body { display: grid; grid-template-columns: minmax(8.4375rem, .85fr) minmax(0, 1.15fr); align-items: start; column-gap: 0.625rem; min-width: 0; }
.field-row.is-dependent { margin-left: 0.9375rem; padding-left: 0.5625rem; border-left: 0.0625rem solid #dfe5ef; border-radius: 0; }
.field-key { position: relative; display: flex; align-items: center; gap: 0.3125rem; min-width: 0; min-height: 1.75rem; font: 0.75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.key-label { min-width: 0; overflow-wrap: anywhere; }
.equals { margin-left: auto; color: #7e8592; }
.field-value { min-width: 0; font: 0.75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.field-gutter { width: 1rem; }
.optional-toggle { align-self: start; margin: 0.375rem 0 0; }
#fields input[type='checkbox'] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0.0625rem solid #b9c5d6;
  border-radius: 0.3125rem;
  background: linear-gradient(180deg, #fff, #f3f6fb);
  box-shadow: inset 0 0.0625rem 0 #fff, 0 0.0625rem 0.125rem #253d6010;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
#fields input[type='checkbox']::before {
  content: '';
  width: 0.25rem;
  height: 0.5rem;
  margin-top: -0.125rem;
  border: solid white;
  border-width: 0 0.125rem 0.125rem 0;
  transform: rotate(45deg);
  opacity: 0;
}
#fields input[type='checkbox']:checked {
  border-color: #0868ba;
  background: var(--blue);
  box-shadow: inset 0 0.0625rem 0 #ffffff40, 0 0.0625rem 0.1875rem #0075d624;
}
#fields input[type='checkbox']:checked::before { opacity: 1; }
#fields input[type='checkbox']:enabled:hover { border-color: var(--blue); box-shadow: 0 0 0 0.1875rem #0075d610; }
#fields input[type='checkbox']:focus-visible { outline: 0.125rem solid var(--blue); outline-offset: 0.1875rem; }
#fields input[type='checkbox']:disabled { cursor: default; opacity: .45; box-shadow: none; }
.string-value, .select-value { display: flex; align-items: center; min-width: 0; min-height: 1.75rem; border: 0.0625rem solid #dce2ed; border-radius: 0.5625rem; background: white; color: #314355; transition: border-color .15s, box-shadow .15s; }
.string-value:hover:has(input:enabled), .select-value:hover:has(select:enabled) { border-color: #cbd6e7; background: white; }
.string-value:focus-within, .select-value:focus-within { border-color: #89b7e7; background: white; box-shadow: 0 0 0 0.1875rem #0075d611; }
.value-input { width: 100%; min-width: 0; height: 1.625rem; padding: 0.1875rem 0.5rem; border: 0; border-radius: 0.3125rem; background: transparent; color: inherit; font: inherit; }
.value-input:focus { outline: 0; }
.value-input::placeholder { color: #8a919f; }
.value-input:disabled { cursor: default; color: #8a919f; -webkit-text-fill-color: currentColor; opacity: 1; }
.is-inactive .key-label, .is-disabled .key-label { color: #858d9b; }
.checkbox-caption.is-unchecked { color: #858d9b; text-decoration: line-through; }
.is-inactive .field-value, .is-disabled .field-value { color: #8a919f; background: #eff1f6; }
.field-help { display: inline-flex; flex: none; align-items: center; }
.help-button { display: inline-grid; place-items: center; width: 1.0625rem; height: 1.0625rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #77859b; font: 0.625rem Arial, Helvetica, sans-serif; }
.help-button:hover, .help-button:focus-visible { background: #e4eaf4; color: #264a7a; }
.field-tooltip { position: absolute; z-index: 10; top: 100%; left: 0; width: min(19.375rem, calc(100vw - 6.25rem)); padding: 0.9375rem 1.0625rem; border-radius: 0.875rem; background: #20232b; color: #f8f9ff; box-shadow: 0 0.5rem 1.625rem #12172a2b; font: 0.75rem/1.65 Arial, Helvetica, sans-serif; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s; }
.field-help:focus-within .field-tooltip, .field-help.is-open .field-tooltip { opacity: 1; visibility: visible; pointer-events: auto; }
.field-help.is-dismissed .field-tooltip { opacity: 0; visibility: hidden; pointer-events: none; }
.config-footer { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.875rem; margin: 0.625rem 0 0 1.25rem; padding-top: 0.375rem; border-top: 0.0625rem solid #e2e7f0; }
.toml-preview { min-width: 0; max-width: 100%; font-size: 0.6875rem; color: var(--muted); }
.toml-preview summary { width: fit-content; padding: 0.375rem 0; list-style: none; }
.toml-preview summary:hover { color: var(--blue); }
.toml-preview summary::-webkit-details-marker { display: none; }
.toml-preview summary span { margin-left: 0.4375rem; }
.toml-preview pre { margin: 0.875rem 0 0; max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.6875rem; line-height: 1.8; color: #484850; }
.prompt-surface { padding: 1.5rem 0.4375rem 0; }
.output-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.625rem; margin-bottom: 1.875rem; }
.output-file { color: #797981; font-size: 0.6875rem; }
#prompt-meta { color: var(--muted); font-size: 0.625rem; }
.prompt-document { display: grid; gap: 1.75rem; user-select: text; }
.prompt-document.is-empty { color: var(--muted); font-size: 0.875rem; line-height: 1.8; }
.prompt-block h3 { margin: 0 0 0.6875rem; color: #4c5565; font: 0.75rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.prompt-block p { margin: 0 0 0.75rem; color: #2d323b; font-size: 0.875rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-block p:last-child { margin-bottom: 0; }
.output-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.9375rem; margin-top: 2.125rem; padding-top: 1.25rem; border-top: 0.0625rem solid #eeeef2; }
.output-footer > span { max-width: 8.125rem; color: var(--muted); font-size: 0.6875rem; line-height: 1.6; }

@media (hover: hover) {
  .field-key:hover .field-tooltip { opacity: 1; visibility: visible; pointer-events: auto; }
  .field-key .field-help.is-dismissed .field-tooltip { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (max-width: 65.625rem) {
  .config-surface { padding: 1rem; }
  .field-body { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
  .field-value { margin-left: 1rem; }
}

@media (max-width: 43.75rem) {
  .config-surface { border-radius: 1.5rem; padding: 0.875rem; }
  .editor-hint { font-size: 0.5625rem; }
  .field-row { padding-block: 0.25rem; }
  .field-key { font-size: 0.75rem; }
  .field-body { gap: 0.0625rem; }
  .field-value { font-size: 0.875rem; }
  .value-input { font-size: 1rem; }
  .field-row.is-dependent { margin-left: 0.5rem; padding-left: 0.375rem; }
  .config-footer { margin-left: 1.25rem; }
  .prompt-surface { padding: 0.9375rem 0.25rem 0; }
  .output-footer > span { max-width: 6.25rem; }
  .output-footer .button--primary { gap: 0.625rem; padding-left: 0.9375rem; font-size: 0.8125rem; }
}

.editor-section { min-width: 0; margin: 0.75rem 0 0 0.125rem; padding: 0.25rem 0 0.125rem 0.625rem; border: 0; border-left: 0.0625rem solid #dce3ee; }
.editor-section-heading { margin-left: -0.6875rem; padding: 0 0.75rem 0 0; }
.section-toggle { display: inline-flex; align-items: center; gap: 0.5625rem; color: #435b83; font: 600 0.8125rem ui-monospace, SFMono-Regular, Consolas, monospace; cursor: pointer; }
.section-toggle input { margin: 0; }
.select-value { position: relative; }
.select-value select { appearance: none; padding-right: 1.6875rem; }
.select-value::after { position: absolute; right: 0.625rem; content: '⌄'; color: #6a7891; font-size: 0.875rem; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  #fields input[type='checkbox'] { transition: none; }
}

@media (forced-colors: active) {
  #fields input[type='checkbox'] { appearance: auto; background: none; box-shadow: none; }
  #fields input[type='checkbox']::before { content: none; }
}
