.wf-controls {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.wf-preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.wf-preset-row .wf-reset-all { min-height: 31px; }
.wf-hint { margin: 0; color: var(--muted); font-size: 11px; }
.wf-preset-actions, .wf-dialog-actions { display: flex; gap: 6px; }
.wf-preset-actions .button { min-height: 28px; font-size: 11px; }
.wf-notice { margin: 0; color: var(--muted); font-size: 11px; }
.wf-notice:empty { display: none; }

.wf-preset-dialog {
  width: min(380px, calc(100% - 28px));
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.wf-preset-dialog::backdrop { background: rgb(0 0 0 / .68); }
.wf-preset-dialog form { display: grid; gap: 12px; }
.wf-preset-dialog h4 { margin: 0; font-size: 15px; }
.wf-dialog-actions { justify-content: flex-end; }

.wf-section {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 3px;
}

.wf-section summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-inline: 3px;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.wf-section summary::-webkit-details-marker { display: none; }

.wf-section summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border: solid var(--muted);
  border-width: 0 1px 1px 0;
  transform: rotate(-45deg);
}

.wf-section[open] summary::before { transform: rotate(45deg); }
.wf-section summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wf-section-status {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.wf-section-content { margin: 3px 0 2px; }
.wf-row + .wf-row { margin-top: 4px; }
.wf-row-header { display: flex; justify-content: space-between; align-items: center; }

.wf-reset {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: start;
}

.wf-reset:hover:not(:disabled) { color: var(--accent); }
.wf-value { color: var(--muted); font: 11px var(--mono); font-variant-numeric: tabular-nums; }

.wf-controls .wf-slider {
  display: block;
  min-height: 20px;
}

.wf-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 7px;
}

.wf-swatch {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 30px;
  padding: 3px 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.wf-swatch::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--wf-color);
}

.wf-swatch:hover:not(:disabled), .wf-swatch[aria-pressed='true'] { color: var(--text); }

.wf-swatch[aria-pressed='true'] {
  border-color: var(--wf-color);
  background: color-mix(in srgb, var(--wf-color) 15%, var(--raised));
}

.wf-swatch.adjusted::after {
  content: '';
  position: absolute;
  inset: auto 3px 3px auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text);
}

.wf-mixer-panel[hidden] { display: none; }
.wf-temp { --wf-track: linear-gradient(90deg, #5981de, #dedede, #e4bd54); }
.wf-tint { --wf-track: linear-gradient(90deg, #68b66c, #dedede, #bb63b9); }
.wf-vib { --wf-track: linear-gradient(90deg, #777, #dedede, #d995bd); }
.wf-sat { --wf-track: linear-gradient(90deg, #777, #dedede, #ed5b60); }
.wf-mixer-hue { --wf-track: linear-gradient(90deg, hsl(calc(var(--wf-hue) - 45) 75% 60%), var(--wf-color), hsl(calc(var(--wf-hue) + 45) 75% 60%)); }
.wf-mixer-sat { --wf-track: linear-gradient(90deg, #888, var(--wf-color)); }
.wf-mixer-lum { --wf-track: linear-gradient(90deg, #292929, var(--wf-color), #ededed); }

.wf-color-slider {
  appearance: none;
  background: transparent;
}

.wf-color-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--wf-track);
}

.wf-color-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--wf-track);
}

.wf-color-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 1px solid #5d6051;
  border-radius: 2px;
  background: var(--text);
}

.wf-color-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid #5d6051;
  border-radius: 2px;
  background: var(--text);
}
